cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP WebDynpro, Interactive Form, and Repeating Subforms

jack_boers
Explorer
0 Kudos

Hi Everyone,

I have a very simple Interactive Form called from ABAP WebDynpro.

Main_View Context:

Node u2013 FORM.

Cardinality 1..1

Selection 0..1

Initialization Lead Selection u2013 X

Node u2013 SPFLI

Dictionary Structure - SPFLI

Cardinality 0..n

Selection 0..1

Initialization Lead Selection u2013 X

Attributes from SPFLI u2013 CARRID and CONNID

View contains an Interactive Form and a u201CSaveu201D button.

Form = Z_TABLE_TEST_FORM, Interface = Z_TABLE_TEST_INT u2013 created through forward navigation in Layout so uses XML interface.

Button u201CSaveu201D has the following code:

METHOD onactionsave.

DATA lo_nd_form TYPE REF TO if_wd_context_node.

DATA lo_nd_spfli TYPE REF TO if_wd_context_node.

DATA lo_el_spfli TYPE REF TO if_wd_context_element.

DATA ls_spfli TYPE wd_this->element_spfli.

DATA ls_element_set TYPE wdr_context_element_set.

lo_nd_form = wd_context->get_child_node( name = wd_this->wdctx_form ).

lo_nd_spfli = lo_nd_form->get_child_node( name = wd_this->wdctx_spfli ).

ls_element_set = lo_nd_spfli->get_elements( ).

IF lo_nd_spfli IS NOT INITIAL.

lo_el_spfli = lo_nd_spfli->get_element( ).

IF lo_el_spfli IS NOT INITIAL.

lo_el_spfli->get_static_attributes(

IMPORTING

static_attributes = ls_spfli ).

ENDIF.

ENDIF.

ENDMETHOD.

On the Interactive Form, u201CPage1u201D is a main page. u201CTableParentu201D is a SubForm, flowed layout, in accessibility tab set to u201CTableu201D, and is bound to u201C$record.SPFLIu201D.

u201CDATAu201D is a SubForm under "TableParent", Positioned layout, in accessibility tab set to u201CBody Rowu201D, and is bound to u201CDATA[*]u201D.

Carrid and Connid are both Text Fields bound to Carrid and Connid, under "DATA".

I also added the Insert/Remove/Reposition buttons, but deleted the two reposition buttons.

The idea was to be able to add 4-5 Carrid/Connid pairs.

When running this, as configured above, then none of the data entered in the form makes it through to the Elements. If the context is changed to make the Cardinality 1..n, then a single Element is added u2013 but not the remainder.

What needs to be done to get this to work?

Many thanks

Jack

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189058
Active Contributor
0 Kudos

Hi Jack,

What code have you written to add the elements in the form?

Reema.

jack_boers
Explorer
0 Kudos

Hi Reema,

None. For all other fields, they are bound to the context, so the transfer is automatic.

These repeating fields are also bound to the context, but it appears that an element needs to be created for every repeating form. How can this be done from the form?

Cheers

Jack

former_member189058
Active Contributor
0 Kudos

select the repeating subform

go to object palette

1. Subform Tab --> Is the subform flowed or positioned?

2. Binding Tab --> Have you checked the Repeat subform for each data item?