‎2009 Apr 20 12:11 PM
Hi guys!
I have i weired problem.
I'm using the bapi_goodsmvt_create to create a goods receipt document for a standard order.
The simulation works fine, no error or warning return, the bapi_goodsmvt_create without simulation flag works fine, bapi_transaction_commit returns no error as well, BUT: the document was not created.
Any idea about the problem?
‎2009 Apr 20 12:18 PM
How are you simulating ?
using SE37?
If yes, you have to do something like this:
Go to se37.
Chose from menu Function Module->Test->Test Sequences.
In the next screenm give the bapi name in line 1
Give the bapi_transaction_commit in line 2.
Press Enter.
GIve the test data for the bapi.
It would show the test reults.
Press back button.
GIve Input parameters for BAPI_TRANSACTION_COMMIT and execute.
Regards,
Ravi
‎2009 Apr 20 12:18 PM
How are you simulating ?
using SE37?
If yes, you have to do something like this:
Go to se37.
Chose from menu Function Module->Test->Test Sequences.
In the next screenm give the bapi name in line 1
Give the bapi_transaction_commit in line 2.
Press Enter.
GIve the test data for the bapi.
It would show the test reults.
Press back button.
GIve Input parameters for BAPI_TRANSACTION_COMMIT and execute.
Regards,
Ravi
‎2009 Apr 20 12:20 PM
I'm using it in my abap program
do i have to perform a BAPI_TRANSACTION_COMMIT after the simulation?
‎2009 Apr 20 12:36 PM
Hi Thomas,
You need to use a BAPI_TRANSACTION_COMMIT to create the document.
regards,
Nupur
‎2009 Apr 20 12:39 PM
I did the following
Bapi_goodsmvt_create // Simulation
//check if errors were returned in the "return" structure
if <no errors>
Bapi_goodsmvt_create
if <no errors>
bapi_transaction_commit
However, on the Testsystem it works, on the Quality system it doesn't. Maybe there is a problem with the order document or whatever,
It's just curious that there is no error or warning message provided
‎2009 Apr 20 12:55 PM
Hello
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING WAIT = 'X'.
‎2009 Apr 20 12:49 PM
Commit the work ..
This code might help u
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_header
goodsmvt_code = wa_gm_code
IMPORTING
goodsmvt_headret = tbl_export
materialdocument = matdoc
matdocumentyear = year
TABLES
goodsmvt_item = tbl_item
goodsmvt_serialnumber = tbl_serial
return = return.
WRITE AT 10 'STATUS OF BAPI UPLOAD' COLOR 2 INTENSIFIED ON .
SKIP 2.
LOOP AT return ASSIGNING <fs_return>.
IF <fs_return>-type EQ 'E'.
WRITE AT 10 'Error in function:' COLOR 6 INTENSIFIED OFF.
WRITE AT 28 <fs_return>-message .
SKIP 1.
err_flag = 'X'.
ELSE.
WRITE AT 10 <fs_return>-message .
SKIP 1.
ENDIF.
ENDLOOP.
IF err_flag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
IF sy-subrc NE 0.
WRITE:/ 'Error in updating'.
EXIT.
ELSE.
WRITE:/
'Number of Material Document created through BAPI:',tbl_export-mat_doc.
WRITE:/ 'Material Document Year':, tbl_export-doc_year.
ENDIF.
ENDIF.
‎2009 Apr 20 12:55 PM
>
> Commit the work ..
>
> This code might help u
I used bapi_transaction_commit to commit.
I use nearly exactly the same code that you provided, (except that i try to simulate before)
However, no errors, and no GR document
Edited by: Thomas Roithmeier on Apr 20, 2009 1:55 PM
‎2009 Apr 20 1:02 PM
can you please paste u r code.
so that i can understand the issue
‎2009 Apr 20 1:03 PM
ok, now i have a new situation
The bapi returned a valid materialdocument and year
But this document is not "connected" to the document flow (if i go VA03 --> select a Position --> view document flow; there i see the order document but not the goods receipt document)
That's why i didn't find it...
Edited by: Thomas Roithmeier on Apr 20, 2009 2:06 PM
‎2009 Apr 20 1:13 PM
please cross check whether the document is updating in MSEG or not.
‎2009 Apr 20 1:23 PM
I checked MSEG
The document is in this table and the KDAUF and KDPOS numbers of the SD document is correctly inserted.
but there is no entry in VBFA
Edited by: Thomas Roithmeier on Apr 20, 2009 2:33 PM
‎2009 Apr 21 10:48 AM
Hi,
Are you able to create a Goods movement document manually(Using MIGO)?
If yes, are you able to find it in the document flow?
Regards,
Ravi Kanth Talagana
‎2009 Apr 20 12:54 PM
Hello,
Use BAPI_TRANSACTION_COMMIT after goods mvt create.
Let me know if prblem still not solved.
Regard's
Swatantra Pathak
Edited by: Swatantra Pathak on Apr 20, 2009 1:55 PM