2019年8月13日星期二

WBS NETWORK ACTIVITY


FORM F_INS_WBS USING" AI_W_SALESORDER    TYPE ZDWGG02
                     AI_V_PSPID          TYPE PROJ-PSPID
                     AI_W_WBSELEMENT_LV2 TYPE PRPS-POSID
                     AI_W_WBSELEMENT_LV3 TYPE PRPS-POSID
                     AI_W_WBSELEMENT2    TYPE BAPI_BUS2054_DETAIL
                     AI_W_WBSELEMENT3    TYPE BAPI_BUS2054_DETAIL
                     AI_W_NETWORK        TYPE BAPI_NETWORK_EXP
                     AI_W_ACTIVITY       TYPE BAPI_NETWORK_ACTIVITY_EXP
            CHANGING AO_V_NETWORK        TYPE BAPI_NETWORK_EXP-NETWORK
                     AO_V_ACTIVITY_NO    TYPE BAPI_NETWORK_ACTIVITY_EXP-ACTIVITY
                     AO_T_RETURN         TYPE BAPIRET2_T
                     AO_V_ERRFLG         TYPE CHAR01.
  DATA:
    LT_WBS            TYPE STANDARD TABLE OF BAPI_BUS2054_NEW,
    LS_WBS            TYPE BAPI_BUS2054_NEW,

    LT_EXT_IN         TYPE STANDARD TABLE OF BAPIPAREX,
    LS_EXT_IN         TYPE BAPIPAREX,
    LS_WBS_EXT        TYPE BAPI_TE_WBS_ELEMENT,
    LT_EXT_OUT        TYPE STANDARD TABLE OF BAPIPAREX,
    LT_RETURN         TYPE STANDARD TABLE OF BAPIRET2,
    LS_RETURN_STATUS  TYPE BAPIRETURN1,
    LS_STATUS         TYPE BAPI_WBS_MNT_SYSTEM_STATUS,
    LT_STATUS         TYPE STANDARD TABLE OF BAPI_WBS_MNT_SYSTEM_STATUS,
    LS_NETWORK_STATUS TYPE BAPI_SYSTEM_STATUS-SYSTEM_STATUS,

    LS_NETWORK        TYPE BAPI_BUS2002_NEW,
    LV_NETWORK        TYPE BAPI_NETWORK_LIST-NETWORK,

    LS_ACTIVITY       TYPE BAPI_BUS2002_ACT_NEW,
    LT_ACTIVITY       TYPE STANDARD TABLE OF BAPI_BUS2002_ACT_NEW,

    LS_NETWORK_INFO   TYPE BAPI_NETWORK_EXP,
    LS_ACTIVITY_INFO  TYPE BAPI_NETWORK_ACTIVITY_EXP,

    LV_MRP_ERR        TYPE CHAR01.
*    LW_WBSNETWORK_DATE TYPE TYP_WBS_NETWORK_DATE.

  CLEAR:
    LT_WBS,
    LS_WBS,
    LT_EXT_IN,
    LS_EXT_IN,
    LT_EXT_OUT,
    LS_NETWORK,
    LV_NETWORK,
    LS_ACTIVITY,
    LT_ACTIVITY,
    LS_WBS_EXT,
    LS_NETWORK_INFO,
    LS_ACTIVITY_INFO.

  IF AI_W_WBSELEMENT2 IS INITIAL.
    LS_WBS-WBS_ELEMENT  AI_W_WBSELEMENT_LV2.
    LS_WBS-DESCRIPTION  'XXXX'"AI_W_SALESWORDER-ZWORKTXT.

    CLEAR LS_WBS-WBS_PLANNING_ELEMENT.

    LS_WBS-WBS_ACCOUNT_ASSIGNMENT_ELEMENT 'X'.

    CLEAR LS_WBS-WBS_BILLING_ELEMENT.

    LS_WBS-COMPANY_CODE '1000'"AI_W_SALESWORDER-BUKRS.
    LS_WBS-PLANT   '1000'.  "AI_W_SALESWORDER-WERKS.
*   利益センタ
    LS_WBS-PROFIT_CTR '1000'."AI_W_SALESWORDER-PRCTR.
*   WBS要素:基本開始日付 (受注伝票日付)
    LS_WBS-WBS_BASIC_START_DATE '20190801'"AI_W_SALESWORDER-AUDAT.
*   WBS要素:基本終了日付 (納入日)
    LS_WBS-WBS_BASIC_FINISH_DATE '20190830'"AI_W_SALESWORDER-EDATU.
    LS_WBS-WBS_UP  AI_V_PSPID.
    APPEND LS_WBS TO LT_WBS.

    LS_EXT_IN-STRUCTURE 'BAPI_TE_WBS_ELEMENT'.
    LS_WBS_EXT-WBS_ELEMENT AI_W_WBSELEMENT2.
*   見積管理No
*   LS_WBS_EXT-ZZXXXX      = AI_W_SALESWORDER-ZESTNO.
    LS_EXT_IN-VALUEPART1 LS_WBS_EXT.
    APPEND LS_EXT_IN TO LT_EXT_IN.
  ENDIF.


  IF AI_W_WBSELEMENT3 IS INITIAL.
    LS_WBS-WBS_ELEMENT  AI_W_WBSELEMENT_LV3.
*   WBS名称 受注明細のテキスト
    LS_WBS-DESCRIPTION  'XXXX'"AI_W_SALESWORDER-ZWORKTXT.
*   区分:計画要素
    LS_WBS-WBS_PLANNING_ELEMENT 'X'.
*   区分:勘定設定要素
    LS_WBS-WBS_ACCOUNT_ASSIGNMENT_ELEMENT 'X'.
*   区分:請求要素
    LS_WBS-WBS_BILLING_ELEMENT 'X'.

    LS_WBS-COMPANY_CODE '1000'"AI_W_SALESWORDER-BUKRS.
    LS_WBS-PLANT   '1000'.  "AI_W_SALESWORDER-WERKS.
*   利益センタ
    LS_WBS-PROFIT_CTR '1000'."AI_W_SALESWORDER-PRCTR.
*   WBS要素:基本開始日付 (受注伝票日付)
    LS_WBS-WBS_BASIC_START_DATE '20190801'"AI_W_SALESWORDER-AUDAT.
*   WBS要素:基本終了日付 (納入日)
    LS_WBS-WBS_BASIC_FINISH_DATE '20190830'"AI_W_SALESWORDER-EDATU.
    APPEND LS_WBS TO LT_WBS.

  ENDIF.

  IF LT_WBS IS NOT INITIAL.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

*   Level2 Level3のWBS登録
    CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
      EXPORTING
        I_PROJECT_DEFINITION AI_V_PSPID
      TABLES
        IT_WBS_ELEMENT       LT_WBS
        ET_RETURN            LT_RETURN
        EXTENSIONIN          LT_EXT_IN
        EXTENSIONOUT         LT_EXT_OUT.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    CLEAR:
      LS_STATUS,
      LT_STATUS,
      LS_RETURN_STATUS.

    LS_STATUS-WBS_ELEMENT AI_W_WBSELEMENT_LV2.
    LS_STATUS-SET_SYSTEM_STATUS 'REL'.
    APPEND LS_STATUS TO LT_STATUS.

    CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'
      IMPORTING
        RETURN              LS_RETURN_STATUS
      TABLES
        I_WBS_SYSTEM_STATUS LT_STATUS.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    CALL FUNCTION 'BAPI_PS_PRECOMMIT'
      TABLES
        ET_RETURN LT_RETURN.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    PERFORM F_UPDATE_GUID.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT 'X'.
  ENDIF.

  IF AI_W_NETWORK IS INITIAL.
    LS_NETWORK-WBS_ELEMENT AI_W_WBSELEMENT_LV2.
    LS_NETWORK-PROJECT_DEFINITION AI_V_PSPID.
    LS_NETWORK-SHORT_TEXT 'AAAA'"AI_W_SALESORDER-ZWORKTXT.
*  MRP CONTROLLERは受注伝票のPSTYVよりADDONテーブルより取得
    LS_NETWORK-MRP_CONTROLLER 'ZZZ'.
*  開始日
    LS_NETWORK-START_DATE '20190801'"AI_W_SALESORDER-AUDAT.
*  終了日(工場出荷予定日)
    LS_NETWORK-FINISH_DATE '20190830'"AI_W_SALESORDER-MBDAT.
*  プラント
    LS_NETWORK-PLANT '1000'.  "AI_W_SALESORDER-WERKS

    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

    CALL FUNCTION 'BAPI_BUS2002_CREATE'
      EXPORTING
        I_NETWORK LS_NETWORK
      TABLES
        ET_RETURN LT_RETURN.

    PERFORM F_ERROR_UNLOCK
       USING
         LT_RETURN
         'X'
       CHANGING
         AO_T_RETURN
         AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    CALL FUNCTION 'BAPI_PS_PRECOMMIT'
      TABLES
        ET_RETURN LT_RETURN.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    PERFORM F_UPDATE_GUID.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT 'X'.

  ENDIF.

  IF AI_W_NETWORK IS INITIAL.
*    Network新規作成した場合、作成したNetwork番号取得
    PERFORM F_GET_NETWORK
      USING
        AI_W_WBSELEMENT_LV2
        AI_W_WBSELEMENT_LV3
     CHANGING
        LS_NETWORK_INFO
        LS_ACTIVITY_INFO
        AO_V_ACTIVITY_NO.

    LV_NETWORK LS_NETWORK_INFO-NETWORK.

    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

    CLEAR LS_RETURN_STATUS.

    LS_NETWORK_STATUS 'REL'.

    CALL FUNCTION 'BAPI_BUS2002_SET_STATUS'
      EXPORTING
        NUMBER            LV_NETWORK
        SET_SYSTEM_STATUS LS_NETWORK_STATUS
      IMPORTING
        RETURN            LS_RETURN_STATUS.

*   エラーが発生した場合、ステータスのエラーロック解除する
    PERFORM F_STATUS_ERROR_UNLOCK
     USING LS_RETURN_STATUS
     CHANGING
           AO_T_RETURN
           AO_V_ERRFLG.

    CALL FUNCTION 'BAPI_PS_PRECOMMIT'
      TABLES
        ET_RETURN LT_RETURN.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    PERFORM F_UPDATE_GUID.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT 'X'.
  ELSE.
    LV_NETWORK AI_W_NETWORK-NETWORK.
  ENDIF.

  AO_V_NETWORK LV_NETWORK.

  IF AI_W_ACTIVITY IS INITIAL.

    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

    CLEARLT_ACTIVITY,
           LS_ACTIVITY.

    LS_ACTIVITY-PLANT '1000'.  "AI_W_SALESORDER-WERKS.
    LS_ACTIVITY-DESCRIPTION 'AAAAA'"AI_W_SALESORDER-ARKTX.
    LS_ACTIVITY-WBS_ELEMENT AI_W_WBSELEMENT_LV3.
    LS_ACTIVITY-ACTIVITY  AO_V_ACTIVITY_NO.
    APPEND LS_ACTIVITY TO LT_ACTIVITY.
    CALL FUNCTION 'BAPI_BUS2002_ACT_CREATE_MULTI'
      EXPORTING
        I_NUMBER    LV_NETWORK
      TABLES
        IT_ACTIVITY LT_ACTIVITY
        ET_RETURN   LT_RETURN.

    PERFORM F_ERROR_UNLOCK
       USING
         LT_RETURN
         'X'
       CHANGING
         AO_T_RETURN
         AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    CALL FUNCTION 'BAPI_PS_PRECOMMIT'
      TABLES
        ET_RETURN LT_RETURN.

    PERFORM F_ERROR_UNLOCK
      USING
        LT_RETURN
        'X'
      CHANGING
        AO_T_RETURN
        AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ENDIF.

    PERFORM F_UPDATE_GUID.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT 'X'.


  ENDIF.




ENDFORM.



FORM F_DEL_WBS  USING  AI_V_PSPID  TYPE PROJ-PSPID
                       AI_W_WBSELEMENT2    TYPE BAPI_BUS2054_DETAIL
                       AI_W_WBSELEMENT3    TYPE BAPI_BUS2054_DETAIL
                       AI_W_NETWORK        TYPE BAPI_NETWORK_EXP
                       AI_W_ACTIVITY       TYPE BAPI_NETWORK_ACTIVITY_EXP
            CHANGING   AO_T_RETURN         TYPE BAPIRET2_T
                       AO_V_ERRFLG         TYPE CHAR01.

  DATA:
    LT_ACTIVITY_STATUS TYPE STANDARD TABLE OF BAPI_ACT_MNT_SYSTEM_STATUS,
    LS_ACTIVITY_STATUS TYPE BAPI_ACT_MNT_SYSTEM_STATUS,

    LS_RETURN_STATUS   TYPE BAPIRETURN1,

    LT_WBS_STATUS      TYPE STANDARD TABLE OF BAPI_WBS_MNT_SYSTEM_STATUS,
    LS_WBS_STATUS      TYPE BAPI_WBS_MNT_SYSTEM_STATUS,
    LS_NETWORK_STATUS  TYPE BAPI_SYSTEM_STATUS-SYSTEM_STATUS,
    LT_RETURN          TYPE STANDARD TABLE OF BAPIRET2,
    LV_WHERE           TYPE STRING.

*    LT_WBS_3           TYPE STANDARD TABLE OF TYP_PRPS,
*    LS_WBS_3           TYPE TYP_PRPS,
*    LW_WBSNETWORK_DATE TYPE TYP_WBS_NETWORK_DATE.

  CLEARLT_RETURN.

  IF AI_W_ACTIVITY IS NOT INITIAL.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
    LS_ACTIVITY_STATUS-ACTIVITY  AI_W_ACTIVITY-ACTIVITY.
    LS_ACTIVITY_STATUS-SET_SYSTEM_STATUS 'DEL'.
    APPEND LS_ACTIVITY_STATUS TO LT_ACTIVITY_STATUS.

    CALL FUNCTION 'BAPI_BUS2002_SET_STATUS'
      EXPORTING
        NUMBER                   AI_W_NETWORK-NETWORK
      IMPORTING
        RETURN                   LS_RETURN_STATUS
      TABLES
        I_ACTIVITY_SYSTEM_STATUS LT_ACTIVITY_STATUS.

    PERFORM F_STATUS_ERROR_UNLOCK
    USING LS_RETURN_STATUS
    CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ELSE.
      CALL FUNCTION 'BAPI_PS_PRECOMMIT'
        TABLES
          ET_RETURN LT_RETURN.

      PERFORM F_ERROR_UNLOCK
        USING
          LT_RETURN
          'X'
        CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

      IF AO_V_ERRFLG IS NOT INITIAL.
        RETURN.
      ENDIF.

      PERFORM F_UPDATE_GUID.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT 'X'.
    ENDIF.
  ENDIF.

  IF AI_W_WBSELEMENT3 IS NOT INITIAL.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

    CLEAR:
      LT_WBS_STATUS,
      LS_WBS_STATUS,
      LS_RETURN_STATUS.

    LS_WBS_STATUS-WBS_ELEMENT  AI_W_WBSELEMENT3-WBS_ELEMENT.
    LS_WBS_STATUS-SET_SYSTEM_STATUS 'DEL'.
    APPEND LS_WBS_STATUS TO LT_WBS_STATUS.

    CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'
      IMPORTING
        RETURN                   LS_RETURN_STATUS
      TABLES
        I_WBS_SYSTEM_STATUS LT_WBS_STATUS.

    PERFORM F_STATUS_ERROR_UNLOCK
    USING LS_RETURN_STATUS
    CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ELSE.
      CALL FUNCTION 'BAPI_PS_PRECOMMIT'
        TABLES
          ET_RETURN LT_RETURN.

      PERFORM F_ERROR_UNLOCK
        USING
          LT_RETURN
          'X'
        CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

      IF AO_V_ERRFLG IS NOT INITIAL.
        RETURN.
      ENDIF.

      PERFORM F_UPDATE_GUID.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT 'X'.
    ENDIF.

  ENDIF.

  IF AI_W_WBSELEMENT2 IS NOT INITIAL.
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

    CLEAR:
      LT_WBS_STATUS,
      LS_WBS_STATUS,
      LS_RETURN_STATUS.

    LS_WBS_STATUS-WBS_ELEMENT  AI_W_WBSELEMENT2-WBS_ELEMENT.
    LS_WBS_STATUS-SET_SYSTEM_STATUS 'DEL'.
    APPEND LS_WBS_STATUS TO LT_WBS_STATUS.

    CALL FUNCTION 'BAPI_BUS2054_SET_STATUS'
      IMPORTING
        RETURN                   LS_RETURN_STATUS
      TABLES
        I_WBS_SYSTEM_STATUS LT_WBS_STATUS.

    PERFORM F_STATUS_ERROR_UNLOCK
    USING LS_RETURN_STATUS
    CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

    IF AO_V_ERRFLG IS NOT INITIAL.
      RETURN.
    ELSE.
      CALL FUNCTION 'BAPI_PS_PRECOMMIT'
        TABLES
          ET_RETURN LT_RETURN.

      PERFORM F_ERROR_UNLOCK
        USING
          LT_RETURN
          'X'
        CHANGING
          AO_T_RETURN
          AO_V_ERRFLG.

      IF AO_V_ERRFLG IS NOT INITIAL.
        RETURN.
      ENDIF.

      PERFORM F_UPDATE_GUID.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT 'X'.
    ENDIF.

  ENDIF.




ENDFORM.

FORM F_STATUS_ERROR_UNLOCK  USING AI_W_ERROR  TYPE BAPIRETURN1
                            CHANGING AO_T_ERROR TYPE BAPIRET2_T
                                     AO_V_ERRFLG TYPE CHAR01.

  DATA:LS_ERROR TYPE BAPIRET2.
  IF AI_W_ERROR-TYPE 'E' OR
    AI_W_ERROR-TYPE ='A'.

    AO_V_ERRFLG 'X'.
    MOVE-CORRESPONDING AI_W_ERROR TO LS_ERROR.
    APPEND LS_ERROR TO AO_T_ERROR.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' .

  ENDIF.

ENDFORM.



FORM F_GET_NETWORK  USING  AI_W_WBS_LV2        TYPE PRPS-POSID
                           AI_W_WBS_LV3        TYPE PRPS-POSID
                    CHANGING
                           AO_W_NETWORK        TYPE BAPI_NETWORK_EXP
                           AO_W_ACTIVITY       TYPE BAPI_NETWORK_ACTIVITY_EXP
                           AO_V_ACTIVITY_NO    TYPE BAPI_NETWORK_ACTIVITY_EXP-ACTIVITY.

ENDFORM.




FORM F_ERROR_UNLOCK  USING     AI_T_ERROR  TYPE BAPIRET2_T
                               AI_V_UNLOCK TYPE CHAR01
                      CHANGING AO_T_ERROR  TYPE BAPIRET2_T
                               AO_V_ERRFLG TYPE CHAR01.

  FIELD-SYMBOLS:<FS_ERROR> TYPE BAPIRET2.

  CLEAR AO_V_ERRFLG.

  LOOP AT AI_T_ERROR ASSIGNING <FS_ERROR>
    WHERE TYPE 'E' AND
          TYPE 'A'.
    AO_V_ERRFLG 'X'.
    APPEND <FS_ERROR> TO AO_T_ERROR.
  ENDLOOP.

  IF AO_V_ERRFLG IS NOT INITIAL AND
     AI_V_UNLOCK IS NOT INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ENDIF.


ENDFORM.










*&-----------------------------------------------------------------------*
*& FORM F_UPDATE_GUID
*&-----------------------------------------------------------------------*
* GUIDの更新処理
*&-----------------------------------------------------------------------*
FORM F_UPDATE_GUID.
  DATA:
    LI_VBMOD_ALL TYPE STANDARD TABLE OF VBMOD,
    LV_ENQDONE   TYPE CHAR01,
    LV_ENQKEY    TYPE EQEUSEVB,
    TH_OPCODE(1TYPE X,
    LV_VBKEY     TYPE VBMOD-VBKEY,
    LV_FUNCNM    TYPE TFDIR-FUNCNAME,
    LV_PNAME     TYPE CHAR40,
    BEGIN OF VBID,
      TIMESTAMP LIKE VBMOD-VBKEY,
      ID        LIKE VBMOD-VBMODCNT,
    END OF VBID.

  FIELD-SYMBOLS:<FS_VBMOD> TYPE VBMOD.
  CONSTANTS:C_GET_VB_KEY LIKE TH_OPCODE VALUE 2.

  CALL 'ThVBCall' ID 'OPCODE' FIELD C_GET_VB_KEY
                  ID 'VBKEY'   FIELD LV_VBKEY
                  ID 'ENQKEY'  FIELD LV_ENQKEY
                  ID 'ENQDONE' FIELD LV_ENQDONE.

  SELECT FROM VBMOD INTO TABLE LI_VBMOD_ALL
    WHERE VBKEY LV_VBKEY.

  SORT LI_VBMOD_ALL BY VBMODCNT  ASCENDING.

  LOOP AT LI_VBMOD_ALL ASSIGNING <FS_VBMOD>.

    SELECT SINGLE PNAME INTO LV_PNAME FROM TFDIR WHERE FUNCNAME <FS_VBMOD>-VBFUNC.
    VBID-TIMESTAMP <FS_VBMOD>-VBKEY.
    VBID-ID        <FS_VBMOD>-VBMODCNT.

    PERFORM (<FS_VBMOD>-VBFUNCIN PROGRAM (LV_PNAMEUSING VBID.


    DELETE FROM VBMOD WHERE  VBKEY    <FS_VBMOD>-VBKEY AND
                             VBMODCNT <FS_VBMOD>-VBMODCNT.
    DELETE FROM VBDATA WHERE VBKEY    <FS_VBMOD>-VBKEY AND
                             VBMODCNT <FS_VBMOD>-VBMODCNT.


  ENDLOOP.

ENDFORM.

没有评论:

发表评论

Customer Characteristic

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