Application Development 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: 

BAPI BAPI_GOODSMVT_CREATE, the document flow is not updated for the outbound delivery.

0 Kudos

Hi, we have SAP Retail (ECC 6.0). We´re implementing Intercompany PO Process, every works fine except the GR with outbound delivery.

We´re using the BAPI BAPI_GOODSMVT_CREATE to Post the Goods Receipt and the document flow is not updated for the outbound delivery.

We´re using the following parameters for calling BAPI

    "-----------------------------------------
"     LLENAR DATOS GOODSMVT_HEADER
"-----------------------------------------
xbapi2093_res_head
-pstng_date = budat.
xbapi2093_res_head
-doc_date   = bldat.
xbapi2093_res_head
-ref_doc_no = delivery. "vbeln.


"---------------------------------------
"   LLENAR DATOS GOODSMVT_CODE
"---------------------------------------
xbapi2017_gm_code
-gm_code = '01'.


"-------------------------------------
"   LLENAR DATOS GOODSMVT_ITEM
"-------------------------------------
MOVE: werks TO xbapi2017_gm_item_create-plant,
'0001' TO xbapi2017_gm_item_create-stge_loc,
'101' TO xbapi2017_gm_item_create-move_type,
erfmg
TO xbapi2017_gm_item_create-entry_qnt,
erfme
TO xbapi2017_gm_item_create-entry_uom,
ref_doc
TO xbapi2017_gm_item_create-po_number,             "bstnr
'00001' TO xbapi2017_gm_item_create-po_item,               "ebelp
delivery
TO xbapi2017_gm_item_create-deliv_numb_to_search"vbeln
'10' TO xbapi2017_gm_item_create-deliv_item_to_search"posnr
'B' TO xbapi2017_gm_item_create-mvt_ind.

APPEND xbapi2017_gm_item_create.

"----------------------------------------------------------
"      LLAMADA A LA BAPI BAPI_GOODSMVT_CREATE
"----------------------------------------------------------
* Esta BAPI genera un documento de artículo a partir de la
* tabla ZMATERIALES

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header 
= xbapi2093_res_head
goodsmvt_code   
= xbapi2017_gm_code
IMPORTING
goodsmvt_headret
= xbapi2017_gm_head_ret
TABLES
goodsmvt_item   
= xbapi2017_gm_item_create
return           = xbapiret.

* Si se crea exitosamente la entrada de mercancía llamaremos a la
* siguiente BAPI para la creación del documento de materiales.
IF xbapiret-type EQ 'S' OR xbapi2017_gm_head_ret-mat_doc <> ''.

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

Why not update the document flow for the outbound delivery?

Thanks and advance

1 ACCEPTED SOLUTION

Former Member

You need to populate and pass the below fields to the BAPI with outbound delivery and item, for the GR to show in document flow

GOODSMVT_ITEM-DELIV_NUMB

GOODSMVT_ITEM-DELIV_ITEM

2 REPLIES 2

Former Member

You need to populate and pass the below fields to the BAPI with outbound delivery and item, for the GR to show in document flow

GOODSMVT_ITEM-DELIV_NUMB

GOODSMVT_ITEM-DELIV_ITEM

Thanks a lot. Its now updated in document flow.

Regards