Application Development and Automation 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: 
Read only

Error while using BAPI_REQUISITION_CHANGE

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,694

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

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,202

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

14 REPLIES 14
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

Still waiting for useful pointers......!!!

Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
2,202

Hello

May be it will help you:

Read only

Former Member
0 Likes
2,202

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.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,203

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

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

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

Read only

0 Likes
2,202

Did you succeed to do the change for one test record with transaction ME52/ME52N or did you get the same kind of message ?

Also, look at FM MASS_CHANGE_PURCHASE_REQ which is a good sample on how to use this BAPI.

Regards,

Raymond

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

@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

Read only

0 Likes
2,202

Have you checked the long text for the message?

Rob

Read only

0 Likes
2,202

Could you

- write the exact number and id of the error message.

- analyse long text

- perform a where-used on message

Regards,

Raymond

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

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

Read only

0 Likes
2,202

Hello

Check WBS E.097614.C.03.

It must be released.

Read only

0 Likes
2,202

Are you able to create PR manually using WBS E.097614.C.03 ?

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
2,202

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