‎2011 Mar 30 3:26 PM
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
‎2011 Mar 31 9:44 AM
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
‎2011 Mar 31 3:57 PM
Thanks Madhan, But this is happening even if we run the function module independently from SE37.
‎2011 Apr 01 9:00 AM
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
‎2011 Apr 15 12:42 PM
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