Dynamic table & More No of buttons addition to the form...

Hi Friends,
I have following issues with my form in webdynpro abap.
1. I have created a main node called ZKPS_TEST and under that I have included three nodes and two attributes.
    the three nodes are as follows:
TIME_DATA With cardinality 1..1 --> to upload a row
TIME_SHEET_DATA with cardinality 1..n --> Dynamic Internal table rows
TIME_COST_DATA with cardinality 1..n --> Dynamic Internal table rows.
I have created an interface and mapped to the form.
When I click on Insert Row Button i am getting a dump saying "Number of Elements of the Collection of Node MAIN.1.ZKPS_TEST Violates the Cardinality.". Please guide me how to solve this error.
2. I have to create three more buttons onto the form as follows:
   a. Save button to save the entered data
   b. Submit button to submit for approval.
   c. Total button to validate the total hrs entered on the form.
   As the submit action is already used for Insert Row button. How can i create these three buttons and where should write code for the same.
Please do the needful at the earliest.
Thanks in advance.
Regards,
Phani Shankar.K

HI Phani,
Try this one...
In ur form keep two buttons.. ADD and SUBMIT..
in the *ADD* button's javascript code add the following,
subformname.tablename.rowname.addInstance(1);
status.rawValue = "ADD";
in *SUBMIT* button's javascript code,
status.rawValue = "SUBMIT";
then, in ur *onactionsubmit*, add the following with ur code (hope u r following my previously posted code..
data:  lt_eban type wd_this->elements_table,
          wa_eban like line of lt_table.
* get single attribute
  lo_el_main->get_attribute(
    exporting
      name =  `STATUS`
    importing
      value = lv_status ).
call method lo_nd_table->get_static_attributes_table
   importing
     table = lt_table.
if lv_status = 'ADD'.
   append wa_table to lt_table.
   clear: wa_table.
call method lo_nd_table->bind_table
   exporting
     new_items = lt_table.
clear lv_status.
elseif lv_status = 'SUBMIT'.
lo_el_table = lo_nd_eban->get_element(  ).
loop at lt_el_table into lo_el_table.
   lo_el_table->get_static_attributes(
      importing
       static_attributes = ls_table ).
       append ls_table to lt_table.
endloop.
endif.
regards,
*Surya*

Similar Messages

  • Pressing escape button twice clearing the form

    Hello,
    I am using Jdeveloper 11.1.1.6 and noticed below issue only with IE browser
    - Developed a .jsff page fragment, created a taskflow and dragged taskflow onto the .jspx
    - Launched the form , and entered some attributes, by pressing twice 'Escape' button twice, clears the form
    Does any one have idea why form get's cleared by pressing twice button ? Appreciate your timely response
    Thanks in Advance.

    Thanks for your reply.
    The field values are getting clearing while swapping between the tabs.
    However, when i am hitting the button(first tab) "Get department Info" in the first tab the report is generated with the details..
    when i am going back to second tab and after comming back to the first tab, still i could see the report. i dont want the report to be visible when swapping between any tabs..
    Please help.

  • Nested Table: How to display formatted text in the form ?

    Hi,
    Scenario:
    I have a nested table, say TAB1, containing another table TAB2 which holds the formatted text.
    Sample data
    Entries in TAB1:
    Column1       Column2(TAB2)
    Text1         Data_from_tab2
    Text2         Data_from_tab2
    Text3         Data_from_tab2
    Requirement:
    The requirement is to display the data in TAB1 as it is maintained.
    Trials:
    I am aware of the fact that we can transfer the content of the nested table (in this scenario, TAB2) in another table(of type TLINE) defined as a global variable in the interface of the form. Then in the context area, we can define a 'TEXT' node and bind it to the table and choose the 'Dynamic text' for the 'text type' attribute and maintain the other atrributes.
    But this approach cannot solve the issue as it is a nested table.
    Kindly suggest how can I resolve this issue.
    Regards
    s@k

    Hi,
    if its like colum1, column2 (tab2).
    you can represent column2 as a nested table in the form. and put these tables structure intoa subform of type flowed.
    then you can have the required format.
    the same can also be acheived using nested subforms instead of tables.
    example of such scenario is PO & line items.
    po number1 , items 1
                          item 2
                          item 3
    po number2 , items 1
                          item 2
                          item 3
    hope this helps you.
    Cheers,
    Sai

  • How do I make a submit button that sends the form to an email address?

    I can see how to link to an email which then opens up an email someone could attach the form to. But I do not see how to make a button that automatically sends the form to an email address. Can someone provide assistance? Thanks!

    I have the same question. You'd thing this would be a no brainer requirement for a form.

  • Floating Button Panel on the form

    Hi,
    I want to design a FLOATING Panel for the action buttons on the form. So if i scroll form up or down ,The panel should float on different pages but at the bottom of the page.
    I am designing above action buttons: Panel so that user sees these functionalities on every page at the bottom where he scrolls.
    Please let me know your ideas how do i do it.
    Please let me knw if I could explain my requirement clearly.
    Regards
    Sunil

    OK. I have a working example that you can find here:
    http://www.fieldeffecttechnologies.com/AdobeForums/FloatingSubform.pdf
    Here is the code I put in the docReady event of the Main subform (any object will do):
    global.timer = app.setInterval(
    "var curView = eval(this.viewState.toSource());"+
    "yPos=curView.pageViewY>=0 ? (curView.pageViewY+4)*.655/curView.pageViewZoom:0;"+
    "xfa.form.form1.pageSet.Page1.all.item(curView.pageViewPageNum).Buttons.y = yPos+\"pt\";",1000);//Change the refresh rate here (in milliseconds)
    Every second the above code determines where the top of the form view is and based on the zoom, it determines the y coordinate for the 'floating' object to move. The .655 constant is what I've determined to be the relationship between the pageViewY's units and point units.
    The object that this code is moving is a subform with buttons that is on masterpage Page1.
    This particular code keeps the buttons at the top. It would take a little while longer to keep them at the bottom, since you'd really have to account for zoom and the page size. Probably getting the media box quads relative to the application window (haven't looked too far into it).
    Also, there is a stop button to stop the timer with the same code in the docClose event of the Main subform:
    app.clearInterval(global.timer);
    delete global.timer;
    Of course the annoying part is having the hourglass appear every once and awhile but unless the event model is updated in future releases to include scrolling, this is how it has to be done.
    Hope this helps you and others. I had fun figuring it out.
    Kyle

  • How to create a submit by email button that emails the FORM AND DATA

    I have Adobe Acrobat Pro 8.  I've created a fillable form that can be fillable and saved in Adobe reader.  How do I add a submit by email button that will send me the form with the data?  Right now I am only getting the data.  I need the form with the data.
    Thank you in advance, Rob

    When you set up a submit form action, you have the option of choosing the form data (FDF, XFDF, HTML) or the complete PDF. Choose the latter. For this to work with Reader (prior to 11), the document has to be Reader-enabled, which you do by selecting: Advanced > Enable Usage Rights in Adobe Reader

  • Disabling submit button after resetting the form.

    Hi. I'm new to JSF/Richfaces and there's something I'd like to do that I just can't figure out.
    Currently, I have a form with various fields to be edited, and the standard Submit and Reset buttons. The Submit button is disabled until a user changes a value on the form, and then I enable it using an A4J event. My problem is that I would like to disable the submit button again if the user clicks Reset. I'd like this to be completely client-side if possible, which I understand would require some javascript to implement, but I haven't been able to come up with a solution that works. Does anyone know how I could do this (with an example, preferably)?
    It's a pretty simple scenario, but here's the button code anyway:
    <h:commandButton id="submitButton" value="Submit" action="#{dataBean.submitForm}"
      disabled="#{! dataBean.pageEdited}" />
    <h:commandButton value="Reset" type="reset">
      <a4j:support event="onmouseup" reRender="submitButton" />
    </h:commandButton>

    I see, thanks! I looked up another example on using the DOM (I told you I was new!) and created the following javascript function, and it worked perfectly. I like that it automatically re-renders the button too so I don't need an A4J event.
    function disableSubmitOnReset(){
      document.getElementById('main_form:submitButton').disabled = true;
    }Definitely as simple as I figured it would be. :P

  • How to disable a button once submit the form?

    Hi guys,
    I need to disable the button instantly once user submit their registration. Should I implement this using actionListener and ActionEvent? Pls help, Thanks !
    regards,
    kmthien

    Speaking about the client-side, you can use cookies to stop the submission.
    This is a simplest, but not too much intelligent example:
    <script language="javascript">
             function preventDoubleSubmit() {
                  if (document.cookie.indexOf('submitted')> -1)
                       return false;
                     document.cookie="submitted=yes";
    </script>Note, that clicking the Refresh (or Back/Forward buttons) user has no more chance to receive the next page in the normal page flow.
    Probably, the server-side way is more suitable for this situation. Search for 'postBack' on this forum. As I remember, it was a discussion here recently.

  • Refresh dynamic table

    I have a dynamic table displayed on my page and a form which adds records to the table displayed in the dynamic table. Is there a way to refresh the contents of the dynamic table after adding a new record from the form so it is displayed there?  I'm familiar with the page refresh header but that can cause a conflict with the form if I'm in it during the refresh cycle. Thanks, Michael

    Can you explain the workflow a little more. Is the update form and table on the same page. Are you looking to have the table refresh when another user updates the data?

  • Using a reset button for a dynamic table

    I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that I want the reset button to clear specific rows of the table, but reset whatever is typed in the row for every instance in the table. The reset button only clears the row I want in the first column, not all the other columns/instances. Has anyone done this before or have any suggestions?
    I don't want to include the whole script for the reset button because it has about 100 fields to clear but essentially this is what I have for the dynamic table and it works but only for the first column/instance, the rest stay the same:
    xfa.host.resetData("form1.Page1.Subform1.Table1.Row5.Textbox1.somExpression");

    Hi,
    I’m not sure I understand your exact scenario but I use a function in a script object that I pass in a subform (possibly the top subform to reset the whole form) and the function resets all fields within it. 
    function resetData(node)
        if (node.className === "field")
            var enableResetData = node.desc.nodes.namedItem("enableResetData");
            if (enableResetData === null || enableResetData.value === true)
                // reset all fields except those with enableResetData set to false
                node.rawValue = null;
        else
            for (var i = 0; i < node.nodes.length; i++)
                var currentNode = node.nodes.item(i);
                if (currentNode.isContainer)
                    // ignore some form objects
                    if (currentNode.className !== "draw" &&
                        currentNode.className !== "variables")
                        resetData(currentNode);
    If there are any fields that I don’t want reset I put the following code in the initialise event of those fields.  Depending on the number of fields involved you might what to reverse this logic.  (you could also add the desc.enableResetData element in the XML Source view)
    var enableResetData = this.desc.nodes.namedItem("enableResetData");
    if (enableResetData == null)
        enableResetData = xfa.form.createNode("boolean", "enableResetData");
        this.desc.nodes.append(enableResetData);
    enableResetData.value = true;
    This works by storing a value “enableResetData” in the desc element of the field, allowing a generic function to have specific behaviour for particular fields.
    Hope this helps.
    Bruce

  • Error while creating dynamic Table

    Hi All,
    I have a node 'SEG' with 3 attributes, ATTR1.2.3, I am tring to crate dynamic table using this context node. Initialy i am displaying view with button, when click on this button i want to create table dynamically.. if click again one more table i have to create.. its giving dump... here is the code... How to do this???
    data: wd_node_info type ref to if_wd_context_node_info,
            wd_node type ref to if_wd_context_node,
            lr_container type ref to cl_wd_uielement_container,
            lv_tablename type string,
            lt_db_data type ref to data,
            lr_table type ref to cl_wd_table.
      field-symbols: <lt_data> type any table.
      wd_node_info = wd_context->get_node_info( ).
      wd_node = wd_context->get_child_node( name = 'SEG' ).
    lr_container ?= view->get_root_element( ).
      cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
    " Creating internal table with the same structure as our dynamic
      context node
      CALL METHOD CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE
        EXPORTING
          UI_PARENT = lr_container
          TABLE_ID  = 'MY_TABLE'
          NODE      = wd_node
        RECEIVING
          TABLE     = lr_table.
      cl_wd_matrix_data=>new_matrix_data( element = lr_table ).
      lr_table->bind_data_source( path = 'SEG' ).
    Thanks'
    Madhan.

    Hi Sarbjeet,
    The code is working fine, when i use in wddomodify view method without button click on first time.( I checked this by creating another component). But I am creating dynamic table when click on button(view contains one button initially), for this i created two attributes FLAG OF TYPE wdy_boolean and count of type int1. and in button action i write this code :
      DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_flag LIKE ls_context-flag.
      get element via lead selection
        lo_el_context = wd_context->get_element( ).
      get single attribute
        lo_el_context->set_attribute(
            name =  `FLAG`
            value = abap_true ).
      DATA lv_count LIKE ls_context-count.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    lv_count = lv_count + 1.
    lo_el_context->set_attribute(
        EXPORTING
          name =  `COUNT`
          value = lv_count ).
    and in wddomodify view method following code..
    Method WDDOMODIFYVIEW
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_flag LIKE ls_context-flag.
      get element via lead selection
        lo_el_context = wd_context->get_element(  ).
      get single attribute
        lo_el_context->get_attribute(
          EXPORTING
            name =  `FLAG`
          IMPORTING
            value = lv_flag ).
      DATA lv_count LIKE ls_context-count.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    if lv_flag = abap_true. ......
    Remaining code same post previously************8
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->set_attribute(
        EXPORTING
          name =  `FLAG`
          value = abap_false ).
    endif.
    endmethod...
    I created like this i am not getting other UI elements(input, ddbykey,button).
    And if i click view button again it going to dump..
    Thanks,
    Madhan.

  • Sum for Dynamic Fields in a Dynamic Table with Field Symbol

    Hi All,
    I currently have an report which I am looking to update with some totals.  The information is currently output in an ALV which is fed data from a dynamic table defined with a field symbol.  The modification that needs to be applied is a summation per currency code where each of the fields to be summed is a dynamically named field at runtime.  I am now just looking to see if anyone has any recommendations on how to obtain these totals it would be appreciated.  I have no problem doing the leg work in piecing the solution together but am just stuck on which approach I should be investigating here.  I have looked into several options but do to the fact that the totals are for dynamic fields in a dynamic table and it is a field symbol I am having some difficulties thinking of the easiest approach to obtain these totals.
    Below is a simple sample of what the report currently looks like and what we are looking to add.
    ====================================================================================
    As-Is Report:
    DETAILED DATA ALV
    Company Code  |  Plant  |  2006 Total  |  2007 Total  |  2008 Total |  CURRENCY
    0001          |   ABCD  |    1,500     |    1,200     |    1,700    |    USD
    0001          |   BCDE   |    2,300     |    4,100     |    3,600    |    GBP
    0003          |   DBCA  |    3,200     |    1,600     |    6,200    |    USD
    Addition 1:
    TOTALS PER CURRENCY
    Currency                |  2006 Total  |  2007 Total  |  2008 Total |
    USD              |    4,700     |    2,800     |    7,900    |
    GBP                       |    2,300     |    4,100     |    3,600    |
    Addition 2:
    CONVERSIONS TO USD
                                          |  2006 Curr   |  2006 USD    |  2008 Curr   |  2006 USD   |
    USD                       |  4,700 USD   |  4,700 USD   |  7,900 USD  |  7,900 USD  |
    GBP   (1.5GBP/1 USD)    |  2,300 GBP   |  1,150 USD   |  2,300 GBP  |  1,800 USD  |
    ====================================================================================
    Any recommendations will be appreciated.

    Hi,
    We cannot use the key word SUM in the loop at assigning statement.
    The way i see is
    When  you are creating the first dynamic internal table , create one more with  the structure below:
    Currency | 2006 Total | 2007 Total | 2008 Total |
    Then while populating the data into first itab,also move the contents to the second itab using collect statement.

  • Repeating dynamic table data in another table in the same document

    Greetings one and all:
    I created a dynamic table (for input) at the beginning of my form.
    I created a dynamic table (for display and printing) later in the same form.
    I wish to populate the second dynamic table with the contents of the first dynamic table.
    I created a button in the first table which adds rows in both tables.
    But I cannot get the second table to populate more than two instances from the first table. Any row after two just copies the contents of the second row.
    Your help will be greatly appreciated.
    Best,
    Steven
    Oregon

    Hi,
    I have an example here that does just that: http://assure.ly/eTOXaH
    Niall

  • Questions on: 1) Last Update; 2) Max String Length; 3) dynamic table keys

    Hi:
    - I am currently prototyping a plug-in but I have some questions:
    - 1) At the 'All Metrics' table, what is the intent of the 'Last Upload' field,
    and how is this field updated?
    - I have created some metrics but for some metrics the 'Last Upload' field
    has a timestamp but for other metrics there is no data.
    As far as I know, the metrics are similar but I do not know why the behaviour is different.
    - 2) Is there a maximum string length that the Oracle agent can accept?
    - I have a script which just returns all the environment variables into one cell.
    In emagent.trc, the Oracle agent issues the following warning:
    2009-08-27 12:38:47 Thread-76336 WARN upload: Truncating value of "STRING_VALUE" from "AGENT_HOME=
    - Is the truncation an issue?
    - 3) I have created some dynamic tables from performing an snmp walk, but the key that I use
    is the index of the SNMP table. The data is collected correctly, but I am not sure that using
    the table index as the key for OEM is a good idea because the metrics are stored according to the SNMP table index.
    Should the OEM key be the something like 'object name' instead of the index number from performing an SNMP walk ?
    For example, when I click a metric, the metric name is: Sensor Index 1.
    But should it not be something like 'Fan #1' ?
    Thanks John

    Metrics are collected at certain intervals, the Last Upload field indicates the date and time of the last time a metric collection was uploaded. The quicker the interval, the more recent that date should be. If you don't specify a CollectionItem in your default collection file for your metrics, they won't be collected or uploaded.
    If your metric column is a STRING type, it is stored in a VARCHAR2(4000)
    I'm not sure I understand your last problem... You have a table metric with a set of columns. The column you use as the key is just some tracking index which doesn't really mean anything. As long as your key column(s) make the row unique, the agent will be satisfied. If you want something more meaningful as your key, then it's something you will have to inject into your dataset if it isn't already there.

  • DYNAMIC TABLE IN WEBDYNPRO INTERACTIVE FORM

    Hi,
      I am using dynamic table in interactive form(webdynpro java).  In that form i bind node for to populate the details for the table. The details should be come from RFC.
    The RFC contains more than one record. While i tried to populate all the records to the dynamic table i cant able to got all the datas. I got only one record to the table.
        Interactive Form table node structure is:
                Node                                          Cardinality                             Singleton
    vnPDFDataSource                                    1..1                                         true
            chnTableList                                     1..1                                         true
                           chnTableRow                     0..n                                         true
                                   chnRowData              1..n                                        false
                                             attr-1
                                               attr-2
                                                attr-n
    o   The nodes bound to table and row in Adobe form are:
    chnTableList u2013 bound to Table
    chnTableRow u2013 bound to Row   
    If anybody know means let me tell how to solve the problem.
    Thanks,
    Senthil prabhu

    Hi,
    To add a row in dynamic table in interactive form How to create dynamic table in the interactive form
    also check page 11-13 in this docuemnt https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63f09fc2-0401-0010-1482-dbf9891e7613
    after adding it you can send the table data to rfc asusal Problems while setting Multiple Rows of data as Table Parameter to the RFC
    give a lot at this too want to save data
    regards,
    Pradeep

Maybe you are looking for

  • I have to send the start impulse from labview to trigger generator?

    i have to send a start impulse to the trigger generator, logging the actual time and requesting the actual time code of Digital video recorder.

  • PO Status in iProc

    Hi all, I would like to know if it is possible for the requestor to only see the PO number in iProc 11.5.10 whenever the PO is approved and not before approved status. Thanks, Leonie

  • Can I change the fstab file?

    I just realied my swap space was not being utilized. So I checked fstab and it has the teh devices /dev/sda1 and /dev/sda2. Now when I was installing Arch, I had unplugged all other windows hard drives, which explains the /dev/sda. Now can I manually

  • Escape Latin Characters

    I need to escape latin characters in an xml doc. Example: "é" is escaped to "&#233;". I thought I could use the ASCII function, but SELECT ASCII('é') FROM DUAL in Oracle gives me 50089. I coded this as a quick fix, but I'm sure there's a better way.

  • Cannot recover Portege R100

    I have some problems with my Portege R100. The HDD was damaged so I bought another one, this one being already formatted . I also have two CD-drives: 1. PCMCIA Card drive Toshiba PX1055E-1NST 2. USB drive Toshiba PA3352U-1CD2 My problem is that the r