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

Similar Messages

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

  • How to Remove Web Dynpro ABAP - Starting Application white banner

    Hi everyone,
    When I call the Web Dynpro ABAP applicaion, it shows the Login screen, after proper authentication, it shows a SAP NetWeaver Web Dynpro ABAP white screen/banner stating "Starting Application... ", and after sometime it launches the Web Dynpro application. I want to remove the white screen. How can we do that?
    Thanks in advance,
    Amber
    Message was edited by: Amber Gupta

    Hi Amber,
    Just as a quick note: There is no artificial delay when displaying the splash screen. During that time the application loads itself. The screen is removed as soon as everything will have been initialized including calling all application hooks such as wdDoInit on all the different controllers. This means, that by removing the splash screen you will only get a blank white screen with a "Application is being loaded.." message that will stay as long as the splash screen would have done. Hence, disabling or enabling it is more a matter of taste, not of performance.
    Best regards,
    Thomas

  • How to modify themes in web dynpro abap

    How can we identify which css file and class are used in web dynpro abap iview ?? I m new to web dynpro abap application. I need to change the look and feel of the page developed in web dynpro abap.
    How i can use css files to change the UI of the page and how can i reach to the css file and class of  a particular page developed in web dynpro abap. When we run the abap application on browser we don't get view source of it. Please tell me the ways to find the css and class files to modify them

    >
    Narendra wrote:
    > Hi,
    >
    > You can create one .css and .js page of page type Page with Flow Logic.and can make use in your normal .htm page..
    >
    >
    > Regards,
    > Narendra.
    I don't believe that your answer applies to Web Dynpro ABAP.  Page with Flog Logic sounds like BSP.  Please make sure you are posting about the correct technology.

  • Where does Web Dynpro Abap run?

    Hey,
    I have a question concerning Web Dynpro Abap: The Portal runs on the AS Java. Web Dynpro Abap is encapsulated in iviews and integrated to the portal. The Abap Backend is linked to the portal via a system specification. As a Developer I do not have to care about the communication between the backend and the portal. Where does the abap web dynpro run? Probably on the linked AS Abap? What happens if the backend is down? Are my other assumptions right?
    KR
    Felix
    Edited by: Felix F. on Jun 28, 2011 2:25 PM

    Hi,
    Though Iam not familiar with Webdynpro java .
    Netweaver WAS java is the runtime for Webdynpro Java.
    A WDJ can consume SAP functions using adaptive RFC ,so obviously if a WDJ accesses a ABAP function and if the system is down,then a WDJ cannot consume it.
    A WDA consumes the data directly from the ABAP system via native ABAP coding so mostly WDA is used for any ABAP based application.
    WDJ is used within SAP to produce robust and highly scalable J2EE applications, such as the Employee Self Service (ESS) and Manager Self Service (MSS) and different SAP Portal applications like User and Role management transaction and Universal Work List (UWL).
    For your question,consider , even during the initialization of WDJ ,if it tries to access a ABAP function module(but ABAP system is down),it will obviously result in error.
    If only a particular button is triggered , WDJ consume a function module(ABAP system is down), I guess WDJ will appear in portal till the button is clicked.
    Refer the below link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0e4940c-035c-2b10-0b9d-eb8f99674f4e?QuickLink=index&overridelayout=true
    Regards
    Karthiheyan M

  • 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 create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • How to determine itab type at run time

    I need to write a subroutine that organizes data in internal tables for presentation by a smartform. There are a few similarly structured internal tables all with the same field name ("recipe_type") by which the data is sorted. My problem is that how I can determine the type of the itab inside my subroutine at run time? Is it ever possible in ABAP?
    The subroutine code is attached below. Thanks for any help.
    FORM beautify_itab    TABLES itab_in TYPE table
                                     USING v_type TYPE any
                                     CHANGING itab_out TYPE table.
    Data declaration
      DATA: v_data_row LIKE LINE OF itab_in,                " THIS WON'T COMPILE!
                 v_blank_row LIKE LINE OF itab_in.              " blank row
    Organize the display of the table data
      LOOP AT itab_in INTO v_data_row.
        IF v_type <> itab_in-recipe_type.                     " 'recipe_type' is the sort key for the incoming itabs
          v_type = itab_in-recipe_type.
          IF sy-tabix > 1.
            APPEND v_blank_row TO itab_out.
          ENDIF.
          APPEND v_data_row TO itab_out.
        ELSE.
          CLEAR v_data_row-recipe_type.
          APPEND v_data_row TO itab_out.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

    The following code does what I want, but only if the input itab structure is declared first in the program. It won't work if the itab is declared as itab_in TYPE TABLE OF sflight. This is because the function 'GET_COMPONENTS_LIST'  only can load the structure of a field declared explicitly in the program.  Does anybody know of any method to load the structure of an itab based off a dtab? 
    Thanks you guys for answers. Points have been rewarded.
    *& Report  Z_GET_ITAB_TYPE_AT_RUN_TIME
    REPORT  z_get_itab_type_at_run_time.
    DATA: BEGIN OF itab_in OCCURS 0,
             seatsocc_b LIKE sflight-seatsocc,
             fldate LIKE sflight-fldate,
          END OF itab_in,
          itab_out TYPE TABLE OF string,
          wa_itab_out TYPE string.
    SELECT seatsocc_b fldate
    INTO TABLE itab_in
    FROM sflight
    WHERE carrid = 'AA' AND
          connid = '0017'
    ORDER BY seatsocc_b.
    PERFORM beautify_itab
                TABLES
                   itab_in
                USING
                   sy-repid
                   'itab_in'
                   'SEATSOCC_B'
                CHANGING
                   itab_out.
    LOOP AT itab_out INTO wa_itab_out.
      WRITE: / wa_itab_out.
    ENDLOOP.
    *&      Form  beautify_itab
          text
         -->ITAB_IN    text
         -->V_KET_FIELD   text
         -->ITAB_OUT   text
    FORM beautify_itab TABLES itab_in TYPE table
                       USING  v_prog_name LIKE sy-repid
                              v_itab_in_name TYPE any
                              v_key_field_name TYPE rstrucinfo-compname
                       CHANGING  itab_out TYPE table.
      DATA: itab_fields TYPE TABLE OF rstrucinfo,
            v_field_name LIKE rstrucinfo-compname,
            v_old_key TYPE string,
            v_field_value TYPE string,
            v_data_line TYPE string,
            v_tabix LIKE sy-tabix,
            c_blank_row TYPE string VALUE ''.
      FIELD-SYMBOLS: <fs_field>,
                     <fs_data_line>,
                     <fs_field_list> TYPE  rstrucinfo.
    gets all of the components of a structure
      CALL FUNCTION 'GET_COMPONENT_LIST'
        EXPORTING
          program    = v_prog_name
          fieldname  = v_itab_in_name
        TABLES
          components = itab_fields.
      LOOP AT itab_in ASSIGNING <fs_data_line>.
        v_tabix = sy-tabix.
        LOOP AT itab_fields ASSIGNING <fs_field_list>.
          v_field_name =  <fs_field_list>-compname.
          ASSIGN COMPONENT v_field_name OF STRUCTURE
                        <fs_data_line> TO <fs_field>.
          v_field_value = <fs_field>.
          IF v_key_field_name = v_field_name.
            IF v_old_key <> v_field_value.
              v_old_key = v_field_value.
              IF v_tabix > 1.
                APPEND c_blank_row TO itab_out.
              ENDIF.
            ELSE.
              CLEAR v_field_value.
            ENDIF.
          ENDIF.
          CONCATENATE v_data_line v_field_value INTO v_data_line
                      SEPARATED BY space.
        ENDLOOP.
        APPEND v_data_line TO itab_out.
        CLEAR v_data_line.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

  • How to add UI elements dynamically in the views of webdynpro

    Hi Experts,
    Here i have a requirement where 2 text-box get added on a click of "ADD" button in the view during the execution of the Application. so is it possible to add the text-box to the view or not?
    if yes how can it be done.
    Thanks in advance
    Regards
    Lalitkumar.

    Even with these expanded requirements I wouldn't necessarily recommend dynamic UI element creation in WDDOMODIFYVIEW.
    If the UI element requirements are fairly static (2 text boxes for each push of the button), then consider using a Multi-Pane (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/df/da8b412bb5b35fe10000000a1550b0/frameset.htm) or Row Repeater (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/93d3792e8c60d6e10000000a114a6b/frameset.htm) UI element. These constructs will both create a series of UI elements based upon the number of context elements in a bound node.  Therefore if you want to generate two textboxes for each push of a button, in the button event handler you simple add another context element to the context node.  You don't need dynamic UI element creation or dynamic data binding.
    If you feel that you must use dynamic UI element creation, then first read up on the WDDOMODIFYVIEW phase model event.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm
    You then probably want to study these three blogs on the topic:
    /people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
    /people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
    /people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements

  • How to pass column name at run time in function.

    how to pass column name at run time in function as parameter.
    thank in advance
    pramod patel

    Hello,
    Using dynamic sql you can pass column name to function. well I am not getting what you really want to do ? Please write in more detail. By the way I am providing one example here. see it uses dynamic sql.
    Create or replace function fun_updtest (p_columnname_varchar2 in varchar2,
    p_value_number in number)
    return number is
    v_stmt varchar2(500);
    begin
    v_stmt := 'update emp
    set '||p_columnname_varchar2||' = '||to_char(p_value_number)||'
              where empno = 7369';
    execute immediate v_stmt;
    return 0;
    commit;
    end;
    call to this function can be like this..
    declare
    v_number               number;
    begin
    v_number := fun_updtest('SAL',5000);
    end;
    Adinath Kamode

  • How to add screen for IEQM0003

    Hi All,
    I am working for T code IE02 in PM module.
    I have requirement that when user saves the Equipment, a Pop-Up screen should come.
    This will contain 2 Radio-buttons and one Ok button.
    After Selection any Radio Button and Pressing OK, a Workflow will be triggered.
    Please give me step by step procedure to do above.
    There is User Exit Enhancement IEQM0003. Pls tell me how to add screen to it.
    Raja

    Rishi
    1. Create custom screen in function group XEQM... which is the same function group for the Exit EXIT_SAPMIEQ0_001.
    2. Do call screen to view that custom screen in user exit EXIT_SAPMIEQ0_001.
    3. Trigger the workflow event as per your requirement. For this write the code in PAI of Custom Screen.
    Thanks
    Amol Lohade

  • 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

  • Add/Delete elements from viewcontaineruielement in web dynpro abap

    Dear all,
    Please let me know how to Add/Delete elements from viewcontaineruielement in web dynpro abap? I have copied a viewcontaineruielement from another program and now i dont want few elements from that viewcontaineruielement in my view. Please guide

    Hi Ajinkya,
    I have copied a viewcontaineruielement from another program and now i dont want few elements from that viewcontaineruielement in my view. Please guide
    Have you saved that VC element as template and using that template in another component?.If so,on resuing that VC element template it populates all the screen elements which you've save as template.
    Now, select that VC element which you've re-used,based on you're requirement add/remove UI elements as Kiran suggested.
    Hope it will resolve your issue.
    Thanks
    KH

  • CRM2007 How to add a Web Dynpro ABAP application to a CRM business role

    I am investigating CRM2007 UI framework and I cannot seem to find a way to add a custom made Web Dynpro ABAP Application (created in CRM 4.0) to a business role, or how to add a custom transaction created in classic ABAP (transaction created via se93, progam created via se38). Whatever I do, I only see BSP components. I am using transaction BSP_WD_CMPWB.
    Next to this it seems you can add/integrate Visual Composer applications to (there is an entry in spro called "integration of the visual composer in BI"). However, I presume we first have to meet the requirements for the portal integration in SAP CRM 2007 as described in spro. If somebody knows how this works, that would be great!
    kind regards
    Angelique Heutinck

    Hello Angelique,
    It should be possible to call web dynpro applications from the L-shape menu of CRM UI (check transaction CRMC_UI_NBLINKS). As for the old GUI transactions, you can embedd them also via transaction launcher using CRMC_UI_NBLINKS (search for "transaction launcher" in this forum, there is plenty of information on it).
    Best Regards,
    Yevgen
    Edited by: Yevgen Trukhin on Jun 19, 2008 11:53 AM

  • How can I capture mouse click events on BSP or Web Dynpro ABAP Screen

    hi Guys,
    Currently we have a user inactivity problem,
    the requirement is: if user is clicking on BSP/Web Dynpro ABAP screen, he/she is considered active. so we need an mechanism to capture the mouse click event.
    Using Firebug, we found that this js is in the iframe which contains BSP/web dynpro scrren: /sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    we want to find this js file & put in some javascript code to track user's mouse click, but i cannot find it on server.
    while in ie if we type http://host:port/sap/public/bc/ur/nw5/js/languages/urMessageBundle_en.js
    this file can be downloaded, means this file is there.
    Any one can help on this issue? find the js file or another way to capture the mouse click event.
    Thanks a lot with points!

    Hi  Feng Guo,
                        We can not capture mouse click events on Web Dynpro ABAP Screen . I am not sure about BSP. But as for as I know the portal keep active the iViews until unless mouse clicks happens.
    But for your problem I think you can get solution by setting iView Expiration to some more time period.
    Regards,
    Siva

Maybe you are looking for

  • Interactive report on view based on pipelined table function.

    Hi, I want to build an Interactive Report on a view. The view definition contains a select on a pipelined table function. I use context functionality to pass paramaters to the pipelined table function. A plain select * from #my_view# in SqlPlus resul

  • Values in "vendor batch" in the Goods-in-order and Goods-in-plan lists are

    Vendor batch No.  : Transaction ZJPMPU322 (Background)      There are "vendor batch" and "batch" fields in Goods-in-order and Goods-in-plan lists (transaction ZJPMPU322). Values for these fields are retrieved from inbound delivery document (transacti

  • Refx lease rental cash flow for non-cancellable contracts

    Dear Refx Group, As per Accounting Standard (AS) 19 - Leases, the lessee should make the following disclosures for operating leases: a) the total of future minimum lease payments under non-cancellable operating leases for each of the  following perio

  • Options missing on iMovie under File Analyze Video

    Hi. I just got the new iLife 11 and was looking through the video about the people finder on this page. http://www.apple.com/ilife/imovie/ However, when I look at iMovie on my computer I don't see the mark camera pans option under file-analyze video

  • NO INTERNET SERVICE SINCE SATURDAY!!!!!

    Hey, I'm Jersey City, I don't have any internet connection since 10/29 Called support yesterday and they said that Verizon has some issues in the area. Promised to get the service up by midnight. I still have no connection.(WTF!!!) Anyone else experi