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

Similar Messages

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

  • 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

  • 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

  • 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 put scrol bar in table viw control in module pool programming

    how to put scrool bar in table-view control in module pool programming

    Hi Rani,
       You need not insert Scrollbar in the table control, it appears automcatically once the amount of data vertical or horizontal limit of table control.
    Regards,
    Sathish
    Note : Reward useful Answers

  • 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

  • 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 use table maintenance view in module pool screen

    hi ,
    want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.

    You can simply call it via SM30.   Or you can call the table maintence view from any program(report or module pool) using a function module.
      call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                       = 'U'
                view_name                    = 'Z_Table_Name'
           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
                others                       = 14.
    Regards,
    RIch Heilman

  • 'how to code for table control wizard in module pool program

    Hi Gurus,
    Please provide me a sample code of table control wizard...
    Thanks in advance!!!!
    Regards,
    Kranthi

    Hi Kranti,
    check this code... it should be helpful
    *& Module pool       Z_TABLE_CONTROL_WIZARD_DEMO                       *
    PROGRAM  z_table_control_wizard_demo             .
    DATA: BEGIN OF lt_vbak OCCURS 0,
           flag  TYPE c,
           vbeln TYPE vbeln_va,
           netwr TYPE netwr,
           kunnr TYPE kunnr,
          END OF lt_vbak.
    DATA: sfkunnr TYPE kunnr.
    *&spwizard: declaration of tablecontrol 'TCONTROL' itself
    CONTROLS: tcontrol TYPE TABLEVIEW USING SCREEN 9000.
    *&spwizard: lines of tablecontrol 'TCONTROL'
    DATA:     g_tcontrol_lines  LIKE sy-loopc.
    DATA:     ok_code LIKE sy-ucomm.
    *&spwizard: output module for tc 'TCONTROL'. do not change this line!
    *&spwizard: update lines for equivalent scrollbar
    MODULE tcontrol_change_tc_attr OUTPUT.
      DESCRIBE TABLE lt_vbak LINES tcontrol-lines.
    ENDMODULE.                    "TCONTROL_change_tc_attr OUTPUT
    *&spwizard: output module for tc 'TCONTROL'. do not change this line!
    *&spwizard: get lines of tablecontrol
    MODULE tcontrol_get_lines OUTPUT.
      g_tcontrol_lines = sy-loopc.
    ENDMODULE.                    "TCONTROL_get_lines OUTPUT
    *&spwizard: input module for tc 'TCONTROL'. do not change this line!
    *&spwizard: modify table
    MODULE tcontrol_modify INPUT.
      MODIFY lt_vbak
        INDEX tcontrol-current_line.
    ENDMODULE.                    "TCONTROL_modify INPUT
    *&spwizard: input modul for tc 'TCONTROL'. do not change this line!
    *&spwizard: mark table
    MODULE tcontrol_mark INPUT.
      DATA: g_tcontrol_wa2 LIKE LINE OF lt_vbak.
      IF tcontrol-line_sel_mode = 1.
        LOOP AT lt_vbak INTO g_tcontrol_wa2
          WHERE flag = 'X'.
          g_tcontrol_wa2-flag = ''.
          MODIFY lt_vbak
            FROM g_tcontrol_wa2
            TRANSPORTING flag.
        ENDLOOP.
      ENDIF.
      MODIFY lt_vbak
        INDEX tcontrol-current_line
        TRANSPORTING flag.
    ENDMODULE.                    "TCONTROL_mark INPUT
    *&spwizard: input module for tc 'TCONTROL'. do not change this line!
    *&spwizard: process user command
    MODULE tcontrol_user_command INPUT.
      ok_code = sy-ucomm.
      PERFORM user_ok_tc USING    'TCONTROL'
                                  'LT_VBAK'
                                  'FLAG'
                         CHANGING ok_code.
      sy-ucomm = ok_code.
    ENDMODULE.                    "TCONTROL_user_command INPUT
    *   INCLUDE TABLECONTROL_FORMS                                         *
    *&      Form  USER_OK_TC                                               *
    FORM user_ok_tc USING    p_tc_name TYPE dynfnam
                             p_table_name
                             p_mark_name
                    CHANGING p_ok      LIKE sy-ucomm.
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA: l_ok              TYPE sy-ucomm,
            l_offset          TYPE i.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
    *&SPWIZARD: Table control specific operations                          *
    *&SPWIZARD: evaluate TC name and operations                            *
      SEARCH p_ok FOR p_tc_name.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      l_offset = STRLEN( p_tc_name ) + 1.
      l_ok = p_ok+l_offset.
    *&SPWIZARD: execute general and TC specific operations                 *
      CASE l_ok.
        WHEN 'INSR'.                      "insert row
          PERFORM fcode_insert_row USING    p_tc_name
                                            p_table_name.
          CLEAR p_ok.
        WHEN 'DELE'.                      "delete row
          PERFORM fcode_delete_row USING    p_tc_name
                                            p_table_name
                                            p_mark_name.
          CLEAR p_ok.
        WHEN 'P--' OR                     "top of list
             'P-'  OR                     "previous page
             'P+'  OR                     "next page
             'P++'.                       "bottom of list
          PERFORM compute_scrolling_in_tc USING p_tc_name
                                                l_ok.
          CLEAR p_ok.
    *     WHEN 'L--'.                       "total left
    *       PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
    *     WHEN 'L-'.                        "column left
    *       PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
    *     WHEN 'R+'.                        "column right
    *       PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
    *     WHEN 'R++'.                       "total right
    *       PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
        WHEN 'MARK'.                      "mark all filled lines
          PERFORM fcode_tc_mark_lines USING p_tc_name
                                            p_table_name
                                            p_mark_name   .
          CLEAR p_ok.
        WHEN 'DMRK'.                      "demark all filled lines
          PERFORM fcode_tc_demark_lines USING p_tc_name
                                              p_table_name
                                              p_mark_name .
          CLEAR p_ok.
    *     WHEN 'SASCEND'   OR
    *          'SDESCEND'.                  "sort column
    *       PERFORM FCODE_SORT_TC USING P_TC_NAME
    *                                   l_ok.
      ENDCASE.
    ENDFORM.                              " USER_OK_TC
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM fcode_insert_row
                  USING    p_tc_name           TYPE dynfnam
                           p_table_name             .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA l_lines_name       LIKE feld-name.
      DATA l_selline          LIKE sy-stepl.
      DATA l_lastline         TYPE i.
      DATA l_line             TYPE i.
      DATA l_table_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>                 TYPE cxtab_control.
      FIELD-SYMBOLS <table>              TYPE STANDARD TABLE.
      FIELD-SYMBOLS <lines>              TYPE i.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (p_tc_name) TO <tc>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
      ASSIGN (l_lines_name) TO <lines>.
    *&SPWIZARD: get current line                                           *
      GET CURSOR LINE l_selline.
      IF sy-subrc <> 0.                   " append line to table
        l_selline = <tc>-lines + 1.
    *&SPWIZARD: set top line                                               *
        IF l_selline > <lines>.
          <tc>-top_line = l_selline - <lines> + 1 .
        ELSE.
          <tc>-top_line = 1.
        ENDIF.
      ELSE.                               " insert line into table
        l_selline = <tc>-top_line + l_selline - 1.
        l_lastline = <tc>-top_line + <lines> - 1.
      ENDIF.
    *&SPWIZARD: set new cursor line                                        *
      l_line = l_selline - <tc>-top_line + 1.
    *&SPWIZARD: insert initial line                                        *
      INSERT INITIAL LINE INTO <table> INDEX l_selline.
      <tc>-lines = <tc>-lines + 1.
    *&SPWIZARD: set cursor                                                 *
      SET CURSOR LINE l_line.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM fcode_delete_row
                  USING    p_tc_name           TYPE dynfnam
                           p_table_name
                           p_mark_name   .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA l_table_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <wa>.
      FIELD-SYMBOLS <mark_field>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (p_tc_name) TO <tc>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
      DESCRIBE TABLE <table> LINES <tc>-lines.
      LOOP AT <table> ASSIGNING <wa>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
        IF <mark_field> = 'X'.
          DELETE <table> INDEX syst-tabix.
          IF sy-subrc = 0.
            <tc>-lines = <tc>-lines - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
    *       text
    *      -->P_TC_NAME  name of tablecontrol
    *      -->P_OK       ok code
    FORM compute_scrolling_in_tc USING    p_tc_name
                                          p_ok.
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA l_tc_new_top_line     TYPE i.
      DATA l_tc_name             LIKE feld-name.
      DATA l_tc_lines_name       LIKE feld-name.
      DATA l_tc_field_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <lines>      TYPE i.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (p_tc_name) TO <tc>.
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' p_tc_name '_LINES' INTO l_tc_lines_name.
      ASSIGN (l_tc_lines_name) TO <lines>.
    *&SPWIZARD: is no line filled?                                         *
      IF <tc>-lines = 0.
    *&SPWIZARD: yes, ...                                                   *
        l_tc_new_top_line = 1.
      ELSE.
    *&SPWIZARD: no, ...                                                    *
        CALL FUNCTION 'SCROLLING_IN_TABLE'
             EXPORTING
                  entry_act             = <tc>-top_line
                  entry_from            = 1
                  entry_to              = <tc>-lines
                  last_page_full        = 'X'
                  loops                 = <lines>
                  ok_code               = p_ok
                  overlapping           = 'X'
             IMPORTING
                  entry_new             = l_tc_new_top_line
             EXCEPTIONS
    *              NO_ENTRY_OR_PAGE_ACT  = 01
    *              NO_ENTRY_TO           = 02
    *              NO_OK_CODE_OR_PAGE_GO = 03
                  OTHERS                = 0.
      ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
      GET CURSOR FIELD l_tc_field_name
                 AREA  l_tc_name.
      IF syst-subrc = 0.
        IF l_tc_name = p_tc_name.
    *&SPWIZARD: et actual column                                           *
          SET CURSOR FIELD l_tc_field_name LINE 1.
        ENDIF.
      ENDIF.
    *&SPWIZARD: set the new top line                                       *
      <tc>-top_line = l_tc_new_top_line.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
    *       marks all TableControl lines
    *      -->P_TC_NAME  name of tablecontrol
    FORM fcode_tc_mark_lines USING p_tc_name
                                   p_table_name
                                   p_mark_name.
    *&SPWIZARD: EGIN OF LOCAL DATA-----------------------------------------*
      DATA l_table_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <wa>.
      FIELD-SYMBOLS <mark_field>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (p_tc_name) TO <tc>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <table> ASSIGNING <wa>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
        <mark_field> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
    *       demarks all TableControl lines
    *      -->P_TC_NAME  name of tablecontrol
    FORM fcode_tc_demark_lines USING p_tc_name
                                     p_table_name
                                     p_mark_name .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA l_table_name       LIKE feld-name.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <wa>.
      FIELD-SYMBOLS <mark_field>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (p_tc_name) TO <tc>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <table> ASSIGNING <wa>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
        <mark_field> = space.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Module  STATUS_9000  OUTPUT
    *       text
    MODULE status_9000 OUTPUT.
      SET PF-STATUS 'S9000'.
      SET TITLEBAR 'T9000'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    *       text
    MODULE user_command_9000 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          LEAVE TO SCREEN 0.
        WHEN 'DISP'.
          SELECT vbeln netwr kunnr INTO CORRESPONDING FIELDS OF TABLE lt_vbak
          FROM vbak
          WHERE kunnr = sfkunnr.
    *    LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN <nnnn>].
    *    By default, the dialog processor returns to the PBO processing of
    *    the screen from which the list processor was called. The optional
    *    addition AND RETURN TO SCREEN allows you to specify a different
    *    screen in the current screen sequence at whose PBO event you want
    *    to resume processing.
        when 'LIST'.
        LEAVE TO LIST-PROCESSING.
        WRITE:/ 'Time  :', SY-UZEIT.
        LOOP AT LT_VBAK.
        WRITE:/ LT_VBAK-VBELN,
                LT_VBAK-NETWR,
                LT_VBAK-KUNNR.
        ENDLOOP.
        WHEN 'SUBM'.
    *& You can call executable programs from other ABAP programs using the
    *& following statement:
    *& SUBMIT <rep>|(<field>) [AND RETURN] [<options>].
          SUBMIT z_submit_report VIA SELECTION-SCREEN AND RETURN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
                                                     TABLE CONTROL WIZARD SE51 CODE
    PROCESS BEFORE OUTPUT.
    *&spwizard: pbo flow logic for tablecontrol 'TCONTROL'
      module TCONTROL_change_tc_attr.
    *&spwizard: module TCONTROL_change_col_attr.
      loop at   LT_VBAK
           with control TCONTROL
           cursor TCONTROL-current_line.
        module TCONTROL_get_lines.
    *&spwizard:   module TCONTROL_change_field_attr
      endloop.
    MODULE STATUS_9000.
    PROCESS AFTER INPUT.
    *&spwizard: pai flow logic for tablecontrol 'TCONTROL'
      loop at LT_VBAK.
        chain.
          field LT_VBAK-VBELN.
          field LT_VBAK-NETWR.
          field LT_VBAK-KUNNR.
          module TCONTROL_modify on chain-request.
        endchain.
        field LT_VBAK-FLAG
          module TCONTROL_mark on request.
      endloop.
      module TCONTROL_user_command.
    *&spwizard: module TCONTROL_change_tc_attr.
    *&spwizard: module TCONTROL_change_col_attr.
    MODULE USER_COMMAND_9000.
    regards
    padma

  • TABLE VIEW CONTROL IN MODULE POOL PROGRAMMING

    Hai Friends,
    <b>My problem is i design table view control using se51. I entered the data on table view and when i  press ENTER button on keyboard the total data is disapears from the screec(i.e table view).
    but i do not want this functionality. when i press ENTER button on keyboard that data is must be on the screen only.....................
    please tell me how it is possible   
    </b>

    Hello,
    Fill the data of the table control in PBO event of the screen.
    CHeck this sample report:
    DEMO_DYNPRO_TABCONT_LOOP
    Vasanth

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

  • Saving Ztable using Module Pool

    hi
    I want to save the entries into a Ztable using Module pool programming.. I want the Module Pool Program to work like the SM30 table maintenance...
    Right now.. I have 2 module pool screen on the screen... one which displays the entries of Ztable and the other which is an input enabled screen so that I can enter records into it..
    When I save the records the Ztable should get updated and when the screen again comes to PBO the enetered records should be displayed in the first table control
    Right now I am stuck here
    PROCESS BEFORE OUTPUT.
    * MODULE STATUS_0001.r45
    MODULE FILL_TABLE.
    LOOP AT TBL_ZTVM3 into wa_ztvm3 WITH CONTROL TC1 CURSOR TC1-TOP_LINE.
    ENDLOOP.
    LOOP AT TBL2_ZTVM3 into ztvm3 WITH CONTROL TC2 CURSOR TC2-TOP_LINE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT TBL_ZTVM3.
    ENDLOOP.
    LOOP AT TBL2_ZTVM3.
    ENDLOOP.
    MODULE USER_COMMAND_0001.
    user command goes like this
    *&  Include           YENTRIES_ZTABLE_I01
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-ucomm.
    when 'SAVE'.
    modify tbl2_ztvm3 from wa2_ztvm3 INDEX TC2-CURRENT_LINE.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    SO quite a simple code.. but after 1 year I just lost touch with this.. I have defined the Selection Column check rows too for the table control
    Can you please help me with this.. I <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Mar 27, 2008 1:41 PM

    IN PAI of the Module flow logic
    you need to modify the internal table with the modified content.
    Like this
    PROCESS AFTER INPUT.
      MODULE EXIT AT EXIT-COMMAND.
      MODULE CHECK_PAI.
      LOOP WITH CONTROL TC.
        MODULE MODIFY_DATA.
      ENDLOOP.
    IN side the MODIFY_DATA
    You need to update the Internal table with the modified content. then your internal table will have the latest Information.
    You save the latest information.

  • What is module pool programming?how we can change the standard screen?

    Hi EXPERTS
    what is module pool programming?how we can change the standard screen using module pool programming ?
    please explain with example.

    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
    regards,
    venkat.

Maybe you are looking for