cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior in model of RFC BAPI_REQUISITION_GETDETAIL

Former Member
0 Kudos

Hi Experts

I have developped an application in web dynpro with Adaptive RFC pointing to rfc BAPI_REQUISITION_GETDETAIL and BAPI_REQUISITION_CREATE.

When i use the second one to create a purchase request, all is ok.

Then, i get the number of purchase request and with this number i execute the model of bapi_requisition_getdetail. In this moment something strange happen. In return node of this model, i receive a mesage PURCHASE REQUISITION <number of requisition> DOES NOT EXIST.

But i access in SAPGUI and i execute the same BAPI in transaction se37, i put the number requisition generated and th returning is sucessfull. The purchase requisition is really created.

In a short way, in SAPGUI the rfc BAPI_REQUISITION_GETDETAIL works fine, in my web dynpro application i get the message mencioned above.

Can someone help me in this issue?

I am using netweaver 7.1 ehp1.

Regards

Marcos

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to use bapi COMMIT_TRANSACTION (I dont remember the actual name) after executing the create.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Marcos,

The issue here could be the length of the purchase order number. It should be always 10 character width. However when you pass from se37 with less characters it will automatically pass the leading zeros, whereas in portal it will not. Hence check what is the length of the purchase order number been returned by the earlier BAPI and if it is less than 10 then append leading zeros and send. This will work.

Regards,

Ponraj M

Former Member
0 Kudos

You probably already used the BAPI_REQUISITION_GETDETAIL to read data before. Close your connection before calling the BAPI_REQUISITION_GETDETAIL again as your current connection reads its data from the JCO-cache.

J

Former Member
0 Kudos

Hi Marcos,

Just print the requisition number returned from the CREATE Bapi and the one which is passed to the GETDETAILS bapi. Please check that they are not different. Now, what you need to do is after you have called modelObject().execute() method to execute the model, invalidate the Output node within your Model node to refresh the context everytime the Bapi is called or else the previous value would be retained in the output node of your model node.

BAPI_REQUISITION_GETDETAIL input = new REQUISITIONGETDETAIL();

input.set(....);

...

wdContext.node<YourModelNode>.bind(input);

try{

wdContext.current<Your Model Node>Element().modelObject().execute();

wdContext.node<YourModelNode>.node<Output Node>().invalidate();

.....

}catch(Exception e){

}

Regards,

Tushar Sinha

Former Member
0 Kudos

Hi Marcos,

What I feel that the purchase request you are sending to the BAPI is not correct somehow.

Try printing it before executing the BAPI to see what you are actually sending and what is being expected by the BAPI. You can also try putting a breakpoint in se37 and then find out the input that you are providing to the BAPI.