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

display data internal table to output screen

Former Member
0 Likes
2,161

Hi all,

My requiremet is change normal report dispalay to ALV grid display.In this normal report display data if conditions their,This conditions how to put internal table display data.

Eample:

loop.

write:/ mara-matnr,

marc-werks,

IF NOT CLASS IS INITIAL.

WRITE:/ KLAH-CLASS.

ENDIF.

write:/ mard-lgort.

endloop.

Above write data how to copy the internal tabe(with condition).

Thanks&Regards,

subbareddy.

Hi all,

My requiremet is change normal report dispalay to ALV grid display.In this normal report display data if conditions their,This conditions how to put internal table display data.

Eample:

loop.

write:/ mara-matnr,

marc-werks,

IF NOT CLASS IS INITIAL.

WRITE:/ KLAH-CLASS.

ENDIF.

write:/ mard-lgort.

endloop.

Above write data how to copy the internal tabe(with condition).

Thanks&Regards,

subbareddy.

4 REPLIES 4
Read only

Former Member
0 Likes
1,162

Hi,

loop.

itab1-matnr = mara-matnr,

itab1-werks = marc-werks,

IF NOT CLASS IS INITIAL.

itab1-class = KLAH-CLASS.

ENDIF.

itab1-lgort = mard-lgort.

endloop.

Now use this internal table in ALV.

Regars,

SUbramanian

Read only

0 Likes
1,162

HI subramaian,

Thanks,

Your ans ok,one question this internal table how to print data with conditions.

Thanks

Sreddy.

Read only

Former Member
0 Likes
1,162

Hi,

Take the filtered data(wanted records) to the separate internal table and at last use the ALV to display the data with this final internal table.

Read only

Former Member
0 Likes
1,162

Just like this:

data: ls_sel_mara type mara.

data: ls_variant type disvariant.

data: lt_mara type table of mara.

select-options: s_matnr for ls_sel_mara-matnr.

select * from mara into table lt_mara where matnr in s_matnr.

ls_variant-REPORT = sy-repid.

ls_variant-handle = 1.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_BYPASSING_BUFFER = 'X'

I_STRUCTURE_NAME = 'MARA'

I_SAVE = 'A'

IS_VARIANT = ls_variant

TABLES

T_OUTTAB = lt_mara

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.