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_goodsmvt_create: no error return, but no document created!

Former Member
0 Likes
6,016

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,862

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

13 REPLIES 13
Read only

Former Member
0 Likes
3,863

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

Read only

0 Likes
3,862

I'm using it in my abap program

do i have to perform a BAPI_TRANSACTION_COMMIT after the simulation?

Read only

0 Likes
3,862

Hi Thomas,

You need to use a BAPI_TRANSACTION_COMMIT to create the document.

regards,

Nupur

Read only

0 Likes
3,862

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

Read only

0 Likes
3,862

Hello


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING WAIT = 'X'.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,862

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.

Read only

0 Likes
3,862

>

> 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

Read only

0 Likes
3,862

can you please paste u r code.

so that i can understand the issue

Read only

0 Likes
3,862

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

Read only

0 Likes
3,862

please cross check whether the document is updating in MSEG or not.

Read only

0 Likes
3,862

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

Read only

0 Likes
3,862

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

Read only

Former Member
0 Likes
3,862

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