Skip to Content
0
Former Member
Apr 16, 2009 at 02:23 PM

concatenate space with internal table variable depending on condition

37 Views

Hi All,

I want to add space to the internal table variable depending on the condition. If the variable length is less than 30, it will add space after the variable and it will make the length as 30. i have given the sample code below,

data: len_g type char30 value ' '.

len1 = STRLEN( data-tplnr ).

IF len1 < con_30. *it will check length is less than 30

len2 = con_30 - len1.

concatenate data-tplnr+len_g(len2) into data-tplnr.

output-tplnr = data-tplnr.

APPEND output-tplnr TO intoutput-tplnr.

else.

*other part.

endif.

i am getting the error 'Unable to interpret data-tplnr+len_g(len2)' .

If the length of variable is 12, then the remaining length will be spaces after variable.