on 2022 Jan 31 10:07 AM
Hi ,
I'm getting error message as inconsistent data in the Bapi call... could you please help me out..
TYPE-POOLS: slis.
TABLES: vbak, vbap.
DATA: BEGIN OF itab_vbak OCCURS 0,
vbeln TYPE vbak-vbeln,
kunnr TYPE vbak-kunnr,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
spart TYPE vbak-spart,
bstdk TYPE vbak-bstdk,
END OF itab_vbak.
DATA: BEGIN OF itab_vbap OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
werks TYPE vbap-werks,
meins TYPE vbap-meins,
vrkme TYPE vbap-vrkme,
END OF itab_vbap.
TYPES: BEGIN OF it_final,
vbeln TYPE vbak-vbeln,
kunnr TYPE vbak-kunnr,
vkorg TYPE vbak-vkorg,
vtweg TYPE vbak-vtweg,
spart TYPE vbak-spart,
bstdk TYPE vbak-bstdk,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
werks TYPE vbap-werks,
meins TYPE vbap-meins,
vrkme TYPE vbap-vrkme,
status TYPE char200,
END OF it_final. *
DATA: gt_final TYPE TABLE OF it_final.
DATA: gv_final TYPE it_final.
TYPES: BEGIN OF ty_message,
status TYPE char200,
END OF ty_message.
DATA: gt_message TYPE STANDARD TABLE OF ty_message,
gv_message TYPE ty_message.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv, gs_fieldcat TYPE slis_fieldcat_alv,
gs_layo TYPE slis_layout_alv.
**Table to Hold Delivery Request
DATA: lv_text TYPE string.
DATA: BEGIN OF tbl_request OCCURS 0.
INCLUDE STRUCTURE bapideliciousrequest. DATA: END OF tbl_request.
*Table to hold Line Items Created
DATA: BEGIN OF tbl_items OCCURS 0.
INCLUDE STRUCTURE bapideliciouscreateditems. DATA: END OF tbl_items.
*Table to hold BAPI Return Messages
DATA: BEGIN OF tbl_return OCCURS 0. INCLUDE STRUCTURE bapiret2.
DATA: END OF tbl_return.
DATA: wa_return TYPE bapiret2.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:S_VBELN FOR VBAK-VBELN. SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
SELECT vbeln
vkorg
vtweg
spart
bstdk
kunnr FROM vbak INTO CORRESPONDING FIELDS OF TABLE itab_vbak
WHERE vbeln IN s_vbeln.
IF sy-subrc EQ 0.
IF itab_vbak[] IS NOT INITIAL.
SELECT vbeln posnr matnr meins werks vrkme FROM vbap INTO CORRESPONDING FIELDS OF TABLE itab_vbap
FOR ALL ENTRIES IN itab_vbak
WHERE vbeln = itab_vbak-vbeln.
ENDIF.
ENDIF.
gs_fieldcat-col_pos = '1'.
gs_fieldcat-fieldname = 'status'.
gs_fieldcat-seltext_l = 'STATUS'.
gs_fieldcat-outputlen = '200'.
APPEND gs_fieldcat TO gt_fieldcat.
CLEAR gs_fieldcat.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC' TABLES request = tbl_request
createditems = tbl_items
return = tbl_return.
LOOP AT tbl_return INTO wa_return. CLEAR:gv_message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING id = wa_return-id
lang = sy-langu
no = wa_return-number
v1 = wa_return-message_v1
v2 = wa_return-message_v2
v3 = wa_return-message_v3
v4 = wa_return-message_v4
IMPORTING msg = lv_text
EXCEPTIONS not_found = 1 OTHERS = 2. gv_message-status = lv_text.
APPEND gv_message TO gt_message.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_message
EXCEPTIONS
program_error = 1
OTHERS = 2.
Hi
I can see that in your code your data to the FM-BAPI is not having any data. So the error.
Please ensure that you filled the data and then call the BAPI
t_request == Loop your sales order item table vbap and filled in this table.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
TABLES
request = t_request
createditems = t_created
return = t_return.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How to get return messages in tbl_return...while calling function module BAPI DELIVERY PROCESSING EXEC ....how to fetch data to that tbl_return
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.