Skip to Content
0
Jul 28, 2010 at 12:26 AM

How to declare multiple line items

26 Views

Hi all,

I am aworking on a web dynpro application and the screen that Ihave created will have both header data and line item data, to let user enter multiple line items I have written the following logic in the method WDDOINIT of the main view:

DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.

  DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
  DATA ls_t_bseg TYPE wd_this->Element_t_bseg.
  DATA ls_t_bseg2 TYPE wd_this->Elements_t_bseg.

* navigate from <CONTEXT> to <T_BSEG> via lead selection
  lo_nd_t_bseg = wd_context->path_get_node( path = `PRELIMINARY_POSTING.CHANGING.T_BSEG` ).

DO 10 TIMES.
    APPEND INITIAL LINE TO ls_t_bseg2.
  ENDDO.

  CALL METHOD lo_nd_t_bseg->bind_table
    EXPORTING
      new_items            = ls_t_bseg2

but right now I have card coded the value upto only ten line items but I want it to be declare dynamacially, for example if user enters 2 line items then only two line items should be available and if he decides to enter more than 10 then that functionality sould also be there.

Can you please help me in this.

Thanks,

Rajat