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

BAPI_PRODORDCONF_CREATE_HDR

Former Member
0 Likes
1,484

Hi,

I am entering order confirmations as well as posting explicit goods movements using the 'BAPI_PRODORDCONF_CREATE_HDR'.

After commiting the transaction:

Calling 'BAPI_PRODORDCONF_GETDETAIL' passing Confirmation no & Confirmation count returned by the order confirmation BAPI to get the goods movement details.

My requirement is to get the Material Doc Number (MBLNR) if goods movements were posted.

The problem I am facing is that when I call the 'get detail' BAPI the goods movement posting & material document creation has not yet completed, hence i fail to get the doc number.

I put a WAIT command just before calling the 'get detail' and it works. For obvious reasons i cannot use WAIT, anyone encountered similar problem please suggest a solution.

Thanks in advance!

3 REPLIES 3
Read only

Former Member
0 Likes
934

Hi

I also faced same kind of problem in a diff scenario in FICA module.

This happens bcoz at the same time two FMs are trying to update the same table.thats why the error comes.bcoz suppose one FM trigerred and locked all the database fields while updating and still that has not been released and the second FM is trying to update.so it fails.

Use WAIT upto 5 SEC and then call the second FM.its advisable in this scenario and no need to worry i think.

Mark points if helpful.

Regs

Manas Ranjan Panda

Read only

Former Member
0 Likes
934

hi Kapil,

I can propose one solution for this issue, apart from the WAIT option.

You need to create an UPDATE FUNCTION MODULE (select the radio button update function module in the attributes of the function module), say Z_PRODORDER_GETDETAIL.

In this new FM, you need to call 'BAPI_PRODORDCONF_GETDETAIL' .

The custom function module has to be called as shown below:

call function 'Z_PRODORDER_GETDETAIL' in update task

exporting......

importing.....

tables........

The new function module you created would be executed in the same update process, as with the create BAPI..If the first bapi fails to create order, the new function module will return no details, otherwise, the details which you requires..

Hope this helps.

Sajan.

Read only

Former Member
0 Likes
934

Hi Sajan,

Thanks for the reply.

BAPI_CREATE does order confirmations (similar to CO15) and goods movements.

I checked the locks created by 'BAPI_CREATE' and it does not have a lock on AFFW / AFWI which I am reading in 'BAPI_GETDETAIL'

Now I do a COMMIT.

Then while calling 'BAPI_GET_DETAIL' which reads from AFFW / AFWI depending on whether the goods movement were succesfully posted or not,

AFFW has not yet been updated with the material document.

Thanks,

Kapil