Hi experts, I'm using FM REUSE_ALV_FIELDCATALOG_MERGE in 4.6 C. It works fine, but in 6.0 two fields are missing when displaying the ALV list. The two fields existing in the data dictionary, so I can't understand why is it.
FORM f_prepare_fcat CHANGING p_gt_fieldcat TYPE slis_t_fieldcat_alv.
....
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'I_LIST'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = p_gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
.....
.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'I_LIST'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = p_gt_fieldcat[] <<< it may resolve the issue
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
Regards
Sarbajit
Hi,
Refer code, its working:-
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = sy-repid "report id i_internal_tabname = 'IT_FINAL' "<--pass your internal table here i_inclname = sy-repid "<--add this parameter CHANGING ct_fieldcat = it_field "<--field catalog table EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.
If your field catalog table is with header line then pass it_field[] instead of it_field.
Hope this helps you.
Regards,
Tarun
Hi ,
Try following solution.
You loop thru this p_gt_fieldcat table as -
loop at p_gt_fieldcat into gs_fieldcat.
case gs_fieldcat-fieldname.
when 'Fieldname'. "The field which is not appearing e.g 'GJAHR'
ls_fieldcat-outputlen = ' ' "Set the output length of that field here
ls_fieldcat-no_zero = ' '.
modify p_gt_fieldcat from gs_fieldcat.
Endloop.
Set the output length for both the fields .
We had a similiar issue and were able to get around it by changing the definition of the fields from TYPE to LIKE or LIKE to TYPE within the structure I_LIST.
Worked for us. Hope this works for you.
Chad
Hi Mrwhite,
*"Table declarations................................................... TABLES: spfli, sflight. *"Type pools................................................... TYPE-POOLS: slis. *"Selection screen elements............................................ SELECT-OPTIONS: s_carrid FOR spfli-carrid, s_connid FOR spfli-connid. *"Data declarations................................................... DATA: BEGIN OF t_spfli OCCURS 0, carrid LIKE spfli-carrid, connid LIKE spfli-connid, cityfrom LIKE spfli-cityfrom, cityto LIKE spfli-cityto, END OF t_spfli. *"Data declarations................................................... DATA: BEGIN OF fs_sflight, carrid LIKE sflight-carrid, connid LIKE sflight-connid, fldate LIKE sflight-fldate, seatsmax LIKE sflight-seatsmax, seatsocc LIKE sflight-seatsocc, END OF fs_sflight. *"Data declarations................................................... DATA: BEGIN OF t_final OCCURS 0, carrid LIKE spfli-carrid, connid LIKE spfli-connid, cityfrom LIKE spfli-cityfrom, cityto LIKE spfli-cityto, fldate LIKE sflight-fldate, seatsmax LIKE sflight-seatsmax, seatsocc LIKE sflight-seatsocc, END OF t_final. *"--------------------------------------------------------------------* * Internal table to hold sflight details * *"--------------------------------------------------------------------* DATA: t_sflight LIKE STANDARD TABLE OF fs_sflight. *"--------------------------------------------------------------------* * Internal table to hold fieldcatlog * *"--------------------------------------------------------------------* DATA: t_fieldcat TYPE slis_t_fieldcat_alv, l_fieldcat LIKE LINE OF t_fieldcat. *"Data declarations................................................... DATA: w_layout TYPE slis_layout_alv, w_repid LIKE sy-repid. *"--------------------------------------------------------------------* * START-OF-SELECTION EVENT * *"--------------------------------------------------------------------* START-OF-SELECTION. w_repid = sy-repid. SELECT carrid connid cityfrom cityto FROM spfli INTO TABLE t_spfli WHERE carrid IN s_carrid AND connid IN s_connid. SELECT carrid connid fldate seatsmax seatsocc FROM sflight INTO TABLE t_sflight FOR ALL ENTRIES IN t_spfli WHERE carrid EQ t_spfli-carrid AND connid EQ t_spfli-connid. LOOP AT t_sflight INTO fs_sflight. READ TABLE t_spfli WITH KEY carrid = fs_sflight-carrid connid = fs_sflight-connid. IF sy-subrc EQ 0. t_final-carrid = t_spfli-carrid. t_final-connid = t_spfli-connid. t_final-cityfrom = t_spfli-cityfrom. t_final-cityto = t_spfli-cityto. t_final-fldate = fs_sflight-fldate. t_final-seatsmax = fs_sflight-seatsmax. t_final-seatsocc = fs_sflight-seatsocc. APPEND t_final. ENDIF. " IF sy-subrc eq 0 CLEAR t_final. ENDLOOP. " LOOP AT t_sflight.... CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = w_repid i_internal_tabname = 'T_FINAL' i_inclname = w_repid CHANGING ct_fieldcat = t_fieldcat[] EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING is_layout = w_layout it_fieldcat = t_fieldcat TABLES t_outtab = t_final EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
Regards,
Sravanthi
hi,
See the below code...it may help you out.
TYPE-POOLS : slis. DATA : BEGIN OF it_vbak OCCURS 0, vbeln LIKE vbak-vbeln, erdat LIKE vbak-erdat, ernam LIKE vbak-ernam, netwr LIKE vbak-netwr, END OF it_vbak, it_fieldcat TYPE slis_t_fieldcat_alv, wa_fieldcat TYPE slis_fieldcat_alv, tbx TYPE sy-tabix. PARAMETERS : p_kunnr TYPE kna1-kunnr. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = sy-repid i_internal_tabname = 'IT_VBAK' i_inclname = sy-repid CHANGING ct_fieldcat = it_fieldcat EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. SELECT vbeln erdat ernam netwr FROM vbak INTO TABLE it_vbak WHERE kunnr = p_kunnr. LOOP AT it_fieldcat INTO wa_fieldcat. wa_fieldcat-no_zero = 'X'. tbx = sy-tabix. MODIFY it_fieldcat INDEX tbx FROM wa_fieldcat TRANSPORTING no_zero. ENDLOOP. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = sy-repid it_fieldcat = it_fieldcat TABLES t_outtab = it_vbak EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.
Thanks & REgards
Add a comment