Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Output table

former_member423024
Participant
0 Likes
774

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
740

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.

4 REPLIES 4
Read only

Former Member
0 Likes
741

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.

Read only

0 Likes
740

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.

Read only

0 Likes
740

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_OUTPUT

Hope this helps.

Harsh

Read only

0 Likes
740

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.