‎2009 Dec 21 3:04 PM
Hi Gurus,
I have to display some list in the output from an internal table.
But here I have to display the list in a TABLE along with the field descriptions.
I can't use the FM REUSE_ALV_LIST_DISPLAY(version 4.3).
Could any post some logic for this with which I could able to draw the lines forming a table, and display the values in the output from the internal table.
Thanks
G sandeep Kumar.
‎2009 Dec 21 5:26 PM
You can directly use WRITE statement for this .
Some more keywords required will be VLINE, ULINE, \ etc. These will help you to make the list dislpay.
You can make a header line and then dislpay your internal table by using write inside loop.
Only you need to check the alignment of vertical lines.
Hope you understand it.
‎2009 Dec 21 5:26 PM
You can directly use WRITE statement for this .
Some more keywords required will be VLINE, ULINE, \ etc. These will help you to make the list dislpay.
You can make a header line and then dislpay your internal table by using write inside loop.
Only you need to check the alignment of vertical lines.
Hope you understand it.
‎2009 Dec 22 5:43 AM
Hi Harsha,
Thanks for the kind response.
Actually there are 20 fields in the internal table. I couldn't able to get the logic.
could you kindly post some sample code for that.
Thanks
Natasha.
‎2009 Dec 22 6:34 AM
Hi Natasha..
Seems like you need to display the output as a classic display and not as ALV display.
For this you need to use the WRITE statment.
PFB the sample code for the same.
FORM display_output.
DATA: lt_objtxt TYPE TABLE OF ty_output,
lw_objtxt TYPE ty_output.
WRITE : /.
*----- Row header -----------------------------------------------------
lw_objtxt-line+0(20) = text-013.
lw_objtxt-line+20(1) = '¦'.
lw_objtxt-line+21(35) = text-016.
lw_objtxt-line+36(1) = '¦'.
lw_objtxt-line+37(71) = text-014.
lw_objtxt-line+72(1) = '¦'.
APPEND lw_objtxt TO lt_objtxt.
CLEAR lw_objtxt.
LOOP AT t_display INTO w_display.
lw_objtxt-line+0(20) = w_display-pernr.
lw_objtxt-line+20(1) = '¦'.
lw_objtxt-line+21(35) = w_display-reinr.
lw_objtxt-line+36(1) = '¦'.
lw_objtxt-line+37(71) = w_display-message.
lw_objtxt-line+72(1) = '¦'.
APPEND lw_objtxt TO lt_objtxt.
CLEAR lw_objtxt.
ENDLOOP.
LOOP AT lt_objtxt INTO lw_objtxt.
FORMAT COLOR COL_POSITIVE.
WRITE:/ lw_objtxt .
ENDLOOP.
ENDFORM. " DISPLAY_OUTPUTHope this helps.
Harsh
‎2009 Dec 22 11:24 AM
You can generate the ouput as required using simple write statements. In above example no need of two loops (internal tables) you can fix this within the first loop (internal table) it self as follows:
LOOP AT t_display INTO w_display.
WRITE: / 1 w_display-pernr,
21 sy-vline, (this will be printed 21st column as pernr field is of length 20 in above example)
.
.
. etc like this you have to design the output using the length of the fields.
ENDLOOP.
You can refer F1 for more help on write option.