Dynamically Creation of  input field in webdynpro

Hello Experts,
I am new to webdynpro.
I have a requirement to create the input filed dynamically for material.
Requirement:- I have to button in my screen "+" and "-" button.
                      after execution  while i will click on + button one input filed should be created automatically and while i will clicik on
                      - button the newly creaed inputfield should be deleted from the screen.
Coulld anybody help me on this.
it would be great if somebody can share any solutin or sample code.
Thanks in Adv...

Hi Kiran,
Jus to clarify on this: There might be situations, we don't know how many fields the user wants to create at runtime.
Yes, OK, that does make sense and justifies the effort in this case, I agree with you.
But in OP's case I think he only wants one field:
after execution while i will click on + button one input filed should be created automatically and while i will clicik on
Still, it does make sense to dynamically create them if there could be one up to X to keep the application slender.
Cheers, Lukas

Similar Messages

  • Dynamic Creation of input fields

    Dear Guys,
    I have a node name 'NodeA' with 10 attributes(a,b,c,d..j) in it.
    When the add button is clicked , I want to display 10 inputfield for the 10 attributes of 'NODEA' to be dynamically created and displayed. so what coding should be written in the add buttons action....
    Regards,
    Shamila

    Hi Shamila,
    I have a context node by name NODE & it has 10 attributes like NODE_1, NODE_2,... NODE_10 under it. All these attributes are of type STRING. So you just have to put the below code into WDDOMODIFYVIEW to get 10 input fields & labels displayed. These input fields would show any string that you have maintained for each attribute using the "Default Value" property.
    METHOD wddomodifyview .
      DATA :  lr_container TYPE REF TO cl_wd_uielement_container,
            lr_input_field TYPE REF TO cl_wd_input_field,
              lr_label TYPE REF TO cl_wd_label,
            lv_attribute_name TYPE string,
            lv_id TYPE string,
              lv_label_text TYPE string.
      CHECK first_time = abap_true.
      lr_container ?= view->get_root_element( ).
      cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
      lr_container->set_width( value = '50%' ).
      DO 10 TIMES.
        MOVE sy-index TO: lv_attribute_name,
                      lv_id,
                          lv_label_text.
    " Figuring out the context attribute name to bind to the input field
    " Since the node name is NODE & attributes are like ATTR_1, ATTR_2..
    " The value to be bound would be like NODE.ATTR_1, NODE.ATTR_2....
    "  Am condensing the string finally to avoid any gaps in between coz it would lead to shortdump
        CONCATENATE 'NODE.ATTR_'
                 lv_attribute_name INTO lv_attribute_name.
        CONDENSE lv_attribute_name NO-GAPS.            
    " Figuring out a unique id to be used for assigning to the input fields
    " Am assigning id's with values like IO_1, IO_2, ... IO_10
    "  Am condensing the string finally to avoid any gaps in between coz it would lead to shortdump
        CONCATENATE 'IO_'
                 lv_id INTO lv_id.
        CONDENSE lv_id NO-GAPS.
    " Figuring out a unique text to be used for assigning to the label fields
    " Am assigning text to labels like Label_1, Label_2, .. Label_10
    "  Am condensing the string finally to avoid any gaps in between coz it would lead to shortdump
        CONCATENATE 'Label_'
                    lv_label_text INTO lv_label_text.
        CONDENSE lv_label_text NO-GAPS.
        lr_input_field =   cl_wd_input_field=>new_input_field( id          = lv_id
                                               bind_value = lv_attribute_name ).
        lr_label = cl_wd_label=>new_label(  label_for  = lv_id
                                            text       = lv_label_text ).
        cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_label ).
        cl_wd_matrix_data=>new_matrix_data( element = lr_input_field ).
        lr_container->add_child( the_child = lr_label ).
        lr_container->add_child( the_child = lr_input_field ).
        CLEAR: lv_attribute_name,
               lv_id,
               lv_label_text.
      ENDDO.
    ENDMETHOD.
    Regards,
    Uday

  • Can we Change the backround color of an Input field in Webdynpro for ABAP.

    Hi Experts ?
    Can we change the background color of an Input field in WebDynpro for ABAP based on results we receive from any function module or BAPI?? .
    Thanks in advance .
    Regards ,
    LAS

    Yes. We can change the background of an input field. The way you do this is by editing the theme that webdynpro application uses. To edit the theme, you will need to install NWDS PLUS the theme edit plugin (Available for download from SAP).
    Once you have edited the theme, you will need to upload your theme back to application server. You can use the program : BSP_UPDATE_MIMEREPOS to do this.
    Bydefault, the theme used by webdynpro applications is :
    /SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow
    You can apply another theme by calling the webdynpro application with a theme parameter. For example, if my webdynpro application name is "zgopaltest", then
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow</b></i>
    will apply the sap_tradeshow theme.
    Likewise, you can apply diffrent theme. There is another theme that SAP provides. Its called : sap_hcb. Hence, you can apply the theme to the above application by:
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_hcb</b></i>

  • Dynamic enabling of input fields via radio btn in report selection screen?

    Hi there!
    I was wondering whether one can dynamically enable/disable input fields on a selection screen of a report-program.
    Or is this only possible for selection screens in dynpro-programs?
    If possible for reports - could you give an example?
    Thanx a lot.
    Andreas

    Hi,
    yes..You can dynamically disable and enable inputs fields in the selection screen..
    Check this ex..If you press the first radio button..The second input will be disabled...And vice versa..
    PARAMETERS: p_r1 RADIOBUTTON GROUP g1 USER-COMMAND usr DEFAULT 'X',
    p_r2 RADIOBUTTON GROUP g1.
    PARAMETERS: p_input1 TYPE matnr MODIF ID m1,
    p_input2 TYPE matnr MODIF ID m2.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF p_r1 = 'X'.
    IF screen-group1 = 'M2'.
    screen-input = '0'.
    ENDIF.
    ELSE.
    IF screen-group1 = 'M1'.
    screen-input = '0'.
    ENDIF.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    Thanks,
    Naren

  • Dynamic filling of input fields in a table

    Hi,
    There are input fields in a two tables these are to be filled parallely at run time. the no of entries depend on the entires in internal table.
    If internal table has more entries, then a certain entries is filled up; say 9 times the control should be given to a new tables and the remaining entries should be filled in the input fields of other table .
    I appreciate help.

    Hi,
    Actually there is two HTML tables, each table has nine rows. if the no of entries in the internal table exceeds nine then the second table should be filled after the first HTML table has filled with all the nine entries.
    Both tables contains same input fields. How to fill both tables dynamically. I think now it makes sense.

  • Dynamically  Visibilty of Input Field in Interactive PDF Form

    Hi All,
    I want to bind the visibilty of Input Field dynamically in an Interactive PDF Form. How can I do ?
    Please give me some solution
    Regards
    Manish

    Manish,
    Well select the inputfield & check the Scripting Window in your Designer.
    On its top, you will see an option something as Show: Events with Scripts.
    Select the initialize event and insert the code she mentioned. Then click on + sign. This will enter your changes.
    There will be language option on top as well. Select JavaScript from it.
    So in the end your code should read something like this.
    ----- data.<YourFormName>.txtInput::initialize: - (JavaScript, client) ----------------------------------
    txtInput.presence = "invisible";
    Chintan

  • Flash Pro CC  dynamically create an input field problems?

    I dynamically created an input TextField and designated a TextFormat object that is a Thai Font. The difficulty I have is the superscript above the Thai letters will not display. These tone marks are cut off by the uppermost dimension of the field.
    The following is an example of the problem   "   นี้  "
    The tone mark "  ้  "does not display
    If there are multiple lines the tone marks are obscured by the line above.
    I have fooled around with carriage returns and RegExp as a work around but this is torture.
    Any ideas?
    thanks

    Thank you Rob for your help. The  leading property will add whatever space I require between lines. So  the response was helpful there. However it does not apply to the first line.I have worked around this by adding a  carriage return as the initial line of text. This is working for me

  • How to display a value in an input field in webdynpro

    I want to get a value already shown in a particular input field
    i.e., have to fetch data to that input field as we enter that screen.
    how can we do that?
    kindly reply if anyone knows.
    Thanks and regards
    suju

    Hi,
    First of all u have to declare one variable in the prog. with the name of the i/o box u have given in the screen.
    Now in the PBO of the screen call one module.
    and in that module write the code like,
    if your i/p field name is INPUT_F then
    MODULE assign OUTPUT.
      INPUT_F = 'XYZ'.
    ENDMODULE. 
    Here u can assign the value by fatching through the DB also.
    I think this will help u.
    thanks

  • F4 help in an Input Field in WebDynpro

    Hello Evryone,
    I Have a question based on F4 help.
    I have a static context node and an element of the node A has a search help shlp_a attached to it. the node A is having a Input field in UI mapped to it. When i use F4 help on this ui element mapped to Node A, i get a F4 help triggered.
    the search help shlp_a is having a search help exit attached to it.
    what i expect is, i want to trigger a Pop-up in place of f4 help. this pop-up should only be displayed only on a specific scenario. i do not want to change this approach as this would disturb my existing functionality.
    is this possible?
    regards
    Om
    Edited by: Savita Nandan Om on Sep 13, 2010 5:00 PM

    HI,
    having F4 search help and to display a pop up in specific condition is not achievable using dictionary search help.
    regrds,
    Madhu

  • How to implement AZAX call for a input field in webdynpro java.

    Hello everyone,
    I want to make a AZAX call , when I click on the input field.Anybody has already implemented this earlier, plz let me know how to do this.
    Thanks,
    Srikanta

    Undo/Redo is a pain in the neck. If I recall correctly, I usually use a javax.swing.undo.CompoundEdit to group smaller edits. Not sure if this will work but you might try starting a compound edit when a user strikes a key and ending it after a certain amount of time passes without a keystroke. This will allow rapid bursts of typing to be grouped as a single edit.

  • Digital Signature Turns Invalid while setting the Property Dynamically to an Input Field

    I have an Input box that turns mandatory only if a check box is clicked.
    The Script goes Something Like This;
    if(chkbox.rawValue === 1){
         inputField.mandatory = "error";
         inputField.mandatoryMessage = "This Field cannot be left Blank";
         inputField.presence = "visible";
    } else {
         inputField.mandatory = "disabled";
         inputField.mandatoryMessage = "";
         inputField.presence = "hidden";
    I am working with Assembler Service and the Signature field is placed in the cover page after which this form is attached.
    Any clue of why the property change Invalidates the Signature?
    Note: The stand alone form where the Check box and Input field is present doesnot have a preSign event as this form doesnot contain a Signature field unless its merged using assembler. This Script is added to the Click Event of the Checkbox.
    Cheers
    Mahesh Krishnan

    weblogic.common.resourcepool.ResourceDisabledException: Pool mds-soa is Suspended, cannot allocate resources to applications ..Check server logs to find out why mds-soa is suspended. Make sure that datasource mds-soa is up and running on SOA servrs before deploying an application.
    Regards,
    Anuj

  • Dynamic creation of input values

    Hi All,
    My Req is:
    FROM APPLICATION:- (drill down combo box)               TO APPLICATION:- (drill down combo box)
    the user selects an application from the list of the appset.Their respective dimensions needs to be displayed as prompts.
    eg:-
    appset: TEST
    app: FINANCE,RATE,LRATE,OWNERSHIP,TEST1
    then...
    FROM APPLICATION : FINANCE(from drop down box)    TO APPLICATON:-RATE(selects from dd)
    the corresponding dimensions must be displayed as prompts in th next page.say FINANCE has 5 dimensions,they have to be displayed in the next page as PROMPTS.
    How is it possible to get the dimensions for selected applications at run time? ,as we r selecting the applications from drop down box.
    dynamically at runtime.

    hi,
    i had given one example it will help you
    data: begin of itab_alv1 occurs 10,
              MAKTX like MAKT-MAKTX ,
              MATFI like MARA-MATFI ,
              MATNR like MARA-MATNR ,
              MFRPN like MARA-MFRPN ,
          END OF ITAB_ALV1.
    type-pools: slis.
    data: afield type slis_fieldcat_alv.
    DATA: fieldcat type slis_t_fieldcat_alv.
    clear afield.
    afield-col_pos = 1 .
    afield-fieldname = 'MAKTX'.
    *afield-seltext = ''.
    append afield to fieldcat.
    afield-col_pos = 2 .
    afield-fieldname = 'MATFI'.
    *afield-seltext = ''.
    append afield to fieldcat.
    select * from mara.
       select * from makt where
             matnr = mara-matnr.
           itab_alv1-matnr = mara-matnr.
           itab_alv1-maktx = makt-maktx.
           append itab_alv1.
       endselect.
    endselect.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           IT_FIELDCAT = fieldcat
        Tables
           t_outtab = itab_alv1.

  • Add Dynamic Input field

    Hi...Experts am new in ABAP Webdynpro. Actually my application is Add Dynamic Input Field in webdynpro. Already One lable, one Input field is there and I add one more button. When I click that button Dynamically Adding same like existing lable and inputfield.Can anyone tel me how to resolve my problem.

    Hi..Yugesh
    U will try this,Definitly Ul get Answer.
    For Dynamically creating Attribute
    DATA : rootnode_info TYPE REF TO if_wd_context_node_info,
    dyn_node_info TYPE REF TO if_wd_context_node_info,
    dyn_node TYPE REF TO if_wd_context_node.
    DATA : dyn_attr_info TYPE wdr_context_attribute_info.
    dyn_attr_info-name = 'NAME'. Attribute Name
    dyn_attr_info-DEFAULT_VALUE = 'Prakash'. +Iam Setting Default value of attribute,u can change as per ur requirement +
    dyn_attr_info-type_name = 'ZDE_NAME' . Data Element(CHAR20) ( Type Of Attribute )
    rootnode_info = wd_context->get_node_info( ).
    CALL METHOD rootnode_info->add_attribute
    EXPORTING
    attribute_info = dyn_attr_info.
    This will create a attribute at run time...
    For Dynamically creating Input Field
    DATA lr_container TYPE REF TO cl_wd_uielement_container.
    DATA lr_input TYPE REF TO cl_wd_input_field.
    DATA lr_table TYPE REF TO cl_wd_table.
    DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
    DATA lr_button TYPE REF TO cl_wd_button.
    DATA lr_grid_data TYPE REF TO cl_wd_grid_data.
    DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
    DATA lr_matrix TYPE REF TO cl_wd_matrix_head_data.
    +Note : Before that change the Layout of ROOTUIELEMENTCONTAINER to MATRIX LAYOUT +
    navigate from <CONTEXT> to <SFLIGHT> via lead selection
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    CALL METHOD cl_wd_input_field=>new_input_field
    EXPORTING
    bind_value = 'NAME' + attribute which i created above+
    id = 'INPUT1'
    RECEIVING
    control = lr_input.
    lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_input ).
    lr_input->set_layout_data( lr_matrix ).
    CALL METHOD lr_container->add_child
    EXPORTING
    index = 1
    the_child = lr_input.
    ENDIF.
    Code it in WDDOMODIFYVIEW...

  • Dynamic input fields

    I need to dynamically generate the input fields based on the results returned from the query. How do I name each input fields differently.
    Eg:-)
    Say I have 5 rows returned from EMP table. I need to generate 5 input fields to change their names??
    How does the XSL script looks like??
    null

    First one - javascript good.
    Second one - take user to another page.
    [JavaBean and Servlet are not interchangable, JSP and Servlet are]

  • Flash Pro CC  Input field difficulties ?

    If I  dynamically create an input field and designate a TextFormat object that is a Thai font. The difficulty I have is that
    the superscript above the Thai letters will not display. They are cut off by the uppermost  dimension of the field .
    The following is an example of the problem     นี้
    The tone mark  "  ้ " does not display.
    I have been fooling around with carriage returns and RegExp  as a work around but this is  torture.
    Any Ideas?
    thanks

    Thank you Rob for your help. The  leading property will add whatever space I require between lines. So  the response was helpful there. However it does not apply to the first line.I have worked around this by adding a  carriage return as the initial line of text. This is working for me

Maybe you are looking for

  • DELETE FROM Subquery Question

    When having to delete form a subquery (based on two unique identifiers) I concantenate the two columns to make them unique to an entry. Are there issues w/ this method and can any suggest something different (if any). delete from ACCT_TEMP a where up

  • Function module to start failed batch job

    Hi all, Any function module in ABAP to start the failed batch job run which i will use in a report. I am using SAP 4.7. Thanks Raj

  • 785GM-E65, 4 DIMM's

    Just read the stickies concerning memory.  A little background 1st. Got this mobo with a used system, came with PSD34G1333K, 2 x 2gb Patriot pc1333.  Worked fine.  Went to Fry's and got 2 x 2gb of TW3X4G1333C9A, Corsair pc1333.  Staff said it should

  • HT1848 apps wont install in my iphone because of outdated software what to do

    apps not installing because of outdated software

  • Color swatch strange behavior

    Hi, I'm working on a AE 5.5 project and try to use the color swatch panel to put in a color RGB R:5 , G: 16 , B: 103 to create a blue color. But what ever I try at the bottom of the panel appears a different color in HEX DEC and that's the color that