2009 Sep 11 9:59 AM
Hi all,
To post the Incoming Idocs, I have created an Inbound FM ZIDOC_INPUT_ZSUBMIGO and inside this I am calliing another FM ZSUB_CRT_MIGO_CREATE which actually creates the Material Document and I have included "Commit" after each of the calls.
But the problem is the idoc does't create the material doc during normal flow in background, but when i process the idoc using we19 manually it is posting. I am wondering why the idoc is not creating the Material doc whenever it has been received at the receiver.Status shows 53 when received at the receiver end.
Appreciate ur inputs.
Thanks,
Subba
2009 Sep 11 10:13 AM
Hi,
Put a wait statement after ZSUB_CRT_MIGO_CREATE funciton module call and test again in background.
KR Jaideep,
2009 Sep 11 10:30 AM
Hi Jai,
I tried But still it works thru we19 as before, but not automatically when the idoc arrives at destination.
This is bit strange.
Thanks,
Subba
2009 Sep 11 10:48 AM
Hi,
Yes, it is strange. Can you please send the code snippet of both the function modules ?
KR Jaideep,
2009 Sep 14 6:05 AM
In Function module ZIDOC_INPUT_ZSUBMIGO
CALL FUNCTION 'ZSUB_CRT_MIGO_CREATE'
EXPORTING
GOODSMVT_HEADER = GOODSMVT_HEADER
GOODSMVT_CODE = GOODSMVT_CODE
TESTRUN = TESTRUN
IMPORTING
MATERIALDOCUMENT = MATERIALDOCUMENT
MATDOCUMENTYEAR = MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = GOODSMVT_ITEM
RETURN = RETURN
EXCEPTIONS
OTHERS = 1.
commit work.
Inside the above FM i am calling the standard FM
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GOODSMVT_HEADER
GOODSMVT_CODE = GOODSMVT_CODE
TESTRUN = TESTRUN
GOODSMVT_REF_EWM =
IMPORTING
GOODSMVT_HEADRET =
MATERIALDOCUMENT = MATERIALDOCUMENT
MATDOCUMENTYEAR = MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = GOODSMVT_ITEM
GOODSMVT_SERIALNUMBER =
RETURN = RETURN
GOODSMVT_SERV_PART_DATA =
EXTENSIONIN =
.
commit work.
Thanks,
Subba
2009 Sep 14 10:46 AM
Are you sure your function module is called in background? (just add an abort message in your code to be sure)
Are you sure the control record is the same in the 2 scenarii?
How do you test with WE19, which button? (standard receipt, function module...)
2009 Sep 14 12:08 PM
Hi Sandra,
I use "Standard inbound" in WE19 and it perfectly triggers my code pasted earlier and Material Document is successfuly posted and can be viewed in MB03 txn.
Only problem is why the posting is not happening as soon as idoc is received and is working via we19 ie manually trigger.
Thanks,
Subba
2009 Sep 14 12:51 PM
Hi,
You may try calling CALL FUNCTION 'BAPI_TRAN.. COMMIT' starting new task 'abc'.
once your Z-Function Module call finishes.
At put a wait statement for some 4-5 seconds.
Thanks,
Preyansh
2009 Sep 14 1:03 PM
No, I was wondering whether your function module was really triggered in "background in the normal flow" as you said ? I was thinking of control record differences, and especially distribution. Are you executing via ALE distribution, or via custom program, or something else? Is it executed under a different user?
Note that some programs may act differently when it is in background, but it's rare.
What I personally do to find out the difference between 2 runs which I presume should be identical, is to trace procedure calls using SE30 (create a variant with "no aggregation" flag checked, and display result with button "call hierarchy"). Do a visual comparison between the 2 results.
2010 Jun 30 5:18 AM