cancel
Showing results for 
Search instead for 
Did you mean: 

how to make 2 selection fields in one row

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

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 

Answers (5)

Answers (5)

Former Member
0 Kudos

Discussion moved from ABAP Development to Web Dynpro ABAP space.

Former Member
0 Kudos

Hi ,

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

Thanks&Regards.

ananth

amy_king
Active Contributor
0 Kudos

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

matteo_montalto
Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi matteo,

Thanks for your quick reply.Absolutly you  are right.but for my requirement i am using select_options(wdr_select_options).

So I am not able to get the idea.If you have the idea plz let me know.

Thanks&Regards,

ananth.

Former Member
0 Kudos

Hi Achari,

AFAIK we cannot align select options fields as per your reqiurement.

Thanks

KH

former_member217916
Participant
0 Kudos

Hi Anantha,

The select_options are visible as ViewContainerUIElement. These can be treated as per the example shown in the above posts.

You would need to add multiple elements and align them accordingly but you would have to bind the each select option to separate wdr_select_options component and view element.

Regards,

Karan

matteo_montalto
Contributor
0 Kudos

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.

harsha_jalakam
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

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

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