SD_DELIVERY_UPDATE_PICKING

Категория:

Группа функций SAP:

Описание модуля: 
Укомплектование поставка
Пример использования: 
DATA:  ls_vbkok    TYPE  vbkok
          , lt_vbpok    TYPE  tab_vbpok
          , lt_prot     TYPE  tab_prott
         , ls_message  TYPE  recamsg
        .
  FIELD-SYMBOLS : <fs_vbpok>  TYPE  vbpok
                , <fs_prot>   TYPE  prott
                .
 
  ls_vbkok-vbeln_vl = '' "Номер поставки
 
  SELECT  SINGLE  vbtyp
  FROM  likp
  INTO  ls_vbkok-vbtyp_vl
  WHERE  vbeln = ls_vbkok-vbeln_vl.
 
  ls_vbkok-kodat    = sy-datum
*
  SELECT  vbeln AS  vbeln_vl
          posnr AS  posnr_vl
          matnr
          lgmng AS  pikmg
          meins
  FROM  lips
      INTO  CORRESPONDING FIELDS OF TABLE lt_vbpok
  ##too_many_itab_fields
  WHERE  vbeln = ls_vbkok-vbeln_vl.
*  AND  uecha <> space.
 
  LOOP AT lt_vbpok  ASSIGNING <fs_vbpok>.
    <fs_vbpok>-vbeln  = <fs_vbpok>-vbeln_vl.
    <fs_vbpok>-posnn  = <fs_vbpok>-posnr_vl.
    <fs_vbpok>-taqui  = abap_true.
    <fs_vbpok>-werks  = '1010'.
  ENDLOOP.
 
  SET UPDATE TASK LOCAL.
  CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING' "DESTINATION 'NONE'
  EXPORTING
    vbkok_wa      = ls_vbkok
    synchron      = 'X'
    nicht_sperren = 'Y'
  TABLES
    vbpok_tab     = lt_vbpok
    prot          = lt_prot.
 
  LOOP AT lt_prot ASSIGNING <fs_prot>.
    MOVE-CORRESPONDING  <fs_prot> TO  ls_message.
 
  ENDLOOP.
 
  LOOP AT lt_prot TRANSPORTING NO FIELDS  WHERE msgty CA  'AXE'.
    EXIT.
  ENDLOOP.
  IF  sy-subrc  = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
 
    MESSAGE e016  WITH  ls_vbkok-vbeln_vl text-neg  INTO  sy-msgli.
 
 
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = abap_true.
 
    MESSAGE s016  WITH  ls_vbkok-vbeln_vl text-pos  INTO  sy-msgli.
 
  ENDIF.
Параметры: