Skip to Content

Assign the value to our lenght field

hi,

i have some issue...

i want to declared one field called Salary..for this field length...before this i am finding the lentgh of other filed...

For example: for Kunnr value is 1000 the lenth is 4.

Now i want to declare to SALARY field dynamically with the lenth of 4(this is the length of ABAP)...

Suppose kunnr value is 12345...the lenght of salary should be 5.

Suppose kunnr value is 123456...the lenght of salary should be 6.

like this i need the solution.....

Please help me....

Regards,

Suresh S

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 11:17 AM

    Hi Suresh,

    Try this Logic,

    ddata : leng type i,

    salary(4),

    salary1(5),

    KUNNR(4) VALUE '1234'.

    leng = STRLEN( kunnr ).

    if leng eq 4.

    *write code for salary.

    elseif leng eq 5.

    *write code for salary1.

    endif.

    Thanks,

    Reward If Helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 11:14 AM

    data lv_swap type char20,

    lv_len type i.

    write kunnr to lv_swap left-justified.

    lv_len = strlen( lv_swap ).

    there you got your length.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.