cancel
Showing results for 
Search instead for 
Did you mean: 

Writting multiple lines in a variable window

Former Member
0 Kudos

Hi Experts,

I have 10 records in my internal table. I need to show all 10 lines on a variable window, one below the other.

Pl help, how to write logic for this in driver program.

Hardik

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Hardik,

TYPES: BEGIN OF ITAB,

MATNR TYPE MARA-MATNR,

MAKTX TYPE MAKT-MAKTX,

END OF ITAB.

DATA LI_STRING TYPE STRING.

DATA ML_STRING TYPE STRING.

LOOP AT ITAB,

CONCATENATE ITAB-MATNR ITAB-MAKTX INTO LI_STRING SEPARATED BY SPACE.

IF LI_STRING IS INITIAL.

MOVE LI_STRING TO ML_STRING.

ELSE.

<b>CONCATENATE ML_STRING LI_STRING SEPARATED BY CL_ABAP_CHAR_UTILITIES=>NEWLINE</b>.

ENDIF.

ENDLOOP.

Display the &ML_STRING& in the script editor.

Thanks,

Vinay