Skip to Content
author's profile photo Former Member
Former Member

BAPI_GOODSMVT_CREATE gm01 move type 101 reutrn none

Hi,

it's a very strang issue.i need goods receipt for a po.the code should be very simple,but it return none, no error and no success message.

is anyone in the case,give me some tips,thank you very much.

my code like:

DATA: WA_EBAN LIKE EBAN, WA_HEADER LIKE BAPI2017_GM_HEAD_01, WA_CODE LIKE BAPI2017_GM_CODE, WA_RETURN LIKE BAPIRET2, GM_CODE LIKE BAPI2017_GM_CODE OCCURS 0, GM_HEADER LIKE BAPI2017_GM_HEAD_01 OCCURS 0, GM_HEADRET LIKE BAPI2017_GM_HEAD_RET, GM_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0, WA_ITEM LIKE BAPI2017_GM_ITEM_CREATE, GM_RETURN LIKE BAPIRET2 OCCURS 0.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF WA_EBAN

FROM EBAN WHERE BANFN = P_PURCHASE_NO AND BNFPO = P_PURCHASE_ITEM.

IF SY-SUBRC = 0.

WA_CODE-GM_CODE = '01'. APPEND WA_CODE TO GM_CODE.

WA_HEADER-PSTNG_DATE = P_POSTG_DATE. WA_HEADER-DOC_DATE = P_DOC_DATE. WA_HEADER-PR_UNAME = SY-UNAME. WA_HEADER-REF_DOC_NO = WA_EBAN-EBELN. WA_HEADER-GR_GI_SLIP_NO = ' '. WA_HEADER-HEADER_TXT = 'PO reciept'. APPEND WA_HEADER TO GM_HEADER.

WA_ITEM-PO_NUMBER = WA_EBAN-EBELN. WA_ITEM-PO_ITEM = WA_EBAN-EBELP. WA_ITEM-MVT_IND = 'B'. WA_ITEM-MOVE_TYPE = '101'. WA_ITEM-ENTRY_QNT = P_QUNATITY. WA_ITEM-ENTRY_UOM = WA_EBAN-MEINS.

APPEND WA_ITEM TO GM_ITEM.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE' EXPORTING GOODSMVT_HEADER = WA_HEADER GOODSMVT_CODE = WA_CODE IMPORTING GOODSMVT_HEADRET = GM_HEADRET TABLES GOODSMVT_ITEM = GM_ITEM RETURN = GM_RETURN. READ TABLE GM_RETURN INTO WA_RETURN WITH KEY TYPE = 'E'. IF SY-SUBRC = 0 OR GM_HEADRET-MAT_DOC IS INITIAL. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. LOOP AT GM_RETURN INTO WA_RETURN WHERE TYPE = 'E'. CONCATENATE LOG WA_RETURN-MESSAGE INTO LOG. ENDLOOP.

ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'. ENDIF.
goodmove.png (15.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2014 at 07:26 AM

    this issue is not solved,but i found the point is my account.other people can do this use bapi and migo,i only can use migo.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.