Adding selection screen elements at run time

Hi,
I have a selection screen with four drop down list which has 20 elements.
When i select any element from drop down, i must be able to add some other UI in the same line.
DD1
DD2
DD3
DD4
If i choose a first item in DD1,
DD1 Lable1 IP1 lable2 IP2
DD2
DD3
DD4
these lables and input fields are not known till selecting the item.
Will i be able to do this in selection screen?
Thanks
Vimalraj

Have a look at this Report. you have to Capture events on User Command and modify the screen accordingly.
REPORT  ztesttt.
PARAMETERS: test1(10) TYPE c MODIF ID sc1,
            test2(10) TYPE c MODIF ID sc2,
            test3(10) TYPE c MODIF ID sc1,
            test4(10) TYPE c MODIF ID sc2.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-group1 = 'SC1'.
      screen-active = '1'.
      MODIFY SCREEN.
      CONTINUE.
    ENDIF.
    IF screen-group1 = 'SC2'.
      screen-ACTIVE = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Similar Messages

  • How to add screen elements at run time on button click in Web Dynpro abap?

    Hello All,
    I have a requirement wherein the user wants to add the textbox dynamically at runtime on button click action. My questions is, Is it feasible to dynamically add screen elements at runtime? If yes, how?
    Please help.
    Thanks

    Hi Ajinkya,
    This is absolutely possible! Adding view elements at runtime is called "dynamic programming". There are a lot of good resources and tutorials on SCN if you do a search. To start you off, here is an excellent series by Thomas Szücs:
    Dynamic Programming in Web Dynpro ABAP - Introduction and Part I: Understanding UI Elements
    Dynamic Programming in Web Dynpro ABAP - Part II: Handling ViewElements
    Dynamic Programming in Web Dynpro ABAP - Part III: Aggregations and DDIC-Binding of ViewElements
    Another option that avoids dynamic programming is to create the view element at design time but bind its visible property to a context attribute of type WDUI_VISIBILITY. You could initially set its visibility to "none" until the user clicks the button, then you could change its visibility to "visible".
    Cheers,
    Amy

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • Disabling ui elements at run time.

    hi ,
    i am working on a screen in which i have a no gui elements. what i basically want that when i use this component in another my buttons and input field (embeded in the tabe) should get disabled. please guide me ,how to change the value of the context bound to the read only property of these ui elements, at run time.

    Hi Vishvdeep,
        I think your requirement is that you want to control the   enabled property of UI elements from one component by other component.
    So what solution Abhi has provided is perfect and if u didnt understand it i am just explaining in steps.
    *Suppose u have two components
    component A and component B
    You want UI elements of component B should be controlled by component A.*
    Step 1) Create a method in component controller of component A and select the interface property of method( so that you can use it in other component)
    Step 2) Create a node along with its attribute and make this node also interface node.
    step 3)Write the code in this method as per your requirement(as Abhi has given the code)
    step 4)Call component A in component B and bind the enable property of ur UI elements with the interface nodes from component A.
    step 5)call the interface method of component A which will make control enable property of component B.
    Hope this will fullfil your requirement.If you have any query feel free to ask.
    regards
    PG

  • 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

  • Clearing screen elements at a time

    hi gurus,
                      can i have a technique by which i can clear all the screen elements at a time. I mean to reset that screen elements.
    One option i have is to call that transaction once again but that has its own limit i,e 6.
    other is to manually clear it as many elements we have like p_matnr = ' ',p_mtart = ' '. but it takes time. Can i have a technique which can clear all the elements in a screen at a time.
    Thanks in advance,
    Gaurav

    You could try to do this in the Process Before Output or AT SELECTION-SCREEN OUPUT block :
    Sample :
    REPORT ZCLRSEL.
    TABLES: mara.
    PARAMETER para LIKE mara-matnr.
    SELECT-OPTIONS selo FOR mara-matnr.
    FIELD-SYMBOLS: <fs> TYPE ANY,
                   <so> TYPE ANY TABLE.
    DATA: fieldname LIKE screen-name,
          dummy.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        CHECK screen-input = 1. " only input fields
        IF screen-name CS '-LOW' " SELECT-OPTIONS
        OR screen-name CS '-HICH'.
          SPLIT screen-name AT '-' INTO fieldname dummy.
          CONCATENATE fieldname '[]' INTO fieldname.
          ASSIGN (fieldname) TO <so>.
          REFRESH <so>.
        ELSE. " single PARAMETERS
          fieldname = screen-name.
          ASSIGN (fieldname) TO <fs>.
          CLEAR <fs>.
        ENDIF.
      ENDLOOP.
    Regards

  • How to create a report with selection screen that can run in background

    Sorry to ask these basic questions but I am knew to ABAP Programming.
    To keep it simply, I am attempting to create a report that has a simple parameter driven selections screen with one field.  That field takes in a folder path from the user.  The user executes the report.  The report creates a simply BDC that goes into SE16, gathers data from a table, and exports the results to a text file using the folder path provided.  I created a variant for the folder path field in the selection screen hoping to use it while executing the report in the background.  The report is not exporting the file as it did when run in the foreground for some reason.
    I am wondering what event is triggered when a report is executed in the background.  In the foreground (or when I execute the program via SE38->Execute->With Variant) the user needs to execute the program by hitting the execute button once the variant has populated the folder path field.  It works then, so I am trying to get the same to work in the background.  I am thinking I didn't put the program together correctly to accommodate the running in the background.  How can you create a report that can accept user input via variant into a selection screen and then run in the background?
    Please, any information would be greatly appreciated.
    Thanks you all for reading this!!!

    Ok, finally I understand what you're doing. Initially you lost me with the SE16 reference...
    Not sure what you're trying to achieve overall, but apart from the fact that you cannot export/download a file to a user's PC via background job (unless you have a mapped network share on the server or something like an FTP server on the user's PC, but both are pretty hypothetical scenarios and unlikely to occur).
    Also, the BDC approach to get data via SE16 is pretty awkward. Note that SE16 is guarded by some authorization checks and often users won't have access in production (which might not matter if you intend to always run your program in background via dedicated batch user). However, I have no clue why you wouldn't want to use [open SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_READING.htm] to read the data. You could then save it on the application server or if you really have to get it to the user you can consider e-mailing the file (extracts should be compressed before sending). For the latter you'll find plenty of references here, basically it's the [business communication services|http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/1c5d3aebba4c38e10000000a114084/frameset.htm] that you'd need to look at.

  • How to remove an selection screen element at the event

    hi,
    can any one tell me how to remove / Disable an selection screen element at the runtime after an event occurs like selection of Value from a parameter.
    Thanks and Regards
    Guhapriyan Subrahmanyam

    TABLES : BKPF.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_BUKRS LIKE BKPF-BUKRS OBLIGATORY.
    "Company code
    SELECT-OPTIONS : S_BELNR FOR BKPF-BELNR MODIF ID M01.
    "Accounting Doc No
    PARAMETERS: P_GJAHR LIKE BKPF-GJAHR MODIF ID M02.
    "Fiscal year
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN ON S_BELNR.
    IF S_BELNR IS NOT INITIAL.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'M02' .
    SCREEN-INVISIBLE = '1'.
    MODIFY SCREEN .
    ENDIF.
    ENDLOOP.
    ENDIF.

  • Issue with selection screen element on At slection scree

    Hi All,
    I am facing an issue with a checkbox which is present within the subscreen of a standard selection screen.
    The issue is that the value of the combobox get toggled by itselfon the event mentioned below. I am unable to find out how this combo box value gets changed by itself on the screen events.I tried clear statemetns etc nothing is helping. I debugged with a watch point on this screen element and found this to happen.It just changes the value of the element to a previously held state.I m trying to clear the combobox but this event puts back the tick mark.How can I stop this.
    AT SELECTION-SCREEN ON COL_FROM.  "COL_FROM is another screen element diffrent from the combobox
    Thanks

    Hi Vighneswaran CE,
    This event corresponds to the PAI module of the COL_FROM field. So, it gets executed each time you press any valid function code on the screen (unless there was an error in a previous field). Nothing abnormal here.
    That's difficult to help you on that topic, you'd better tell us exactly what report it is, where you have added your code (and what code) to change the checkbox, ...
    Best regards,
    Sandra

  • Re: LSMW. adding selection screen

    HI,
    I have to write an conversion program in LSMW
    in the field mapping and conversion rules i have updated the select fields.. but..
    how to change the text element and selection texts
    Thanks in advance
    Guhapriyan

    Hello,
    As the conversion program is a program created by SAP at run time we will not be able to put the selection texts, Since the name of conversion program will be in SAP std., namespace.
    An alternate solution would be to use:
    SELECTION-SCREEN COMMENT 1(20) 'COMMENT'.
    Hope this helps,
    Best Regards, Murugesh AS

  • Adding complex computed column at run-time fails in PB 12.6

    I support a large 'vintage' application that was originally written in the late 90's, and has been migrated from version to version over the years.  Currently I'm working to get it working in PB 12.6 Classic, build 3506, migrating it from PB 11.5
    The first issue I've come across is that PFC treeviews are not working properly.  After some debugging, I determined that the cause of the failure is the PFC code's creation of 'key' column in the datawindows being used to populate each level.
    In the pfc_u_tv.of_createkey function, it looks at the linkages between the levels of a treeviews data, and then crafts an expression, and then uses that to create a computed column, which is subsequently used to uniquely identify the data.
    The expression is a series of string concatenations, such as this:
    expression='String(ctg_cd) + "#$%" + String(app_cd) + "#$%" + String(app_cd) + "#$%" + String(win_id) + "#$%" + String(ctg_cd) + "#$%"'
    This expression is then used in a modify statement to create the new compute key column:
    ls_rc = ads_obj.Modify("create compute(band=detail x='0' y='0' " + &
      "height='0' width='0' name=pfc_tvi_key " + ls_Exp + ")")
    In earlier versions, this works, and when you do a getitemstring afterward you get a long concatenated value that PFC uses to uniquely identify treeview items.
    Such as 'a/r#$%plcy#$%plcy#$%w_m_plcy_fncl_tran#$%a/r#$%'
    However, in PB 12.6, only the first portion of the expression is processed.  There is no error returned from the Modify function, and the column is created, but the expression is only evaluating one part of the expression.  In this partiular case, it results in
    'plcy'
    I just noticed that this isn't the *first* item in the set of concatenated columns and string literals, which is interesting.  In any case, when the computed key values are not correct, the whole method PFC is using to populate and run the treeview falls apart, and you get all children under each parent, and selections on the treeview object do not work properly because the key column values are not unique.
    I can copy the expression value from a debugging session, and use that to create a computed column at design time, pasting the expression in, and naming it the same as the created column (pfv_tvi_key), and this then allows the treeview to work properly.  However, this is a very cumbersome and problematic workaround.  The application has a lot of treeviews, with a very large number of datawindows operating as all the different types of items on different levels of different trees.  I don't think it's a practical workaround, and future maintenance would be very difficult.
    bu the workaround still demonstrates it is not an issue with the syntax of the compute expression, just an issue with the way it is handled by PowerBuilder when a column is created at run time,vs. at design time.
    Has anyone else encountered this issue?  I would think there are a fair number of older apps still around that are using PFC treeviews.
    My next step will be to install PB 12.6 build 4011 and cross my fingers.  Other than that, perhaps try 12.5?

    Updating the PFC layers has started to lead down a rabbit hole of hundreds and hundreds of errors.
    Granted, many of these are probably rooted in a few ancestor issues.
    But I'm not sure this will lead to a solution.
    The problem lies in using a modify statement to create a computed column at run time containing an expression with multiple concatenated values.
    If I look at the pfc_u_tv.of_createkey function from the newer PFC version, I see the same code there:
    ls_rc = ads_obj.Modify("create compute(band=detail x='0' y='0' " + &
      "height='0' width='0' name=pfc_tvi_key " + ls_Exp + ")")
    And the same code above it which creates the expression used in the modify.
    So after doing all the patching for the new PFC version, I somehow suspect I'll still be facing the same datastore.modify problem.
    Not to say that isn't a good thing to do, just not sure it addresses the root of the problem.

  • Why Selection Screen is taking much time, very first time?

    Hi Experts,
    I hv a Selection Screen-1000 with 15 select options, 2 push buttons, 6  radio buttons, 3 paras. with List Boxes with my_T.Code.
    So, When I executed this SS-1000 with my_t.code, its consuming time like,
    1 - first time - 58 Sec.
    2 - 2nd time - 31 Sec.
    3 - 3rd time - 5 Sec.
    4-4th time - 5 sec.
    So,
    1 -  Why its happening like this(any buffer concept involved?)? Obviuosly, I hv been asked to get the first time also with in a short time.
    thanq.

    ThanQ Rich,
    OK, anyways, of my curiousity asking that, It shuld all times shuld consume same time for displaying the selection screen! Why its taking differed timings?
    In Intialization:
    push_name1  = 'A1'
    push_name2  = 'A2'
    AT SS OUTPUT:
    filling list_box1
    filling list_box2
    filling list_box3
    perform modify_screen
    So, U mean, I hv to look these things!
    ThanQ.

  • Error in adding selection screen fields

    Hi All,,
    I am getting error when i add a selection screen parameters in module pool.
    I copied stadard program to custom one, when I add an input field to screen it gives information message saying
    "Selection screen: Report generation makes screen changes ineffective". 
    If though if i add the selection screen, when i relogin newly added screeen disappears.
    Can any one y this is happening?

    Hi,
    You can find a lot of posts on the SDN. Please search for them.
    [What create docking container on a subscreen?]
    [Query Regarding 'cl_gui_docking_container'] are a few

  • Adding panel into JDialog at run time problem

    Hi ,
    I am adding one component at a time into the jdialog at run time.
    What I do , when I launch jdialog instance first time I added one
    component into the jdialog. when OI press next button it removes this
    component and adding next one , but the problem is that is is not showing in the jdialog.
    Please give me any idea that
    How I can add component into jdialog at run time.
    Thaks In Advance.
    - vikas

    Hello,
    without source-code its difficult to understand where your problem is. The following sample code works 'fine':
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AddCompoDialog extends JDialog {
         int compoCounter;
         public AddCompoDialog(){
              setLocationRelativeTo(null);
              setSize(300,300);
              JPanel mainPanel=new JPanel(new BorderLayout());
              JPanel buttonPanel =new JPanel();
              final JPanel compoPanel=new JPanel(new GridLayout(10,10));
              JButton newCompo=new JButton("add new Component");
              newCompo.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        compoPanel.add(new JLabel("Compo #"+ ++compoCounter));
                        compoPanel.revalidate(); //Dont forget to relayout your container
              buttonPanel.add(newCompo);
              JButton close=new JButton("close Dialog");
              close.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e) {
                        dispose();
              buttonPanel.add(close);
              mainPanel.add(buttonPanel,BorderLayout.NORTH);
              mainPanel.add(compoPanel);
              getContentPane().add(new JScrollPane(mainPanel));
         public static void main(String[] params) {
              new AddCompoDialog().setVisible(true);
    }Regards,
    Tim

  • How to disable the selection screen element?

    Hello Colleague,
    I have a report which has a checkbox in the selection screen. Currently I need to create two transaction codes for the report. When Tcode1 is executed, the program will execute in normal way. When Tcode2 is executed, the checkbox should be selected and greyed (not ready to input).
    To implement the requirement, I think I should control the screen in the INITIALIZATION event according to the SY-TCODE.  But when I tried to use LOOP AT SCREEN, I find SCREEN is empty.
    I search a lot of threads. They all introduce the selection control after screen is displayed. 
    Can any expert help me on the problem?
    Thansk & Regards, Yongbo.

    I think you can use Screen Variants T.Code SHD0.

Maybe you are looking for