Skip to Content
-1
Jul 23, 2019 at 04:52 AM

type conflict when calling a function module

86 Views

Hi,

i am getting type conflict error while executing the code, please help out to go my practice forward

REPORT ztest_m03_inner_joins.
TYPE-POOLS: slis.
TABLES: vbrk, vbrp.
TYPES: BEGIN OF ty_vbrk,
vbeln TYPE vbeln_vf,
fkart TYPE fkart,
fktyp TYPE fktyp,
vbtyp TYPE vbtyp,
END OF ty_vbrk.

TYPES:BEGIN OF ty_vbrp,
vbeln TYPE vbeln_vf,
posnr TYPE posnr,
fkimg TYPE fkimg,
vrkme TYPE vrkme,
END OF ty_vbrp.

TYPES: BEGIN OF ty_out,
vbeln TYPE vbeln_vf,
fkart TYPE fkart,
fktyp TYPE fktyp,
vbtyp TYPE vbtyp,
posnr TYPE posnr,
fkimg TYPE fkimg,
vrkme TYPE vrkme,
END OF ty_out.

DATA: wa_out TYPE ty_out,
it_out TYPE TABLE OF ty_out,

wa_fcat TYPE slis_fieldcat_alv,
it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.

SELECT-OPTIONS: s_vbeln FOR vbrk-vbeln.

START-OF-SELECTION.


wa_fcat-col_pos = 1.
wa_fcat-fieldname = 'VBELN'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'BILLING DOC NO'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 2.
wa_fcat-fieldname = 'FKART'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'BILLING TYPE'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 3.
wa_fcat-fieldname = 'FKTYP'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'BILLING CATAGERY'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 4.
wa_fcat-fieldname = 'VBTYP'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'SD DOCUMENT CATAGERY'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 5.
wa_fcat-fieldname = 'VBTYP'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'SD DOCUMENT CATAGERY'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 6.
wa_fcat-fieldname = 'POSNR'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'BILLING ITEM'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 7.
wa_fcat-fieldname = 'FKIMG'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'QUANTITY'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.

wa_fcat-col_pos = 8.
wa_fcat-fieldname = 'VRKME'.
wa_fcat-tabname = 'IT_OUT'.
wa_fcat-seltext_m = 'SALES UNIT'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.


SELECT a~vbeln
fkart
fktyp
vbtyp
posnr
fkimg
vrkme FROM vbrk AS a INNER JOIN vbrp AS b
ON a~vbeln = b~vbeln INTO TABLE it_out UP TO 30 ROWS
WHERE a~vbeln IN s_vbeln.

*END-OF-SELECTION.
*DATA: tb_lines TYPE i.
*DESCRIBE TABLE it_out LINES tb_lines.
*WRITE: 'NO.OF RECORDS', tb_lines.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat

TABLES
t_outtab = it_out
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.