How to use module pool program in my custom report?

Hi,
I am developing a custom report in abap. I want to fetch data from a standard module pool program.I want output of this standard module pool program to be used in my standad report.Submit cannot be used with module pool programs. How can i do this?Can u please suggest?

HI friend,
For this you can directly use the table fields i.e. each and every module pool screen fields will be having the table name along with its fields (which you can see by double clicking the field and selecting technical settings button) and since it is a standard module pool program that will get populated directly. So you can get the screen field values directly from the table. I think this will help. Please try and let us know wheather it is solved.
Thanks and regards,
Sri Hari Anand Kumar
Edited by: srihari.kumar on Apr 6, 2011 3:31 PM

Similar Messages

  • Checking Records in multiple screens using module pool programming

    Hi,
        I created student registration form using module pool programming.In first SCREEN i designed like the Below.
              Name:     <INPUT/OUTPUT Field>
             Emailid:    <INPUT/OUTPUT Field>
             Password:<INPUT/OUTPUT Field>
              CREATE<Push Button>    SIGNIN<Push Button>       cancel<Push Button>
    in  screen 1000 I created like the above screen and i wrote the code for it.It's successfully inserted records in ZSTUDENT database.
    BUT
        when i call the second screen 2000.I design the screen like below.And database table is ZSTU_LOGIN.
          username : <INPUT/OUTPUT Field>
         password  : <INPUT/OUTPUT Field>
             LOGIN<push Button>   EXIT<Push Button>
    AND i created Third screen 3000.Like full of detail of student details like First Name,Last Name,DOB,Education Details,Contact Details etc...
    BUT I'm facing the pbm is
                  whatever the record is stored in table ZSTUDENT-Name & password when i call the screen 2000 that USERNAME & PASSWORD are same
    Then go to THIRD screen 3000.BUT i wrote the code for second screen 2000 by using SELECT statement.without my code check it will go to third
    screen 3000 By the Statement of Call screen 3000.
    PLZ any one help me HOW to CHECK the Exact Record From second Screen 2000 to First Screen 1000.
    HOW to Check the code AND can u provide me any code available.
    thanks,
    Anusha

    Hi vikram,
        I wrote the code for screen 2000 like below.
    MODULE STATUS_2000 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
       TABLES : ZSTUDENT_ENTER.
      TYPES: BEGIN OF ST_TAB1,
          USERNAME TYPE ZSTUDENT_ENTER-USERNAME,
         PASSWORD1 TYPE ZSTUDENT_ENTER-PASSWORD1,
         END OF ST_TAB1.
       DATA : W_TAB1 TYPE ZSTUDENT_ENTER.
       DATA : IT_TAB1 TYPE STANDARD TABLE OF ZSTUDENT_ENTER.
       DATA : USERNAME TYPE CHAR50,
             PASSWORD1 TYPE CHAR25.
    ENDMODULE.                 " STATUS_2000  OUTPUT
    *&      Module  USER_COMMAND_2000  INPUT
    *       text
    MODULE USER_COMMAND_2000 INPUT.
    CLEAR W_TAB1.
       MOVE-CORRESPONDING W_TAB TO W_TAB1.
    IF SY-SUBRC EQ 0.
       SELECT SINGLE MAILID PASSWORD
         INTO CORRESPONDING FIELDS OF W_TAB
           FROM ZSTUDENT_INFO
           WHERE USERNAME = W_TAB-MAILID AND
                PASSWORD1 = W_TAB-PASSWORD.
           CALL SCREEN 2000.
           ENDSELECT.
                 ELSEIF SY-SUBRC NE 0.
               MESSAGE 'INVALID USERNAME/PASSWORD'.
               ELSEIF SY-UCOMM = 'LOGIN'.
                 CALL SCREEN 3000.
                 ENDIF.
    ENDMODULE.                 " USER_COMMAND_2000  INPUT
    But i could not found whether code is write or not.
    syntax error is USERNAME is Unknown.
    could solve me my pbm anybody.....
    Thanks,
    Anusha

  • Entering values in MARA table using module pool programming

    Hi All,
    I need a help from you all. I want to enter the values in the MARA table using module pool programming.
    Can you please give me the detailed approach and if possible then code also as i am new to ABAP.
    Thanks in Advance

    Create the screen fields with ref to field in MARA table, once data is entered on screen by user then fill appropriate structure of FM BAPI_MATERIAL_SAVEDATA. If call to Fm BAPI_MATERIAL_SAVEDATA is successful then call FM BAPI_TRANSACTION_COMMIT to make changes permanent in database .

  • How to debug module pool program

    Hi everybody,
    How to debug module pool program ,please send any material for module pool programming .
    Thanks & Regards,
    Siddivinesh.Jogu
    [email protected]

    Hi
    Check the below link:
    http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
    http://www.sap-img.com/
    http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
    http://www.sapgenie.com/links/abap.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
    You can also check the transaction ABAPDOCU which gives you lot of sample programs.
    Also you can see the below examples...
    Go to se38 and give demodynpro and press F4.
    YOu will get a list of demo module pool programs.
    One more T-Code is ABAPDOCU.
    YOu can find more examples there.
    See the prgrams:
    DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
    DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    Debugging
    Refer to this thread
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    Debugging
    Check these documents.
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_nw04/helpdata/en/5a/4ed93f130f9215e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    ABAP Debugging
    http://www.saplinks.net/index.php?option=com_content&task=view&id=24&Itemid=34
    Look at the SAP help link below
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    Regards
    Anji

  • How to create selections-screens to display PO using module pool program

    All,
    I'm new to module pool programming. Can any one please provide me where to create selections screens to display existing purchase orders using the below selection criteria in thr module pool program.,
    SELECT-OPTIONS : S_LIFNR FOR EKKO-LIFNR,
                     S_BSART FOR EKKO-BSART,
                     S_BUKRS FOR EKKO-BUKRS,
                     S_WERKS FOR EKPO-WERKS OBLIGATORY,
                     S_BEDAT FOR SY-DATUM,
                     S_EINDT FOR EKET-EINDT,
                     S_EBELN FOR EKKO-EBELN,
                     S_MATNR FOR EKPO-MATNR.
    provide me step by step to do this.

    Hi,
    Thanks for the reply can you please let me know.
    How can I create the ranges
    like low and high in the selection.
    Using se51 i was able to do only one i,e
    example I need
    purchase order number----
    f4 -
    f4
    Can please tell me how to do this

  • How to insert data into a  Ztable by using module pool programming??

    Hi,
    I am new to ABAP, Actually I have made a Ztable now I want to insert data by using the module pool programming. In which there are all field in the first screen and there is a save button. So when ever i press SAVE button it shud update the Ztable with new entries.But actually I am not getting How can i update that??can you please send me the code for inserting data.
    Thanks in Advance.
    Edited by: Swapna Ram on Feb 17, 2008 12:01 AM

    Swapna,
    Check this thread...
    Custom Table updation thru table control
    ALso check this..
    Dialog programming

  • 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

  • Help in uploading image using module pool programming!!!

    hi all
       I need a help from you all...iam designing my company's Visitors Identity card...im workin in module pool programming,i need to know wat function module should i use to get jpg image n to display it...
    i hav tried it using DP_PUBLISH_WWW_URL func module but it asks for OBJID dono wat should i give...i referred SAP_PICTURE_DEMO.....
    <b>plz suggest me with some solutions to diplay image which is stored in desktop....</b>
    asha.......

    hi,
    u try this importing jpeg image  in transcation oaor .
    in that give class name as pictures and class type as ot and execute it.
    in that u import which image u want to say for suppose a DUMMY.
    FORM TOP_OF_PAGE.                                           "#EC CALLED
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
            EXPORTING
                <b>I_LOGO             = 'DUMMY'</b>
                "'ENJOYSAP_LOGO'
                IT_LIST_COMMENTARY =  GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    "TOP_OF_PAGE
    this top of page u use in FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
         I_CALLBACK_PROGRAM                = sy-repid
         I_CALLBACK_PF_STATUS_SET          = gc_pf_status_set
         I_CALLBACK_USER_COMMAND           = GC_USER_COMMAND
        <b> I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'</b>
    this may solve ur problem.

  • How to download Module-pool program

    Hi,
    I am having one module-pool program in quality system, how to download the same
    and upload into Sandbox.
    Any suggestions
    Regards
    VENk@

    HI venkat,
         Please follow the below steps to resolve your problem.
        1 ) go to the screen painter
        2) go to the Utilities->upload /  download -> download
             --  provide name to the file and save it in local drive.
        3) in Sandbox create the program in se51 and go to the screen painter
        4) Utilities->upload /  download -> upload
             --  choose the correct file name from the local drive.
        5) rest of the Program coding you proceed to copy into flow login and driver program as well.
        then save the program and activate
    all the very best
    sreenivasa sarma

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

  • Table maintenance by using module pool program

    Hi
    Please give me step by step procedure to generate table maintenance by using module pool program

    While creating table maintenance, you can go thro' the module pool program used for that.In that,in PBO part,just try making particular field active = 1 inside loop at screen.
    Girish Kumar Lo...  
    Posts: 1,518
    Questions: 2
    Registered: 4/19/07
    Forum points: 1,982 
       Re: Regarding Table maintanence generator  
    Posted: Jun 26, 2007 9:02 AM    in response to: Younus Khan       Reply      E-mail this post 
    here is the code for that
    REPORT ZTAB_MAINT
           NO STANDARD PAGE HEADING
           MESSAGE-ID ZZ.
                      T Y P E  D E C L A R A T I O N S
    *--Types declaration for selection to be passed as parameter into
    *--VIEW_MAINTENANCE_CALL FM
    TYPES: BEGIN OF TP_RANGETAB.
            INCLUDE STRUCTURE VIMSELLIST.
    TYPES: END OF TP_RANGETAB.
                   D A T A  D E C L A R A T I O N S
    DATA: V_MATNR TYPE MATNR,              " Material Number
          V_WERKS TYPE WERKS_D,              " Plant
          V_KONOB TYPE KONOB,              " Product allocation object
          V_ZCPLT(40) TYPE C.              " Message
           I N T E R N A L  T A B L E  D E C L A R A T I O N S
    Internal table to subroutine code
    *Internal table used as selection for VIEW_MAINTENANCE_CALL FM
    DATA: IT_RANGETAB TYPE STANDARD TABLE OF TP_RANGETAB WITH HEADER LINE.
    *--Internal table used for getting the tablefields
    DATA: BEGIN OF IT_HEADER OCCURS 1.
            INCLUDE STRUCTURE VIMDESC.
    DATA: END   OF IT_HEADER.
    *--Name Tabel
    DATA: BEGIN OF IT_NAMTAB OCCURS 50.
            INCLUDE STRUCTURE VIMNAMTAB.
    DATA: END   OF IT_NAMTAB.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_MATNR OCCURS 0,
            MATNR TYPE MATNR,
          END OF IT_MATNR.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_WERKS OCCURS 0,
            WERKS TYPE WERKS,
          END OF IT_WERKS.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_KONOB OCCURS 0,
            KONOB TYPE KONOB,
          END OF IT_KONOB.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_ZCPLT OCCURS 0,
            ZCPLT(40) TYPE C,
          END OF IT_ZCPLT.
                       I N P U T  S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK SELSCR WITH FRAME TITLE TEXT-001.
    RANGES: R_MATNR FOR V_MATNR.
    RANGES: R_WERKS FOR V_WERKS.
    RANGES: R_KONOB FOR V_KONOB.
    RANGES: R_ZCPLT FOR V_ZCPLT.
    Select Options
    SELECT-OPTIONS: S_MATNR FOR V_MATNR NO-EXTENSION,     " Material
                    S_WERKS FOR V_WERKS NO-EXTENSION,     " Plant
                    S_KONOB FOR V_KONOB NO-EXTENSION,
                                            " Product allocation object
                    S_ZCPLT FOR V_ZCPLT NO-EXTENSION.     " Plant
    SELECTION-SCREEN END OF BLOCK SELSCR.
                 A T  S E L E C T I O N  S C R E E N
    AT SELECTION-SCREEN.
    Validate user inputs
      PERFORM FRM_VALIDATIONS.
                S T A R T  O F  S E L E C T I O N
    START-OF-SELECTION.
    Fetch Data from Data Base
      PERFORM FRM_GET_DATA.
                         S U B  R O U T I N E S
    *&      Form  frm_get_data
          Call the function module VIEW_MAINTENNACE_CALL to get data
          based on selection criteria
    FORM FRM_GET_DATA .
      CALL FUNCTION 'VIEW_GET_DDIC_INFO'
        EXPORTING
          VIEWNAME = 'ZTAB'
        TABLES
          X_HEADER = IT_HEADER
          X_NAMTAB = IT_NAMTAB
          SELLIST  = IT_RANGETAB
        EXCEPTIONS
          NO_TVDIR_ENTRY = 1
          TABLE_NOT_FOUND = 2.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Error in ZTAB table'(005).
      ENDIF.
      CLEAR: IT_RANGETAB,
             IT_RANGETAB[].
      LOOP AT IT_NAMTAB.
        CASE IT_NAMTAB-VIEWFIELD.
          WHEN 'MATNR'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'MATNR'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_MATNR.
              CASE S_MATNR-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_MATNR-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_MATNR,
                         R_MATNR[].
                  R_MATNR-SIGN = 'I'.
                  R_MATNR-OPTION = 'BT'.
                  R_MATNR-LOW = S_MATNR-LOW.
                  R_MATNR-HIGH = S_MATNR-HIGH.
                  APPEND R_MATNR.
                  SELECT MATNR
                         INTO TABLE IT_MATNR
                         FROM ZTAB
                         WHERE MATNR IN R_MATNR.
                  DELETE ADJACENT DUPLICATES FROM IT_MATNR COMPARING MATNR
                  LOOP AT IT_MATNR.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_MATNR-MATNR.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_MATNR-OPTION.
                  IT_RANGETAB-VALUE    = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'WERKS'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'WERKS'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_WERKS.
              CASE S_WERKS-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_WERKS-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_WERKS,
                         R_WERKS[].
                  R_WERKS-SIGN = 'I'.
                  R_WERKS-OPTION = 'BT'.
                  R_WERKS-LOW = S_WERKS-LOW.
                  R_WERKS-HIGH = S_WERKS-HIGH.
                  APPEND R_WERKS.
                  SELECT WERKS
                         INTO TABLE IT_WERKS
                         FROM MARC
                         WHERE WERKS IN R_WERKS.
                  DELETE ADJACENT DUPLICATES FROM IT_WERKS COMPARING WERKS
                  LOOP AT IT_WERKS.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_WERKS-WERKS.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_WERKS-OPTION.
                  IT_RANGETAB-VALUE    = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'KONOB'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'KONOB'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_KONOB.
              CASE S_KONOB-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_KONOB-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_KONOB,
                         R_KONOB[].
                  R_KONOB-SIGN = 'I'.
                  R_KONOB-OPTION = 'BT'.
                  R_KONOB-LOW = S_KONOB-LOW.
                  R_KONOB-HIGH = S_KONOB-HIGH.
                  APPEND R_KONOB.
                  SELECT KONOB
                         INTO TABLE IT_KONOB
                         FROM T190
                         WHERE KONOB IN R_KONOB.
                  DELETE ADJACENT DUPLICATES FROM IT_KONOB COMPARING KONOB
                  LOOP AT IT_KONOB.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_KONOB-KONOB.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_KONOB-OPTION.
                  IT_RANGETAB-VALUE    = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'ZCPLT'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'ZCPLT'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_ZCPLT.
              CASE S_ZCPLT-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_ZCPLT,
                         R_ZCPLT[].
                  R_ZCPLT-SIGN = 'I'.
                  R_ZCPLT-OPTION = 'BT'.
                  R_ZCPLT-LOW = S_ZCPLT-LOW.
                  R_ZCPLT-HIGH = S_ZCPLT-HIGH.
                  APPEND R_ZCPLT.
                  SELECT ZCPLT
                         INTO TABLE IT_ZCPLT
                         FROM ZTAB
                         WHERE ZCPLT IN R_ZCPLT.
                  DELETE ADJACENT DUPLICATES FROM IT_ZCPLT COMPARING ZCPLT
                  LOOP AT IT_ZCPLT.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_ZCPLT-ZCPLT.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_ZCPLT-OPTION.
                  IT_RANGETAB-VALUE    = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
        ENDCASE.
      ENDLOOP.
      IF S_ZCPLT[] IS INITIAL.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            ACTION      = 'U'
            VIEW_NAME   = 'ZTAB'
          TABLES
            DBA_SELLIST = IT_RANGETAB
          EXCEPTIONS
            CLIENT_REFERENCE                     = 1
            FOREIGN_LOCK                         = 2
            INVALID_ACTION                       = 3
            NO_CLIENTINDEPENDENT_AUTH            = 4
            NO_DATABASE_FUNCTION                 = 5
            NO_EDITOR_FUNCTION                   = 6
            NO_SHOW_AUTH                         = 7
            NO_TVDIR_ENTRY                       = 8
            NO_UPD_AUTH                          = 9
            ONLY_SHOW_ALLOWED                    = 10
            SYSTEM_FAILURE                       = 11
            UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
            VIEW_NOT_FOUND                       = 13
            MAINTENANCE_PROHIBITED               = 14
            OTHERS                               = 15.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSE.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            ACTION      = 'U'
            VIEW_NAME   = 'ZTAB_ZTEST'
          TABLES
            DBA_SELLIST = IT_RANGETAB
          EXCEPTIONS
            CLIENT_REFERENCE                     = 1
            FOREIGN_LOCK                         = 2
            INVALID_ACTION                       = 3
            NO_CLIENTINDEPENDENT_AUTH            = 4
            NO_DATABASE_FUNCTION                 = 5
            NO_EDITOR_FUNCTION                   = 6
            NO_SHOW_AUTH                         = 7
            NO_TVDIR_ENTRY                       = 8
            NO_UPD_AUTH                          = 9
            ONLY_SHOW_ALLOWED                    = 10
            SYSTEM_FAILURE                       = 11
            UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
            VIEW_NOT_FOUND                       = 13
            MAINTENANCE_PROHIBITED               = 14
            OTHERS                               = 15.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " frm_get_data
    *&      Form  frm_validations
          Validating field values
    FORM FRM_VALIDATIONS .
    Material number should not be validated (10/17/2005)
      CLEAR V_MATNR.
      SELECT SINGLE MATNR
                    INTO V_MATNR
                    FROM MARA
                    WHERE MATNR IN S_MATNR.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Material not found'.
      ENDIF.
      CLEAR V_WERKS.
      SELECT SINGLE WERKS
                    INTO V_WERKS
                    FROM ZTAB
                    WHERE WERKS IN S_WERKS.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Plant (WERKS) not found'(002).
      ENDIF.
      CLEAR V_KONOB.
      SELECT SINGLE KONOB
                    INTO V_KONOB
                    FROM ZTAB
                    WHERE KONOB IN S_KONOB.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH ' Product allocation object not found'(003).
      ENDIF.
      CLEAR V_WERKS.
      SELECT SINGLE WERKS
                    INTO V_WERKS
                    FROM ZTAB
                    WHERE WERKS IN S_ZCPLT.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Plant (ZCPLT) not found'(004).
      ENDIF.
    ENDFORM.                    " frm_validations
    reward points if it is usefull ...
    Regarding Table maintanence generator

  • How to create dynamic screen using module pool programming

    Hi,
    Could anybody help me how to create dynamic screens?
    I am developing a screen with HR Person with assignment info. If PERNR have multiple assignments, i need to show all the details one by one. How to show the details on screen. I need to call one by one assignment information dynamically.
    Please suggest me how to do, apart from using table controls.
    Thanks,
    Kamal

    You may have the below options:
    1) Table Control
    2) Individual fields
    3) ALV
    4) pop-up screen

  • Reg alv grid  using module pool programming

    Dear Friends,
    I have a situation where i am using alv grid in module programming where in when i click the total button in the tool bar for any numeric column, the screen goes for a run time error.
    I have giving all conditions such as made the column in the field structure of lvc_field_catalog as do_sum = 'X',
    still goes for a dump...can anyone throw some hints to do more or the reason behind this and also have not excluded the function code for this total pushbutton while passing to the method set_table_for_first_display
    thanks...

    hi,
    check this up
    internal tables
    DATA: i_tab TYPE TABLE OF zchangereq,
    w_tab TYPE zchangereq.
    display field details
    DATA: w_field_cat_wa TYPE lvc_s_fcat. " Field Catalog work area
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-020.
    PARAMETERS: p_outs RADIOBUTTON GROUP g1,
    p_comp RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    *MACROS
    DEFINE add_field.
    &1 = FIELDNAME &2 = HEADING &3 = Key field flag
    clear w_field_cat_wa.
    w_field_cat_wa-fieldname = &1.
    lw_field_cat_wa-ref_table = p_ref_table.
    lw_field_cat_wa-inttype = p_inttype.
    lw_field_cat_wa-decimals = p_decimals.
    lw_field_cat_wa-coltext = p_coltext.
    lw_field_cat_wa-seltext = p_seltext.
    lw_field_cat_wa-do_sum = p_do_sum.
    lw_field_cat_wa-no_out = p_no_out.
    lw_field_cat_wa-col_pos = p_col_pos.
    lw_field_cat_wa-reptext = p_coltext.
    lw_field_cat_wa-colddictxt = p_colddictxt.
    w_field_cat_wa-scrtext_m = &2.
    w_field_cat_wa-key = &3.
    append w_field_cat_wa to i_field_cat.
    END-OF-DEFINITION.
    ALV specific Declarations...........................................
    ALV specific Internal table declarations.............................
    DATA: i_field_cat TYPE lvc_t_fcat, " Field catalogue
    i_alv_sort TYPE lvc_t_sort. " Sort table
    ALV variables........................................................
    DATA: w_alv_layout TYPE lvc_s_layo, " ALV Layout
    w_alv_save TYPE c, " ALV save
    w_alv_variant TYPE disvariant. " ALV Variant
    ALV Class definitions................................................
    CLASS lcl_event_handler DEFINITION.
    PUBLIC SECTION.
    METHODS: handle_double_click
    FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING e_row e_column.
    METHODS: handle_hotspot
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id.
    ENDCLASS. " CLASS LCL_EVENT_HANDLER DEF..
    ALV Class implementation............................................
    In the Event of a Double Click drill down to the corresponding CHANGE REQUEST
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_double_click.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    not working yet - hotspot seems to stay in the gui!!
    METHOD handle_hotspot.
    DATA: l_tab LIKE LINE OF i_tab.
    CHECK e_row_id-rowtype(1) EQ space.
    READ TABLE i_tab INDEX e_row_id-index INTO l_tab.
    SET PARAMETER ID 'ZTY' FIELD l_tab-ztype.
    SET PARAMETER ID 'ZCR' FIELD l_tab-zcref.
    CALL TRANSACTION 'ZCRT' AND SKIP FIRST SCREEN.
    ENDMETHOD. " HANDLE_DOUBLE_CLICK
    ENDCLASS. " CLASS LCL_EVENT_HANDLER IMPL...
    ALV Grid Control definitions........................................
    DATA:
    ALV Grid Control itself
    o_grid TYPE REF TO cl_gui_alv_grid,
    Container to hold the ALV Grid Control
    o_custom_container TYPE REF TO cl_gui_custom_container,
    Event handler (defined in the class above)
    o_event_handler TYPE REF TO lcl_event_handler.
    INITIALIZATION.
    PERFORM create_field_catalogue. " Create ALV Field Catalog
    START-OF-SELECTION.
    Outstanding requests
    IF p_outs = 'X'.
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus < 99.
    ELSE.
    completed requests
    SELECT * FROM zchangereq
    INTO TABLE i_tab
    WHERE zstatus = 99.
    ENDIF.
    END-OF-SELECTION.
    PERFORM list_output_to_alv. " Perform ALV Output operations
    FORM LIST_OUTPUT_TO_ALV *
    This subroutine is used to call the screen for ALV Output. *
    There are no interface parameters to be passed to this subroutine. *
    FORM list_output_to_alv.
    CALL SCREEN 100.
    ENDFORM. " LIST_OUTPUT_TO_ALV
    Module STATUS_0100 OUTPUT *
    This is the PBO module which will be processed befor displaying the *
    ALV Output. *
    MODULE status_0100 OUTPUT.
    SET PF-STATUS '0100'. " PF Status for ALV Output Screen
    IF p_outs = 'X'.
    SET TITLEBAR 'STD'.
    ELSE.
    completed requests
    SET TITLEBAR 'COMP'.
    ENDIF.
    CREATE OBJECT: o_custom_container
    EXPORTING container_name = 'SC_GRID',
    o_grid
    EXPORTING i_parent = o_custom_container.
    PERFORM define_alv_layout. " ALV Layout options definitions
    PERFORM save_alv_layout_options. " save ALV layout options
    PERFORM call_alv_grid. " Call ALV Grid Control
    ENDMODULE. " STATUS_0100 OUTPUT
    Module USER_COMMAND_0100 INPUT *
    This is the PAI module which will be processed when the user performs*
    any operation from the ALV output. *
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT' OR 'BACK' OR 'CANC'.
    may need to do this so display is refreshed if other report selected
    CALL METHOD o_custom_container->free.
    SET SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    FORM DEFINE_ALV_LAYOUT *
    This subroutine is used to Define the ALV layout. *
    FORM define_alv_layout .
    w_alv_layout-numc_total = 'X'. " Numc total line
    w_alv_layout-cwidth_opt = 'X'. " Optimal column width
    w_alv_layout-detailinit = 'X'. " Show values that are initial in
    " detail list.
    w_alv_layout-sel_mode = 'A'. " Column selection mode
    w_alv_layout-no_merging = 'X'. " No merging while sorting columns
    w_alv_layout-keyhot = 'X'.
    ENDFORM. " DEFINE_ALV_LAYOUT
    FORM SAVE_ALV_LAYOUT_OPTIONS *
    This subroutine is used to Save the ALV layout options. *
    FORM save_alv_layout_options.
    See the ALV grid control documentation for full list of options
    w_alv_save = 'A'.
    w_alv_variant-report = sy-repid.
    ENDFORM. " SAVE_ALV_LAYOUT_OPTIONS
    FORM CALL_ALV_GRID *
    This subroutine is used to call ALV Grid control for processing. *
    FORM call_alv_grid.
    CALL METHOD o_grid->set_table_for_first_display
    EXPORTING
    is_layout = w_alv_layout
    i_save = w_alv_save
    is_variant = w_alv_variant
    CHANGING
    it_outtab = i_tab[]
    it_sort = i_alv_sort
    it_fieldcatalog = i_field_cat.
    Link used Events and Event Handler Methods
    CREATE OBJECT o_event_handler.
    Set handler o_event_handler->handle_top_of_page for o_grid.
    SET HANDLER o_event_handler->handle_double_click FOR o_grid.
    ENDFORM. " CALL_ALV_GRID
    *& Form create_field_catalogue
    set up field catalogue
    FORM create_field_catalogue .
    Fieldname Heading Key?
    *eg add_field 'ZTYPE' 'Type' 'X'.
    ENDFORM. " create_field_catalogue

  • How to delete Subroutine Pool and delete the custom report in mass

    Hello,
    How to delete the subroutine pool
    Is there any transaction to delete report mass.
    Thanks in advance,
    Best Regards,
    Suresh kumar K

    You can use FM RS_DELETE_PROGRAM in your program and pass all the programs
    that are to be deleted into that FM using TADIR table..
    Alternatively you can create a bdc for the same.

  • How to insert Logo in module pool programming

    Plz any one can explain me that  how we will inseart Logo on screens by using module pool programming (in GUI programming) .

    Hello.
    I'll give you an example of inserting a personal photo in UI programming. Hope it helps you.
    First of all, in your screen (painter), insert a custom control and give it a name (PHOTO in my example).
    Then, in your screen PBO, insert a coding like this:
    CLEAR handle.
    CALL FUNCTION 'HR_IMAGE_INIT'
        EXPORTING
          p_pernr        = pernr
          p_tclas        = 'A'
          container      = 'PHOTO'
        IMPORTING
          handle         = handle
        EXCEPTIONS
          no_document    = 1
          internal_error = 2
          OTHERS         = 3.
      CALL FUNCTION 'HR_IMAGE_SHOW'
        EXPORTING
          p_pernr        = pernr
          p_tclas        = 'A'
          handle         = handle
        EXCEPTIONS
          invalid_handle = 1
          no_document    = 2
          internal_error = 3
          OTHERS         = 4.
    Regards.
    Valter Oliveira.

Maybe you are looking for