12-11-2013 11:19 AM
Can anyone answer me with code how to change pr using bapi (BAPI_REQUISITION_CHANGE)?
12-11-2013 11:23 AM
Hi divye, try this...
DATA : wa_old TYPE BAPIEBANC,
wa_new TYPE BAPIEBANC.
DATA: rett TYPE TABLE OF BAPIRETURN,
ret_wa TYPE BAPIRETURN.
CALL FUNCTION 'BAPI_REQUISITION_CHANGE'
EXPORTING
number = wa_new-preq_no
tables
requisition_items_old = it_old
requisition_items_new = it_new
RETURN = rett.
for this bapi u need to send the old value of PR(wa_old) as well with the changed values of PR(wa_new) as well..........
Hope this will work........
Regards,
Adarsh
12-11-2013 11:23 AM
Hi divye, try this...
DATA : wa_old TYPE BAPIEBANC,
wa_new TYPE BAPIEBANC.
DATA: rett TYPE TABLE OF BAPIRETURN,
ret_wa TYPE BAPIRETURN.
CALL FUNCTION 'BAPI_REQUISITION_CHANGE'
EXPORTING
number = wa_new-preq_no
tables
requisition_items_old = it_old
requisition_items_new = it_new
RETURN = rett.
for this bapi u need to send the old value of PR(wa_old) as well with the changed values of PR(wa_new) as well..........
Hope this will work........
Regards,
Adarsh
12-11-2013 11:27 AM
12-11-2013 1:46 PM
Note that this BAPI is a pre-enjoy BAPI associated with ME52, better use BAPI_PR_CHANGE which is the "enjoy" BAPI associated with ME52N.
Ref: 499627 - FAQ: BAPIs for purchase requisitions
The function modules BAPI_REQUISITION_CREATE and BAPI_REQUISITION_CHANGE do not cover all of the functions of the EnjoySAP purchase requisition transactions. This is because the two asynchronous BAPIs have been developed based on ME51 and ME52 (program SAPMM06B). The user exits from the function group MEREQ (for example, MEREQ001) are therefore not available.
In SAP R/3 Release 4.70, two new API methods are developed that are based on the EnjoySAP technology of the purchase requisition transactions ME51N and ME52N. The function modules BAPI_PR_CREATE and BAPI_PR_CHANGE are released in Release 6.00 (ERP2005).
Regards,
Raymond