05-30-2007 12:09 PM
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
05-30-2007 12:14 PM
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.
05-30-2007 12:17 PM
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.