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: 

Need a BAPI to upload "Number of packages" for outbound delivery in VL02N

Former Member
0 Kudos

Hi,

I need a BAPI which can change data into field LIKP-ANZPK (Number of packages) for outbound delivery with tcode VL02N.

I saw BAPI_OUTB_DELIVERY_CHANGE but don't know what to parameter to fill.

Can anyone help me?

Tarick.

2 REPLIES 2

naveen_kumar116
Active Participant
0 Kudos

Hi,

I think BADI will help in your issue....

Definition name is LE_SHP_DELIVERY_PROC

Interface is IF_EX_LE_SHP_DELIVERY_PROC

method SAVE_DOCUMENT_PREPARE

paste this code in method u will get the no.of packages.

********************************************************************************************

DATA: wa_likp TYPE likpvb.

DATA : it_lips TYPE TABLE OF lipsvb.

DATA : v_lines TYPE likp-anzpk.

IF sy-tcode = 'VL01N' OR sy-tcode = 'VL02N' OR sy-tcode = 'VL03N'.

IF ct_xlips[] IS NOT INITIAL.

it_lips[] = ct_xlips[].

IF it_lips[] IS NOT INITIAL.

DELETE it_lips WHERE charg = ''.

DESCRIBE TABLE it_lips LINES v_lines.

LOOP AT ct_xlikp INTO wa_likp.

wa_likp-anzpk = v_lines.

MODIFY ct_xlikp FROM wa_likp TRANSPORTING anzpk.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

max_anjos
Explorer
0 Kudos

This solution is in kzapk and kzntg.

Example:

CLEAR ls_vbkok.

     ls_vbkok-vbeln_vl  = <ls_created>-document_numb.

     ls_vbkok-vbtyp_vl  = <ls_created>-document_category_sd.

     ls_vbkok-anzpk     = id_volum.

     ls_vbkok-kzapk  = 'X'.

     ls_vbkok-kzntg  = 'X'.

     ls_vbkok-wabuc  = 'X'.

     CALL FUNCTION 'WS_DELIVERY_UPDATE_2'

       EXPORTING

         vbkok_wa       = ls_vbkok

         update_picking = 'X'

         synchron       = 'X'

         commit         = 'X'

         delivery       = <ls_created>-document_numb

       IMPORTING

         ef_error_any   = ld_error.