2019年5月6日星期一

Logistics Execution


Add append fields to bapi BAPI_OUTB_DELIVERY_CHANGE

1.add apend fields to structure vbkok and vbpok

2.implement badi:SMOD_V50B0001 method EXIT_SAPLV50I_010

 METHOD IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010.
    CONSTANTS:
      LC_VBKOK    TYPE CHAR5  VALUE 'VBKOK',  "出荷ヘッダ(拡張項目ZXX含まれる)
      LC_VBPOK    TYPE CHAR5  VALUE 'VBPOK',  "出荷明細(拡張項目ZXX含まれる)
      LC_CS_VBKOK TYPE CHAR8  VALUE 'CS_VBKOK'.

    DATA:
      LV_ITEM       TYPE POSNR_VL,
      LW_EXTENSION2 TYPE BAPIEXT.

    FIELD-SYMBOLS:
      <LFS_FIELDNAME> TYPE ANY,
      <LFS_VBKOK>     TYPE ANY,
      <LFS_VBPOK>     TYPE ANY.


    LOOP AT EXTENSION2 INTO LW_EXTENSION2.

      CASE LW_EXTENSION2-PARAM.
        WHEN LC_VBKOK"LIKPの拡張項目
          ASSIGN (LC_CS_VBKOKTO <LFS_VBKOK>.
          IF <LFS_VBKOK> IS ASSIGNED.
            ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBKOK> TO <LFS_FIELDNAME>.
            IF <LFS_FIELDNAME> IS ASSIGNED.
              <LFS_FIELDNAME> LW_EXTENSION2-VALUE.
            ENDIF.
          ENDIF.

        WHEN LC_VBPOK"LIPSの拡張項目
          MOVE LW_EXTENSION2-ROW TO LV_ITEM.
          READ TABLE CT_VBPOK ASSIGNING <LFS_VBPOK> WITH KEY POSNR_VL LV_ITEM.
          IF SY-SUBRC 0.
            ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBPOK> TO <LFS_FIELDNAME>.
            IF <LFS_FIELDNAME> IS ASSIGNED.
              <LFS_FIELDNAME> LW_EXTENSION2-VALUE.
            ENDIF.
          ENDIF.

      ENDCASE.

    ENDLOOP.


3. implement badi (enhancement spot) LE_SHP_DELIVERY_UPDATE 

  method IF_EX_LE_SHP_DELIVERY_UPDATE~UPDATE_HEADER.
   CS_LIKP-ZZ1_TEST_TOSS_NO_DLH IS_VBKOK-ZZ2_TEST_TOSS_NO_DLH.
  endmethod. 

    method IF_EX_LE_SHP_DELIVERY_UPDATE~UPDATE_ITEM.
   endmethod.



Customer Characteristic

  Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...