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: 

how to extend an Bapi_po_change

Former Member
0 Kudos

hi,

How to extend bapi_po_change useing extensionin and extensionout.

3 REPLIES 3

che_eky
Active Contributor
0 Kudos

Take a look at the documentation for the BAPI it gives good information:

The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:

EXIT_SAPL2012_002 (at start of BAPI)

EXIT_SAPL2012_004 (at end of BAPI)

These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).

There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.

Former Member
0 Kudos

when i execute the program, the debugger is not stooping at the above mentioned exit.

the below is the code.

data: lt_poaccount like bapimepoaccount occurs 0 with header line,

lt_poaccountx like bapimepoaccountx occurs 0 with header line,

return type bapiret2 occurs 0 with header line,

poitem like bapimepoitem occurs 0 with header line,

poitemx like bapimepoitem occurs 0 with header line,

extin like bapiparex occurs 0 with header line,

extou like bapiparex occurs 0 with header line.

poitem-po_item = '0010'.

poitemx-po_item = '0010'.

poitem-vendrbatch = 12322.

poitemx-vendrbatch = 'X'.

poitem-ematerial = 'TEST'.

poitemx-ematerial = 'X'.

poitem-grant_nbr = 'GRANT_NBR'.

poitemx-grant_nbr = 'X'.

poitem-no_more_gr = 'NO_MORE'.

poitemx-no_more_gr = 'X'.

append poitem.

append poitemx.

extin-structure = 'BAPI_TE_MEPOITEM'.

extin-valuepart1 = 'EAN_UPC'.

append extin.

lt_poaccount-po_item = '0010'.

lt_poaccountx-po_item = '0010'.

lt_poaccount-serial_no = '0001'.

lt_poaccountx-serial_no = '0001'.

lt_poaccount-gr_rcpt = '176'.

lt_poaccountx-gr_rcpt = 'X'.

append lt_poaccount.

append lt_poaccountx.

data: po_num type ebeln.

po_num = 7600000285.

call function 'BAPI_PO_CHANGE'

exporting

purchaseorder = po_num

tables

return = return

poitem = poitem

poitemx = poitemx

poaccount = lt_poaccount

poaccountx = lt_poaccountx

extensionin = extin

extensionout = extou

.

if sy-subrc eq 0.

call function 'BAPI_TRANSACTION_COMMIT'.

endif.

**

write 😕 'a'.

che_eky
Active Contributor
0 Kudos

I believe the exists are for enjoy purchase orders. Have you created a project in CMOD for the exit and activated it????