Skip to Content
avatar image
Former Member

how to make 2 selection fields in one row

hi experts,

Iam new to webdynpro abap. I have doubt in webdynpro abap.I am creating selection screen in webdynpro abap.In this screen i am having 4 selection screen fields.but my reqirement is first two selection screen fields would be in first row.how to achieve this reqirement.plz let me know the solution.

Thanks&Regards

ananth.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Jan 20, 2015 at 01:25 PM

    Hi Ananth,

    The ADD_SELECTION_FIELD and ADD_PARAMETER_FIELD methods of interface IF_WD_SELECT_OPTIONS don't include an option to layout the fields horizontally-- each method call creates the field on a new line.

    However, you can still achieve your requirement with a little layout magic. Create two separate ViewContainerUIElement containers on your view and place these side-by-side. Then create two separate WDR_SELECT_OPTIONS component usages and add one to each of these containers-- let's call the component usages SELOPT_LEFT and SELOPT_RIGHT. Then create some select-options fields in SELOPT_LEFT and other select-options fields in SELOPT_RIGHT.

    Cheers,

    Amy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 19, 2015 at 12:24 PM

    Hi,

    As you mentioned it as WEBDYNPRO ABAP, try to post your requirement in this community Web Dynpro ABAP

    Any how check below for solution.

    You can go for Matrix or Grid layout to achive your requirement. Check the below snapshot for reference where i've taken two i/p fields namely user name 1 and user name2 and i had set the layout of the transperant container as grid layout with col count = 4.

    Hope this helps you.

    Thanks

    KH


    Capture.JPG (58.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 19, 2015 at 12:40 PM

    Hi Anantha,

    As suggested by KH, please set the Layout type as Row/ Matrix Layout for the ROOTUIELEMENTCONTAINER. And if you want to make the UI element to begin in a new line, set the corresponding UI 's layout data as Row Head data/Matrix head data.

    Please check the following document which helps you in understanding the layout types in WebDynpro ABAP.

    http://scn.sap.com/docs/DOC-28829

    Regards,

    Harsha

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 20, 2015 at 09:44 AM

    Hi Anantha,

    all the solutions provided above should apply; I'd suggest to start from the document linked by Harsha in order to have a better, clear idea on how layout types work in Abap WD.

    As per your requirement, an "easy" and quick way to design a WD layout could be as follows:

    - define a "root" container, using MatrixLayout;

    - define each element which you need to be in the first "column" as MatrixHeadData, while following fields on the same row should adopt MatrixData instead.

    Quick example: working on 4 different fields, A B C and D. The root container has the property "Layout" set as MatrixLayout.

    Setting the property LayoutData for the fields as follows:

    A -> MatrixHeadData

    B -> MatrixData

    C -> MatrixHeadData
    D -> MatrixData

    leads to the following output:

    A B

    C D

    Hope that helps,

    M.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi achari,

      if you are using wdr_select_options components, then you should have a ViewContainerUIElement where your field are placed.

      You can then proceed as follows:

      Let's say that you have 4 selection fields in your view, call them A, B, C, D.

      Create 4 different TransparentContainer elements: the layout of the root should be MatrixData, and the root will contain the 4 transparentContainer.
      In each TransparentContainer, add your ViewContainerUIElement.

      So basically the tree should be as follows:
      ROOTUIELEMENTCONTAINER

      -> TC_1

      --> ViewContainerUIElement (which is used for A)

      -> TC_2

      --> ViewContainerUIElement (which is used for B)

      -> TC_3

      --> ViewContainerUIElement (which is used for C)

      -> TC_4

      --> ViewContainerUIElement (which is used for D)

      Now you can work on the LAYOUT DATA property of each TC, with the following rules:
      MatrixHeadData -> the element is shown in the first "column" of your view;

      MatrixData -> the element is shown in the column that follows the previous element.

      With respect to my previous example:

      TC_1-> MatrixHeadData

      TC_2 -> MatrixData

      TC_3 -> MatrixHeadData
      TC_4 -> MatrixData

      leads to the following output:

      A B

      C D

      Hope that helps,

      M.

  • avatar image
    Former Member
    Jan 20, 2015 at 01:35 PM

    Hi ,

    It is working now.Thanks for your reply.Is there any alternative way to achieve this requirement.

    Thanks&Regards.

    ananth

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Ananth,

      Please mark your question as answered so members know it no longer needs a response. If posters here helped you to resolve your requirement, please mark their posts as either Helpful or Correct as appropriate.

      Cheers,

      Amy

  • avatar image
    Former Member
    Jan 20, 2015 at 03:04 PM

    Discussion moved from ABAP Development to Web Dynpro ABAP space.

    Add comment
    10|10000 characters needed characters exceeded