Module pool program

Hi,
Im very new to module pool
i have one requirement . that is i want to write the functionality for follwoing keys.
1.newentry
2.copy
3.delete.
as per spec i want the following logic
PBO Logic 
Create PF status in the PBO and create Application toll bar buttons for New Entry, Copy and Delete.
PAI Logic
Code logic for New Entry, Copy and Delete Entries.
During SAVE.
For actions New Entry and Copy  : Check for already existing entry and raise message.
Enqueue  the table for update creating a lock object .
When Successfully saved  dequeue the table and display u2018Entry Saved u201C message.
Thanks,
Narasimha
Moderator message: "spec dumping", please work yourself first on your requirement, get some training if you're new to the area, SCN cannot be a substitute for this.
locked by: Thomas Zloch on Aug 11, 2010 3:39 PM

You should be able to run it from SE38, you don't need a transaction code in this case, as there is a call screen 100 in there.
How did you copy the program? In SE38, enter the program name and press copy. It should give you a pop-up screen with a bunch of checkboxes. Select all of them and press copy again. That should copy all the objects to your Z program. You then need to activate all of them. In SE38, enter your Z program name and activate. It will give another pop-up with object and obj. name columns. Select all of them again and then press activate.
Hope this helps,
Srinivas

Similar Messages

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • Getting error while calling a subscreen in  module pool program

    HI  ALL,
                         ACTUALLY I'M GETTING A SYNTAX ERROR WHILE I'M CALLING A SUBSCREEN
                       IN A MODULE POOL PROGRAM IN PAI MODULE
                       THE ERROR IS AS FOLLOW
                           "." or "ID ... FIELD ..." expected after "SUBSCREEN"
                        CAN ANYBODY PLS HELP ME.
    REGARDS
    ANDREWS

    HI MAX ,
                      THE CODE IS AS FOLLOWS:
    *& Report  ZTABSTRIP_PS
    REPORT  ZTABSTRIP_PS.
    type-pools : vrm.
    DATA:number1 type I,
         number2 type I,
         result  type I,
         ok_code like SY-UCOMM,
         employee1 type c,
         ABAP(19)    type c,
         SALES(19)  type c,
         HR(19)      type c,
         MM(19)     type  c,
    employee type c.
        emp type c.
    CONTROLS  tabstrip TYPE TABSTRIP.
    CALL SCREEN 100.
    call screen 110.
    call screen 130.
    call screen 120.
    call screen  140.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
      SET TITLEBAR 'TITLE'.
      CASE OK_CODE.
        WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program.
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
       WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
      when 'TAB1'.
    tabstrip-activetab = 'TAB1'.
       when 'TAB2'.
    tabstrip-activetab = 'TAB2'.
    result = number1 + number2.
       when 'TAB3'.
      tabstrip-activetab = 'TAB3'.
    SET TITLEBAR 'TITLE1'.
      when 'TAB4'.
        tabstrip-activetab = 'TAB4'.
       if employee = 'NEERAJ'.
         ABAP = 'NEERAJ'.
       elseif employee = 'UMESH'.
         SALES = 'UMESH'.
       ELSEIF employee = 'RAM'.
         HR = 'RAM'.
       elseif employee = 'ANIL'.
         MM = 'ANIL'.
         endif.
       employee = employee.
    WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    ENDCASE.
       WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program .
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0110  OUTPUT
          text
    **MODULE STATUS_0110 OUTPUT.
    SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    **case ok_code.
    **WHEN 'back' or 'exit' or 'delete'.
        leave PROGRAM.
        WHEN 'save'.
          MESSAGE 'please choose a valid function ' TYPE 'W'.
    ENDCASE.
    **ENDMODULE.                 " STATUS_0110  OUTPUT
    *&      Module  USER_COMMAND_0110  INPUT
          text
    MODULE USER_COMMAND_0110 INPUT.
      number1 = number1.
      number2 = number2.
    CLEAR NUMBER1.
    CLEAR NUMBER2.
    REFRESH NUMBER1.
    REFRESH NUMBER2.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    *&      Module  STATUS_0130  OUTPUT
          text
    MODULE STATUS_0130 OUTPUT.
    SET PF-STATUS 'STATUS2'.
    SET TITLEBAR 'xxx'.
    RESULT = number1 + number2.
    *CLEAR RESULT.
    REFRESH RESULT.
    ENDMODULE.                 " STATUS_0130  OUTPUT
    *&      Module  STATUS_0120  OUTPUT
          text
    MODULE STATUS_0120 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    DATA:  l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'ANIL'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '2'.
      l_value-text = 'RAM'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '3'.
      l_value-text = 'NEERAJ'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '4'.
      l_value-text = 'UMESH'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
    l_name =  'employee'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID                    =  l_name
          VALUES                =  li_list
       EXCEPTIONS
         ID_ILLEGAL_NAME       = 1
         OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR li_list.
    ENDMODULE.                 " STATUS_0120  OUTPUT
    *&      Module  USER_COMMAND_0120  INPUT
          text
    MODULE USER_COMMAND_0120 INPUT.
    INCLUDING sy-repid '140'.
    employee1 = employee.
    IF employee1 CS 'NEERAJ'.
      call SUBSCREEN    sub4  .
      ABAP = 'NEERAJ'.
      CLEAR ABAP.
    ELSEIF employee1 CS 'UMESH'.
       call SUBSCREEN  sub4  .
        SALES = 'UMESH'.
        CLEAR SALES.
    elseif employee1 CS 'RAM'.
      call SUBSCREEN sub4 .
       HR = 'RAM'.
       CLEAR  HR.
    ELSEIF employee1 CS 'ANIL'.
       call SUBSCREEN sub4 .
       MM = 'ANIL'.
       CLEAR MM.
       endif.
    ENDMODULE.                 " USER_COMMAND_0120  INPUT
    *&      Module  STATUS_0140  OUTPUT
          text
    MODULE STATUS_0140 OUTPUT.
    *CASE OK_CODE.
       WHEN employee1  'NEERAJ'.
         screen-active = 1.
         ABAP = 'NEERAJ'.
       WHEN employee1 = 'UMESH'.
         screen-active = 1.
         SALES = 'UMESH'.
       WHEN employee1 = 'RAM'.
         screen-active = 1.
         HR = 'RAM'.
       WHEN employee1 = 'ANIL'.
         screen-active = 1.
         MM = 'ANIL'.
         endif.
    *ENDCASE.
    ENDMODULE.                 " STATUS_0140  OUTPUT

  • Can we use Initilization event in module pool program?

    Hi All,
    Can we use Initialization event in module pool program? If not why?
    Thanks In Advance!!!!!!!!!

    The runtime environment creates the INITIALIZATION event and calls the corresponding event block (if it has been defined in the ABAP program).
    http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb2d67358411d1829f0000e829fbfe/content.htm
    SEE THE ABOVE LINK...THINK IT WILL SOLVE ALL YOUR DOUBTS
    REGARDS
    RACHEL

  • Use of "Pool Table(s)" in Module Pool Program

    Hi,
    I often see/hear that Pool tables play an important role in Module Pool Programs.
    anybody please explain me how Pool tables are used in Module Pools?? => Did you look for any documentation?
    if possible with code snippets. =>NO.
    Thanks,
    Kranthi.
    Edited by: kishan P on Nov 14, 2010 7:23 PM

    Hi,
    I often see/hear that Pool tables play an important role in Module Pool Programs.
    anybody please explain me how Pool tables are used in Module Pools?? => Did you look for any documentation?
    if possible with code snippets. =>NO.
    Thanks,
    Kranthi.
    Edited by: kishan P on Nov 14, 2010 7:23 PM

  • How to call a "Z"module pool program in a "z"report

    Hi Guys,
    I have two reports .
    1. Report : uploads a tab delimited " .Txt1" file and update the "z1" table
        ".TXT1" : File contains 4 fields
    2. Module pool. :Uploads a a tab delimited " .Txt2" file and update another "z2" table
        ".TXT2" file contains  the 4 fileds of ".TXT1" and also 2 extra fields.
    I want to merge (call) the module pool program in the Report and perform the upload function using only one ".TXT" file.Please do guide me precisely .
    *Report:*
    REPORT zrswbgcs009 NO STANDARD PAGE HEADING MESSAGE-ID zwb
                         LINE-SIZE 185.
    TABLES:  zgcs_foc.      "FOC Parts Table
    *data count buffer
    DATA:    read_cnt(6)    TYPE p,        "Find read record
             update_cnt(6)  TYPE p,        "OK record
             error_cnt(6)   TYPE p.        "Error record
    *file buffer(FOC)
    DATA: BEGIN OF FOC_inrec  OCCURS  0,
            CUSTOMER(10),      "Customer
            PART_CODE(18),     "Parts Code
            REF_NO(35),        "Ref No.
            REF_DATE(10),      "Ref Date
            QTY(12),           "Parts Qty
            TEXT(100),         "Remark
          END OF FOC_inrec.
    *file buffer
    DATA: BEGIN OF inrec  OCCURS  0,
            CUSTOMER(10),      "Customer
            PART_CODE(18),     "Parts Code
            REF_NO(35),        "Ref No.
            REF_DATE(10),      "Ref Date
            QTY(12),           "Parts Qty
            PRICE(15),         "Parts Price
            WAERK(5),          "Parts Currency
            TEXT(100),         "Remark
          END OF inrec.
    DATA : v_file      LIKE rlgrap-filename.
    DATA gt_zgcs_foc LIKE zgcs_foc OCCURS 0 WITH HEADER LINE.
    DATA gs_zgcs_foc LIKE zgcs_foc.
    *File name ACCEPT--------------------------------------------------
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *Company code
    PARAMETERS:  p_comp LIKE zgcs_imei-company OBLIGATORY.
    PARAMETERS:  pcfile LIKE rlgrap-filename OBLIGATORY LOWER CASE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS: HQfile  RADIOBUTTON GROUP b2.
    SELECTION-SCREEN COMMENT 7(20)  text-101 FOR FIELD HQfile.
    SELECTION-SCREEN POSITION 31.
    PARAMETERS: SUBfile RADIOBUTTON GROUP b2.
    SELECTION-SCREEN COMMENT 37(20) text-102 FOR FIELD SUBfile.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN  END   OF BLOCK b1.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK box WITH FRAME.
    SELECTION-SCREEN: COMMENT /2(40) text-011, COMMENT  42(40) text-001,
                      ULINE,
                      COMMENT /2(40) text-012, COMMENT  42(40) text-002,
                      COMMENT /2(40) text-013, COMMENT  42(40) text-003,
                      COMMENT /2(40) text-014, COMMENT  42(40) text-004,
                      COMMENT /2(40) text-015, COMMENT  42(40) text-005,
                      COMMENT /2(40) text-016, COMMENT  42(40) text-006,
                      COMMENT /2(40) text-017, COMMENT  42(40) text-007,
                      COMMENT /2(40) text-018, COMMENT  42(40) text-008,
                                               COMMENT /42(40) text-009.
    SELECTION-SCREEN END OF BLOCK box.
    * -- AT SELECTION SCREEN ON
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcfile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = space
                def_path         = 'C:\'
                mask             = ',*.txt,*.TXT.'
                mode             = 'O'
                title            = ' '
           IMPORTING
                filename         = pcfile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *-----------------------------start--------------------------------
    START-OF-SELECTION.
      CLEAR: read_cnt, update_cnt, error_cnt.
      REFRESH gt_zgcs_foc.        CLEAR gs_zgcs_foc.
      PERFORM file_upload_from_pc.
      SORT gt_zgcs_foc.
      DELETE ADJACENT DUPLICATES FROM gt_zgcs_foc
             COMPARING COMPANY CUSTOMER PART_CODE REF_NO REF_DATE.
    *// customer code check
      DATA: LT_ZESTD LIKE ZESTD OCCURS 0 WITH HEADER LINE.
      IF NOT gt_zgcs_foc[] IS INITIAL.
        SELECT COMPANY CUSTOMER CURRENCY
          INTO CORRESPONDING FIELDS OF TABLE LT_ZESTD
          FROM ZESTD
           FOR ALL ENTRIES IN gt_zgcs_foc
         WHERE COMPANY  = gt_zgcs_foc-COMPANY
           AND CUSTOMER = gt_zgcs_foc-CUSTOMER.
      ENDIF.
      SORT LT_ZESTD BY COMPANY CUSTOMER.
    *// part code check
      DATA: LT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
      IF NOT gt_zgcs_foc[] IS INITIAL.
        SELECT *
          INTO TABLE LT_MARA
          FROM MARA
           FOR ALL ENTRIES IN gt_zgcs_foc
         WHERE MATNR = gt_zgcs_foc-PART_CODE.
      ENDIF.
      SORT LT_MARA BY MATNR.
      LOOP AT gt_zgcs_foc.
    *// customer code check
        READ TABLE LT_ZESTD WITH KEY
                COMPANY  = gt_zgcs_foc-COMPANY
                CUSTOMER = gt_zgcs_foc-CUSTOMER.
        IF SY-SUBRC <> 0.
          WRITE:/'Invalid Customer code ',
             gt_zgcs_foc-COMPANY, ' ',
             gt_zgcs_foc-CUSTOMER.
          STOP.
        ENDIF.
    *// part code check
        READ TABLE LT_MARA WITH KEY MATNR = gt_zgcs_foc-PART_CODE
          BINARY SEARCH.
        IF SY-SUBRC <> 0.
          WRITE:/ 'Invalid part code ', gt_zgcs_foc-PART_CODE.
          STOP.
        ENDIF.
    *// REF_NO
        TRANSLATE gt_zgcs_foc-REF_NO     TO UPPER CASE.
        SHIFT gt_zgcs_foc-REF_NO     LEFT DELETING LEADING SPACE.
        IF gt_zgcs_foc-REF_NO = SPACE.
          WRITE:/'Ref No. is blank'.
          STOP.
        ENDIF.
    *// REF_DATE
        IF gt_zgcs_foc-REF_DATE = 0.
          WRITE:/'Invalid Ref Date'.
          STOP.
        ENDIF.
    *// QTY
    *    IF gt_zgcs_foc-QTY CO ' 0123456789'.
    *    ELSE.
    *      WRITE:/ gt_zgcs_foc-QTY, ' Invalid Qty value'.
    *      STOP.
    *    ENDIF.
      ENDLOOP.
    * Insert/Update table
    *  MODIFY zgcs_foc FROM TABLE gt_zgcs_foc.
      INSERT zgcs_foc FROM TABLE gt_zgcs_foc.
      IF sy-subrc EQ 0.
        COMMIT WORK.
        DESCRIBE TABLE gt_zgcs_foc LINES update_cnt.
        error_cnt = read_cnt - update_cnt.
      ELSE.
        ROLLBACK WORK.
        error_cnt = read_cnt - update_cnt.
      ENDIF.
      ULINE.
      FORMAT COLOR 3.
      WRITE: / 'Read count                :', read_cnt.
      WRITE: / 'Insert/Update count       :', update_cnt.
      WRITE: / 'Error count               :', error_cnt.
      FORMAT COLOR OFF.
    *end-of-selection--------------------------------------------------
    END-OF-SELECTION.
    *&      Form FILE_UPLOAD_FROM_PC
    FORM file_upload_from_pc.
      IF pcfile IS INITIAL.
        WRITE: / 'SELECT UPLOAD FILE !'.
      ELSE.
        MOVE pcfile TO v_file.
    * HQ file upload
        IF HQfile EQ 'X'.
          CALL FUNCTION 'WS_UPLOAD'
               EXPORTING
                    filename                = v_file
                    filetype                = 'DAT'
               TABLES
                    data_tab                = FOC_inrec
               EXCEPTIONS
                    conversion_error        = 1
                    file_open_error         = 2
                    file_read_error         = 3
                    invalid_type            = 4
                    no_batch                = 5
                    unknown_error           = 6
                    invalid_table_width     = 7
                    gui_refuse_filetransfer = 8
                    customer_error          = 9
                    OTHERS                  = 10.
          IF sy-subrc <> 0.
            WRITE: / 'FILE UPLOAD                :', sy-subrc.
          ENDIF.
          LOOP AT FOC_inrec.
            ADD 1 TO read_cnt.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-customer
                 importing
                      output = FOC_inrec-customer.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-part_code
                 importing
                      output = FOC_inrec-part_code.
            MOVE-CORRESPONDING FOC_inrec TO gs_zgcs_foc.
            MOVE p_comp          TO gs_zgcs_foc-company.
            MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
            MOVE sy-uname        TO gs_zgcs_foc-ERNAM.
            MOVE sy-datum        TO gs_zgcs_foc-ERDAT.
            MOVE sy-UZEIT        TO gs_zgcs_foc-ERZET.
    * Source(1:HQ,2:SUB,0:Etc)
            MOVE '1'             TO gs_zgcs_foc-source.
            APPEND gs_zgcs_foc TO gt_zgcs_foc.
          ENDLOOP.
    * SGE file upload
        ELSE.
          CALL FUNCTION 'WS_UPLOAD'
               EXPORTING
                    filename                = v_file
                    filetype                = 'DAT'
               TABLES
                    data_tab                = inrec
               EXCEPTIONS
                    conversion_error        = 1
                    file_open_error         = 2
                    file_read_error         = 3
                    invalid_type            = 4
                    no_batch                = 5
                    unknown_error           = 6
                    invalid_table_width     = 7
                    gui_refuse_filetransfer = 8
                    customer_error          = 9
                    OTHERS                  = 10.
          IF sy-subrc <> 0.
            WRITE: / 'FILE UPLOAD                :', sy-subrc.
          ENDIF.
          LOOP AT inrec.
            ADD 1 TO read_cnt.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = inrec-customer
                 importing
                      output = inrec-customer.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-part_code
                 importing
                      output = FOC_inrec-part_code.
            MOVE-CORRESPONDING inrec TO gs_zgcs_foc.
            MOVE p_comp          TO gs_zgcs_foc-company.
            MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
            MOVE sy-uname        TO gs_zgcs_foc-ERNAM.
            MOVE sy-datum        TO gs_zgcs_foc-ERDAT.
            MOVE sy-UZEIT        TO gs_zgcs_foc-ERZET.
    * Source(1:HQ,2:SUB,0:Etc)
            MOVE '2'             TO gs_zgcs_foc-source.
            APPEND gs_zgcs_foc TO gt_zgcs_foc.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.
    *MODULE POOL::*
    *& Module Name      : Warranty Bill
    *& Sub-Module       : W/B
    *& Description      : Parts Q'ty Adjust(Sales & Warranty)
    *& Program Name     : ZRSWBP004
    *& History
    *& Date             Author            Reason
    *& 2007.05.08       Song, Ji-Hyun     Initial Coding     Req.by WH.Song
    *& Logic Process
    *  - CONDITIONS
    *    Company, Customer, Material
    *  - PROCESS
    *    Display,Insert,Update data in the T/B ZESP04
    REPORT  zrswbp004 NO STANDARD PAGE HEADING
                      MESSAGE-ID 00
                      LINE-SIZE  250
                      LINE-COUNT 50.
    *               G L O B A L    V A R I A B L E S                       *
    TABLES : zesp04.
    DATA : BEGIN OF itab_list OCCURS 0,
            company       LIKE zesp04-company,
            customer      LIKE zesp04-customer,
            material      LIKE zesp04-material,
            adj_date      LIKE zesp04-adj_date,
            adjust        LIKE zesp04-adjust,
            reason        LIKE zesp04-reason,
            reason_code   LIKE zesp04-reason_code,
            doc_no        LIKE zesp04-doc_no,
            in_date       LIKE zesp04-in_date,
            create_id     LIKE zesp04-create_id,
          END OF itab_list.
    DATA : itab_upload LIKE TABLE OF zesp04 WITH HEADER LINE.
    DATA : s_mode(10).
    DATA : table_name(10) VALUE 'ZESP04'.
    DATA : tot_cnt TYPE i.
    DATA : ref_flag(1).
    *               M A C R O    D E F I N E                               *
    DEFINE conversion_kunnr.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
           exporting
                input  = &1
           importing
                output = &1.
    END-OF-DEFINITION.
    DEFINE conversion_material.
      call function 'CONVERSION_EXIT_MATN1_INPUT'
           exporting
                input  = &1
           importing
                output = &1.
    END-OF-DEFINITION.
    *               S E L E C T I O N   S C R E E N                        *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME  TITLE title1.
    PARAMETERS     : company LIKE zesp04-company MEMORY ID buk MODIF ID v1
                     OBLIGATORY.
    SELECT-OPTIONS : customer   FOR zesp04-customer MEMORY ID kun
                                                    MODIF ID v1.
    SELECT-OPTIONS : material   FOR zesp04-material MEMORY ID mat
                                                    MODIF ID v1.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 3.
    SELECTION-SCREEN COMMENT 3(12) text-002 MODIF ID v2.
    PARAMETERS : up_flag AS CHECKBOX MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(12) text-001 MODIF ID v2.
    PARAMETERS : p_fname(300) LOWER CASE MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME  TITLE title2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(53) text-003 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(10) text-004 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(12) text-005 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(12) text-006 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(15) text-007 MODIF ID v2.
    PARAMETERS : df1 TYPE c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 24(13) text-012 MODIF ID v2.
    PARAMETERS : df2 TYPE c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 41(11) text-013 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(14) text-008 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(11) text-009 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(14) text-010 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(10) text-011 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b2.
    INCLUDE zrswbp004_pbo.
    INCLUDE zrswbp004_pai.
    INITIALIZATION.
      title1 = ' Parts Quantity Adjustment '.
      title2 = ' Text File Layout '.
    *            S T A R T   O F   S E L E C T I O N                       *
    TOP-OF-PAGE.
      PERFORM write_header.
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM write_header.
    START-OF-SELECTION.
      IF up_flag = 'X'.
        PERFORM upload_data.
      ELSE.
        PERFORM select_data.
        SET PF-STATUS 'PF01' EXCLUDING 'SAVE'.
        PERFORM display_data.
      ENDIF.
    AT USER-COMMAND.
      PERFORM user_command.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      PERFORM get_filename.
    *&      Form  SELECT_DATA
    *       Select Data for Display
    FORM select_data.
      SELECT * FROM (table_name)
        INTO CORRESPONDING FIELDS OF TABLE itab_list
       WHERE company = company
         AND customer IN customer
         AND material IN material.
      CHECK sy-subrc <> 0.
      WRITE: 'No data found with your option.'.
    ENDFORM.                    " SELECT_DATA
    *&      Form  DISPLAY_DATA
    *       Display Data following Condition
    FORM display_data.
      LOOP AT itab_list.
        FORMAT COLOR 2 INTENSIFIED.
        WRITE : / '|' NO-GAP.
        WRITE :  (07) itab_list-company    CENTERED   NO-GAP, '|' NO-GAP,
                 (10) itab_list-customer   CENTERED   NO-GAP, '|' NO-GAP,
                 (20) itab_list-material   CENTERED   NO-GAP, '|' NO-GAP,
                 (10) itab_list-adj_date   CENTERED   NO-GAP, '|' NO-GAP,
                 (15) itab_list-adjust  RIGHT-JUSTIFIED  NO-GAP, '|'
    NO-GAP,
                 (55) itab_list-reason LEFT-JUSTIFIED NO-GAP, '|' NO-GAP,
                 (11) itab_list-reason_code CENTERED  NO-GAP, '|' NO-GAP,
                 (10) itab_list-doc_no      CENTERED  NO-GAP, '|' NO-GAP,
                 (10) itab_list-in_date  CENTERED   NO-GAP, '|' NO-GAP,
                 (12) itab_list-create_id  CENTERED   NO-GAP, '|' NO-GAP.
        FORMAT INTENSIFIED OFF.
        HIDE itab_list.
      ENDLOOP.
      WRITE : / sy-uline(171).
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  WRITE_HEADER
    *       Write Report Header
    FORM write_header.
      DATA : line(1024).
      CLEAR line WITH '-'.
      DESCRIBE TABLE itab_list LINES tot_cnt.
      FORMAT INTENSIFIED ON.
      WRITE : 15 'Parts Quantity Adjustment'.
      SKIP.
      WRITE : / 'Total Count : ', tot_cnt.
      WRITE : /.
      WRITE : (171) sy-uline.
      WRITE : / '|' NO-GAP.
      WRITE : (07) 'Company'  CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Customer' CENTERED   NO-GAP, '|' NO-GAP,
              (20) 'Material' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Adj. Date' CENTERED   NO-GAP, '|' NO-GAP,
              (15) 'Adjust' CENTERED   NO-GAP, '|' NO-GAP,
              (55) 'Reason' CENTERED   NO-GAP, '|' NO-GAP,
              (11) 'Reason Code' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Doc No' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'IN DATE' CENTERED   NO-GAP, '|' NO-GAP,
              (12) 'CREATE ID' CENTERED   NO-GAP, '|' NO-GAP.
      WRITE : /(171) sy-uline.
      FORMAT INTENSIFIED OFF.
    ENDFORM.                    " WRITE_HEADER
    *&      Form  UPLOAD_DATA
    *       Data Upload from File
    FORM upload_data.
      DATA : l_filename LIKE rlgrap-filename,
             temp_dateformat TYPE dateformat.
      IF df1 = 'X'.
        temp_dateformat = 'YYYY.MM.DD'.
      ELSE.
        temp_dateformat = 'DD.MM.YYYY'.
      ENDIF.
      MOVE p_fname TO l_filename.
      CHECK l_filename NE space.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = l_filename
                filetype                = 'DAT'
                dat_d_format            = temp_dateformat
           TABLES
                data_tab                = itab_list
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9.
      IF sy-subrc NE 0.
        MESSAGE s000 WITH 'File upload is failed!'.
        STOP.
      ELSE.
        CLEAR : itab_upload, itab_upload[].
        LOOP AT itab_list.
          MOVE-CORRESPONDING itab_list TO itab_upload.
          conversion_kunnr    itab_upload-customer.
          conversion_material itab_upload-material.
          itab_upload-mandt     = sy-mandt.
          itab_upload-in_date   = sy-datum.
          itab_upload-create_id = sy-uname.
    *>>>>Insert by GSCHOI 2007.11.08
          IF itab_list-adj_date+0(6) NE sy-datum+0(6).
            MESSAGE i368 WITH 'Adjust month must same as current month!'.
            ROLLBACK WORK.
            STOP.
          ENDIF.
    *<<<<End
          APPEND itab_upload.
          INSERT INTO (table_name) VALUES itab_upload.
          IF sy-subrc EQ 0.
            CONTINUE.
          ELSEIF sy-subrc EQ 4.
            MESSAGE s368 WITH 'Duplicated Data Error!'.
            ROLLBACK WORK.
            STOP.
          ELSE.
            MESSAGE s368 WITH 'File Error!'.
            ROLLBACK WORK.
            STOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF sy-subrc EQ 0.
        MESSAGE s368 WITH 'Uploaded Successfully!'.
      ENDIF.
    ENDFORM.                    " UPLOAD_DATA
    *&      Form  USER_COMMAND
    *       User Command Execution in Screen 1000
    FORM user_command.
      MOVE-CORRESPONDING itab_list TO zesp04.
      CASE sy-ucomm.
        WHEN 'INSERT'.
          PERFORM insert_item.
        WHEN 'UPDATE'.
          PERFORM update_item.
        WHEN 'DISPLAY'.
          PERFORM display_item.
        WHEN 'REFRESH'.
          PERFORM refresh_list.
      ENDCASE.
      IF ref_flag = 'Y'.
        PERFORM refresh_list.
        CLEAR ref_flag.
      ENDIF.
    ENDFORM.                    " USER_COMMAND
    *&      Form  INSERT_ITEM
    *       When Clicking Insert Button
    FORM insert_item.
      CLEAR : s_mode.
      CLEAR : zesp04.
      s_mode = 'INSERT'.
      CALL SCREEN '100'.
    ENDFORM.                    " INSERT_ITEM
    *&      Form  UPDATE_ITEM
    *       When Clicking Update Button
    FORM update_item.
      CLEAR : s_mode.
      s_mode = 'UPDATE'.
      CALL SCREEN '100'.
    ENDFORM.                    " UPDATE_ITEM
    *&      Form  DISPLAY_ITEM
    *       When Clicking Display Button
    FORM display_item.
      CLEAR : s_mode.
      s_mode = 'DISPLAY'.
      CALL SCREEN '100'.
    ENDFORM.                    " DISPLAY_ITEM
    *&      Form  REFRESH_LIST
    *       When Clicking Refresh Button or Returning Display Screen
    FORM refresh_list.
      CLEAR : itab_list, itab_list[].
      PERFORM select_data.
      sy-lsind = sy-lsind - 1.
      PERFORM display_data.
    ENDFORM.                    " REFRESH_LIST
    *&      Form  GET_FILENAME
    *       Get Filename
    FORM get_filename.
      DATA: l_fname LIKE ibipparms-path .
      DATA : p_name LIKE sy-repid.
      p_name = sy-repid.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = p_name
                dynpro_number = sy-dynnr
                field_name    = ''
           IMPORTING
                file_name     = l_fname.
      p_fname = l_fname.
    ENDFORM.                    " GET_FILENAME
    Edited by: Matt on Nov 24, 2008 11:24 AM - surrounded the ABAP with  tags

    Hi,
        Use SUBMIT statement in your first Report zrswbgcs009 at the end, to call the Modulepool program zrswbp004.
    do a search in SDN you will get lot of threads on SUBMIT statement with selection screen.
    SUBMIT... [VIA SELECTION-SCREEN]
               [USING SELECTION-SET <var>]
               [WITH <sel> <criterion>]
               [WITH FREE SELECTIONS <freesel>]
               [WITH SELECTION-TABLE <rspar>].
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm
    Regards
    Bala Krishna

  • Calling a report from module pool program

    Hi all,
            I had a requirement where I need to call a report from the module pool program where in when we click REPORT button, it should display the report output in the another screen.
    Can we do by calling screen after pushing REPORT button. If so, where we should write that code ( In pbo or pai). Please give me an idea.
    Thanking you,
    Regards,
    Murali Krishna T

    Use submit syntax.
    Press F1 on submit, Donot use return statement with it.
    If so, where we should write that code ( In pbo or pai).
    Please understand about these two events before doing the requirement.

  • How to make a fld mandatory in module pool program?

    I need help on following 2 things
    I have module pool program created, in that many screen subscreens created.
    1.I want to make a field mandatory
    second one  is, I have a general tab and  data tab.
    General tab screen - 2101
    Data tab = 2102
    In general tab, I have edited the values (change mode), when change the values and try to save it,
    It is holding old value.but If i exucute the transaction once again, it is showing the changed value(new value)
    For ex: there is a date field  value is 03/08/2009
    If I change this to 03/09/2009 and press on Save button from the standard menu, still it is showing the  value 03/08/2009. but I execute this transaction once again it is showing the value as 03/09/2009
    I will be thankful if someone helps me here

    Hi Chitra,
    Go to the properties of the filed select program tab and say input required.
    then you will get the problem solved.
    For second one actually its saving but not displaying the saved value at the same time ,
    for this you write the select statement after saving , so that once save is execute m, select statement also will execute  and it will display the newly saved value.
    so after saving imdeatly u write the select statement.
    like case sy-ucomm.
    when 'SAVE'.
    insert ztable.
    select filed from z table.
    endcase.
    let me know if ur problem solved.
    Regards
    Rajendra

  • How to use one module pool program in another module pool programming?

    Hi
    I have one moodule pool program.
    In one of my screen i want to use some code which already developed in another module pool program.
    Is there any direct way for using one module pool programcode  in another module pool program.
    If there any approaches for this plz help me in this issue.

    Dear,
    If you want to use the code.
    first you can write your code in a subroutine in module pool program 1
    and then you can use it from module pool  program 2 by
    perform subroutine_name(program_name)
    using P_1
    changing C_1
    if you wan to use one module pool data into other module pool.
    so that is another requirement.

  • How to create Long Text in Module Pool Program

    Hi all,
    I want to develop a new module pool program and I want to use Long text screen in this program and also want this text will store in table.I never develop such type of module pool before.This long text will like sales order long text.Please let me know the steps how I can develop such type of program and how I save long text huge data in table.
    Thanks & Regards
    Nirmal

    Hai ,
    here you have to use custom control, for this
    DATA: line(256) TYPE c,
          text_tab LIKE STANDARD TABLE OF line,
          field LIKE line.
    1)  Create custom control in your screen
    2)   CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',   "--> (this is custom control name in screen)
                       editor    EXPORTING parent = container.
    3)  CALL METHOD editor->get_text_as_stream  "This method reads data from custom control , inserts into itab 'text_tab' 
             IMPORTING       
              text = text_tab.                                       "
          READ TABLE text_tab  INTO line INDEX 1. read the text into wa 'line'
    if you want more clarity , see  'ABAPDOCU' >ABAP USER DIALOGS>    COMPLEXSCREEN ELEMENTS-->  DEMO CUSTOM_CONTROL

  • How to take backup of an entire module pool program with code,screen,etc.

    Hi experts,
    I have some important data in the ides server for which i want to take backup of them.
    I have some question regarding the same.
    1.How to take backup/download of an entire module pool program with code,screen,etc.
    2.How can we take backup/download for a DB table with its structure?
    3.How can we take backup of a search help?
    Please give some suggestions abt the same.
    Regards,
    Ashesh.

    Hi,
    May be just for viewing, try downloading from SE80 transaction from the others option.
    Here just try issuing the print, it will generate the spool.
    Now using the spool, download to your desktop as required. It will have all the information regarding the attributes, fields, elements everything.
    The only issue is, may be you need to take all the screens separately.
    Regards,
    Santhosh.

  • How to validate the field values in module pool program?

    Hi Guys
         I am working with module pool programming.
         Here I want to validate the fields like below.
         with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled.  This can be done by checking all the fields individually.
         I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
         If it is possible, can anyone help me?

    You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
    If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>.
    ENDCHAIN.
    all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
    Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
    ashish

  • How to change the logon language in module pool program?

    Hello All,
    I had created a module pool program and had desiged a screen.
    When i am logged in English language i am able to see them in english as per the requirement it is working fine.
    But the requirement is wen i am logged in DE then the selection-screen texts should show in English and not in German.
    Kindly give me a solution for this.
    Thanks & Regards,
    Rajesh Kumar

    Hi Rajesh,
    This problem is because you have maintained a standard dictionary fields on selection screen and all the standard dictionary fields are maintained in DE language, on the screen layout, go to the attributes of that particular text field, there is a option MODIFIZ for dictionary fields (it is a drop down), selection F TEXT, now whatever the text u will define, it will remain same for all the languages, once u do this  then u again login in DE,l u will see the text maintained by u and not the DE text.
    Do reply if problem still persist.
    point if useful.
    Rohit G
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:24 PM
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:30 PM
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:36 PM
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:36 PM
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:37 PM
    Edited by: Rohit Gaharwar on Aug 11, 2009 1:38 PM

  • How to get tree structure navigation in module pool program

    please send me a sample code for getting tree structure navigation in a screen  in module pool program.
    ex.
    masters
    items

    do a chain and endchain on the fields.Then insert the fields in to the required database.

  • Runtime errors in module pool programming

    HI all,
    I have done a module pool program for invoice tracking level wise.
    I am encountering a runtime error, LIST_TOO_MANY_LPROS, while execution ie., for two and more than two updations of the database.
    The error analysis says that "At present, the maximum permitted number of nested screen levels is restricted to 50".
    Short Text :- "No further list processing possible".
    Can anyone please come out with a solution for this problem.
    regards
    samarendra.
    Edited by: samarendra penugonda on Nov 5, 2008 5:03 AM

    Hi
    U should replace the comand CALL SCREEN with LEAVE TO SCREEN.
    The command CALL SCREEN create an internal mode to link the calling screen to called screen automatically: in this way when it needs to back to calling screen it doesn't need to specify the screen number but only to use:
    - LEAVE TO SCREEN 0.
    or
    - SET SCREEN 0. LEAVE SCREEN.
    Now if you use  LEAVE TO SCREEN, u need to indicate the screen when it needs to back to calling screen:
    - Go from 100 to 200
    LEAVE TO SCREEN 200. (Instead of CALL SCREEN 200)
    - Back to 100.
    LEAVE TO SCREEN 100. (Instead of LEAVE TO SCREEN 0)
    Max

  • Need help in module Pool programming.

    Dear gurus
    I'm stuck in a step of Module Pool program
    Steps i used for enhancement in XK01.
    1)  i appended a structure in table LFA1 having two fields A and B.
    2)  then i went to IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields -> Prepare     Modification-Free Enhancement of Vendor Master Record ( Here i created my screen group Z1 without Function Code.
    3) then i created below module pool program. of screen 9999 and in layout i added to fields to display A and B which i appended.
    PROGRAM  ZSNAK_XK01.
    TABLES: lfa1.
    module status_9999 output.
    endmodule.                 " status_9999  OUTPUT
    module user_command_9999 input.
    endmodule.
    4) After this i wen to  IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields ->
        Business Add-In: Processing of Master Data Enhancements ( Here  i created my implementation on method  CHECK_ADD_ON_ACTIVE  and added this code
    if i_screen_group eq 'Z1'.
    e_add_on_active = 'X'.
    endif.
    5) then i went to   IMG-> Logistic -> Business Partner-> Vendor -> Adoption of Customer's Own Master Data Fields ->
       Business Add-In: Customer Subscreens. and created my implementation on method GET_TAXI_SCREEN where i have written this code.
    e_screen = '9999'.
      e_program = 'ZSNAK_XK01'.
      e_headerscreen_layout = ''.
    After activation when i execute t-code XK01 i see my button there after INFORMATION BUTTON when i click on it i get following error.
    Incorrect screen type: Screen is incorrectly defined or used.
      The attribute screen type with the values 'Normal Screen' and
      'Subscreen' determines the use of the screen. If a normal screen is used
       as subscreen or vice versa, an error occurs.
      The screen "ZSNAK_XK01" 9999 has, in this respect, an inappropriate screen
       type.
    Please guide me
    Regards
    Saad Nisar.

    I think you have defined the screen 9999 as normal screen. go to attributes tab of the screen and make it as "subscreen' (radio button) and activate

Maybe you are looking for

  • Sqlplus.exe - Entry point not found

    On my laptop I have an Oracle database 11G installed, as well as Oracle Warehouse Builder 10.2.0.1. My PATH environment variable has the bin directory in my database Oracle-home as the first entry. When I start sqlplus from the command prompt from a

  • OC4J 9.0.2 or 9.0.3

    Hi Folks, Currently we have Oracle 9i AS 9.0.2 installed and running in production. So far we have been using just the portal part of it. Now we are developing a J2EE based application with Struts and Toplink. I have been hearing lots of horror stori

  • Help with Page Breaks!

    Hello, I am having great difficulty with page breaks. I have included a link below to a jpg of a format template I am working on (edited for public release, but it works): http://home.swbell.net/grog1/work/pagebreaksample.jpg The layout template has

  • Error after upgrading to oraOLEDB 9.2.0.1

    After upgrading from oraOLEDB.oracle 9.0.1.0 to 9.2.0.1 I receive the following message. Error number -2147168246 Message: New transaction cannot enlist in the specified transaction coordinator. Number: 8004D00A Description: New transaction cannot en

  • PowerBook LDC Color Profile

    My display became noticably washed out looking. System Preferences>Display>Color will not allow me to choose a custom profile... I keep getting a warning 'beep'. Clicking on the Calibrate button displays an error dialog that says "Cannot calibrate di