Skip to Content
author's profile photo Former Member
Former Member

How to get values to WebDynpro ABAP from dynamic table?

Hi All,

I have created dynamic table in the interactive form which initially have 7 rows and user may add or delete rows up to 30 rows. I have 2 problems..

1. When i enter data in that dynamic table in the first row, the same data is repeating in the all the rows. What to do for not repeating data in table?

2. After filling the table user enters submit button, how to get the table data back to SAP. I have created node with Cardinality 1..1 and Selection 0..1, using get_static_attributes i get only one row data. How to get all rows data?

I have searched in SDN, but couldn't find solution, Please give me a solution or any related threads will be helpful.

Adobe LiveCycle Designer 7.1

WebDynpro for ABAP.

--

MK

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Aug 10, 2009 at 06:50 AM

    Hi,

    for your second issue, set the cardinality as 0..n and then try to read values using get_static_attributes. and before this you need to fill the context node which you will set the cardinality as 0..n which in turn reacts as table with empty rows.

    i.e. in wdinit method of webdynpro, append initial rows to this context node and how many initial rows you will append that many rows you can read from the filled table in adobe form.

    i.e. if you fill 7 initial rows then you can read only 7 rows from adobe form filled table even if you add 10 rows in adobe form table.

    Thanks,

    Madhu.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 10:59 AM

    Hi Mohan,

    1. When i enter data in that dynamic table in the first row, the same data is repeating in the all the rows. What to do for not repeating data in table?

    Make sure you have taken the type for the table in the interface of the form as Table type.

    2. After filling the table user enters submit button, how to get the table data back to SAP. I have created node with Cardinality 1..1 and Selection 0..1, using get_static_attributes i get only one row data. How to get all rows data?

    Use the method Get_static_attributes_table to get all the rows filled by the user at run time. Make sure that when the user adds or deletes a row in the PDF table, the same is also reflected back in your WD context. So, with every addition or deletion of a row, make simillar changes in your WD context.

    Regards,

    Runal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2009 at 02:51 PM

    Mohan,

    Have a look at below links for some help:-

    [Adobe Interactive Form - Read A Table Manually WDA|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9121] [original link is broken] [original link is broken] [original link is broken];

    Chintan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member MadhuSudhan Kadagoni

      Hi Madhu,

      I tried creating your way, but still not working. Check the below code which i am using.

      EXP -- Parent Node - (Cardinality 1..n, Selection 1..n, Initialization Lead Selection 'FALSE', Singleton 'TRUE')

      ADOBE_EXP -- Child Node - (Cardinality 0..n, Selection 0..n, Initialization Lead Selection 'FALSE', Singleton 'FALSE')

      Col1(Attribute)

      Col2(Attribute)

      Col3(Attribute)

      Col4(Attribute)

      Mapped attributes on PDF document from DATAVIEW.

        DATA lo_nd_exp TYPE REF TO if_wd_context_node.
      
        DATA lo_nd_adobe_exp TYPE REF TO if_wd_context_node.
        DATA lo_el_adobe_exp TYPE REF TO if_wd_context_element.
        DATA ls_adobe_exp1 TYPE STANDARD TABLE OF IF_MAIN=>element_adobe_exp INITIAL SIZE 0.
      
      * navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
        lo_nd_exp = wd_context->get_child_node( name = IF_MAIN=>wdctx_exp ).
      
      * navigate from <ADOBE_DATA> to <ITEM> via lead selection
        lo_nd_adobe_exp = lo_nd_exp->get_child_node( name = IF_MAIN=>wdctx_adobe_exp ).
      
      * get element via lead selection
        lo_el_adobe_exp = lo_nd_adobe_exp->get_element(  ).
      
      * get all declared attributes
       lo_nd_adobe_exp->get_static_attributes_table(
          IMPORTING
            table = ls_adobe_exp1 ).
      

      Debugging Values:

      LO_ND_EXP

      LO_ND_ADOBE_EXP

      LO_EL_ADOBE_EXP

      LO_ND_ADOBE_EXP is not filling up for some reason, and it is failing at this position giving error "Access via 'NULL' object reference not possible"

       * get element via lead selection
        lo_el_adobe_exp = lo_nd_adobe_exp->get_element(  ).
      

      Let me know if i need to add anything else to this code.

      --

      MK

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 09:35 AM

    Hi,

    To get the Table in the Adobe Form to webdynpro

    In WebDynpro Context, Create a main node named "MAIN" with cardinality default cardinality as specified by system(mostly it is 0..1 or 1..1 I dont remember, but not 1..n or 0..n) and create another node like LT_TABLE in MAIN node with cardinality 0..n and in this node create attributes FIELD1 and FIELD2 and so on.

    ( Specify the Event "Submit" for the Interactive Form in the Layout. )

    Now goto method "ONSUBMITACTION" and in that method using code wizard read the node A1.

    And use the below code snippet sample in your program, i.e. code this under respective method of the webdynpro.

    
    *Declare the TYPES 
     TYPES : BEGIN OF TY_TABLE,
     FIELD1 TYPE CONTEXT_TABLE_COLUMN_TYPE,
     FIELD2 TYPE CONTEXT_TABLE_COLUMN_TYPE,
     END OF TY_TABLE.
     
    *Define Internal Table and work area.
     DATA : IT_TABLE TYPE STANDARD TABLE OF TY_TABLE INITIAL SIZE 0.
     
    *Context Navigation 
    *READ NODE LT_TABLE USING CODE WIZARD
     
    * get all declared attributes
     lo_nd_lt_table->get_static_attributes_table(
        IMPORTING
          table = IT_TABLE ).
    
    

    Regards

    Pradeep Goli

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.