Application Development and Automation 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: 
Read only

Creating delivery Using GN_DELIVERY_CREATE

arindam_samanta
Participant
0 Likes
5,870

Hi Expert,

I am trying to create delivery number 'GN_DELIVERY_CREATE'. Below is my code:


* Document Item
       CLEAR:l_count.
       LOOP AT im_poitem INTO lw_poitem.

         ADD 1 TO l_count.

*        lw_komdlgn-vstel = v_curop_plnt.
         lw_komdlgn-vstel = lw_poitem-plant.
         lw_komdlgn-vkorg = w_sales-vkorg.
         lw_komdlgn-vtweg = w_sales-vtweg.
         lw_komdlgn-spart = w_sales-spart.
         lw_komdlgn-lfart = 'LB'.
         lw_komdlgn-kunwe = w_sales-kunnr.
         lw_komdlgn-matnr = lw_poitem-material.
         lw_komdlgn-werks = lw_poitem-plant.
         lw_komdlgn-wadat = sy-datum.
         lw_komdlgn-lfdat = sy-datum.
         lw_komdlgn-lfimg = lw_poitem-quantity.
         lw_komdlgn-vrkme = lw_poitem-po_unit.
         lw_komdlgn-vgpos = l_count.
         lw_komdlgn-lgort = lw_poitem-stge_loc.
         lw_komdlgn-charg = lw_poitem-batch.
         lw_komdlgn-lifnr = im_head-vendor.
         lw_komdlgn-lifex = im_ebeln.
         lw_komdlgn-lifexpos = lw_poitem-po_item.
*      lw_komdlgn-empst

         APPEND lw_komdlgn TO lt_komdlgn.

         CLEAR:lw_poitem,lw_komdlgn.
       ENDLOOP.


CALL FUNCTION 'GN_DELIVERY_CREATE'
         EXPORTING
           vbsk_i         = lw_vbsk
           no_commit      = 'X'
           vbls_pos_rueck = 'X'
           if_no_deque    = 'X'
         TABLES
           xkomdlgn       = lt_komdlgn
           xvbfs          = lt_vbfs
           xvbls          = lt_vbls.

Using above code, I got the delivery number. But when I checked in Table LIPS, the field LFIMG contains 0(zero) for every line items. But I passed the actual quantity. How can I get the actual quantity in LIPS table?

Any possible solution would be gratefully accepted.

Thanks

Arindam Samanta.

3 REPLIES 3
Read only

arindam_samanta
Participant
0 Likes
3,328

Hi Expert,

I passed the quantity to  komdlgn-lfimg. After delivery creation, when I checked in table LIPS, all item quantity (lifmg) field in the table LIPS becomes 0.

Why the quantity has been changed inside the function module.

Any solution would be gratefully accepted.

Regards,

Arindam Samanta.

Read only

custodio_deoliveira
Active Contributor
0 Likes
3,328

Hi Arindam,

Have you tried populating table XXLIPS?

Cheers,

Custodio

Read only

former_member228404
Discoverer
0 Likes
3,328

Sorry for the delay, but I had the problem this year. In my case I decided to change the control of the subroutine in the view "V_TVCPLAP", table "TVCPL". Someone changed the "TVCPL-GRUAP" VBAP control to 900. The correct one is 202.