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

Former Member
0 Likes
791

Hi,

I need to write a FM that calls this BAPI to do a goods receipt using delivery confirmation data stored in ztables. Can anyone help me with a sample code for this FM? What should I pass to the FM, what to pass to the BAPI,etc.

Thanks,

A.P.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
704

hi ,

DATA : V_HEADER_TXT LIKE X_GOODS_MVT_HEAD-HEADER_TXT.

DATA : X_GOODS_MVT_HEAD LIKE BAPI2017_GM_HEAD_01,

X_GOODS_MVT_CODE LIKE BAPI2017_GM_CODE,

IT_GOODS_MVT_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,

IT_RETURN LIKE BAPIRET2 OCCURS 0

WITH HEADER LINE.

X_GOODS_MVT_HEAD-PSTNG_DATE = SY-DATUM.

X_GOODS_MVT_HEAD-DOC_DATE = SY-DATUM.

X_GOODS_MVT_HEAD-HEADER_TXT = V_HEADER_TXT.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = X_GOODS_MVT_HEAD

GOODSMVT_CODE = X_GOODS_MVT_CODE

IMPORTING

MATERIALDOCUMENT = P_MATDOC

TABLES

GOODSMVT_ITEM = IT_GOODS_MVT_ITEM

RETURN = IT_RETURN.

u need to call this fm if the above is successful

IF NOT P_MATDOC IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

V_BAPI_NO_ERR = 'X'.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
705

hi ,

DATA : V_HEADER_TXT LIKE X_GOODS_MVT_HEAD-HEADER_TXT.

DATA : X_GOODS_MVT_HEAD LIKE BAPI2017_GM_HEAD_01,

X_GOODS_MVT_CODE LIKE BAPI2017_GM_CODE,

IT_GOODS_MVT_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,

IT_RETURN LIKE BAPIRET2 OCCURS 0

WITH HEADER LINE.

X_GOODS_MVT_HEAD-PSTNG_DATE = SY-DATUM.

X_GOODS_MVT_HEAD-DOC_DATE = SY-DATUM.

X_GOODS_MVT_HEAD-HEADER_TXT = V_HEADER_TXT.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = X_GOODS_MVT_HEAD

GOODSMVT_CODE = X_GOODS_MVT_CODE

IMPORTING

MATERIALDOCUMENT = P_MATDOC

TABLES

GOODSMVT_ITEM = IT_GOODS_MVT_ITEM

RETURN = IT_RETURN.

u need to call this fm if the above is successful

IF NOT P_MATDOC IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

V_BAPI_NO_ERR = 'X'.

ENDIF.

Read only

Former Member
0 Likes
704

Hi A.P,

Please check this links for sample code.

http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm

http://www.4ap.de/abap/bapi_goodsmvt_create.php

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
704

Hi,

Thank you for ur replies. But I'm still confused on the importing, exporting, table parameters of the FM that will be calling bapi_goodsmvt_create.

A.P.

Read only

Former Member
0 Likes
704

Hi A.P,

Please check also the function module documentation (F9) perhaps it may help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
704

Hi,

I am also getting the same error message, i have used the 413 'E' in BAPI. please share your knowledge on this.

How to solve this issue.

Expecting your reply.

Thanks

Shankar