Skip to Content
0
Former Member
Jun 10, 2013 at 06:07 AM

BAPI BAPI_GOODSMVT_CREATE

427 Views

Hi All,

I am using the BAPI_GOODSMVT_CREATE to post the GR with inbound delivery document.

We have ECC(Data) and EP(Development) system.

In ECC system, if I run the BAPI_GOODSMVT_CREATE, then the document is posted successfully.

But if I try to post the document in EP system, I am getting the error as shown below.

Entry #####EA EA LFA1 does not exist in (check entry)

Also, find below is my code for reference.

w_bapi2017_gm_head_01-pstng_date = '20130311'."sy-datum.
w_bapi2017_gm_head_01-doc_date = '20130311'."sy-datum.
w_bapi2017_gm_head_01-ref_doc_no = ls_asn_header_det-vbeln. "Inbound delivery number
w_bapi2017_gm_head_01-pr_uname = sy-uname.
w_bapi2017_gm_head_01-header_txt = ls_asn_header_det-invoice.
w_bapi2017_gm_head_01-ver_gr_gi_slip = '1'.
w_bapi2017_gm_head_01-ver_gr_gi_slipx = 'X'.

w_bapi2017_gm_code-gm_code = '01'.

LOOP AT lt_asn_item_det INTO ls_asn_item_det.


w_bapi2017_gm_item_create-material = ls_asn_item_det-matnr.
w_bapi2017_gm_item_create-plant = ls_asn_header_det-plant.
w_bapi2017_gm_item_create-stge_loc = ls_asn_header_det-lgort.
w_bapi2017_gm_item_create-move_type = '103'.
w_bapi2017_gm_item_create-vendor = ls_asn_header_det-lifnr.
w_bapi2017_gm_item_create-entry_qnt = ls_asn_item_det-menge.
w_bapi2017_gm_item_create-entry_uom = ls_asn_item_det-meins.
w_bapi2017_gm_item_create-orderpr_un_iso = ls_asn_item_det-meins.
w_bapi2017_gm_item_create-po_number = ls_asn_item_det-ebeln.
w_bapi2017_gm_item_create-po_item = ls_asn_item_det-ebelp.
w_bapi2017_gm_item_create-item_text = ls_asn_item_det-txz01.
w_bapi2017_gm_item_create-gr_rcpt = ls_asn_header_det-wempf.
w_bapi2017_gm_item_create-mvt_ind = 'B'.


APPEND w_bapi2017_gm_item_create TO it_bapi2017_gm_item_create.
CLEAR w_bapi2017_gm_item_create.


ENDLOOP.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE' DESTINATION 'ECC_STACK'
EXPORTING
goodsmvt_header = w_bapi2017_gm_head_01
goodsmvt_code = w_bapi2017_gm_code
testrun = ' '
IMPORTING
goodsmvt_headret = w_goodsmvt_headret
materialdocument = w_materialdocument
matdocumentyear = w_matdocumentyear
TABLES
goodsmvt_item = it_bapi2017_gm_item_create
return = it_bapiret2.

IF it_bapiret2 IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.

ENDIF.

Please guide me on the above issue

With Regards,

Gurulakshmi