Cumartesi , 16 Aralık 2017

Malzeme Bach input örnek kod

Home Forumlar SAP ABAP Forum ABAP Genel Malzeme Bach input örnek kod

Bu konu 0 yanıt ve 1 izleyen içeriyor ve en son  Sinan Dilaver tarafından 2 yıl 4 ay önce tarihinde güncellendi.

1 yazı görüntüleniyor (toplam 1)
  • Yazar
    Yazılar
  • #4214

    Sinan Dilaver
    Yönetici

    REPORT ZSMS_FINISHED_GOODS_PRICE_COND .

    *———————————————————————-*
    *— DICTIONARY STRUCTURES
    *———————————————————————-*
    TABLES:
    MARA, “Material basic data
    MVKE, “Material sales view
    MAKT, “Material short texts
    MARD. “Storage Location Data for Material

    *———————————————————————-*
    *— DATA DEFINITIONS
    *———————————————————————-*
    * — ALV
    INCLUDE .
    TYPE-POOLS: SLIS.
    DATA: FLDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    DATA: IS_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: CURPGM LIKE SY-REPID .
    DATA: GT_COLOR TYPE SLIS_T_SPECIALCOL_ALV WITH HEADER LINE.
    DATA: G_VARIANT LIKE DISVARIANT.

    * — BDC
    DATA: BEGIN OF BDCDATA OCCURS 0.
    INCLUDE STRUCTURE BDCDATA.
    DATA: END OF BDCDATA.
    DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF T_LOG OCCURS 0,
    STATUS(4),
    MATNR_PMSA LIKE ZSMS14-MATNR_PMSA,
    MAKTX_PMSA LIKE MAKT-MAKTX,
    TEXT70(70),
    END OF T_LOG.
    INCLUDE ZSBDCINC.

    * — PROGRAM DATA
    CONSTANTS: C_NIL(2) VALUE ‘??’,
    C_Z2 LIKE MVKE-VMSTA VALUE ‘Z2’. “Blocked for sales

    DATA: GV_VMSTA LIKE MVKE-VMSTA.
    DATA: TMPBDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

    DATA: BEGIN OF ITAB OCCURS 0,
    SELKZ TYPE C, “Selection box
    FLAG(4) TYPE C, “Flag: different price

    MATNR LIKE MARA-MATNR, “Brand
    MAKTX LIKE MAKT-MAKTX, “Brand text
    VMSTA LIKE MVKE-VMSTA, “DChain-spec mat. status
    VMSTD LIKE MVKE-VMSTD, “Valid from
    LABST LIKE MARD-LABST, “Valuated stock with unrestricted
    INSME LIKE MARD-INSME, “Stock in quality inspection
    MEINS LIKE MARA-MEINS, “Base unit of measure

    COLINFO TYPE SLIS_T_SPECIALCOL_ALV,
    END OF ITAB.

    * PMSA bilgi kaydi bazinda toplanmis guncelleme tablosu
    DATA: BEGIN OF T_UPD OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    VMSTA LIKE MVKE-VMSTA,
    END OF T_UPD.

    DATA ANSWER.
    DATA CHANGE_VALID_FROM LIKE SY-DATUM.
    DATA OK110 LIKE SY-UCOMM.
    DATA ITAB_OK.

    *———————————————————————-*
    *— SELECTION SCREEN
    *———————————————————————-*
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
    S_VMSTA FOR MVKE-VMSTA.
    PARAMETERS:
    P_WERKS LIKE EINE-WERKS OBLIGATORY DEFAULT ‘PM01’,
    P_VKORG LIKE A004-VKORG OBLIGATORY DEFAULT ‘0058’,
    P_VTWEG LIKE A004-VTWEG OBLIGATORY DEFAULT ’10’.
    SELECTION-SCREEN END OF BLOCK B1.

    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
    PARAMETERS: LAYOUT LIKE DISVARIANT-VARIANT DEFAULT ‘/DEFAULT’.
    SELECTION-SCREEN END OF BLOCK B2.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR LAYOUT.
    PERFORM F01_F4_VARIANT CHANGING LAYOUT.

    *———————————————————————-*
    *— START OF SELECTION
    *———————————————————————-*
    START-OF-SELECTION.
    * PMSA verileri
    PERFORM FILL_BRANDS.
    PERFORM CHECK_QUANTITIES.

    * Listeyi goster
    PERFORM WRITE_LIST.

    *———————————————————————-*
    *— SUBROUTINES
    *———————————————————————-*

    *&———————————————————————*
    *& Form WRITE_LIST
    *&———————————————————————*
    FORM WRITE_LIST.

    PERFORM REUSE_ALV_FIELDCATALOG_MERGE.
    PERFORM MODIFY_FIELD_CATALOG.
    PERFORM REUSE_ALV_LIST_DISPLAY.

    ENDFORM. ” WRITE_LIST

    *&———————————————————————*
    *& Form REUSE_ALV_FIELDCATALOG_MERGE
    *&———————————————————————*
    FORM REUSE_ALV_FIELDCATALOG_MERGE.

    CURPGM = SY-REPID.

    CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
    EXPORTING
    I_PROGRAM_NAME = CURPGM
    I_INTERNAL_TABNAME = ‘ITAB’
    I_INCLNAME = CURPGM
    CHANGING
    CT_FIELDCAT = FLDCATALOG[]
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3.

    ENDFORM. ” REUSE_ALV_FIELDCATALOG_MERGE

    *&———————————————————————*
    *& Form MODIFY_FIELD_CATALOG
    *&———————————————————————*
    FORM MODIFY_FIELD_CATALOG.

    IS_LAYOUT-COLWIDTH_OPTIMIZE = ‘X’.
    IS_LAYOUT-BOX_FIELDNAME = ‘SELKZ’.
    IS_LAYOUT-BOX_TABNAME = ‘ITAB’.
    IS_LAYOUT-COLTAB_FIELDNAME = ‘COLINFO’.

    LOOP AT FLDCATALOG.
    CASE FLDCATALOG-FIELDNAME .
    WHEN ‘FLAG’.
    FLDCATALOG-ICON = ‘X’.
    FLDCATALOG-KEY = ‘X’.
    FLDCATALOG-SELTEXT_L = ‘Active’.
    FLDCATALOG-SELTEXT_M = ‘Active’.
    FLDCATALOG-SELTEXT_S = ‘Act’.
    FLDCATALOG-REPTEXT_DDIC = ‘Act’.
    FLDCATALOG-OUTPUTLEN = 2.
    WHEN ‘MATNR’.
    FLDCATALOG-KEY = ‘X’.
    FLDCATALOG-SELTEXT_L = ‘Material’.
    FLDCATALOG-SELTEXT_M = ‘Material’.
    FLDCATALOG-SELTEXT_S = ‘Material’.
    FLDCATALOG-REPTEXT_DDIC = ‘Material’.
    WHEN ‘MAKTX’.
    FLDCATALOG-SELTEXT_L = ‘Material Description’.
    FLDCATALOG-SELTEXT_M = ‘Material Description’.
    FLDCATALOG-SELTEXT_S = ‘Desc’.
    FLDCATALOG-REPTEXT_DDIC = ‘Material Desc’.
    WHEN ‘VMSTA’.
    FLDCATALOG-SELTEXT_L = ‘Sales Status’.
    FLDCATALOG-SELTEXT_M = ‘Sales Status’.
    FLDCATALOG-SELTEXT_S = ‘St’.
    FLDCATALOG-REPTEXT_DDIC = ‘Sales Status’.
    WHEN ‘VMSTD’.
    FLDCATALOG-SELTEXT_L = ‘Valid From’.
    FLDCATALOG-SELTEXT_M = ‘Valid From’.
    FLDCATALOG-SELTEXT_S = ‘Valid’.
    FLDCATALOG-REPTEXT_DDIC = ‘Valid From’.
    WHEN ‘LABST’.
    FLDCATALOG-SELTEXT_L = ‘Unrestricted Stock’.
    FLDCATALOG-SELTEXT_M = ‘Unrestricted Stock’.
    FLDCATALOG-SELTEXT_S = ‘Unrest. St’.
    FLDCATALOG-REPTEXT_DDIC = ‘Unrestricted Stock’.
    WHEN ‘INSME’.
    FLDCATALOG-SELTEXT_L = ‘QA Stock’.
    FLDCATALOG-SELTEXT_M = ‘QA Stock’.
    FLDCATALOG-SELTEXT_S = ‘QA Stock’.
    FLDCATALOG-REPTEXT_DDIC = ‘QA Stock’.
    WHEN ‘MEINS’.
    FLDCATALOG-SELTEXT_L = ‘Base Unit of measure’.
    FLDCATALOG-SELTEXT_M = ‘Base Unit’.
    FLDCATALOG-SELTEXT_S = ‘UoM’.
    FLDCATALOG-REPTEXT_DDIC = ‘UoM’.
    ENDCASE.
    MODIFY FLDCATALOG.
    ENDLOOP.

    ENDFORM. ” MODIFY_FIELD_CATALOG

    *&———————————————————————*
    *& Form REUSE_ALV_LIST_DISPLAY
    *&———————————————————————*
    FORM REUSE_ALV_LIST_DISPLAY.

    DATA: L_SUBRC1 LIKE SY-SUBRC,
    L_SUBRC2 LIKE SY-SUBRC.

    IF G_VARIANT-REPORT IS INITIAL.
    G_VARIANT-REPORT = SY-REPID.
    G_VARIANT-VARIANT = LAYOUT.
    ENDIF.

    AUTHORITY-CHECK OBJECT ‘M_MATE_STA’
    ID ‘STATM’ FIELD ‘V’
    ID ‘ACTVT’ FIELD ’02’.
    L_SUBRC1 = SY-SUBRC.

    AUTHORITY-CHECK OBJECT ‘M_MATE_VKO’
    ID ‘VKORG’ FIELD P_VKORG
    ID ‘VTWEG’ FIELD P_VTWEG
    ID ‘ACTVT’ FIELD ’02’.
    L_SUBRC2 = SY-SUBRC.

    IF L_SUBRC1 IS INITIAL AND L_SUBRC2 IS INITIAL.
    CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’
    EXPORTING
    I_CALLBACK_PROGRAM = CURPGM
    I_CALLBACK_PF_STATUS_SET = ‘STANDARD’
    I_CALLBACK_USER_COMMAND = ‘USER_COMMAND’
    IT_FIELDCAT = FLDCATALOG[]
    IS_LAYOUT = IS_LAYOUT
    I_SAVE = ‘A’
    IS_VARIANT = G_VARIANT
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ELSE.
    CALL FUNCTION ‘REUSE_ALV_LIST_DISPLAY’
    EXPORTING
    I_CALLBACK_PROGRAM = CURPGM
    * i_callback_pf_status_set = ‘STANDARD’
    * i_callback_user_command = ‘USER_COMMAND’
    IT_FIELDCAT = FLDCATALOG[]
    IS_LAYOUT = IS_LAYOUT
    I_SAVE = ‘A’
    IS_VARIANT = G_VARIANT
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDIF.

    ENDFORM. ” REUSE_ALV_LIST_DISPLAY

    *———————————————————————*
    * FORM STANDARD *
    *———————————————————————*
    FORM STANDARD USING EXTAB TYPE SLIS_T_EXTAB.

    SET PF-STATUS ‘STANDLI’.

    ENDFORM.
    *&———————————————————————*
    *& Form CHECK_LINES
    *&———————————————————————*
    * text
    *———————————————————————-*
    * < --P_LF_OK text *----------------------------------------------------------------------* FORM CHECK_LINES. DATA: LF_CHANGE. ITAB_OK = 'X'. * Hic satir secilmis mi ? READ TABLE ITAB WITH KEY SELKZ = 'X'. IF NOT SY-SUBRC IS INITIAL. CLEAR ITAB_OK. MESSAGE S318(BCTRAIN). CHECK 1 = 2. ENDIF. CLEAR ITAB_OK. * Secilen satirlar icinde SD gorunumu olan var mi ? LOOP AT ITAB WHERE SELKZ = 'X'. CHECK NOT ITAB-VMSTA = C_NIL. ITAB_OK = 'X'. EXIT. ENDLOOP. IF ITAB_OK IS INITIAL. MESSAGE S185(ZM). CHECK 1 = 2. ENDIF. ENDFORM. " CHECK_LINES *&---------------------------------------------------------------------* *& Form USER_CONFIRMATION *&---------------------------------------------------------------------* FORM USER_CONFIRMATION. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING TITLEBAR = TEXT-030 TEXT_QUESTION = TEXT-040 IMPORTING ANSWER = ANSWER EXCEPTIONS TEXT_NOT_FOUND = 1 OTHERS = 2. ENDFORM. " USER_CONFIRMATION *&---------------------------------------------------------------------* *& Form UPDATE_MATERIAL *&---------------------------------------------------------------------* FORM UPDATE_MATERIAL. DATA LC_DATUM(10). CLEAR T_LOG. REFRESH T_LOG. IF GV_VMSTA IS INITIAL. T_LOG-MAKTX_PMSA = '=== FOLLOWING PRODUCTS ARE UNLOCKED ==='. ELSE. T_LOG-MAKTX_PMSA = '=== FOLLOWING PRODUCTS ARE BLOCKED ==='. ENDIF. APPEND T_LOG. WRITE SY-DATUM TO LC_DATUM. LOOP AT T_UPD. SELECT SINGLE MTART INTO MARA-MTART FROM MARA WHERE MATNR = T_UPD-MATNR. CHECK SY-SUBRC IS INITIAL. CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW' EXPORTING MATERIAL = T_UPD-MATNR MATERIALART = MARA-MTART SELECTION = 'V' "Sales TCODE = 'MM02' "Change TABLES BTCI_D0070 = TMPBDC EXCEPTIONS MATERIAL_NOT_FOUND = 1 MATERIAL_NUMBER_MISSING = 2 MATERIAL_TYPE_MISSING = 3 MATERIAL_TYPE_NOT_FOUND = 4 NO_ACTIVE_DYNPRO_SELECTED = 5 NO_AUTHORITY = 6 OTHERS = 7. CHECK SY-SUBRC IS INITIAL. CHECK NOT TMPBDC[] IS INITIAL. * Gorunum secimi (SD) PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0060'. PERFORM BDC_FIELD USING 'RMMG1-MATNR' T_UPD-MATNR. LOOP AT TMPBDC. BDCDATA = TMPBDC. APPEND BDCDATA. ENDLOOP. * Organizasyon duzeyleri secimi PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0080'. PERFORM BDC_FIELD USING 'RMMG1-WERKS' P_WERKS. PERFORM BDC_FIELD USING 'RMMG1-VKORG' P_VKORG. PERFORM BDC_FIELD USING 'RMMG1-VTWEG' P_VTWEG. PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'. * SD (1/2/3) PERFORM BDC_DYNPRO USING 'SAPLMGMM' '3001'. PERFORM BDC_FIELD USING 'MVKE-VMSTA' GV_VMSTA. IF NOT GV_VMSTA IS INITIAL. PERFORM BDC_FIELD USING 'MVKE-VMSTD' LC_DATUM. ELSE. PERFORM BDC_FIELD USING 'MVKE-VMSTD' SPACE. ENDIF. PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'. PERFORM BDC_DYNPRO USING 'SAPLMGMM' '3100'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'. PERFORM BDC_FIELD USING 'BDC_OKCODE' 'BU'. PERFORM BDC_TRANSACTION USING 'MM02' 'N' 'S'. PERFORM FILL_MESSAGE_TABLE. ENDLOOP. ENDFORM. " UPDATE_MATERIAL *&---------------------------------------------------------------------* *& Form CHECK_QUANTITIES *&---------------------------------------------------------------------* FORM CHECK_QUANTITIES. LOOP AT ITAB. CLEAR: ITAB-LABST, ITAB-INSME. SELECT * FROM MARD WHERE MATNR EQ ITAB-MATNR AND WERKS EQ P_WERKS. ITAB-LABST = ITAB-LABST + MARD-LABST. ITAB-INSME = ITAB-INSME + MARD-INSME. ENDSELECT. IF ITAB-VMSTA IS INITIAL. IF ITAB-LABST NE 0 OR ITAB-INSME NE 0. " Stock exists ? ITAB-FLAG = ICON_LED_GREEN. ELSE. ITAB-FLAG = ICON_WARNING. ENDIF. ELSE. IF ITAB-LABST NE 0 OR ITAB-INSME NE 0. " Stock exists ? ITAB-FLAG = ICON_ALERT. ELSE. ITAB-FLAG = ICON_LED_RED. ENDIF. ENDIF. MODIFY ITAB. ENDLOOP. ENDFORM. " CHECK_QUANTITIES *&---------------------------------------------------------------------* *& Form FILL_BRANDS *&---------------------------------------------------------------------* FORM FILL_BRANDS. REFRESH ITAB. SELECT MATNR MEINS INTO (MARA-MATNR,MARA-MEINS) FROM MARA WHERE MATNR IN S_MATNR AND MTART EQ 'FERT' AND LVORM EQ SPACE. CLEAR: MAKT, ITAB. SELECT SINGLE MAKTX INTO MAKT-MAKTX FROM MAKT WHERE MATNR = MARA-MATNR AND SPRAS = SY-LANGU. CLEAR: MVKE. SELECT SINGLE VMSTA VMSTD INTO (MVKE-VMSTA, MVKE-VMSTD) FROM MVKE WHERE MATNR = MARA-MATNR AND VKORG = P_VKORG AND VTWEG = P_VTWEG AND LVORM = SPACE. IF NOT SY-SUBRC IS INITIAL. MVKE-VMSTA = C_NIL. ENDIF. CHECK MVKE-VMSTA IN S_VMSTA. ITAB-MATNR = MARA-MATNR. ITAB-MAKTX = MAKT-MAKTX. ITAB-MEINS = MARA-MEINS. * IF mvke-vmstd LE p_datum. " Exclude if the valid from date ITAB-VMSTA = MVKE-VMSTA. " is not reached ITAB-VMSTD = MVKE-VMSTD. * ENDIF. APPEND ITAB. ENDSELECT. SORT ITAB. ENDFORM. " FILL_BRANDS *---------------------------------------------------------------------* * FORM USER_COMMAND * *---------------------------------------------------------------------* FORM USER_COMMAND USING RF_UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD. CLEAR ITAB_OK. CLEAR ANSWER. CASE RF_UCOMM. WHEN 'UEXE'. CLEAR GV_VMSTA. PERFORM CHECK_LINES. CHECK ITAB_OK = 'X'. PERFORM CHECK_UNLOCK. CHECK ITAB_OK = 'X'. PERFORM USER_CONFIRMATION. CHECK ANSWER = '1'. PERFORM COLLECT_UPDATE_TABLE_UNLOCK. PERFORM UPDATE_MATERIAL. PERFORM DISPLAY_MESSAGE. WHEN 'UINA'. GV_VMSTA = C_Z2. PERFORM CHECK_LINES. CHECK ITAB_OK = 'X'. PERFORM CHECK_LOCK. CHECK ITAB_OK = 'X'. PERFORM USER_CONFIRMATION. CHECK ANSWER = '1'. PERFORM COLLECT_UPDATE_TABLE_LOCK. PERFORM UPDATE_MATERIAL. PERFORM DISPLAY_MESSAGE. WHEN 'ULOG'. PERFORM DISPLAY_LOG. ENDCASE. ENDFORM. *&---------------------------------------------------------------------* *& Form DISPLAY_LOG *&---------------------------------------------------------------------* FORM DISPLAY_LOG. IF T_LOG[] IS INITIAL. MESSAGE S121(BB). CHECK 1 = 2. ENDIF. CALL SCREEN 100 STARTING AT 5 5 ENDING AT 130 20. ENDFORM. " DISPLAY_LOG *&---------------------------------------------------------------------* *& Form FILL_MESSAGE_TABLE *&---------------------------------------------------------------------* FORM FILL_MESSAGE_TABLE. DATA : L_TEXT TYPE MESSAGE. DATA : L_MSGNO LIKE SY-MSGNO. LOOP AT MESSTAB. T_LOG-MATNR_PMSA = T_UPD-MATNR. T_LOG-MAKTX_PMSA = T_UPD-MAKTX. CASE MESSTAB-MSGTYP. WHEN 'A' OR 'E' OR 'X'. T_LOG-STATUS = ICON_LED_RED. WHEN 'S'. T_LOG-STATUS = ICON_LED_GREEN. WHEN OTHERS. T_LOG-STATUS = ICON_LED_YELLOW. ENDCASE. L_MSGNO = MESSTAB-MSGNR. CALL FUNCTION 'WRITE_MESSAGE' EXPORTING MSGID = MESSTAB-MSGID MSGNO = L_MSGNO MSGTY = MESSTAB-MSGTYP MSGV1 = MESSTAB-MSGV1 MSGV2 = MESSTAB-MSGV2 MSGV3 = MESSTAB-MSGV3 MSGV4 = MESSTAB-MSGV4 IMPORTING MESSG = L_TEXT. T_LOG-TEXT70 = L_TEXT-MSGTX. APPEND T_LOG. ENDLOOP. ENDFORM. " FILL_MESSAGE_TABLE *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* MODULE STATUS_0100 OUTPUT. SET PF-STATUS '100'. SET TITLEBAR '100'. SUPPRESS DIALOG. LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. LOOP AT T_LOG. IF T_LOG-MATNR_PMSA IS INITIAL. WRITE:/ T_LOG-MAKTX_PMSA COLOR 7. ELSE. WRITE:/ T_LOG-STATUS AS ICON, T_LOG-MATNR_PMSA COLOR 4, (25) T_LOG-MAKTX_PMSA COLOR 4, T_LOG-TEXT70 COLOR 2. ENDIF. ENDLOOP. ENDMODULE. " STATUS_0100 OUTPUT *&---------------------------------------------------------------------* *& Module STATUS_0110 OUTPUT *&---------------------------------------------------------------------* MODULE STATUS_0110 OUTPUT. SET PF-STATUS '110'. SET TITLEBAR '110'. SUPPRESS DIALOG. LEAVE TO LIST-PROCESSING. "AND RETURN TO SCREEN 0. WRITE:/ TEXT-060. WRITE:/ TEXT-061. SKIP. * LOOP AT T_INV. * WRITE:/ T_INV-MATNR_PMSA COLOR 2, * T_INV-MAKTX_PMSA COLOR 2, * T_INV-CINFD COLOR 3 INTENSIFIED, * T_INV-KCINF COLOR 2, * T_INV-KONWI COLOR 2, * T_INV-KPEII COLOR 2, * T_INV-KMEII COLOR 2. * ENDLOOP. ENDMODULE. " STATUS_0100 OUTPUT *&---------------------------------------------------------------------* *& Module EXIT_COMMAND_100 INPUT *&---------------------------------------------------------------------* MODULE EXIT_COMMAND_100 INPUT. SET SCREEN 0. LEAVE SCREEN. ENDMODULE. " EXIT_COMMAND_100 INPUT *&---------------------------------------------------------------------* *& Module EXIT_COMMAND_110 INPUT *&---------------------------------------------------------------------* MODULE EXIT_COMMAND_110 INPUT. ANSWER = 'A'. SET SCREEN 0. LEAVE SCREEN. ENDMODULE. " EXIT_COMMAND_110 INPUT *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* MODULE USER_COMMAND_0100 INPUT. SET SCREEN 0. LEAVE SCREEN. ENDMODULE. " USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* *& Module USER_COMMAND_0110 INPUT *&---------------------------------------------------------------------* MODULE USER_COMMAND_0110 INPUT. SET SCREEN 0. LEAVE SCREEN. ENDMODULE. " USER_COMMAND_0110 INPUT *&---------------------------------------------------------------------* *& Form DISPLAY_MESSAGE *&---------------------------------------------------------------------* FORM DISPLAY_MESSAGE. READ TABLE T_LOG WITH KEY STATUS = ICON_LED_RED. IF SY-SUBRC IS INITIAL. PERFORM DISPLAY_LOG. MESSAGE W202(ZM). ELSE. MESSAGE S203(ZM). ENDIF. ENDFORM. " DISPLAY_MESSAGE *&---------------------------------------------------------------------* *& Form F01_F4_VARIANT *&---------------------------------------------------------------------* FORM F01_F4_VARIANT CHANGING P_LAYOUT. DATA: L_EXIT TYPE CHAR1. G_VARIANT-REPORT = SY-REPID. CALL FUNCTION 'REUSE_ALV_VARIANT_F4' EXPORTING IS_VARIANT = G_VARIANT I_SAVE = 'A' IMPORTING E_EXIT = L_EXIT ES_VARIANT = G_VARIANT EXCEPTIONS NOT_FOUND = 2. IF SY-SUBRC = 2. MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE. IF L_EXIT EQ SPACE. P_LAYOUT = G_VARIANT-VARIANT. ENDIF. " F01_F4_VARIANT ENDIF. ENDFORM. *&---------------------------------------------------------------------* *& Form CHECK_UNLOCK *&---------------------------------------------------------------------* FORM CHECK_UNLOCK. * Bloke olmayan malzemelerin blokajini acmaya calisma CLEAR ITAB_OK. LOOP AT ITAB WHERE SELKZ = 'X'. CHECK NOT ITAB-VMSTA = C_NIL. CHECK NOT ITAB-VMSTA IS INITIAL. ITAB_OK = 'X'. ENDLOOP. IF ITAB_OK IS INITIAL. MESSAGE S186(ZM). CHECK 1 = 2. ENDIF. ENDFORM. " CHECK_UNLOCK *&---------------------------------------------------------------------* *& Form CHECK_LOCK *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
    * <-- p2 text *----------------------------------------------------------------------* FORM CHECK_LOCK. * bloke olmayan malzemelerin blokajini acmaya calisma CLEAR ITAB_OK. LOOP AT ITAB WHERE SELKZ = 'X'. CHECK NOT ITAB-VMSTA = C_NIL. CHECK ITAB-VMSTA IS INITIAL. ITAB_OK = 'X'. ENDLOOP. IF ITAB_OK IS INITIAL. MESSAGE S187(ZM). CHECK 1 = 2. ENDIF. ENDFORM. " CHECK_LOCK *&---------------------------------------------------------------------* *& Form COLLECT_UPDATE_TABLE_UNLOCK *&---------------------------------------------------------------------* FORM COLLECT_UPDATE_TABLE_UNLOCK. CLEAR T_UPD. REFRESH T_UPD. LOOP AT ITAB WHERE SELKZ = 'X'. CHECK NOT ITAB-VMSTA = C_NIL. CHECK NOT ITAB-VMSTA IS INITIAL. T_UPD-MATNR = ITAB-MATNR. T_UPD-MAKTX = ITAB-MAKTX. COLLECT T_UPD. ENDLOOP. ENDFORM. " COLLECT_UPDATE_TABLE_UNLOCK *&---------------------------------------------------------------------* *& Form COLLECT_UPDATE_TABLE_LOCK *&---------------------------------------------------------------------* FORM COLLECT_UPDATE_TABLE_LOCK. CLEAR T_UPD. REFRESH T_UPD. LOOP AT ITAB WHERE SELKZ = 'X'. CHECK NOT ITAB-VMSTA = C_NIL. CHECK ITAB-VMSTA IS INITIAL. T_UPD-MATNR = ITAB-MATNR. T_UPD-MAKTX = ITAB-MAKTX. COLLECT T_UPD. ENDLOOP. ENDFORM. " COLLECT_UPDATE_TABLE_LOCK

1 yazı görüntüleniyor (toplam 1)

Bu konuyu yanıtlamak için giriş yapmış olmalısınız.