02-06-2008 1:44 PM
Hi guys,
I was able to successfully post a goods receipt using WS_DELIVERY_UPDATE.
But for some deliveries with missing batch, I'm unable to update the batch of items. I don't know what parameter I'm missing because when I tested the function module, it didn't produce any error. But it also didn't update the batch (LIPS-CHARG) of the delivery items. Anybody here with experience in successful update of the batch field using this function module, or any other function module, please post your sample code.
Thanks in advance.
Regards,
Carl
02-06-2008 4:29 PM
BAPI_GOODSMVT_CREATE
use this it works but put code field also accordinhly means 01,02,04 reading documentation
02-15-2008 5:31 PM
Hi,
Try this code for posting GR. this works using delivery.
SELECT SINGLE vgbel
FROM lips
INTO gv_vgbel
WHERE vbeln = gk_vekp-vpobjkey.
SELECT SINGLE ebelp
FROM ekpo
INTO gv_ebelp
WHERE ebeln = gv_vgbel.
gk_gm_head_01-pstng_date = sy-datum.
gk_gm_head_01-doc_date = sy-datum.
gk_gm_head_01-ref_doc_no = gk_vepo1-vbeln.
gk_gm_item_create-material = gk_vepo1-matnr.
gk_gm_item_create-plant = gk_vepo1-werks.
gk_gm_item_create-stge_loc = gk_vepo1-lgort.
gk_gm_item_create-batch = gk_vepo1-charg.
gk_gm_item_create-move_type = gc_101.
gk_gm_item_create-no_more_gr = gc_x.
gk_gm_item_create-mvt_ind = gc_b.
gk_gm_item_create-entry_qnt = gk_vepo1-vemng.
gk_gm_item_create-entry_uom = gk_vepo1-vemeh.
gk_gm_item_create-po_number = gv_vgbel.
gk_gm_item_create-po_item = gv_ebelp.
gk_gm_code-gm_code = gc_01.
APPEND gk_gm_item_create TO gt_gm_item_create.
Creation of GR Number for HU
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = gk_gm_head_01
goodsmvt_code = gk_gm_code
IMPORTING
goodsmvt_headret = gk_head_ret
materialdocument = gv_goods_receipt
matdocumentyear = gk_year
TABLES
goodsmvt_item = gt_gm_item_create
return = gt_bapiret2.
thanks
Sumanth
04-14-2008 3:35 PM
Hello Carl,
Did you get it? Because I have the same problem than you.
I don't have to post any movemet, I just need to change de batch.
Thank you,
Rosana
04-14-2008 5:21 PM
Hi Rosana,
Unfortunately, no. I'm able to change batch, but at the same time post the goods issue. If I don't post the movement, it won't update the batch. Like you, I wanted to just change the batch.
Regards,
Carl
04-15-2008 8:01 AM
OK, Carl
So thank you very much! I will try will a CALL TRANSACTION or something like that... I don't like it at all, but I need it.
Thank you again,
Rosana