2008 Jul 16 3:23 PM
Hi,
I want to modify a PO but it's not working ... when I execute this code nothing happened, i've checked in PO (ME23N). Please someone help me. Thank you.
PARAMETER ebeln TYPE ekpo-ebeln OBLIGATORY.
DATA: BEGIN OF it_pointem OCCURS 0.
INCLUDE STRUCTURE bapimepoitem.
DATA: END OF it_pointem.
DATA: BEGIN OF it_pointemx OCCURS 0.
INCLUDE STRUCTURE bapimepoitemx.
DATA: END OF it_pointemx.
it_pointem-vend_mat = 'EAN1234'.
APPEND it_pointem.
it_pointemx-vend_mat = 'X'.
APPEND it_pointemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = ebeln
* poheader =
* POHEADERX =
* POADDRVENDOR =
* TESTRUN =
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* POEXPIMPHEADER =
* POEXPIMPHEADERX =
* VERSIONS =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
* NO_PRICE_FROM_PO =
* IMPORTING
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
* RETURN =
poitem = it_pointem
POITEMX = IT_POINTEMX
* POADDRDELIVERY =
* POSCHEDULE =
* POSCHEDULEX =
* POACCOUNT =
* POACCOUNTPROFITSEGMENT =
* POACCOUNTX =
* POCONDHEADER =
* POCONDHEADERX =
* POCOND =
* POCONDX =
* POLIMITS =
* POCONTRACTLIMITS =
* POSERVICES =
* POSRVACCESSVALUES =
* POSERVICESTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* POEXPIMPITEM =
* POEXPIMPITEMX =
* POTEXTHEADER =
* POTEXTITEM =
* ALLVERSIONS =
* POPARTNER =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
* IMPORTING
* RETURN =
.
2008 Jul 16 3:24 PM
Hi Dan,
You have to include the position number you want to change.
Regards,
John.
2008 Jul 16 3:24 PM
Hi Dan,
You have to include the position number you want to change.
Regards,
John.
2008 Jul 16 3:29 PM
2008 Jul 17 12:46 PM
John, it's not working, i've append to it possition number and also i've checked the return message and no message is returned;
any idea?
PARAMETER ebeln TYPE ekpo-ebeln OBLIGATORY.
DATA: BEGIN OF it_pointem OCCURS 0.
INCLUDE STRUCTURE bapimepoitem.
DATA: END OF it_pointem.
DATA: BEGIN OF it_pointemx OCCURS 0.
INCLUDE STRUCTURE bapimepoitemx.
DATA: END OF it_pointemx.
DATA : BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA : END OF it_return.
DATA: mesg TYPE string.
it_pointem-vend_mat = 'EAN1234'.
it_pointem-po_item = '00010'.
APPEND it_pointem.
it_pointemx-vend_mat = 'X'.
APPEND it_pointemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = ebeln
* poheader = it_expheader
* POHEADERX =
* POADDRVENDOR =
* TESTRUN =
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* POEXPIMPHEADER =
* POEXPIMPHEADERX =
* VERSIONS =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
* NO_PRICE_FROM_PO =
* IMPORTING
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
return = it_return
poitem = it_pointem
poitemx = it_pointemx
* POADDRDELIVERY =
* POSCHEDULE =
* POSCHEDULEX =
* POACCOUNT =
* POACCOUNTPROFITSEGMENT =
* POACCOUNTX =
* POCONDHEADER =
* POCONDHEADERX =
* POCOND =
* POCONDX =
* POLIMITS =
* POCONTRACTLIMITS =
* POSERVICES =
* POSRVACCESSVALUES =
* POSERVICESTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* POEXPIMPITEM =
* POEXPIMPITEMX =
* POTEXTHEADER =
* POTEXTITEM =
* ALLVERSIONS =
* POPARTNER =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
* IMPORTING
* RETURN =
.
2008 Jul 17 12:58 PM
Hi Dan,
You have to include the position number in the it_pointemx table as well:
it_pointemx -po_item = '00010'.
Could you try again?
Regards,
John.
2008 Jul 17 1:07 PM
not working , why ???
it_pointem-vend_mat = 'EAN1234'.
it_pointem-po_item = '00010'.
APPEND it_pointem.
it_pointemx-vend_mat = 'EAN1234'.
it_pointemx-po_item = '00010'.
it_pointemx-vend_mat = 'X'.
it_pointemx-po_item = 'X'.
APPEND it_pointemx.
2008 Jul 17 1:18 PM
it_pointem-vend_mat = 'EAN1234'.
it_pointem-po_item = '00010'.
APPEND it_pointem.
it_pointemx-vend_mat = 'EAN1234'.
it_pointemx-po_item = '00010'.
it_pointemx-vend_mat = 'X'.
it_pointemx-po_item = 'X'. <----- Remove this line
APPEND it_pointemx
John.
2008 Jul 17 1:36 PM
it_pointemx-po_item = 'X'. <----- Remove this line
I've removed that line ... because I don't want to modify po_item, my fault ;
Not working... why? i cant' understand ;
john, copy my program into your DEV SAP system and try it ... , please.
2008 Jul 17 1:50 PM
Hi Dan,
This is what I have copied:
PARAMETER ebeln TYPE ekpo-ebeln OBLIGATORY.
DATA: BEGIN OF it_pointem OCCURS 0.
INCLUDE STRUCTURE bapimepoitem.
DATA: END OF it_pointem.
DATA: BEGIN OF it_pointemx OCCURS 0.
INCLUDE STRUCTURE bapimepoitemx.
DATA: END OF it_pointemx.
DATA : BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA : END OF it_return.
DATA: mesg TYPE string.
it_pointem-vend_mat = 'EAN1234'.
it_pointem-po_item = '00010'.
APPEND it_pointem.
it_pointemx-po_item = '00010'.
it_pointemx-vend_mat = 'X'.
APPEND it_pointemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = ebeln
* poheader = it_expheader
* POHEADERX =
* POADDRVENDOR =
* TESTRUN =
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* POEXPIMPHEADER =
* POEXPIMPHEADERX =
* VERSIONS =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
* NO_PRICE_FROM_PO =
* IMPORTING
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
return = it_return
poitem = it_pointem
poitemx = it_pointemx
* POADDRDELIVERY =
* POSCHEDULE =
* POSCHEDULEX =
* POACCOUNT =
* POACCOUNTPROFITSEGMENT =
* POACCOUNTX =
* POCONDHEADER =
* POCONDHEADERX =
* POCOND =
* POCONDX =
* POLIMITS =
* POCONTRACTLIMITS =
* POSERVICES =
* POSRVACCESSVALUES =
* POSERVICESTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* POEXPIMPITEM =
* POEXPIMPITEMX =
* POTEXTHEADER =
* POTEXTITEM =
* ALLVERSIONS =
* POPARTNER =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
* IMPORTING
* RETURN =
.
In table IT_RETURN I get 2 messages:
- Standard PO 3126459 changed
- Change Vendor Mat. No. could not be effected
which is correct as we don't use EAN numbers in our system.
Regards,
John.
2008 Jul 17 2:06 PM
John, this is the content of it_return:
- I | |000 |Changing of PO using Enjoy BAPI unsuccess<
- E |MEPO |000 |Purchase order still contains faulty item<
- W |06 |698 |Import data incomplete or does not exist <
- E |ME |082 |Material group OP not defined (please che<
it seems that PO contains faulty items ... which field is material group?
2008 Jul 17 2:24 PM
Dan,
If you execute this change using the transaction, do you have the same problems?
Regards,
John.
2008 Jul 17 3:40 PM
John, it's working...thanks a lot; you deserve those 10 points
it was a problem with that PO, so I try on another PO number
Thank you!
2008 Jul 16 3:29 PM
Hi,
Give a RETURN parameter table name ans check what messges you get in that .
2008 Jul 17 1:11 PM
hiii
refer sample code for this FM in given link..it iwll help you to solve..
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
regards
twinkal
2008 Jul 17 1:56 PM
Dan,
Please read the BAPI (function module) documentation. This bapi have some restrictions.
a®