Skip to Content

Dynamic Selection screen with checkbox on WebDynpro View

Hi Experts,

I have a requirement to design a selection screen as below.

I have used ViewContainerUIElement element named 'VIEW_CONTAINER'.

Created Dynamic Selection screen using component WDR_SELECT_OPTIONS inside WDDOINIT method under my main view. Used flow layout for my design.

Then trying to create Labels with check box as given above dynamically inside WDDOMODIFYVIEW method. But not able to align the elements as per requirement.

I have created check boxes. but not able to bring it under my dynamic selection parameter (as shown below).

I have to take container w.r.t ROOTUIELEMENTCONTAINER.

If i am taking VIEW_CONTAINER as reference, it is giving error for add_child method as it is not available in cl_wd_view_container_uielement.

Data lr_container TYPE REF TO cl_wd_uielement_container.

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lr_container->add_child(
        EXPORTING
          index     = sy-tabix
          the_child = lr_check_box

Taken reference from below threads.

https://archive.sap.com/discussions/thread/630107

https://archive.sap.com/discussions/thread/3246709

Please help on this.

Thanks in advance,

Manoj

untitled.png (6.1 kB)
capture.png (8.7 kB)
allign.png (5.0 kB)
allign.png (5.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 25, 2017 at 12:51 PM

    You could create the checkboxes dynamically with your WDR_SELECT_OPTIONS. Probably easier. Or create another usage for WDR_SELECT_OPTIONS, and add the checkboxes as parameters within that.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 25, 2017 at 04:56 PM

    Hello Matthew,

    Now i am able to design my selection screen as below.

    Now struggling with making check box side by side having caption.

    I have created a transparent container to align checkbox.

    Thanks,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 28, 2017 at 08:29 AM

    Hi Manoj,

    What I see is the missing Layout Info. Before you 'add_child' apply layout to the ui element.

    cl_wd_matrix_data=>new_matrix_data( element = lr_check_box ). " Add Matrix Head data OR Matrix data based on where the ui is required.

    And instead of adding directly the UI at index place. Create a Transparent Container / Group UI and insert the check boxes within the Transparent container to have the Title for each section.

    Hope this helps,

    Regards,

    Kiran

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Manoj,

      With Select options, it's always matrix head data (new row); There is no provision to control the layout with the standard select options component. You will have to follow your initial approach(custom transparent container) and start adding the ui fields dynamically with the Layout data taken into account while adding the dynamic fields.

      Standard select options (always new row) -> for your reference.

      Hope this helps,

      Regards,

      Kiran

      std-sel-opt.jpg (51.5 kB)