Skip to Content
0
Former Member
Nov 16, 2010 at 02:37 AM

VL02N update DN packing fields

107 Views

I want to update DN packing fields such as handling unit ID2, these fields link to TABLE VEKP.

The packing handling unit have been created, it need to modify some data.

I have tried the function module as follows:

LOOP AT it_data into line_pk.
    read table it_vekp with key VPOBJKEY = line_pk-vbeln.
    if sy-subrc = 0 .
      tabix = sy-tabix.
      index = tabix + line_pk-seqnr - 1.
      read table it_vekp index index.
      if sy-subrc = 0.
        clear verko_tab.
        MOVE-CORRESPONDING it_vekp TO verko_tab.
        MOVE-CORRESPONDING line_pk TO verko_tab.
        append verko_tab.
      endif.
    endif.
    vbeln = line_pk-vbeln.
    loop at it_vepo where vbeln = vbeln.
      move-corresponding it_vepo to verpo_tab.
      append verpo_tab.
    endloop.

    CALL FUNCTION 'SD_DELIVERY_UPDATE_PACKING_1'
      EXPORTING
        DELIVERY                  = vbeln
        COMMIT                    = 'X'
        SYNCHRON                  = 'X'
      TABLES
        VERKO_TAB                 = verko_tab[]
        VERPO_TAB                 = verpo_tab[]
        PROT                      = prot[]
*       IT_PACKING                =
*       IT_REPACK                 =
*       IT_HANDLING_UNITS_1       =
*       IT_PACKING_SERNR          =
*       IT_VERPO_SERNR            =
*       VBPOK_TAB                 =
     EXCEPTIONS
       UPDATE_NOT_POSSIBLE       = 1
       OTHERS                    = 2
              .
    IF SY-SUBRC = 0.
      COMMIT WORK.
    ELSE.
      ROLLBACK WORK.
    ENDIF.

  ENDLOOP.

But the FM return no information and no errors,and the packing information cannot be updated as I check it use VL03N.

How should I process it ? Please help me and thanks a lot !

Edited by: bluetornado on Nov 16, 2010 3:49 AM