Pop-up in module pool program

I created a module pool program for inserting/changing/deleting a database record through a table control on a screen. Now everything is working fine. When I executed that module pool program by a transaction (there is only one screen in this program which has table control on it), I would like that screen to come-up as a pop-up which I am not able to figure how to do it. Any ideas?
Help is appreciated.
Thanks in advance

in se51 create the screen , and check the radio button Dialog box. and place alll the components...and then save /activate it.
now in your program call the screen like this..
call screen 200 starting at 1 5  
                ending at 30 20.
regards
vijay

Similar Messages

  • Strange problem in module pool programming

    Hi all,
    we have a module pool program which consists of screen 100 and 200 and 3 sub-screens 201,202 and 203.the problem is when we double click on any field we get a pop up message which should appear only when we press the 'SAVE' button for which ok_code is 'CHNG'.I have debugged the program for screen 100 pbo,pai,200 pbo but the value of ok_code is not equal to 'CHNG' then it takes me to screen 200 and when i double click then popup appears and and in 200 PAI the value of ok_code had already got changed  to 'CHNG' without entering the change logic and I have not even pressed the SAVE button which has 'CHNG' code associated with it.Can any one help me solve this problem.I wish I could give a better explanation.
    Thanks and Regards,
    Sangram

    Hi,
    This is because the Shortcut key assigned to SAVE button in PF-STATUS is "F2". F2 is for Double Click. Assign some other Function Key to SAVE or any Button. Try to avoid assigning F2 key.
    This would solve the problem.
    Best regards,
    Prashant
    PS : Please reward all helpful answers !

  • Module pool program - populating values for columns in Table control

    Hi all,
    In my module pool program Table control i  am having 10 columns fields.
    in one of the column field i have used 'PROCESS ON VALUE-REQUEST'   to get the material no.
    in that F4 search help list is having releated information of the material like material group, company code, description etc.
    user while searching for material  they will use F4 search help and in that list they will select the material .
    From the list I need releated information of the materials like material group, company code, description etc
    to be populated in other columns while selecting the material .( User is not ready to enter all the values for the fileds)
    I appended the releated values for the material in the Table control Internal table in the Process on value-request  Module.
    (after selecting material by the user from F4 search help)
    even then I am not getting the data in the screen.
    kindly help me how to proceed  to get the data in other columns.
    Thanks in advance,
    sharma

    Hi Himanshu Verma ,
    Thanks for fast reply.
    but i tried with field names available in F4  Internal table.
    even then I am not getting.
    T_DYNPFLD_MAPPING-FLDNAME = ' MTART.
    APPEND T_DYNPFLD_MAPPING TO ITAB_DYNPFLD_MAPPING.
    T_DYNPFLD_MAPPING-FLDNAME = 'MBRSH'.
    APPEND T_DYNPFLD_MAPPING TO ITAB_DYNPFLD_MAPPING.
      SELECT
      MATNR
    MTART
    MBRSH
    MATKL
    BISMT
    MEINS
    BSTME
      FROM MARA
      INTO TABLE INT_F4
      up to 5000 rows
      CLEAR INT_F4.
    ****function module to get pop-up window of f4.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = 'MATNR'
          DYNPPROG        = W_PROGNAME
          DYNPNR          = W_SCR_NUM
          DYNPROFIELD     = 'V_TAB-MATNR'
          VALUE_ORG       = 'S'
        TABLES
          VALUE_TAB       = INT_F4
          RETURN_TAB      = RETURN_VALUES
          DYNPFLD_MAPPING = ITAB_DYNPFLD_MAPPING
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.
      IF SY-SUBRC NE 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE .
        V_TAB-matnr = RETURN_VALUES-FIELDVAL.
    endif.
    I have used the above code.  I am not getting the field values available in ITAB_DYNPFLD_MAPPING.
    kindly help me how to get the exact row for the F4 table.
    Thanks in advance.
    sharma

  • How to write module pool program

    hai,
    what is the module -pool program ?
    what are the procedures to write the module-pool program.
    plz give the simple program for module-pool programs?
    regards
    surender

    Hi
    This component though is not attached to the screen painter, plays important role in transaction. Normally, for reports, on line executable programs are written but for transaction, Module Pool Programs are written. The module pool program contains only modules to handle various events associated with screen and data declaration statements.
    System divides the module pool program into several include program. These are global field, PBO modules, and PAI modules. It is entirely user’s decision whether to use these modules or write directly into main program.
    Creation of Module Pool Program
    You can create module pool program either through
    Object browser
    System automatically creates the module pool program and for these program which are created through object browser, system creates the include modules.
    Or
    ABAP/4 editor
    It is similar to normal program creation. Type of program should be given ‘M’ and is not created by system.
    Communication between Dynpro and Module Program
    For each screen, the system executes the flow logic, which contains corresponding events. The control is passed to Module Pool Program. Module Pool Program handles the code for these events and again passes back control to the flow logic and finally to screen. Unlike on line program, in this case, the control remains with flow logic. The switching of control between flow logic and module pool program and back is common process when user executes transaction.
    Creation of a Complete Transaction
    Steps involved to create a complete transaction
    •     Create module pool program.
    •     From screen painter create screens.
    •     Write flow logic for each screen.
    •     Write code for all the events in module pool program.
    •     Check for any error in screen and flow logic.
    •     Generate each and every component of screen i.e. flow logic and screen.
    •     Single screen can be tested using Screen Painter.
    •     Create transaction code through object browser.
    •     Generate the transaction code.
    •     User can execute the transaction by entering the transaction code in the command field.
    Handling Function Code
    The function code or OKCODE is the last field of Field list. Function code can be handled as follows:
    During the Designing of the screen, a function code is assigned to pushbutton.
    •     In field list, developer needs to specify OKCODE as last field.
    •     In module program it is a global field and can be evaluated in the PAI event.
    •     A function code is treated in the same way, regardless it comes from pushbutton, menu item or any other GUI element.
    When the user clicks on the Display button, you want to display details of sflight, with corresponding carrid and connid (which is entered by the user).
    Module pool program to handle this particular screen is as follows:
    Program YVTEST7.
    TABLES: SFLIGHT.
    DATA: OKCODE (4).
    MODULE INPUT1 INPUT,
    CASE OKCODE.
       WHEN ‘DISP’.
         SELECT * FROM SFLIGHT
                WHERE CARRID =  SFLIGHT – CARRID AND
                               CONNID = SFLIGHT – CONNID.
         ENDSELECT.
         LEAVE TO SCREEN 200.
       WHEN ‘EXIT’.  LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.               “INPUT1 INPUT
    MODULE USER_COMMAND_0200 INPUT.
    CASE OKCODE.
    WHEN ‘BACK’. LEAVE TO SCREEN 100.
    ENDCASE.
    ENDMODULE.                    “USER_COMMAND_0200 INPUT
    When the user clicks on display, control is transferred to screen no. 200 on which you display sflight details & on the same screen, when user clicks on BACK button, he comes back to main screen.
    Flow logic for screen 100 is as follows:
    PROCESS AFTER INPUT.
    MODULE INPUT.
    Flow logic for screen 200
    PROCESS AFTER INPUT.
    USER_COMMAND_0200.
    MODULES: Modules are handled in module pool program.
    You need to write flow logic for screen 200 and design screen 200.
    In case of transaction transfer of data from program to screen is automatic i.e. you need not transfer the data from program to screen explicitly. The fields, which you define in the screen receives the data from program and displays the same.
    The Field Checks
    As already mentioned Transaction is the only method, which SAP recommends to update the database tables. Data entered in the database table should be valid and correct. Data entered is validated at each and every point. ABAP/4 offers various methods to validate data and those are as follows:
    •     Automatic field checks
    •     Checks performed in the flow logic
    •     Checks performed in the ABAP/4 module pool program
    Automatic Field Checks
    These checks are based on the field information stored in the dictionary. These checks are performed by the system automatically when the user enters the data for the screen field. System performs these checks before PAI event is triggered. Types of field checks performed by system are as follows:
    •     Required input
    While designing the screen, for particular screen field if you click the Req. Entry checkbox, the field becomes mandatory. When the transaction is executed if user leaves this particular field blank, the system displays error message. User cannot proceed until the user enters some data.
    •     Proper Data Format
    Each field has its own data format whether it is table field or screen field. Whenever data is entered, system checks for the proper format of the data. For example date. Each user has its own format for date, which is defined in the user master record. If the date defined in the user master record is in the format DD/MM/YYYY, if the user enters the date, say, in YY/DD/MM, the user displays the error message. System also checks for the value of month or days. For example if month entered is greater than twelve then the error message is displayed.
    •     Valid Value for the Field
    In data dictionary two tables are related by Primary key-Foreign key relationship.  Whenever the user enters the data, the system checks for the check table values.   Also in Domain, if you have fixed values, then the system checks for these values.
    Automatic field checks are repeated each time the user enters the data.
    About at Exit – Command
    Automatic field checks can be avoided by AT EXIT-COMMAND, which works exactly the same way as Cancel works on application tools bar. In the R/3 screen, if you want to quit the processing of that particular screen without entering the mandatory fields, user can click the Cancel button. Same functionality can be incorporated in the user-defined transaction by using AT EXIT-COMMAND. This module can be called before the system executes the automatic field checks and it goes without saying that before PAI event. Code for AT EXIT-COMMAND in flow logic and in module pool program can be written as follows:
    In Flow Logic
    Process After Input.
    Module exit AT EXIT-COMMAND.
             In module pool program.
    Module exit.
    Case okcode.
    When ‘Exit’.
    Leave to screen 0.
    To achieve this kind of functionality a pushbutton or menu item should be assigned a function type ‘E’. It tells the system to process this particular module before carrying out any field checks.
    Flow Logic Validations
    Consider the case where you want user to enter only ‘LH’ and ‘SQ’ for sflight-carrid. In this case, you are restricting value of a screen field. This cannot be achieved by automatic field check. Hence there is a need of additional validation. It can be done in flow logic by using following statement:
    Field -
    Values
    Syntax
    PAI.
    Field sflight-carrid values (‘LH’).
    For multiple values
    PAI.
    Field sflight-carrid values (‘LH’ ‘SQ’).
    Field sflight-price values (between 1000 and 2000).
    In this case when the user enters the value, PAI is triggered  and field is checked for  that particular value. If the value entered happens to be wrong, that field is enabled for user to enter. If you have multiple Field statements in your flow logic, it is sequential execution.
    Consider the following case:
    PAI.
    Module  assign.
    Field sflight-carrid values (‘LH’ ‘SQ’).
    In ABAP/4
    Module  assign.
    Data: carrid1 like sflight-carrid.
    Carrid1 = sflight-carrid.
    Endmodule.
    In this case, Sflight-carrid is used in the flow logic before the field statement. The system will give invalid value or some previous value as the field sflight-carrid is used in module before it is checked i.e., field statement is after the module in which sflight-carrid is being used. The field is not available to the system unless it executes the field statement. Field statement transfers the values to the program and is done only once. If you don’t have Field statement in your flow logic, transfer of values takes place in PAI event.
    Consider one more case where you have multiple field statement
    PAI.
    Field Sflight-carrid values (‘LH’).
    Field Sflight-connid values (‘0400’ ‘0500’).
    In this case if the user enters only carrid wrong, then this particular field is enabled and rest of the fields are disabled for user to input. Many times if the user enters wrong value for one field, then you might want to give option to user to enter all the fields, which is not possible by using Field statement only. This functionality can be achieved by CHAIN – ENDCHAIN.
    Syntax
    Chain.
    Field sflight-carrid value (‘LH’).
         Field sflight-connid values (between ‘200’ and ‘500’).
    Endchain.
    Field sflight-price values (‘100’ ‘1000’).
    In this case, if the user enters wrong value only for carrid, both the fields i.e. carrid and connid are enabled as they are grouped together in the Chain statement. The field price will be disabled for input. Usually, logically related fields are grouped together with Chain-Endchain statement.
    Module Pool Program Validations
    Checking fields ABAP/4 program includes
    •     Field statement in flow logic.
    •     Module statement in ABAP/4 module pool Program.
    Syntax
    PAI.
    Field sflight-carrid module <name>.
    This module can be handled in the main program i.e. module pool program.
    In ABAP/4 program
    Module Check.
    Select single * from sflight where carrid = sflight-carrid.
    If sy-subrc ne 0.
         Message e001.
    Endif.
    In this case, field sflight-carrid is checked in the table for its existence.
    Dynamically Calling the Screens
    About Displaying Next Screen
    Transaction is a sequence of screens, which are displayed one after the other. The next screen displayed depends upon the attributes of first screen. In attributes you need to give Next Screen number i.e. if next screen displayed should be 200 screen, then this number should be given in next Screen attributes. These are static attributes of the screen. By default, if nothing is specified in the program, the system branches out to the screen number, which is specified in the attribute screen.
    In this case, if user selects MARA pushbutton, then fields from Mara table are displayed. When the user clicks on the MARD, then the fields from MARD table are displayed. Depending upon users selection, the screen is branched out and this has to be done during runtime. This functionality can be achieved by dynamically calling the screen in module pool program.
    The screen can branch out to new screen depending upon user selection. Following command in module pool program can do this:
    •     SET SCREEM
    •     CALL SCREEN
    •     LEAVE TO SCREEN <NUMBER>
    All these commands override the specifications given in the attributes. This overriding is temporary. The values stored in the attribute are not changed.
    Set Screen
    Syntax
    Set screen <number>.
    In module pool program
    Case okcode.
         When  ‘DISP’.
              Set screen 200.
         When ‘LIST’.
              Set screen 300.
    Endcase.
    In this case, the entire processing of current screen takes place and then the system branches out to next screen. If you want to branch out to the next screen without processing the current screen, LEAVE SCREEN should be used along with the SET SCREEN.
    For Example:
    Case okcode..
         When  ‘DISP’.
              Set screen 200.
              Leave Screen.
         When ‘LIST’.
              Set screen 300.
              Leave Screen.
    Endcase.
    When SET SCREEN is used, control cannot be transferred to the main screen or previous screen, unless you write code for the same.
    Call Screen
    Usually used for pop up screens. Many times, there is a need for user to enter additional information or secondary information on another screen or pop up screen. Once the user enters the data, he should be able to go back to main screen or to the screen where he started. This is not possible by using SET SCREEN. CALL SCREEN achieves this functionality.
    Syntax
    Call Screen 200.
    Will simply call a screen number 200 from a main screen. Once the screen is displayed the user can enter all the data and return to the main screen by clicking BACK button.
    To call screen as pop up screen the syntax is
    Call screen starting at <col.no.> <line no>
                         Ending at <col no> <line no>.
    In this case window will be popped as window and user can close it by using BACK button.
    Leave to screen
    To SET a new screen without processing current screen, you need to use the following two statements together:
    SET SCREEN 200.
    LEAVE SCREEN.
    Or a Single statement
    LEAVE TO SCREEN 200.

  • Reg : Variant saving for Module Pool Programming

    Hey Friends,
       Plz help me in how to create variant for Module Pool Programming as in normal reports.Thanx in advance.

    Hi,
    You can create variants for Module pool program using the transaction SHD0. You can create Screen variants for your screens using this Tcode.
    Go to SHD0 -> Give the Transaction code(ZTRAN) for which you want to create a variant -> name of some variant (ZVAR) -> create -> takes you to your transaction -> Give the values that you want to be displayed as variants -> Click on Save -> Opens a pop up to confirm the screen entries -> Check the check boxes of those fields that you have entered the data with (the column with check boxes that says W.Content) -> Exit and Save -> Save the variant -> You can see a screen variant created (ZVAR_0100)
    Now Goto -> Create variant transaction -> Give your transaction variant name (ZVAR) -> Select Transaction with variant -> Takes you to SE93 transaction -> Give the transaction variant name  -> save. Run with the created transaction.
    Edited by: Nitwick on Jul 27, 2009 4:49 PM

  • 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.

Maybe you are looking for

  • Sql Server Reporting  services with ORACLE

    We are thinking of using Sql Server Reporting servicesvwith an ORACLE DB. I will like to know the pros and cons. Any advice would be appreciated.. Thanks alot.

  • Change Font Size in SMARTFORMS

    Hi Experts, I am developing a smartform for label printing. for that according to the size of the label i have to adjust the content. How can I change the font size of the entire content including the logo? I tried to reduce the font size in the new

  • Editing chapter buttons problem

    Hi I'm trying to alter the font and size of the text for my chapter buttons on my submenu. I single click to select the button I want, and then click again but it keeps taking me into the movie instead of highlighting the text! I know this should wor

  • IPod is disabled. Says to connect to itunes however itunes won't recognize the device. What do I do?

    IPod Touch is disabled. Its says to connect to itunes however itunes won't recognize the device. What do I do?

  • Modification selection screen

    Hello,   I have to use submit command for my program. Can I change or customize selection-screen of called program as we do in AT selection screen output event. When I do submit it must be able to change the selection screen of the report I have call