‎2009 Jun 04 12:58 PM
Hello All,
I am using the bapi BAPI_REQUISITION_CHANGE, to change the quantity for the PR number.
Currently I am passing the following details:-
PR number in importing parameters
PR line item,
Storage Location,
Material Group,
Quantity, and
UOM
both in tables REQUISITION_ITEMS_OLD and REQUISITION_ITEMS_NEW
But I have changed the quantity field value.
When I execute it gives a message in table RETURN:
Data in Data in Data in REQUISITION_ITEM_OLD for item 00001 does not correspond to current database status
Am I missing some of the parameter values that needs to passed as input...??
Please help..!!
Thanks & Regards,
Tarun Gambhir
‎2009 Jun 04 2:30 PM
You have to use BAPI_REQUISITION_GETDETAIL to fill the whole old and new structure via MOVE-CORRESPONDING, then adjust the data in new structure and call BAPI_REQUISITION_CHANGE.
This is specified in the documentation of the BAPI
You must pass on the purchase requisition number and the necessary
tables for the items that are to be changed. For more information, refer
to the documentation on the table parameters.
To fill the table parameters correctly with the old status, use the
method GetDetail of the business object PurchaseRequisitionbefore
invoking this method.
Regards,
Raymond
‎2009 Jun 04 1:29 PM
Still waiting for useful pointers......!!!
Regards,
Tarun Gambhir
‎2009 Jun 04 1:51 PM
‎2009 Jun 04 1:41 PM
Hi Tarun,
Try with the foloowing code.
data: lt_item_old TYPE STANDARD TABLE OF bapiebanv,
ls_item_old TYPE bapiebanv,
lt_item_new TYPE STANDARD TABLE OF bapiebanv,
ls_item_new TYPE bapiebanv.
data: iebantx_new LIKE bapiebantx OCCURS 0 WITH HEADER LINE,
iebantx_temp LIKE bapiebantx OCCURS 0 WITH HEADER LINE.
DATA: lt_bapi_return TYPE STANDARD TABLE OF bapireturn.
CALL FUNCTION 'BAPI_REQUISITION_CHANGE'
EXPORTING
number = p_banfn
TABLES
requisition_items_old = lt_item_old
requisition_items_new = lt_item_new
requisition_text_old = iebantx_temp
requisition_text_new = iebantx_new
return = lt_bapi_return.
U have to pass the above fields.
Thanks,
Sreekala.
‎2009 Jun 04 1:50 PM
Hi @Sreekala,
Hope you didnt get my point..
I am already following the same...
But not too sure of the fields for which I need to pass values into the TABLES.
I have already mentioned the fields for which I am currently passing some values, but I guess there are some more fields that needs to be added....!!
Thanks & Regards,
Tarun Gambhir
‎2009 Jun 04 2:30 PM
You have to use BAPI_REQUISITION_GETDETAIL to fill the whole old and new structure via MOVE-CORRESPONDING, then adjust the data in new structure and call BAPI_REQUISITION_CHANGE.
This is specified in the documentation of the BAPI
You must pass on the purchase requisition number and the necessary
tables for the items that are to be changed. For more information, refer
to the documentation on the table parameters.
To fill the table parameters correctly with the old status, use the
method GetDetail of the business object PurchaseRequisitionbefore
invoking this method.
Regards,
Raymond
‎2009 Jun 04 2:41 PM
Hi @Raymond,
I am following the same, but still I am getting message:-
Material purchase requisition" is not allowed (WBS E.097614.C.03)
Any pointers to this message would be really appreciated...!!
Thanks & Regards,
Tarun Gambhir
‎2009 Jun 04 2:56 PM
‎2009 Jun 04 3:16 PM
@Raymond,
Yes, I have used t-code ME52N, and its working fine.
But cant find the reason why BAPI is not working....
Thanks & Regards,
Tarun Gambhir
‎2009 Jun 04 3:46 PM
‎2009 Jun 04 3:59 PM
‎2009 Jun 05 5:05 AM
Hi @Raymond,
I was out some where, couldnt reply yesterday..
These are the details for the message I am getting.
TYPE : E
CODE : BS007
MESSAGE : "Material purchase requisition" is not allowed (WBS E.097614.C.03)
LOG_ON :
LOG_MSG_NO : 000000
MESSAGE_V1 : Material purchase requisition
MESSAGE_V2 : WBS E.097614.C.03
MESSAGE_V3 : RMBA
MESSAGE_V4 :
Thanks & Regards,
Tarun
‎2009 Jun 05 5:34 AM
‎2009 Jun 05 5:35 AM
Are you able to create PR manually using WBS E.097614.C.03 ?
‎2009 Jun 05 5:47 AM
Hi,
I have a PR number which i need to change using the BAPI_REQUISITION_CHANGE
But i am getting an error as specified above...
This was just because of the WBS element being closed...
Thanks to all for your helpful answers...
Regards,
Tarun Gambhir