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

VBWS_UOM_MAINTAIN_DARK example

Former Member
0 Likes
1,096

Hi,

Can you send me an example of FM VBWS_UOM_MAINTAIN_DARK.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
807

chk this FM VBWS_UOM_SAVE_REPLICA where the FM specified by you was used

3 REPLIES 3
Read only

Former Member
0 Likes
808

chk this FM VBWS_UOM_SAVE_REPLICA where the FM specified by you was used

Read only

0 Likes
807

Thanks. I solved the problem with using VBWS_UOM_SAVE_REPLICA

Read only

Former Member
0 Likes
807

Hi,


    DATA:
    gt_meinh         TYPE smeinh OCCURS 0 WITH HEADER LINE,
    gt_meinh_ws      TYPE smeinh_ws OCCURS 0 WITH HEADER LINE,
    gt_meinh_ws_upd  TYPE smeinh_wsupd OCCURS 0 WITH HEADER LINE,
    gt_meinh_ws_updx TYPE smeinh_wsupdx OCCURS 0 WITH HEADER LINE,
    gt_message       TYPE matmess OCCURS 0 WITH HEADER LINE,
    gt_return        TYPE bapireturn1 OCCURS 0 WITH HEADER LINE.

    FREE:
      gt_meinh ,gt_meinh_ws, gt_meinh_ws_upd, gt_meinh_ws_updx,
      gt_message,  gt_return.


    CALL FUNCTION 'VBWS_UOM_READ_WITH_MATNR'
           EXPORTING
                i_matnr                  = template-material
*         I_BUFFER_REFRESH         = 'X'
*         I_EXIT_BY_FIRST_ERROR    = 'X'
*         I_LIST_ERRORS_ONLY       = ' '
*         I_ERROR_BY_MISSING_UOM   = 'X'
*         I_ERROR_BY_INCORRECT_UOM = 'X'
*         I_SYSTEM                 =
*    IMPORTING
*         E_KZWSM                  =
*         E_MARA                   =
          TABLES
               e_meinh                  = gt_meinh
               e_meinh_ws               = gt_meinh_ws
               e_meinh_ws_upd           = gt_meinh_ws_upd
               e_meinh_ws_updx          = gt_meinh_ws_updx
               e_message                = gt_message
               e_return                 = gt_return
          EXCEPTIONS
               error                    = 1
               OTHERS                   = 2
                .

With this Function Module 'VBWS_UOM_READ_WITH_MATNR' you will get from an template Material all the necessary internal tables filled. That could help you to understand in what matter the tables have to be filled up to use the function module:

VBWS_UOM_MAINTAIN_DARK.

The next step is to use the filled tables with the function module 'VBWS_UOM_MAINTAIN_DARK'


    FREE: gt_message, gt_return.
    CALL FUNCTION 'VBWS_UOM_MAINTAIN_DARK'
         EXPORTING
            i_matnr               =  new-material
            i_kzwsm               = 'B'
            i_kzwsmx              = 'X'
*         I_TYPE_OF_BLOCK       = 'E'
            i_exit_by_first_error = 'X'
*         I_LIST_ERRORS_ONLY    = ' '
            i_user                = sy-uname
            i_buffer_refresh      = 'X'
*         I_UPDATE_BUFFER_ONLY  = ' '
            i_no_update           = ' '
*         I_RFC_SENDER          =
*         I_CALLING_METHOD      =
*    IMPORTING
*         E_KZWSM               =
*         E_KZWSM_OLD           =
        TABLES
             i_meinh_ws_upd        = gt_meinh_ws_upd
             i_meinh_ws_updx       = gt_meinh_ws_updx
*         I_MEINH_WS_SFN        =
*         I_MEINH_WS_SFNX       =
*            e_meinh_ws            = gt_meinh_ws
*            e_meinh               = gt_meinh
*         E_MEINH_OLD           =
           e_message             = gt_message
           e_return              = gt_return
        EXCEPTIONS
             error                 = 1
             OTHERS                = 2.

I think that could help you.

regards

Thorsten