Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

dynamic concatenation

Hi,

i have a field of char type length 18. I need to concatenate zeros to this field dynamically

for eg. if the field is 12345 i need to make it 000000000000012345

if the field is 12345678 i need to make it 000000000012345678 and the total length should not exceed 18 bytes

how can i make my code dynamic.

your help would be appreciated.

Thanks,

Kranthi.

Tags:
replied

Hi,

just check this..

REPORT  ZTEST   .

data: a(18).
data:b(4), c(6).

b = '1234'.
c = '12345'.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = b
 IMPORTING
   OUTPUT        = a
          .

write a.


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = c
 IMPORTING
   OUTPUT        = a
          .

write a.

Regards

vijay

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question