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

Issue while using FM L_TO_CREATE_POSTING_CHANGE

Former Member
0 Likes
2,302

Hi All,

We are facing an issue when creating a transfer order using the FM

L_TO_CREATE_POSTING_CHANGE.

We have developed a custom program to change the status (Zfield) of a

specific SU in LQUA and update its stock category. The program creates

the material document and posting change document in the background.

During this process, the badi MB_DOCUMENT_BADI~MB_DOCUMENT_UPDATE gets

triggered where we call the above FM in the background task. During TO

creation, we have also implemented the badi LE_WM_LE_QUANT to update

the quant with the specific SU which was changed by the user in the

custom program. (We get this from the custom data base table).

The TO is created for mvt types 321, 322, 343, 344, 349 and 350.

We do not pass the t_LUBQU table in the above FM so that the program

gets the updated quant from the badi. The issue is that the FM

sometimes does not process properly and ends up without creating the

TO. We are not able to get the exact scenario for which it is

failing. When we debug it, we get message S178 - Foreground processing

is required.

Can anyone let me know what is the problem here?

Thanks in advance,

Chetan

4 REPLIES 4
Read only

Former Member
0 Likes
1,153

Dear Chetan

I think you are calling the Function module at wrong place.

Check this OSS note - Note 1284654 - Caution with implementations of the BAdI: MB_DOCUMENT_BADI

Please take opinion from BASIS / SAP on the same

Regards

Madhan D

Read only

0 Likes
1,153

Thanks Madhan, But this is happening even if we run the function module independently from SE37.

Read only

0 Likes
1,153

Dear Chetan

Since you are facing this issue in standard SAP.

I suggest you to raise a OSS message to SAP to take there help

Regards

Madhan D

Read only

Former Member
0 Likes
1,153

As mentioned by Madhan

you are trying to do a chicken and egg thing...

You have to commit the MM posting of the BAPI to create the change posting in WM before you can convert the change posting using the FM...

In other words.

call BAPI_GOODSMVMT_CREATE

commit work and wait

call L_TO_CREATE_POSTING_CHANGE

be aware that you still might get locking problems. the commit work and wait does not handle that all the time correctly...

bjorn