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_AGREEMENT_MAINTAIN

Former Member
0 Kudos
560

Hi Gurus.

I want to use BAPI_AGREEMENT_MAINTAIN for ME32L. Can anyone tell me how to use this.

Thanks.

1 REPLY 1

Former Member
0 Kudos
93

here is the sample code ... hope it might help


data: IM_AGREEMENT_HEADER like BAPIOAHEAD occurs 0 with header line.
data: IM_AGREEMENT_HEADER_X like BAPIOAHEAX occurs 0 with header line.
data: IM_AGREEMENT_ITEMS like BAPIOAITEM occurs 0 with header line.
data: IM_AGREEMENT_ITEMS_X like BAPIOAITEX occurs 0 with header line.


IM_AGREEMENT_HEADER-AGMT_NO = '0085011092'.
Append IM_AGREEMENT_HEADER.

IM_AGREEMENT_HEADER_X-AGMT_NO = 'X'.
Append IM_AGREEMENT_HEADER_X.

IM_AGREEMENT_ITEMS-AGRMT_ITEM = '00001'.
IM_AGREEMENT_ITEMS-TRACKINGNO = 'test'.
Append IM_AGREEMENT_ITEMS.

IM_AGREEMENT_ITEMS_X-TRACKINGNO = 'X'.
Append IM_AGREEMENT_ITEMS_X.

CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
EXPORTING
IM_AGREEMENT_HEADER = IM_AGREEMENT_HEADER
TABLES
EXT_RETURN = RETURN
IMT_AGREEMENT_ITEMS = IM_AGREEMENT_ITEMS
IMT_AGREEMENT_ITEMS_X = IM_AGREEMENT_ITEMS_X.


commit work and wait.

LOOP AT RETURN.
WRITE: /0(10) RETURN-TYPE,
10(10) RETURN-ID,
20(10) RETURN-NUMBER,
30(40) RETURN-MESSAGE.
ENDLOOP.