Hi Guru's,
Please help me out in this issue..
Runtime Errors DYN_TABLE_ILL_COMP_VAL
Except. CX_SY_DYN_TABLE_ILL_COMP_VAL
ABAP Program SAPLKKBL
Program looks as follows
REPORT ZMOD_DEMO1 no STANDARD PAGE HEADING.
TYPE-POOLS : slis.
TYPES : BEGIN OF ty_ekko,
ebeln TYPE ebeln,
bsart TYPE bsart,
bstyp TYPE bstyp,
ernam TYPE ernam,
END OF ty_ekko,
BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
matnr TYPE matnr,
netwr TYPE netwr,
END OF ty_ekpo,
BEGIN OF ty_mara,
matnr TYPE matnr,
mtart TYPE mtart,
END OF ty_mara,
BEGIN OF ty_out,
ebeln TYPE ekko-ebeln,
ebelp type ebelp,
ernam TYPE ernam,
bstyp TYPE bstyp,
netwr TYPE netwr,
matnr TYPE matnr,
mtart TYPE mtart,
END OF ty_out.
DATA : w_ekko TYPE ty_ekko,
w_ekpo TYPE ty_ekpo,
w_mara TYPE ty_mara,
w_out TYPE ty_out,
t_ekko TYPE STANDARD TABLE OF ty_ekko,
t_ekpo TYPE STANDARD TABLE OF ty_ekpo,
t_mara TYPE STANDARD TABLE OF ty_mara,
t_out TYPE STANDARD TABLE OF ty_out.
DATA : t_field TYPE slis_t_fieldcat_alv,
w_field TYPE slis_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv,
w_sort TYPE slis_sortinfo_alv,
w_layout TYPE slis_layout_alv,
w_disvariant TYPE disvariant.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS : s_ebeln FOR w_ekko-ebeln.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
SELECT ebeln
bsart
bstyp
ernam
FROM ekko
INTO TABLE t_ekko
WHERE ebeln IN s_ebeln.
IF sy-subrc = 0.
SELECT ebeln
ebelp
matnr
netwr
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_ekko
WHERE ebeln = t_ekko-ebeln.
IF sy-subrc = 0.
SELECT matnr
mtart
FROM mara
INTO TABLE t_mara
FOR ALL ENTRIES IN t_ekpo
WHERE matnr = t_ekpo-matnr.
ENDIF.
ENDIF.
END-OF-SELECTION.
LOOP AT t_ekko INTO w_ekko.
READ TABLE t_ekko INTO w_ekko WITH KEY ebeln = w_ekpo-ebeln.
IF sy-subrc = 0.
* w_out-vbeln = w_vbak-vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = w_ekko-ebeln
IMPORTING
output = w_out-ebeln.
w_out-bstyp = w_ekko-bstyp.
w_out-ernam = w_ekko-ernam.
w_out-ebelp = w_ekpo-ebelp.
w_out-matnr = w_ekpo-matnr.
w_out-netwr = w_ekpo-netwr.
READ TABLE t_mara INTO w_mara WITH KEY matnr = w_ekpo-matnr.
IF sy-subrc = 0.
w_out-mtart = w_mara-mtart.
ENDIF.
ENDIF.
APPEND w_out TO t_out.
ENDLOOP.
PERFORM fill_fieldcatlog USING : 1 'eBELN' 'Purchase Order',
2 'bstyp' 'PO Type',
3 'ernam' 'Created by',
5 'eblep' 'Item',
4 'NETWR' 'Net Qty',
6 'MATNR' 'Material',
7 'NETWR' 'Net price',
8 'MTART' 'Mat Group'.
w_sort-fieldname = 'eBELN'.
w_sort-up = 'X'.
w_sort-subtot = 'X'.
APPEND w_sort TO t_sort.
w_layout-colwidth_optimize = 'X'.
DATA : lv_prog TYPE sy-repid.
lv_prog = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = lv_prog
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP_OF_PAGE1'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = w_layout
it_fieldcat = t_field
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = t_sort
* IT_FILTER =
* IS_SEL_HIDE =
* i_default = 'X'
i_save = 'X'
is_variant = w_disvariant
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = t_out
* 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.
*&---------------------------------------------------------------------*
*& Form FILL_FIELDCATLOG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM fill_fieldcatlog USING : p_pos TYPE sy-cucol
p_field TYPE slis_fieldname
p_text TYPE dd03p-scrtext_m.
w_field-col_pos = p_pos.
w_field-fieldname = p_field.
IF p_field = 'NETWR'.
w_field-do_sum = 'X'.
ENDIF.
w_field-seltext_s = p_text.
APPEND w_field TO t_field.
CLEAR w_field.
ENDFORM. " FILL_FIELDCATLOG
*&---------------------------------------------------------------------*
*& Form top_of_page1
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM top_of_page1.
DATA : lt_list TYPE slis_t_listheader,
lw_list TYPE slis_listheader.
lw_list-typ = 'H'.
lw_list-info = 'Purchase Order Details'.
APPEND lw_list TO lt_list.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = s_ebeln-low
IMPORTING
output = s_ebeln-low.
lw_list-typ = 'S'.
lw_list-key = 'Purchase Order'.
CONCATENATE s_ebeln-low 'to' s_ebeln-high INTO lw_list-info SEPARATED BY space.
APPEND lw_list TO lt_list.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_list
* I_LOGO =
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
ENDFORM. "top_of_page1