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

short dump during select statement

Former Member
0 Likes
1,585

hi,

i have to display 1 alv list output using REUSE_ALV_HIERSEQ_LIST_DISPLAY function module...so i have populated the data using select statement

select EXIDV

brgew meabm

vegr1 erlkz vhilm erdat aenam

ernam from vekp

into corresponding fields of table gt_master

up to gs_test-select_amount rows.

so the data is also getting populated to gt_master table before the function module...but after executing the function module..it is giving short dump...due to some standard program....any idea

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,471

so that means the error is not from the select statement , the error is coming from the fieldcatalog. how are you populating the fieldcatalog , show the code for fieldcatalog population.

13 REPLIES 13
Read only

Former Member
0 Likes
1,471

I'm not really sure what's happening, but I'd check the type of the variable used for up to n rows, and specifically, check if it's not initial.

Read only

Former Member
0 Likes
1,472

so that means the error is not from the select statement , the error is coming from the fieldcatalog. how are you populating the fieldcatalog , show the code for fieldcatalog population.

Read only

0 Likes
1,471

thanks for the reply ,...but when i am going to remove the select statement the program is not giving any short dump..but the data are not there..

one more thing...i am getting this error in program LKKBLF99 due to a typed field symbol...before it has been set with assign statement

Read only

0 Likes
1,471

lkkbl means related to fieldcatalog and alv. nothing related to select. show your code if you have no issues.

Read only

0 Likes
1,471

hi,

my coding is

************************************************************************

  • Report : ZBCALV *

  • Author : *

  • SAP-User : *

  • Requester : *

  • Date : *

  • Specification: *

************************************************************************

  • Description : *

************************************************************************

  • Changes : *

************************************************************************

  • Change No : *

  • Author : *

  • SAP-User : *

  • Date : *

  • Reason / Desc: *

************************************************************************

REPORT ZBCALV.

**&----


*

**& Report BCALV_TEST_HIERSEQ_LIST_EVENTS *

**& *

**&----


*

**& *

**& *

**&----


*

*report bcalv_test_hierseq_list_events.

types: g_ty_t_exidv type standard table of vekp,

g_ty_t_brgew type standard table of vekp,

g_ty_t_vegr1 type standard table of vekp,

g_ty_t_vekp type standard table of vekp,

g_ty_t_curr type standard table of alv_cur,

  • g_ty_s_vekp type alv_t_t2,

g_ty_s_exidv type alv_tab,

g_ty_s_brgew type alv_tab,

g_ty_s_vegr1 type alv_chck,

g_ty_s_vekp type vekp,

g_ty_s_curr type alv_cur.

constants:

*con_vekp type lvc_fname value 'ALV_T_T2',

con_scarr type lvc_fname value 'ALV_TAB', "#EC *

con_spfli type lvc_fname value 'ALV_CHCK', "#EC *

con_vekp type lvc_fname value 'VEKP',

con_scurx type lvc_fname value 'ALV_CUR'. "#EC *

*----


*

  • DATA *

*----


*

tables: sscrfields. " for processing the FCODEs in Selektion screens

type-pools: slis, kkblo.

class lcl_events_d1001 definition deferred.

types: begin of g_ty_s_test,

select_amount type i,

selected_recs_m type i,

selected_recs_s type i,

no_info_popup type char1,

info_popup_once type char1,

events type lvc_fname occurs 0,

events_exit type slis_t_event_exit,

events_info_popup type lvc_fname occurs 0,

list_append type char1,

list_amount type i,

list_append_status type i,

layo_expand_field type char1,

layo_expand_all type char1,

vari_default type char1,

vari_save type char1,

bypassing_buffer type char1,

buffer_active type char1,

end of g_ty_s_test,

begin of g_ty_s_evt_exit.

include type slis_event_exit.

types: text type string,

end of g_ty_s_evt_exit,

g_ty_t_evt_exit type standard table of g_ty_s_evt_exit.

constants: con_true type char1 value 'X',

con_ok type sy-ucomm value 'OK',

con_exit type sy-ucomm value 'EXIT',

con_canc type sy-ucomm value 'CANC',

con_back type sy-ucomm value 'BACK',

con_event_01 type lvc_fname value 'PF_STATUS_SET',

con_event_02 type lvc_fname value 'USER_COMMAND',

con_event_03 type lvc_fname value 'CALLER_EXIT',

con_event_04 type lvc_fname value 'LIST_MODIFY',

con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',

con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',

con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',

con_event_08 type lvc_fname value 'REPREP_MODIFY',

con_event_09 type lvc_fname value 'TOP_OF_PAGE',

con_event_10 type lvc_fname value 'END_OF_PAGE',

con_event_11 type lvc_fname value 'TOP_OF_LIST',

con_event_12 type lvc_fname value 'END_OF_LIST',

con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',

con_event_14 type lvc_fname value 'END_OF_COVERPAGE',

con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',

con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',

con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE',

con_event_18 type lvc_fname value 'ITEM_DATA_EXPAND'.

data: gs_test type g_ty_s_test.

data: g_okcode type sy-ucomm.

data: g_repid type sy-repid.

data: gt_evt_exit type g_ty_t_evt_exit.

data: gr_container_d1001 type ref to cl_gui_custom_container,

gr_grid_d1001 type ref to cl_gui_alv_grid,

gr_events_d1001 type ref to lcl_events_d1001.

data: g_start_listinfo type slis_lineinfo.

*addition for extra

DATA: fieldcatalog TYPE slis_t_fieldcat_alv with header line.

types : BEGIN OF gt_output ,

EXIDV TYPE VEKP-EXIDV,

  • VGBEL TYPE LIPS-VGBEL,

BRGEW TYPE VEKP-BRGEW,

VEGR1 TYPE VEKP-VEGR1,

MEABM TYPE VEKP-MEABM,

ERLKZ TYPE VEKP-ERLKZ,

  • VSTAT TYPE NAST-VSTAT,

VHILM TYPE VEKP-VHILM,

ERDAT TYPE VEKP-ERDAT,

AENAM TYPE VEKP-AENAM,

VBELN TYPE VBELN_GEN,

ERNAM TYPE VEKP-ERNAM,

END OF gt_output.

data: ls_output type gt_output,

lt_output type gt_output occurs 0 WITH HEADER LINE .

types : BEGIN OF gt_item_output ,

EXIDV TYPE VEKP-EXIDV,

BRGEW TYPE VEKP-BRGEW,

vEGR1 TYPE VEKP-VEGR1,

TARAG TYPE VEKP-TARAG,

NTGEW TYPE VEKP-NTGEW,

MEABM TYPE VEKP-MEABM,

BREIT TYPE VEKP-BREIT,

HOEHE TYPE VEKP-HOEHE,

  • ANW_STATUS TYPE VEKP-ANW_STATUS,

MATNR TYPE VEPO-MATNR,

VEGR2 TYPE VEKP-VEGR2,

VSTEL TYPE VEKP-VSTEL,

WERKS TYPE VEKP-WERKS,

END OF gt_item_output.

data: ls_ITEM_output type gt_ITEM_output,

lt_ITEM_output type gt_ITEM_output occurs 0 with header line.

types: begin of g_ty_s_master.

include type gt_output.

types: box type char1,

  • lights type char1,

checkbox type char1,

expand type char1,

help type i,

end of g_ty_s_master,

g_ty_t_master type standard table of g_ty_s_master,

begin of g_ty_s_slave.

include type gt_item_output.

types: box type char1,

  • lights type char1,

checkbox type char1,

expand type char1,

help type i,

end of g_ty_s_slave,

g_ty_t_slave type standard table of g_ty_s_slave.

data: gt_master type g_ty_t_master with header line,

gt_slave type g_ty_t_slave with header line,

gs_master type g_ty_s_master.

*----


*

  • CLASS lcl_events_d1001 DEFINITION

*----


*

*

*----


*

class lcl_events_d1001 definition.

public section.

methods:

data_changed for event data_changed

of cl_gui_alv_grid

importing er_data_changed

e_onf4

e_onf4_before

e_onf4_after,

data_changed_finished

for event data_changed_finished

of cl_gui_alv_grid.

endclass. "lcl_events_d1001 DEFINITION

*----


*

  • CLASS lcl_events_d1001 IMPLEMENTATION

*----


*

*

*----


*

class lcl_events_d1001 implementation.

method data_changed.

endmethod. "data_changed

method data_changed_finished.

endmethod. "data_changed_finished

endclass. "lcl_events_d1001 IMPLEMENTATION

*----


*

  • SELECTION-SCREEN *

*----


*

selection-screen begin of block gen with frame.

parameters:

p_amount type i default 30.

selection-screen end of block gen.

at selection-screen.

*----


*

  • AT SELECTION-SCREEN *

*----


*

case sscrfields-ucomm.

when 'PB01'.

call screen 1001 starting at 1 1 ending at 80 20.

endcase.

*----


*

  • START-OF-SELECTION *

*----


*

start-of-selection.

g_repid = sy-repid.

gs_test-select_amount = p_amount.

*----


*

  • END-OF-SELECTION *

*----


*

end-of-selection.

perform f01_call_list.

*&----


*

*& Form f01_call_list

*&----


*

  • text

*----


*

form f01_call_list.

data: l_callback_program type sy-cprog, "#EC NEEDED

ls_layo type slis_layout_alv,

lt_fcat type slis_t_fieldcat_alv,

ls_keyinfo type slis_keyinfo_alv.

data: ls_master type g_ty_s_master,

ls_slave type g_ty_s_slave.

l_callback_program = sy-repid.

perform f01_alv_get_outtab.

perform f01_alv_set_layout changing ls_layo.

perform f01_alv_set_fcat changing lt_fcat.

perform f01_alv_set_keyinfo changing ls_keyinfo.

if gs_test-list_append_status ne 0.

ls_layo-list_append = gs_test-list_append.

endif.

call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

exporting

i_callback_program = g_repid

is_layout = ls_layo

it_fieldcat = lt_fcat

i_tabname_header = 'GT_MASTER'

i_tabname_item = 'GT_SLAVE'

is_keyinfo = ls_keyinfo

tables

t_outtab_header = gt_master

t_outtab_item = gt_slave

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.

endform. " f01_call_list

*----


*

  • FORM f01_alv_set_fcat

*----


*

*

*----


*

form f01_alv_set_fcat changing ct_fcat type slis_t_fieldcat_alv.

data: lt_fcat_master type slis_t_fieldcat_alv,

lt_fcat_slave type slis_t_fieldcat_alv.

clear ct_fcat[].

perform f01_alv_set_fcat_master changing lt_fcat_master.

perform f01_alv_set_fcat_slave changing lt_fcat_slave.

append lines of lt_fcat_master to ct_fcat.

append lines of lt_fcat_slave to ct_fcat.

endform. " F01_ALV_SET_FCAT

*&----


*

*& Form f01_alv_set_fcat_master

*&----


*

  • text

*----


*

form f01_alv_set_fcat_master changing ct_fcat type slis_t_fieldcat_alv.

data: ls_fcat type slis_fieldcat_alv,

l_char(3) type c.

  • get fieldcatalog

fieldcatalog-fieldname = 'EXIDV'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

FIELDCATALOG-KEY = 'X'.

FIELDCATALOG-TECH = 'X'.

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-ref_tabname = 'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VGBEL'.

fieldcatalog-seltext_L = 'SALES ORDER'.

fieldcatalog-outputlen = 15.

fieldcatalog-ref_tabname = 'LIPS'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BRGEW'.

fieldcatalog-seltext_l = 'WEIGHT'.

FIELDCATALOG-KEY = 'X'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 3.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'MEABM'.

fieldcatalog-seltext_l = 'DIMENSION'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 4.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR1'.

fieldcatalog-seltext_l = 'IPPC NR'.

fieldcatalog-outputlen = 15.

FIELDCATALOG-KEY = 'X'.

fieldcatalog-col_pos = 5.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERLKZ'.

fieldcatalog-seltext_l = 'STATUS'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 6.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VSTAT'.

fieldcatalog-seltext_l = 'PRINT STATUS'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 7.

fieldcatalog-ref_tabname = 'VSTAT'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VHILM'.

fieldcatalog-seltext_l = 'PACKING MATERIAL'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 8.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERDAT'.

fieldcatalog-seltext_l = 'CREATED FROM'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 9.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'AENAM'.

fieldcatalog-seltext_l = 'LAST CHANGE'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 10.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VBELN'.

fieldcatalog-seltext_l = 'DELIVERY'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 11.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERNAM'.

fieldcatalog-seltext_l = 'CREATED BY'.

fieldcatalog-outputlen = 12.

fieldcatalog-col_pos = 8.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

ls_fcat-tabname = 'GT_MASTER'.

modify ct_fcat from ls_fcat transporting tabname

where tabname ne ls_fcat-tabname.

loop at ct_fcat into ls_fcat.

if ls_fcat-fieldname eq 'BRGEW'.

  • or ls_fcat-fieldname eq ''.

*§1.Set status of columns PLANETYPE and SEATSOCC to editable.

ls_fcat-edit = 'X'.

modify ct_fcat from ls_fcat.

endif.

endloop.

endform. " f01_alv_set_fcat_master

*&----


*

*& Form f01_alv_set_fcat_slave

*&----


*

  • text

*----


*

form f01_alv_set_fcat_slave changing ct_fcat type slis_t_fieldcat_alv.

data: ls_fcat type slis_fieldcat_alv,

l_char(3) type c.

fieldcatalog-fieldname = 'EXIDV'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

FIELDCATALOG-KEY = 'X'.

FIELDCATALOG-TECH = 'X'.

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-ref_tabname = 'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'TARAG'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-ref_tabname = 'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'NTGEW'.

fieldcatalog-seltext_L = 'WEIGHT HU'.

fieldcatalog-outputlen = 15.

fieldcatalog-ref_tabname = 'VEKP'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BRGEW'.

fieldcatalog-seltext_l = 'WEIGHT'.

FIELDCATALOG-KEY = 'X'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 3.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'LAENG'.

fieldcatalog-seltext_l = 'LENGTH'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 4.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BREIT'.

fieldcatalog-seltext_l = 'WIDTH'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 5.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'HOEHE'.

fieldcatalog-seltext_l = 'HEIGHT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 6.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR1'.

fieldcatalog-seltext_l = 'HU GR1'.

FIELDCATALOG-KEY = 'X'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 7.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR2'.

fieldcatalog-seltext_l = 'HU GR2'.

FIELDCATALOG-KEY = 'X'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 8.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'MATNR'.

fieldcatalog-seltext_l = 'MAT NO'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 9.

fieldcatalog-ref_tabname = 'VEPO'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VSTEL'.

fieldcatalog-seltext_l = 'SHIPPING'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 10.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WERKS'.

fieldcatalog-seltext_l = 'PLANT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 11.

fieldcatalog-ref_tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

ls_fcat-tabname = 'GT_SLAVE'.

modify ct_fcat from ls_fcat transporting tabname

where tabname ne ls_fcat-tabname.

endform. " f01_alv_set_fcat_slave

*----


*

  • FORM f01_alv_set_layout

*----


*

*

*----


*

form f01_alv_set_layout changing cs_layout type slis_layout_alv.

*... Display options

cs_layout-colwidth_optimize = con_true.

cs_layout-no_colhead = space.

cs_layout-no_hotspot = space.

cs_layout-zebra = space.

cs_layout-no_vline = space.

cs_layout-cell_merge = space.

cs_layout-no_min_linesize = space.

cs_layout-min_linesize = space.

cs_layout-max_linesize = space.

cs_layout-window_titlebar = space.

cs_layout-no_uline_hs = space.

cs_layout-no_sumchoice = space.

cs_layout-no_totalline = space.

cs_layout-totals_before_items = space.

cs_layout-totals_only = space.

cs_layout-totals_text = space.

cs_layout-no_subchoice = space.

cs_layout-no_subtotals = space.

cs_layout-subtotals_text = space.

cs_layout-numc_sum = space.

cs_layout-no_unit_splitting = space.

*... Interaction

cs_layout-box_fieldname = 'BOX'.

cs_layout-box_tabname = space.

cs_layout-box_rollname = space.

if gs_test-layo_expand_field eq con_true.

cs_layout-expand_fieldname = 'EXPAND'.

endif.

cs_layout-hotspot_fieldname = space.

cs_layout-f2code = space.

cs_layout-key_hotspot = space.

cs_layout-flexible_key = space.

cs_layout-reprep = space.

cs_layout-group_buttons = space.

cs_layout-no_keyfix = space.

cs_layout-get_selinfos = con_true.

cs_layout-group_change_edit = con_true.

cs_layout-no_scrolling = space.

cs_layout-expand_all = gs_test-layo_expand_all.

*... Detailed screen

cs_layout-detail_popup = space.

cs_layout-detail_initial_lines = space.

cs_layout-detail_titlebar = space.

*... PF-status

cs_layout-def_status = space.

*... Display variants

cs_layout-header_text = space.

cs_layout-item_text = space.

cs_layout-default_item = space.

*... colour

cs_layout-info_fieldname = space.

cs_layout-coltab_fieldname = space.

*... others

cs_layout-list_append = space.

endform. " F01_ALV_SET_LAYOUT

*&----


*

*& Form f01_alv_set_keyinfo

*&----


*

  • text

*----


*

form f01_alv_set_keyinfo changing cs_keyinfo type slis_keyinfo_alv.

cs_keyinfo-header01 = 'EXIDV'.

cs_keyinfo-item01 = 'EXIDV'.

cs_keyinfo-header02 = 'BRGEW'."'CARRID'.

cs_keyinfo-item02 = 'BRGEW'."."'CARRID'.

cs_keyinfo-header03 = 'VEGR1'."'CONNID'.

cs_keyinfo-item03 = 'VEGR1'."'CONNID'.

cs_keyinfo-header04 = space.

cs_keyinfo-item04 = 'VEGR2'."'FLDATE'.

cs_keyinfo-header05 = space.

cs_keyinfo-item05 = space.

endform. " f01_alv_set_keyinfo

*----


*

  • FORM f01_alv_event_pf_status_set

*----


*

*

*----


*

form f01_alv_event_pf_status_set using rt_extab type slis_t_extab.

"#EC *

data: l_event type lvc_fname. "#EC NEEDED

if gs_test-info_popup_once eq con_true.

read table gs_test-events_info_popup into l_event

with key table_line = 'PF_STATUS_SET'.

if sy-subrc ne 0.

insert 'PF_STATUS_SET' into gs_test-events_info_popup index 1.

message i000(0k) with text-t01.

endif.

elseif gs_test-no_info_popup eq space.

message i000(0k) with text-t01.

endif.

set pf-status 'STANDARD' excluding rt_extab.

set titlebar 'STANDARD'.

endform. " F01_ALV_EVENT_PF_STATUS_SET

*&----


*

*& Form F01_ALV_EVENT_BEFORE_LINE_OUTP

*&----


*

  • text

*----


*

form f01_alv_event_before_line_outp

using rs_lineinfo type slis_lineinfo. "#EC *

data: l_event type lvc_fname. "#EC NEEDED

if gs_test-info_popup_once eq con_true.

read table gs_test-events_info_popup into l_event

with key table_line = 'BEFORE_LINE_OUTPUT'.

if sy-subrc ne 0.

insert 'BEFORE_LINE_OUTPUT' into gs_test-events_info_popup

index 1.

message i000(0k) with text-t05.

endif.

elseif gs_test-no_info_popup eq space.

message i000(0k) with text-t05.

endif.

format color off

intensified off

inverse off

hotspot off

input off.

if rs_lineinfo-tabname eq 'GT_MASTER'.

if

  • gs_master-exidv ne gt_master-exidv or

gs_master-brgew ne gt_master-brgew.

write: / text-t05.

write: /

  • gt_master-exidv,

gt_master-brgew.

gs_master = gt_master.

endif.

if gs_test-selected_recs_m eq rs_lineinfo-tabindex.

clear gs_master.

endif.

endif.

endform. " F01_ALV_EVENT_BEFORE_LINE_OUTP

*&----


*

*& Form f01_alv_get_outtab

*&----


*

  • text

*----


*

form f01_alv_get_outtab .

field-symbols: .

select

exidv BRGEW VEGR1

TARAG NTgew meabm BREIT HOEHE VEGR2 VSTEL weRKS

from

(con_vekp) into corresponding fields of table

lt_slave up to gs_test-select_amount rows

where

  • exidv eq <ls_master>-exidv and

brgew eq -vegr1.

.

append lines of lt_slave to gt_slave.

endloop.

sort gt_slave by exidv brgew vegr1.

endif.

describe table gt_master lines gs_test-selected_recs_m.

describe table gt_slave lines gs_test-selected_recs_s.

clear gt_master.

clear gt_slave.

endform. " f01_alv_get_outtab

*&----


*

*& Module d1001_pbo OUTPUT

*&----


*

  • text

*----


*

module d1001_pbo output.

  • perform d1001_pbo.

endmodule. " d1001_pbo OUTPUT

*&----


*

*& Module d1001_pai INPUT

*&----


*

  • text

*----


*

module d1001_pai input.

  • perform d1001_pai.

endmodule. " d1001_pai INPUT

Read only

0 Likes
1,471

Hi priya,

VEGR2 is Key in Slave table. But its not at all there in Master table. I think that is the problem. Just remove the marked line from Slave


fieldcatalog-fieldname = 'VEGR2'.
fieldcatalog-seltext_l = 'HU GR2'.
"FIELDCATALOG-KEY = 'X'.   Should remove

Also remove the keyinfo details for them


cs_keyinfo-header04 = space.
cs_keyinfo-item04 = 'VEGR2'."'FLDATE'.

I think that should solve the problem

Cheers,

Kothand

Read only

0 Likes
1,471
fieldcatalog-fieldname = 'EXIDV'. "Field name in itab
fieldcatalog-seltext_l = 'HU-NR'. "Column text
FIELDCATALOG-KEY = 'X'.
FIELDCATALOG-TECH = 'X'.
fieldcatalog-col_pos = 1. "Column position
fieldcatalog-tabname = 'GT_MASTER'.  "For header use GT_MASTER
fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.

you don't need to use ref_tabname, you can use tabname to specify the internal table.

for slave

fieldcatalog-fieldname = 'EXIDV'. "Field name in itab
fieldcatalog-seltext_l = 'HU-NR'. "Column text
FIELDCATALOG-KEY = 'X'.
FIELDCATALOG-TECH = 'X'.
fieldcatalog-col_pos = 1. "Column position
fieldcatalog-tabname = 'GT_SALVE'.
fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.
CLEAR fieldcatalog.

see here you need to mention the tabname , until unless you specify the name of the internal table for header and item. ALv function fail to identify the tables to display.

i_tabname_header = 'GT_MASTER'
i_tabname_item = 'GT_SLAVE'

so correct the error.

Read only

0 Likes
1,471

hi,

still i am getting the same error

Read only

0 Likes
1,471

the code seems to be so confusing. seems like you copied standard program and modified the logic. why can't you try it from the scratch.

check the program BALVHD01

Edited by: Vijay Babu Dudla on Oct 28, 2008 8:59 AM

Read only

0 Likes
1,471

hi vijay,

i have done from the scratch...in simple way ...but it is giving me the same error...my coding is

&----


*& Report BCALV_TEST_HIERSEQ_LIST *

*& *

&----


*& *

*& *

&----


report zbcalv_test.

TYPE-POOLS : slis.

TABLES : vekp,sscrfields.

DATA:BEGIN OF it_z75580emp OCCURS 0,

exidv type vekp-exidv,

  • VGBEL TYPE LIPS-VGBEL,

BRGEW TYPE VEKP-BRGEW,

MEABM TYPE VEKP-MEABM,

VEGR1 TYPE VEKP-VEGR1,

ERLKZ TYPE VEKP-ERLKZ,

  • VSTAT TYPE NAST-VSTAT,

VHILM TYPE VEKP-VHILM,

ERDAT TYPE VEKP-ERDAT,

AENAM TYPE VEKP-AENAM,

VBELN TYPE VBELN_GEN,

ERNAM TYPE VEKP-ERNAM,

END OF it_z75580emp.

  • LINE ITEMS INTERNAL TABLE

DATA:BEGIN OF it_z75580dep OCCURS 0,

  • MANDT TYPE VEKP-MANDT,

  • VENUM TYPE VEKP-VENUM,

TARAG TYPE VEKP-TARAG,

NTGEW TYPE VEKP-NTGEW,

BRGEW TYPE VEKP-BRGEW,

MEABM TYPE VEKP-MEABM,

BREIT TYPE VEKP-BREIT,

HOEHE TYPE VEKP-HOEHE,

  • ANW_STATUS TYPE VEKP-ANW_STATUS,

MATNR TYPE VEPO-MATNR,

vEGR1 TYPE VEKP-VEGR1,

VEGR2 TYPE VEKP-VEGR2,

VSTEL TYPE VEKP-VSTEL,

WERKS TYPE VEKP-WERKS,

END OF it_z75580dep.

*FIELDCATALOG ( SAME FIELDCATALOG FOR BOTH HEADER AND LINE ITEMS)

DATA:it_fieldcat TYPE slis_t_fieldcat_alv.

DATA:ct_fcat TYPE slis_t_fieldcat_alv .

DATA:fieldcatalog TYPE slis_t_fieldcat_alv with header line.

DATA:l_repid TYPE sy-repid.

DATA:g_tabname_header TYPE slis_tabname,

g_tabname_item TYPE slis_tabname,

gs_keyinfo TYPE slis_keyinfo_alv. " KEYINFO

*PARAMETERS : s_o TYPE z75580emp-empno.

selection-screen begin of block gen with frame.

parameters:

p_amount type i default 30.

selection-screen end of block gen.

at selection-screen.

----


  • AT SELECTION-SCREEN *

----


case sscrfields-ucomm.

when 'PB01'.

call screen 1001 starting at 1 1 ending at 80 20.

endcase.

  • HEADER DATA INTERNAL TABLE

START-OF-SELECTION.

select exidv

brgew meabm

vegr1 erlkz vhilm erdat aenam

into corresponding fields of table it_z75580emp from vekp

up to p_amount rows.

  • SELECT empno

*

  • empname

*

  • deptno

*

  • location

*

  • INTO TABLE it_z75580emp

*

  • FROM z75580emp

*

  • WHERE empno = s_empno.

  • IF NOT it_z75580dep[] IS INITIAL.

select

exidv

TARAG NTgew BRGEW meabm BREIT HOEHE VEGR1 VEGR2 VSTEL weRKS

from

vekp into corresponding fields of table

it_z75580dep

up to p_amount rows

where

  • exidv eq <ls_master>-exidv and

brgew eq it_z75580emp-brgew

and vegr1 eq it_z75580emp-vegr1.

  • SELECT deptname

*

  • INTO TABLE it_z75580dep

*

  • FROM z75580dep

*

  • FOR ALL ENTRIES IN it_z75580emp

*

  • WHERE deptno = it_z75580emp-deptno.

*

  • ENDIF.

*

*

  • l_repid = sy-repid.

  • FIELD CATALOG FOR HEADER

  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • i_program_name = l_repid

  • i_internal_tabname = 'IT_Z75580EMP'

  • i_inclname = l_repid

  • i_bypassing_buffer = 'X'

  • i_buffer_active = ''

  • CHANGING

  • ct_fieldcat = it_fieldcat

  • EXCEPTIONS

  • inconsistent_interface = 1

  • program_error = 2

  • OTHERS = 3.

*

*data: ls_fcat type slis_fieldcat_alv,

  • l_char(3) type c.

  • get fieldcatalog

fieldcatalog-fieldname = 'EXIDV'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VGBEL'.

fieldcatalog-seltext_L = 'SALES ORDER'.

fieldcatalog-outputlen = 15.

fieldcatalog-tabname = 'IT_Z75580EMP'."'LIPS'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BRGEW'.

fieldcatalog-seltext_l = 'WEIGHT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 3.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'MEABM'.

fieldcatalog-seltext_l = 'DIMENSION'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 4.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR1'.

fieldcatalog-seltext_l = 'IPPC NR'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 5.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERLKZ'.

fieldcatalog-seltext_l = 'STATUS'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 6.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VSTAT'.

fieldcatalog-seltext_l = 'PRINT STATUS'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 7.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VSTAT'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VHILM'.

fieldcatalog-seltext_l = 'PACKING MATERIAL'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 8.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERDAT'.

fieldcatalog-seltext_l = 'CREATED FROM'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 9.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'AENAM'.

fieldcatalog-seltext_l = 'LAST CHANGE'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 10.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VBELN'.

fieldcatalog-seltext_l = 'DELIVERY'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 11.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'ERNAM'.

fieldcatalog-seltext_l = 'CREATED BY'.

fieldcatalog-outputlen = 12.

fieldcatalog-col_pos = 8.

fieldcatalog-tabname = 'IT_Z75580EMP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • FIELD CATALOG FOR ITEMS

  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • i_program_name = l_repid

  • i_internal_tabname = 'IT_Z75580DEP'

  • i_inclname = l_repid

  • i_bypassing_buffer = 'X'

  • i_buffer_active = ''

  • 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.

fieldcatalog-fieldname = 'EXIDV'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'TARAG'. "Field name in itab

fieldcatalog-seltext_l = 'HU-NR'. "Column text

fieldcatalog-col_pos = 1. "Column position

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

fieldcatalog-outputlen = 05. "Column width

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'NTGEW'.

fieldcatalog-seltext_L = 'WEIGHT HU'.

fieldcatalog-outputlen = 15.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BRGEW'.

fieldcatalog-seltext_l = 'WEIGHT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 3.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'LAENG'.

fieldcatalog-seltext_l = 'LENGTH'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 4.

fieldcatalog-tabname = 'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'BREIT'.

fieldcatalog-seltext_l = 'WIDTH'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 5.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'HOEHE'.

fieldcatalog-seltext_l = 'HEIGHT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 6.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR1'.

fieldcatalog-seltext_l = 'HU GR1'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 7.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VEGR2'.

fieldcatalog-seltext_l = 'HU GR2'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 8.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'MATNR'.

fieldcatalog-seltext_l = 'MAT NO'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 9.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEPO'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'VSTEL'.

fieldcatalog-seltext_l = 'SHIPPING'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 10.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'WERKS'.

fieldcatalog-seltext_l = 'PLANT'.

fieldcatalog-outputlen = 15.

fieldcatalog-col_pos = 11.

fieldcatalog-tabname = 'IT_Z75580DEP'."'VEKP'.

APPEND fieldcatalog TO ct_fcat.

CLEAR fieldcatalog.

  • PASSING THE FOREIGN KEY RELATIONSHIP

gs_keyinfo-header01 = 'EXIDV'.

gs_keyinfo-item01 = 'EXIDV'.

g_tabname_header = 'IT_Z75580EMP'.

g_tabname_item = 'IT_Z75580DEP'.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

i_callback_program = l_repid

it_fieldcat = ct_fcat

i_tabname_header = g_tabname_header

i_tabname_item = g_tabname_item

is_keyinfo = gs_keyinfo

TABLES

t_outtab_header = it_z75580emp

t_outtab_item = it_z75580dep

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

ENDIF.

please help..

Read only

0 Likes
1,471

Hi,

In this new program there are 2 small problems which i can see in calling REUSE_ALV_HIERSEQ_LIST_DISPLAY...

1)This line is commented(i guess) and then you used l_repid in call function. just uncomment it


l_repid = sy-repid. 

2)Directly pass the table names like below


i_tabname_header =  'IT_Z75580EMP'   "Should be in CAPS
i_tabname_item = 'IT_Z75580DEP'   "Should be in CAPS

Try to correct them. Atleast the error may be different

Cheers,

Kothand

Read only

0 Likes
1,471

Check the modified code.

The error is coming from the keyfields you mentioned . there should be a common field for both thte tables then only you can show the hierarchy

TYPE-POOLS : SLIS.

TABLES : VEKP,SSCRFIELDS.

DATA:BEGIN OF IT_Z75580EMP OCCURS 0,
    EXIDV LIKE VEKP-EXIDV,
    VGBEL LIKE LIPS-VGBEL,
    BRGEW  LIKE VEKP-BRGEW,
    MEABM  LIKE VEKP-MEABM,
    VEGR1  LIKE VEKP-VEGR1,
    ERLKZ  LIKE VEKP-ERLKZ,
    VSTAT  LIKE NAST-VSTAT,
    VHILM  LIKE VEKP-VHILM,
    ERDAT  LIKE VEKP-ERDAT,
    AENAM  LIKE VEKP-AENAM,
    VBELN  LIKE VEKP-VBELN_GEN,
    ERNAM  LIKE VEKP-ERNAM,
END OF IT_Z75580EMP.


DATA:BEGIN OF IT_Z75580DEP OCCURS 0,
    EXIDV  LIKE VEKP-EXIDV,
    VENUM  LIKE VEKP-VENUM,
    TARAG  LIKE VEKP-TARAG,
    NTGEW  LIKE VEKP-NTGEW,
    BRGEW  LIKE VEKP-BRGEW,
    MEABM  LIKE VEKP-MEABM,
    BREIT  LIKE VEKP-BREIT,
    HOEHE  LIKE VEKP-HOEHE,
    ANW_STATUS  LIKE VEKP-STATUS,
    MATNR  LIKE VEPO-MATNR,
    VEGR1  LIKE VEKP-VEGR1,
    VEGR2  LIKE VEKP-VEGR2,
    VSTEL  LIKE VEKP-VSTEL,
    WERKS  LIKE VEKP-WERKS,

END OF IT_Z75580DEP.

DATA:IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:CT_FCAT TYPE SLIS_T_FIELDCAT_ALV .
DATA:FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
DATA:L_REPID TYPE SY-REPID.


DATA:G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME,
GS_KEYINFO TYPE SLIS_KEYINFO_ALV. " KEYINFO




SELECTION-SCREEN BEGIN OF BLOCK GEN WITH FRAME.
      PARAMETERS:
      P_AMOUNT TYPE I DEFAULT 30.
SELECTION-SCREEN END OF BLOCK GEN.

AT SELECTION-SCREEN.

  CASE SSCRFIELDS-UCOMM.
    WHEN 'PB01'.
      CALL SCREEN 1001 STARTING AT 1 1 ENDING AT 80 20.
  ENDCASE.

START-OF-SELECTION.
  SELECT EXIDV
  BRGEW MEABM
  VEGR1 ERLKZ VHILM ERDAT AENAM
  INTO CORRESPONDING FIELDS OF TABLE IT_Z75580EMP FROM VEKP
  UP TO P_AMOUNT ROWS.
  IF NOT IT_Z75580EMP[] IS INITIAL.
    SELECT
    EXIDV
    TARAG NTGEW BRGEW MEABM BREIT HOEHE VEGR1 VEGR2 VSTEL WERKS
    FROM
    VEKP INTO CORRESPONDING FIELDS OF TABLE
    IT_Z75580DEP
    UP TO P_AMOUNT ROWS
    WHERE
    BRGEW EQ IT_Z75580EMP-BRGEW
    AND VEGR1 EQ IT_Z75580EMP-VEGR1.
    L_REPID = SY-REPID.
*field catalog for header
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        I_PROGRAM_NAME         = L_REPID
        I_INTERNAL_TABNAME     = 'IT_Z75580EMP'
        I_INCLNAME             = L_REPID
      CHANGING
        CT_FIELDCAT            = IT_FIELDCAT
      EXCEPTIONS
        INCONSISTENT_INTERFACE = 1
        PROGRAM_ERROR          = 2
        OTHERS                 = 3.
    DATA:L_CHAR(3) TYPE C.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        I_PROGRAM_NAME         = L_REPID
        I_INTERNAL_TABNAME     = 'IT_Z75580DEP'
        I_INCLNAME             = L_REPID
        I_BYPASSING_BUFFER     = 'X'
        I_BUFFER_ACTIVE        = ''
      CHANGING
        CT_FIELDCAT            = IT_FIELDCAT
      EXCEPTIONS
        INCONSISTENT_INTERFACE = 1
        PROGRAM_ERROR          = 2
        OTHERS                 = 3.
    IF SY-SUBRC NE 0.
    ENDIF.

*  passing the foreign key relationship
    GS_KEYINFO-HEADER01 = 'EXIDV'.
    GS_KEYINFO-ITEM01 = 'EXIDV'.
    G_TABNAME_HEADER = 'IT_Z75580EMP'.
    G_TABNAME_ITEM = 'IT_Z75580DEP'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM = L_REPID
        IT_FIELDCAT        = IT_FIELDCAT
        I_TABNAME_HEADER   = G_TABNAME_HEADER
        I_TABNAME_ITEM     = G_TABNAME_ITEM
        IS_KEYINFO         = GS_KEYINFO
      TABLES
        T_OUTTAB_HEADER    = IT_Z75580EMP
        T_OUTTAB_ITEM      = IT_Z75580DEP
      EXCEPTIONS
        PROGRAM_ERROR      = 1
        OTHERS             = 2.

    IF SY-SUBRC NE 0.

    ENDIF.
  ENDIF.

Read only

Former Member
0 Likes
1,471

Hi Priya,

Check once by removing CORRESPONDING FILEDS.