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: 

VL02N update DN packing fields

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

I want to update the VEKP fields,but when I debug it,the program always repack the VEPO fields,so I 'm not sure what's the issue.

Anybody have ever used the FM 'SD_DELIVERY_UPDATE_PACKING_1' please do me a favor !!!

Edited by: bluetornado on Nov 18, 2010 2:08 AM

0 Kudos

As I only need to change the header fields ,so

I try to user function module 'BAPI_HU_CHANGE_HEADER', but it cannot change the outbound delivery as VPOBJECT = '01'.

There are the source codes in FM as follows :

* fill import-parameters (key)
  lf_lock = 'X'.
  perform find_hu tables return
                   using hukey
                   changing ls_header
                            lf_lock.
  if not ( ls_header-vpobj = '12'  or  ls_header-vpobj = '05'
     or  ls_header-vpobj = '06' ).
*   Liefer- und Transporthus werden nicht gesperrt...
    RETURN-TYPE = 'E'.
    RETURN-ID = 'HUFUNCTIONS'.
    RETURN-NUMBER = '261'.
    APPEND RETURN.
    EXIT.
  endif.

Which BAPI shoud I use and or other way to solve? Desire for the suggestion !