03-26-2008 6:27 AM
Hi all,
I'm using the 'BAPI_PO_CHANGE' FM to update the PO "OVERALL" limit and "EXPECTED" value of a Purchase Order No. But it returns error.
Could anyone send me the code for UPDATING these 2 fields (PO_LIMITS -> LIMIT and EXP_LIMIT values) using BAPI_PO_CHANGE with all the correct input and output parameters and tables.
In case of successful updation, what will be the RETURN CODE?.
points will be rewarded...
Regards,
Shanthi
03-26-2008 8:34 AM
Hi Shanti,
What is the error message returned by the BAPI? you can have a look at the RETURN internal table, there you will find all errors passed by the BAPI.
To change the limit value of the PO you can use the following steps:
1. Declare the PO limit internal table:
t_polimit TYPE STANDARD TABLE OF bapiesuhc WITH HEADER LINE
2. Set the limit value of the PO:
t_polimit-limit = the desired LIMIT_VALUE
t_polimit-exp_value = the desired EXPECTED_VALUE
append t_polimit.
3. Call the BAPI and pass the limit internal table
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = g_purchaseorder
poheader = wa_poheader
poheaderx = wa_poheaderx
testrun = g_testrun
memory_uncomplete = g_memory_uncomplete
memory_complete = g_memory_complete
no_messaging = g_no_messaging
no_message_req = g_no_message_req
no_authority = g_no_authority
no_price_from_po = g_no_price_from_po
TABLES
return = t_bapi_return
poitem = t_poitem
poitemx = t_poitemx
polimits = t_polimit
EXCEPTIONS
OTHERS = 1.
If you pass the correct header value for the PO it should be updated accordingly.
Edited by: Fandi Kusmawardi on Mar 26, 2008 9:38 AM