11-21-2016 9:06 AM - edited 01-21-2024 10:20 PM
TYPE-POOLS slis.
DATA: fld_catalog TYPE slis_t_fieldcat_alv, "Lvc_t_fcat
wa_fld_catalog LIKE LINE OF fld_catalog.
DATA g_repid LIKE sy-repid.
DATA: gs_layout TYPE slis_layout_alv.
DATA: w_variant TYPE disvariant.
DATA: BEGIN OF TY_DISPLAY OCCURS 0,
matnr LIKE marc-matnr,
werks LIKE marc-werks,
END OF TY_DISPLAY.
DATA: it_display LIKE STANDARD TABLE OF ty_display WITH HEADER LINE.
SELECTION-SCREEN: BEGIN OF BLOCK a1 WITH FRAME TITLE text-i01.
SELECT-OPTIONS: s_matnr FOR marc-matnr, " Material number
s_werks FOR marc-werks. " Material group
SELECTION-SCREEN END OF BLOCK a1.
AT SELECTION-SCREEN.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE it_display
FROM marc
WHERE werks IN s_werks
AND matnr IN s_matnr.
INITIALIZATION.
START-OF-SELECTION.
g_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_DISPLAY'
CHANGING
ct_fieldcat = fld_catalog[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
END-OF-SELECTION.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = fld_catalog
i_save = 'A'
TABLES
t_outtab = it_display
EXCEPTIONS
program_error = 1
OTHERS = 2.
11-22-2016 4:45 AM
Hi,
I_INTERNAL_TABNAME = 'IT_DISPLAY'
I_STRUCTURE_NAME = 'YOUR STRUCTURE' "Create structure and assign here.
Please create structure and assign it in FM
Regards,
E.Ananthachari
11-21-2016 9:43 PM
Anucha,
Change your FM call as follows ...
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_DISPLAY'
i_inclname = g_repid
CHANGING
ct_fieldcat = fld_catalog[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
11-22-2016 1:50 AM
Hi Duane,
Error again i don't know why i got the error because i think my code that correct.
11-22-2016 4:45 AM
Hi,
I_INTERNAL_TABNAME = 'IT_DISPLAY'
I_STRUCTURE_NAME = 'YOUR STRUCTURE' "Create structure and assign here.
Please create structure and assign it in FM
Regards,
E.Ananthachari
11-22-2016 6:01 AM
Thank you i already got answer.
I don't know how to close my question.
11-22-2016 7:24 AM
If you've got your answer, then share it here. This is supposed to be two-way community - give as well as take.
To close a question either "accept" the answer you think gives the answer, or go to "actions" and click on "close".
11-22-2016 6:00 AM
11-22-2016 7:27 AM
If you've got your answer, then share it here. This is supposed to be two-way community - give as well as take.
To close a question either "accept" the answer you think gives the answer, or go to "actions" and click on "close".