I have one requirement in which i want to put 4 variable values in one column.
I have used concatenate statement , but it is not printing vertically in alv instead it is displaying horizontally in debugging.
Below is my code:
LOOP AT it_mseg INTO w_mseg.
w_tab-budat_mkpf = w_mseg-budat_mkpf.
w_tab-ebeln = w_mseg-ebeln.
SHIFT w_mseg-matnr LEFT DELETING LEADING '0'.
w_tab-matnr = w_mseg-matnr.
w_tab-erfmg = w_mseg-erfmg.
w_tab-erfme = w_mseg-erfme.
on CHANGE OF w_mseg-ebeln.
CLEAR w_tab-amount.
LOOP at it_mg INTO w_mg WHERE ebeln = w_mseg-ebeln.
case w_mg-ebelp.
WHen '10'.
cnt = w_mg-dmbtr.
w_tab-count1 = w_tab-count1 + cnt.
CLEAR cnt.
WHEN '20'.
cnt = w_mg-dmbtr.
w_tab-count2 = w_tab-count2 + cnt.
CLEAR CNT.
WHEN '30'.
cnt = w_mg-dmbtr.
w_tab-count3 = w_tab-count3 + cnt.
CLEAR CNT.
WHen '40'.
cnt = w_mg-dmbtr.
w_tab-count4 = w_tab-count4 + cnt.
CLEAR cnt.
Endcase.
CONCATENATE w_tab-count1 w_tab-count2 w_tab-count3 w_tab-count4 INTO w_tab-amount.
ENDON.
READ TABLE it_ekko INTO w_ekko WITH KEY ebeln = w_mseg-ebeln.
w_tab-ebeln = w_ekko-ebeln.
READ TABLE it_konv INTO w_konv WITH key knumv = w_ekko-knumv.
w_tab-kbetr = w_konv-kbetr.
APPEND w_tab to it_tab.
CLEAR :w_ekko, w_konv, w_tab.
CLEAR w_tab-amount.
ENDLOOP.