Need to generate dynamic selection screen

Hi,
'am looking for a requirement in ABAP Programming which is <b>feasible</b>!
  While executing my report, std. selection screen ( 1000) gets displayed and it gives the output list which consists of only one field that will have TABLE NAMES. Once the user selects any one of the record on this output list, I need to display another screen ( selection screen ) with all the key fields of that table that got seleted.
  <b>How do I populate a dynamic selection screen by passing <i>TABLE NAME</i> as parameter with all the <i>keyfields of that table as select-options</i>.</b>
  Awaiting your quick positive reply..
Regards,
Kriss.

hii
check this one
SELECTION-SCREEN BEGIN OF BLOCK blk.
PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND FC,
             p_rb2 TYPE c RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK blk.
SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME.
PARAMETERS : p_werks1 TYPE werks_d MODIF ID bk1.
SELECTION-SCREEN END OF BLOCK blk_1.
SELECTION-SCREEN BEGIN OF BLOCK blk_2 WITH FRAME.
PARAMETERS : p_werks2 TYPE werks_d MODIF ID bk2,
             p_matnr2 TYPE matnr   MODIF ID bk2.
SELECTION-SCREEN END OF BLOCK blk_2.
AT SELECTION-SCREEN OUTPUT.
  IF p_rb1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BK1'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'BK2'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
Regards
Naresh

Similar Messages

  • How to generate dynamic selection-screen?

    Hi all,
    I have two radio buttons on selection-screen.
    If user-selects the one, Then under the radio button another parameter should be displayed
    if he selects another radio button, the previous parameter should not  be displayed and another parameter should appear in the selection screen under the second radio button.
    Please help by giving the code to solve this problem?
    Thanks,
    Vamshi.

    Hi Vamsi,
    By using AT SELECTION-SCREEN OUTPUT and creating the MOdif id for the selection screen parameter you can achieve the dynamic selection scree..
    AT SELECTION-SCREEN OUTPUT.
    * Modify selection screen as per the radio buttons selected.
      PERFORM modify_sel-screen.
    FORM modify_sel-screen .
    * If radio button - process in range of STR's selected, display STR
    * range and Date range as input
      IF p_rb1 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir2.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    * If radio button - process from excel is selected, give option for
    * user to upload file
      ELSEIF p_rb2 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir1.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " MODIFY_SEL-SCREEN
    see the below example....
    copy the below code you can come to know how the dynamic selection screen happens..
    *                   S E L E C T I O N  S C R E E N                     *
    * Selection criteria
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_rb1  RADIOBUTTON GROUP gr1 USER-COMMAND com1 DEFAULT 'X',
                                             "Process STR's in date range
               p_rb2  RADIOBUTTON GROUP gr1. "Process STR's from Excel
    SELECTION-SCREEN BEGIN OF BLOCK c1 WITH FRAME .
    PARAMETERS : p_apover TYPE zcpeg_fg_related-pl_version OBLIGATORY.
                                                                "PJ1031008
    SELECTION-SCREEN END OF BLOCK c1.
    SELECTION-SCREEN END OF BLOCK b1.
    * Display date range to process STR's
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS: s_banfn FOR w_preq MODIF ID ir1,
                                        "Purchase requisition number
                    s_lfdat FOR w_lfdat MODIF ID ir1.
    "Date range
    SELECTION-SCREEN END OF BLOCK b2.
    * Option for uploading file to process STR's
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_file TYPE rlgrap-filename MODIF ID ir2. "File name
    SELECTION-SCREEN END OF BLOCK b3.
    AT SELECTION-SCREEN OUTPUT.
    * Modify selection screen as per the radio buttons selected.
      PERFORM modify_sel-screen.
    FORM modify_sel-screen .
    * If radio button - process in range of STR's selected, display STR
    * range and Date range as input
      IF p_rb1 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir2.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    * If radio button - process from excel is selected, give option for
    * user to upload file
      ELSEIF p_rb2 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir1.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " MODIFY_SEL-SCREEN
    Regards,
    Prabhudas

  • How to generate a dynamic selection-screen

    Hi folks,
    I have a itab with all fields and descriptions of a database-table. Now i want to generate a selection screen dynamically. I want to create a select-option for every field of the table.
    First I read all fields of a database table into my intern table:
    CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        tabname              = 'database_tabname'
      TABLES
        dfies_tab            = it_tabname_fields.
    Then I tried to generate a dynamic selection-screen with a select-options statement per field of the itab, but it doesn't work:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 NO INTERVALS.
    LOOP AT it_tabname_fields INTO s_tabname_fields. "should be 14 loops and 14 lines
      SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT (25) s_tabname_fields-SCRTEXT_S FOR FIELD var1. "the name of the field should be set dynamically from the itab
      SELECT-OPTIONS var1 FOR tabname-s_tabname_fields-fieldname. "s_tabname_fields-fieldname should be set dynamically for each line
      SELECTION-SCREEN END OF LINE.
    ENDLOOP.
    SELECTION-SCREEN END OF BLOCK b2.
    I know that this doesn't work but it should help you to understand what i want to do. It doesn't create more than one select-option (it should be 14 because there are 14 lines in the table) and it doesn't get the values from the table.
    I hope you can help me...
    Regards,
    Sebastian

    hi
    Firstly, have a look at the following code to see how this can be implemented -
    REPORT ZTEST.
    perform test.
    class test definition.
      public section.
        methods: create_screen.
    endclass.
    class test implementation.
      method create_screen.
        data:  report_line(72),
               report_source like table of report_line.
        data: err_message(240),
              err_line type i,
              err_word(100).
        report_line = 'REPORT TEST.'.
        append report_line to report_source.
        report_line = 'PARAMETERS: P_TEST TYPE I.'.
        append report_line to report_source.
        report_line = 'START-OF-SELECTION.'.
        append report_line to report_source.
        report_line = 'WRITE : P_TEST.'.
        append report_line to report_source.
        syntax-check for report_source message err_message
                                       line    err_line
                                       word    err_word.
        if err_message is initial.
          INSERT REPORT 'ZZZTESTZZZ' FROM REPORT_SOURCE.
          SUBMIT ZZZTESTZZZ VIA SELECTION-SCREEN AND RETURN.
        endif.
      endmethod.
    endclass.
    form test.
      data test type ref to test.
      CREATE OBJECT TEST.
      call method test->create_screen.
    endform.
    As you can see, the report is being written dynamically. Once the INSERT REPORT statement is executed, the program is available. you can you external subroutine calls to pass the data between the programs now.
    Regards,
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Need to disable one of the select-options in dynamic selection screen

    Hi,
    we have copied the Standard program: RFDOPR00 into Z, my requirement is to disable one of the select-options in dynamic selection screen for ex: Reason code(User shouldnot able to enter anything in it).
    Can anyone please tell me the procedure to do it... I had tried using at selection-screen but it doesnt work as it in 'LOOP AT SCREEN', i am not able to capture the Parameter name(screen-name).
    Thanks,
    Ravi

    Hi,
    Get inside your selection screen, by executing your program.
    Now type /h in the field where you enter transaction code and press enter.
    Now again press enter, this will take you debugger starting from your Selection screen.
    You might be knowing this, still if you are not aware of this, this might be a valuable tip.
    From here , you can trace your Parameter name.

  • Problems creating dynamic selection screen

    Hi all,
    i'm trying to dynamically generate a selection screen and show it as subscreen using the two function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. I call the function modules in the PBO of the therefor defined subscreen. The FREE_SELECTIONS_DIALOG fm has the two import parameter "as_subscreen" and "as_window". If i use the "as_window" parameter the selection screen comes up as popup. If i use the "as_subscreen" parameter, i can't see anything in my defined subscreen.
    Any suggestions ?
    Thanks in Advance
    Dirk

    Hi,
    The above requirement is not possible without using logical database.
    The reason is that the compiler identifies the below syntax only inside a LDB program .
    SELECTION-SCREEN DYNAMIC SELECTIONS
                     FOR {NODE|TABLE} node [ID id].
    The above syntax creates a subscreen container on the standard selection screen of the program during generation
    and we are able to view the dynamic selections icon on the selection screen.
    Hence it is not possible to use the FM 'FREE_SELECTIONS_DIALOG' as a subscreen without using a
    logical database of the relevant table.
    However if you dont want to create a new LDB for each table, there is a trick which needs to be performed
    once in your SAP system and all custom programs can use this FM to create a dynamic selection screen
    as a subscreen of the standard selection screen.
    The prerequisite steps are as follows:
    1: Create a dummy  / test database table in SE11 with a single field i.e. for example mandt , matnr
    2: Create a new logical database program for this table in SE36. Save and activate.
    This will create dynamic selections for the fields of the table created in step 1.
    Steps to be followed in the required custom ABAP program to create the dynamic selection screen as a subscreen.
    A: Include the LDB program created in step 2, in the attributes of the custom ABAP program.
    Now when you execute the program, you can see the dynamic selection icon for the dummy table created in step 1.
    B: In your custom program we need to suppress the icon for 'Dynamic Selections' from the standard selection screen.
       We need to perform this action, because the 'Dynamic Selections' icon always triggers a call to the
       dynamic selection screen of the included LDB progam. ( In our case a dummy table created in step 1 ).
       Whereas we want to trigger a call of the dynamic selection screen of our desired table.
       Logic is as follows:
       In 'AT SELECTION-SCREEN OUTPUT' event call the FM RS_SET_SELSCREEN_STATUS to exclude the fcode 'DYNS'.
    C: Add a pushbutton / checkbox on your selection screen to trigger a call to the FM 'FREE_SELECTIONS_INIT' &
       'FREE_SELECTIONS_DIALOG' in the 'AT SELECTION-SCREEN' event.
    D: When the user clicks the pushbutton / checkbox for dynamic selections call the above 2 FM for the desired table
        with the AS_SUBSCREEN flag of FREE_SELECTIONS_DIALOG = 'X'
    Result: Your dynamic selections screen will be created as a subscreen of the standard selection screen and not as a pop-up.
    Advantage: With the creation of the single custom table & LDB, you are now able to create dynamic selections as subscreen
    in any program in the system. All we need to do is follow the steps A, B & C in each program.
    Note: Your other restrictions with dynamic selection screen ie. submit in background , save as variant still remain and
    you need to handle them accordingly.
    let me know if you need sample code.
    Regards,
    Bhawit Kumar

  • How to deal with dynamic selection screen elements when macros are used?

    Hello experts,
    This is regarding the dynamic selection screen elements. Actually the requirement is to modify the existing standard report program RFUMSV00 by copying it into a Z report, adding a few selection screen elements and new fields in the output. I actually did everything required except for the one thing that is going out of my reach.
    There are a certain fields which are coming when they are not supposed to get displayed. I don't understand the code because of its obsoleteness. Neither can I debug it because it is just data declaration.
    This is the code where there is a fault. If I copy the entire code into a new Z report, I'm getting new fields like Entry Date, Document Type, Reference Transaction,  Reference key, Logical system.
      DEFINE selection_screen_line.
      selection-screen: begin of line.
      parameters &3 like &4 default 'X' modif id mc4.
      selection-screen: comment (30) &1 for field &3 modif id mc4.
      selection-screen: comment pos_low(10) text-019
                        for field &2 modif id mc4.  "neu
      parameters &2 like rfums_alv-variante modif id mc4.
      selection-screen:
          position pos_high.
      selection-screen: pushbutton (15) text-028
                        user-command &5 modif id mc4.
      selection-screen end of line.
    END-OF-DEFINITION.
    Kindly, suggest me the right solution.

    In the program attributes ( SE38 > RFUMSV00 > GOTO > Properties ), you will find a logical database BRF declared. The include DBBRFSEL is part of the selection screen of this logical database.
    The selection screen is actually the selection screen of this logical database.
    Under the Logical Database field, there is a Selection screen field where you can input which selection screen of the logical database to be used.
    But, this is just to change the selection screen that is displayed. To completely suppress it you need to remove logical database declaration from the properties of the program and call it inside your program through function module.
    You cannot just remove it from the declaration because many of its variables are used in the program.
    So call it using function module as the first step in INITIALIZATION section of the program.
    The syntax and function module to call it in your program can be found in the following thread :
    How to hide the selection screen of a Logical datebase?
    Regards,
    Ashish

  • How to add a new Field in the Dynamic Selection screen section.

    HI,
    There is a requirement in which I need to add a field in existing program of dynamic selections.
    I need to add a field KNKK-DBRTG (Customer Rating) in dynamic selections screen of some existing report
    which has a dynamic selection screen with other fields like customer account, company code etc. Along with this i need to add Customer rating field also in the selection screen.
    I have used GET KNKK statement to select this in the Dynamic selection screen. But I need to make it appear
    on the screen.
    LDB used is the Customer Database.
    I have added GET KNKK statement after GET KNA1 statement.
    Can any one help me how we can make this rating field appear in the selection screen.
    With the GET statement Credit control area Fields can be selected in the selection screen but I have to permanantly add the field in the selection screen.
    Regards
    Prashant Prabhu

    Hi,
    So you need that this new field have data in old records?
    1.- If you are in BI 7.0 and the logic or data for that New field are in the same Dimension, you can use a Remodeling to fill it. I mean if you want if you want to load from a Master Data from other InfoObject in the same Dim.
    2.- If condition "1" is not yours.
    First add the new field, then create a Backup Cube (both cubes with the new field) and make a full update with all information in the original Cube. The new field willl be empty in both cubes.
    Create an UR from BackUp_Cube to Original_Cube with all direct mapping and create a logic in the Start Routine of the UR (modiying the data_package) you can look for the data in the DSO that you often use to load.
    To do that both cubes have to be Datasources ( right click on Cube-> aditional function-> and I think is "Extract Datasource")
    Hope it helps. Regards, Federico

  • How to use dynamic selection screen inputs in main program

    hi all,
      its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program.
    regards,
    vara..

    Hi,
    i think u have created that dynamic selection screen in seperate program and calling to ur main program.instead of that u just create that synamic selection screen program as include program and include it in ur main program.
    or u need to use set/get parameter id concept.
    rgds,
    bharat.

  • How to retrieve values from Dynamic Selection screen while using LDB  - PSJ

    I am having problem in PSJ Logical database. In a custom report which is using PSJ LDB, we are using PROJ and PRPS_R tables.
    When I run program it displays one dynamic selection screen, there we are giving selection criteria for PRPS (Master data WBS element) - Created on (giving some range like 2011/01/01 to 2011/01/31).
    So I want to display all WBS element which are created during the period (2011/01/01 - 2011/01/31).
    How do I retrieve the select-option low and high value of the field Created on Of WBS element if we Select data from any table based on this condition.
               Please help me.
    Thanks.

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • Passing values to a dynamic selection screen via a report

    Hi,
    I have the following problem and need to seek your expertise urgently.
    In my program, I need to call another report by passing in parameters to the selection screen of other report. However, I could not pass values into a dynamic selection screen. I tried to use submit (report) with free selection but do not know how it works.
    Currently, I tried calling the function RS_REFRESH_FROM_DYNAMICAL_SEL and FREE_SELECTIONS_RANGE_2_EX. Using the object the first function has returned to me, I tried to append values such as fieldname etc to it. However, I realised the field names of a dynamic selection screen keeps changing. So I would not know how to pass a particular value to a selection field.
    Appreciate any help given.
    Thanks,
    CK

    Hello CK,
    Are you using logical database in your selection screen program attributes? If it is, look at include file DBxxxSEL for parameter named xxxDYNSE where xxx = logical database. Debug the program that has that dynamic selection, and look at field xxxDYNSE. This should give you a hint on how to populate the parameter when you submit the program.

  • Dynamic selection screen

    Hello all,
    I have a requirement to create a 'dynamic' selection screen with 2 sections(vertical).
    The first section contains set of selection options for which the type comes from the values stored in the internal table(populated at runtime). The second section contains checkbox corresponding to each selection option generated/created in the first section mentioned above.
    So the number of fields and checkboxes to be created are identified only at the runtime.
    Note: I already tried to use FMs FREE_SELECTIONS* but it is not serving my purpose.
    Looking forward to your inputs.
    Thanks & Regards,
    Rajat
    Edited by: rajat.sap123 on Feb 7, 2012 7:18 PM

    Why don't you use the At selection-screen output event.
    As i have understood your scenario you have two sections. with the first one containing the select-options. The second will change on basis of the first section selection.
    Hope it helps you.
    Elaborate a bit more so i can paste a code.

  • Adding new table dynamic selection screen of transaction FBL5N (LDB DDF).

    Hi,
    I have a requirement to add SEGMENT (CEPC-SEGMENT) field on the dynamic selection screen of transaction FBL5N (LDB DDF).
    Please let me know how can I meet this requirement
    Thanks

    I did not find any screen exits for this Tcode, may be you need to use enhancement spots.

  • Specific criteria in dynamic selection screen.

    Hi experts.
    I have a requirement to build dynamic selection screen fields. For these I would like to use FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG function modules.
    The problem is that all fields could be single field or as a range... Is there any chance to make specific fields (DATS) as a single field and others as a range ?
    Thanks a lot.
    Daniel.

    yes
    you need to pass fields in parameter FIELDS_TAB of function FREE_SELECTIONS_DIALOG
    in this structure you have the field type P or S

  • Issue with MB25 BDC for Dynamic Selection Screen

    Hi Experts,
    I recorded one BDC for MB25 Tcode regarding to determine Open Reservation(s) in E Mode (Display Mode). I am passing 3 parameters.
    1. Plant,
    2. Requirement Date
    3. Multiple Reservation Numbers i.e. RSNUM from Dynamic Selection i.e. 2nd Button -> Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    But while executing that BDC, I need to manually click every time on 'Header Data for Reservation' Tree and then Multiple Selection for Reservation Icon.
    I want below steps automatically while executing:
    - Open 'Header Data for Reservation' Tree
    - Click Reservation
    - Open Popup for 'Multiple Selection'.
    So no need to click every time on Dynamic Selection Screen i.e. Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    Please find attached screen shot for your reference.
    Please guide.
    Thanks and Regards,
    Emon Master

    Hello Jainam,
    submit (sy-repid) with selection-table v_sp
                             with free selections EXPRESSIONS
                             via selection-screen.
    Without going through the details, dont you think this will cause an inifinite loop as the calling & the called programs are the same.
    Please enlighten me !!
    BR,
    Suhas

  • Dynamic selection screen for FDK43

    HI All,
    I need to add a field (accounting clerk - BUSAB)in the dynamic selection-screen  of transaction FDK43.
    I used se36 to view the current selection-screen view and it does show me the field accouting clerk under functional group  - 04  (Company Code) .The field is ticked for preselect.
    However I am not able to see this field (BUSAB) in the dynamic selection when I run transaction FDK43.
    Any idea on how to make the function group 04 available for selection  ? or maybe even the field in it available for selection ?
    Regards,
    Shital

    hi
    use this link
    Dynamic selection screen
    Cheers
    Snehi

Maybe you are looking for

  • Premier Pro video settings

    I am attemting to use Premier Pro  CS4 to edit a video that was apparently shot with a setting of 720p on a  Kodak Zi8 camera 9 (is supposed to allow you to sent videos directly  from the camera to You Tube.  When I edit in Premier Pro the settings 

  • Ordering photo prints from iPad In the UK

    Anyone know how I can order photo prints from the iPad in the UK. Currently have to switch my pc on which isn't ideal

  • No Bluetooth on Macbook Pro 17

    I have a MB Pro 17 inch core 2 duo 2.4 Ghz. Bluetooth used to work but stopped sometime after installing snow leopard (after 1 of the updates). The icon is in the menu but when you click on it, it says "Bluetooth: Not Available". I have run Hardware

  • Parse errors from server behaviors

    I have created an input form for a mysql/php database set up on my testing server with a set of fields in a repeat region. All the fields are properly displayed when I switch to LiveView or browser preview. I am, however, having the following problem

  • Problem reading hidden fields

    We have a problem with OC4J. Our web application is working perfectly fine on other application servers, such as Tomcat, but when running it on OC4J we experience some weird behavior. We have a HttpServlet which handles the request and prints out the