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: BAPI_GOODSMVT_CREATE Return Null

0 Likes
2,127

Hi Expert,

I am using BAPI BAPI_GOODSMVT_CREATE for posting material in MB1B and using  BAPI_TRANSACTION_COMMIT with WAIT = 'X'.


Now the issue is BAPI Return Table which having null value , doesn't contain any rows, But Output is working fine the document is posting.

Movement Type is 311.

please suggest..

Thanks & Regards

Sushil Kumar Shrivastava

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,317

Hi Sushil,

Posted document will be found in        MATERIALDOCUMENT and       MATDOCUMENTYEAR  field

  CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

    EXPORTING

      goodsmvt_header       = header

      goodsmvt_code         = '04'

    IMPORTING

*     GOODSMVT_HEADRET      =

      MATERIALDOCUMENT      = doc

      MATDOCUMENTYEAR       = yr

    TABLES

      goodsmvt_item         = it_item

*     goodsmvt_serialnumber = it_sno

      return                = it_return.

  IF it_return[] IS INITIAL.

    CONCATENATE doc yr 'Posted' INTO   lv_text SEPARATED BY SPACE.

    MESSAGE lv_text type 'S'.

ENDIF.

Hope it helpful,

Regards,

Venkat.

3 REPLIES 3
Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,318

Hi Sushil,

Posted document will be found in        MATERIALDOCUMENT and       MATDOCUMENTYEAR  field

  CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

    EXPORTING

      goodsmvt_header       = header

      goodsmvt_code         = '04'

    IMPORTING

*     GOODSMVT_HEADRET      =

      MATERIALDOCUMENT      = doc

      MATDOCUMENTYEAR       = yr

    TABLES

      goodsmvt_item         = it_item

*     goodsmvt_serialnumber = it_sno

      return                = it_return.

  IF it_return[] IS INITIAL.

    CONCATENATE doc yr 'Posted' INTO   lv_text SEPARATED BY SPACE.

    MESSAGE lv_text type 'S'.

ENDIF.

Hope it helpful,

Regards,

Venkat.

Read only

agnihotro_sinha2
Active Contributor
0 Likes
1,317

That is CORRECT.

Table "return" will not have any DATA if its successfully posted. It will only have data if there are any errors.

Your posted MBLNR will be found in structure GOODSMVT_HEADRET fields ( mat_doc,  doc_year) or in MATERIALDOCUMENT and MATDOCUMENTYEAR.


But you should always check the RETURN table if any messages have been passed.

Read only

Former Member
0 Likes
1,317

check through se37,execute as an standalone function module ,so that your doubt gets clarified.