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: 

WS_DELIVERY_UPDATE not updating customer field

Former Member
0 Kudos

Hi, I have a problem with  WS_DELIVERY_UPDATE since the function is not updating my customer field. Here is the code example:

DATA: ls_vbkok TYPE vbkok,

      lv_vbeln TYPE likp-vbeln.

lv_vbeln = '0000000123'.

ls_vbkok-vbeln_vl = lv_vbeln.

ls_vbkok-vbtyp_vl = 'J'.

ls_vbkok-vbeln = lv_vbeln.

ls_vbkok-/mes/0_pkbma = 'X'.

CALL FUNCTION 'WS_DELIVERY_UPDATE'

  EXPORTING

    vbkok_wa      = ls_vbkok

    synchron      = 'X'

    commit        = 'X'

    delivery      = lv_vbeln.

COMMIT WORK AND WAIT.

5 REPLIES 5

ashraf_usmani
Participant
0 Kudos

Hello,

Please consider the below code:

The below FM will be used in Loop Because it will update one by one :

CALL FUNCTION 'WS_DELIVERY_UPDATE'

    EXPORTING

      VBKOK_WA                           = WA_VBKOK

*   SYNCHRON                           = ' '

*   NO_MESSAGES_UPDATE                 = ' '

     COMMIT                             = 'X'

      DELIVERY                           = I_DELIVERY

*   UPDATE_PICKING                     = ' '

*   NICHT_SPERREN                      = ' '

*   IF_CONFIRM_CENTRAL                 = ' '

*   IF_WMPP                            = ' '

*   IF_GET_DELIVERY_BUFFERED           = ' '

*   IF_NO_GENERIC_SYSTEM_SERVICE       = ' '

     IF_DATABASE_UPDATE                 = '1'

*   IF_NO_INIT                         = ' '

*   IF_NO_READ                         = ' '

     IF_ERROR_MESSAGES_SEND_0           = 'X'

*   IF_NO_BUFFER_REFRESH               = ' '

   IMPORTING

     EF_ERROR_ANY_0                     = V_ERR_ANY

     EF_ERROR_IN_ITEM_DELETION_0        = V_ERR_ITMDEL

     EF_ERROR_IN_POD_UPDATE_0           = V_ERR_POD

     EF_ERROR_IN_INTERFACE_0            = V_ERR_INT

     EF_ERROR_IN_GOODS_ISSUE_0          = V_ERR_PGI

     EF_ERROR_IN_FINAL_CHECK_0          = V_ERR_FINALCHECK

   TABLES

     VBPOK_TAB                          = IT_VBPOK

     PROT                               = T_PROT

*   VERKO_TAB                          =

*   VERPO_TAB                          =

*   VBSUPCON_TAB                       =

*   IT_VERPO_SERNR                     =

*   IT_PACKING                         =

*   IT_PACKING_SERNR                   =

*   IT_REPACK                          =

*   IT_HANDLING_UNITS                  =

*   SERNR_TAB                          =

            .

You can Use below FM to read error message:

  CALL FUNCTION 'FORMAT_MESSAGE'

             EXPORTING

                  ID        = SY-MSGID

                  LANG      = 'EN'

                  NO        = SY-MSGNO

                  V1        = SY-MSGV1

                  V2        = SY-MSGV2

             IMPORTING

                  MSG       = E_MSGOUT

             EXCEPTIONS

                  NOT_FOUND = 1

                  OTHERS    = 2.

Regards

Ashraf Usmani

0 Kudos

About what one by one you are talking? I just want to update the entry in the header in LIKP.

Is it really necessary to pass VBPOK_TAB with all the positions?


Still not working with your solution.

raghug
Active Contributor
0 Kudos

For most of the fields that you can change in the header there are corresponding flag field. I don't have the ls_vbkok-/mes/0_pkbma on my system so I am not sure what if any corresponding flag there is, is that an extension for the Manufacturing Execution System?

See the screen shot for examples of this flag

Former Member
0 Kudos

Hi, yes I know, but this is a cusstomer field.

I thought that somebody will know what I Need to do to get it working

raghug
Active Contributor
0 Kudos

I don't think you can update customer fields using WS_DELIVERY_UPDATE without using some sort of custom code on your end. You could try the DELIVERY_PUBLISH BADI, enhancing the include MV50AFZ1 or adding enhancements to the function modules WS_DELIVERY_UPDATE or WS_DELIVERY_UPDATE_2.