Application Development 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: 

bapi example

Former Member
0 Kudos

Anybody has example using this bapi for posting goods issue in VL02N :

BAPI_OUTB_DELIVERY_CONFIRM_DEC

Thanks a lot.

3 REPLIES 3

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this sample codes.

DATA: BAPI_Z05DOGI_DELIVERY LIKE BAPIOBDLVHDRCON-DELIV_NUMB ,

BAPI_Z05DOGI_HEADER_DATA LIKE BAPIOBDLVHDRCON OCCURS 0 WITH HEADER LINE ,

BAPI_Z05DOGI_HEADER_CONTROL LIKE BAPIOBDLVHDRCTRLCON OCCURS 0 WITH HEADER LINE,

BAPI_Z05DOGI_ITEM_DATA LIKE BAPIOBDLVITEMCON OCCURS 0 WITH HEADER LINE,

BAPI_Z05DOGI_ITEM_CONTROL LIKE BAPIOBDLVITEMCTRLCON OCCURS 0 WITH HEADER LINE ,

BAPI_Z05DOGI_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE .

CLEAR: BAPI_Z05DOGI_DELIVERY , BAPI_Z05DOGI_HEADER_DATA , BAPI_Z05DOGI_HEADER_CONTROL , BAPI_Z05DOGI_ITEM_DATA ,BAPI_Z05DOGI_ITEM_CONTROL , BAPI_Z05DOGI_RETURN .

REFRESH: BAPI_Z05DOGI_HEADER_DATA , BAPI_Z05DOGI_HEADER_CONTROL , BAPI_Z05DOGI_ITEM_DATA , BAPI_Z05DOGI_ITEM_CONTROL , BAPI_Z05DOGI_RETURN .

BAPI_Z05DOGI_DELIVERY = ZMM_WB1-ISSUE .

BAPI_Z05DOGI_HEADER_DATA-DELIV_NUMB = ZMM_WB1-ISSUE.

APPEND BAPI_Z05DOGI_HEADER_DATA.

BAPI_Z05DOGI_HEADER_CONTROL-DELIV_NUMB = ZMM_WB1-ISSUE.

BAPI_Z05DOGI_HEADER_CONTROL-POST_GI_FLG = 'X'.

APPEND BAPI_Z05DOGI_HEADER_CONTROL.

BAPI_Z05DOGI_ITEM_DATA-DELIV_NUMB = ZMM_WB1-ISSUE.

BAPI_Z05DOGI_ITEM_DATA-DELIV_ITEM = 10.

BAPI_Z05DOGI_ITEM_DATA-DLV_QTY = LFIMGGIA.

BAPI_Z05DOGI_ITEM_DATA-SALES_UNIT = XTAB-MEINS.

            • BAPI_Z05DOGI_ITEM_DATA-DLV_QTY_IMUNIT = LFIMGGIA.

BAPI_Z05DOGI_ITEM_DATA-FACT_UNIT_NOM = UMVKZLIPS.

BAPI_Z05DOGI_ITEM_DATA-FACT_UNIT_DENOM = UMVKNLIPS.

APPEND BAPI_Z05DOGI_ITEM_DATA.

BAPI_Z05DOGI_ITEM_CONTROL-DELIV_NUMB = ZMM_WB1-ISSUE.

BAPI_Z05DOGI_ITEM_CONTROL-DELIV_ITEM = 10.

BAPI_Z05DOGI_ITEM_CONTROL-CHG_DELQTY = 'X'.

APPEND BAPI_Z05DOGI_ITEM_CONTROL.

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'

EXPORTING

DELIVERY = BAPI_Z05DOGI_DELIVERY

HEADER_DATA = BAPI_Z05DOGI_HEADER_DATA

HEADER_CONTROL = BAPI_Z05DOGI_HEADER_CONTROL

TABLES

ITEM_DATA = BAPI_Z05DOGI_ITEM_DATA

ITEM_CONTROL = BAPI_Z05DOGI_ITEM_CONTROL

RETURN = BAPI_Z05DOGI_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = BAPI_Z05DOGI_RETURN.

0 Kudos

I am trying your code in se37 first and I am getting the message 46 (it does nt say anything). What does it mean?

Thanks again.

Former Member
0 Kudos

HI

Go thru this link

http://www.planetsap.com/LIST_ALL_BAPIs.htm

Thanks

sunil