Skip to Content
0
Jan 08, 2016 at 11:22 AM

Error VL216 when using SD_DELIVERY_UPDATE_PICKING via IDOC

548 Views

Hello,

I'm trying to use SD_DELIVERY_UPDATE_PICKING to set the picking quantity of a set of delivery items to ZERO. The code is as simple as this:

CLEAR:

ls_vbkok_wa,

lt_vbpok_tab[].

ls_vbkok_wa-vbeln_vl = lv_delivery.

ls_vbkok_wa-vbtyp_vl = 'J'.

ls_vbkok_wa-vbeln = lv_delivery.

LOOP AT lt_lips.

CLEAR:

ls_vbpok_tab.

ls_vbpok_tab-vbeln_vl = lv_delivery.

ls_vbpok_tab-posnr_vl = lt_lips-posnr.

ls_vbpok_tab-vbeln = lv_delivery.

ls_vbpok_tab-posnn = lt_lips-posnr.

ls_vbpok_tab-pikmg = 0.


APPEND ls_vbpok_tab TO lt_vbpok_tab.

ENDLOOP.

CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING'

EXPORTING

vbkok_wa = ls_vbkok_wa

* SYNCHRON = 'X'

* NO_MESSAGES_UPDATE = 'X'

NICHT_SPERREN = 'X'

* AUFRUFER_T = ' '

IF_ERROR_MESSAGES_SEND = 'X'

TABLES

vbpok_tab = lt_vbpok_tab

PROT = lt_prot.



Here's my problem:


  • Using SE37 the FM works fine;
  • Using this chunk of code in another FM that is called by an IDOC, I get error VL216 - Item 10 does not exist;


Can someone help me? Why do I get a different behaviour when the FM is called via IDOC?


Regards,


João