cancel
Showing results for 
Search instead for 
Did you mean: 

Interactive form in WD4A - dynamic table - adding rows

Former Member
0 Kudos

Hi,

I have a problem with dynamic table in WD4A. User can add row to table by clicking a button on form, but added rows are not transfered to mapped context node in my web dynpro application. I have made a lot of searches on SDN and I have found a lots of threads, but no answer.

Maybe this should be a way:

https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9121. [original link is broken] [original link is broken] [original link is broken] - Read adobe data manually and create context element manualy too.. But I think this should be a part of webdynpro/interactive forms framework.

Thanks for any answer!

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>But I think this should be a part of webdynpro/interactive forms framework.

I'm sorrry, but that simply isn't the case. You can't create new elements from within the form itself. You have to trigger the event back on the server and add the context element there first.

Former Member
0 Kudos

Hi, many thanks for your answer, so what do you think is the best solution for adding rows by user to interactive form's dynamic table?

Manually read xml data during submit by this way: https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9121. [original link is broken] [original link is broken] [original link is broken] ?

Or is there better solution for this? (any link to some examples, blogs, etc...)

Many thanks for any answer!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No I don't think reading the XML manually is the best approach. My favored approach would be to place a button on the form that triggers the submit event of the interactiveForm and in this event handler you add the row to the context. This is assuming that the form itself is too large. You do have to rebuild the form data after each event. Only if the form is too large and this becomes a performance problem should you consider the XML manual parsing approach.

Former Member
0 Kudos

Many thanks for solution!

Former Member
0 Kudos

Can I have another question?

How can I distinguish between classic "Submit to SAP" button and my new "Add row to table Submit button" in method ONACTIONPROCESS_SUBMIT of Interactive form? I need both of course (first for sending data to SAP, second for adding row to table in interactive form).

Many thanks for answer!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You will have to test. I was thinking that the ID of the button in the form used to get passed into the event handler. There used to be few sentences in the OSS note 1098009 that talked about this workaround, but it has been changed and now only reads:

Web Dynpro ABAP does NOT support dynamic tables in forms.

I wonder if there was some problem and the event ID was removed. If this is the case then you might have to resort to parsing the XML yourself. You may not have any other choice now.

Former Member
0 Kudos

Hi, I have taken a look at WDEVENT during ON_SUBMIT, but WDEVENT has only 3 "parameters":

NAME - is set 'ON_SUBMIT' (name of event)

and in PARAMETERS structure:

ID - 'INTERACIVE_FORM'

CONTEXT_ELEMENT - initial.

So I can't distinguish between 'Submit data to SAP button' and 'Add row to table button'. I have to use xml parsing

Former Member
0 Kudos

Hi Jiri,

You can take a context attribute (string) in your form context, and for your buttons in the form, in click event set the value. like

STATUS.rawValue = "1";

And in your submit event read this context attribute and you can use CASE like when 1 , when 2 etc and you can execute your code accordingly.

it should solve your problem.

Regards,

Ravi.D

Answers (0)