cancel
Showing results for 
Search instead for 
Did you mean: 

How to auto align fields on View in SAP ABAP Webdynpro?

vimal
Active Participant
0 Kudos

If i have set Invisible an input field,i want rest of the fields to cover the space created due to invisibility of that field.

How can we achieve this ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

If you use Flow layout it will automatically aligns in the empty space caused by invisible UI.

OR even in the Matrix layout if all the UI elements are Matrix data without line break( Matrix head data) and the same with Row Layout as well.

Regards,

Kiran

vimal
Active Participant
0 Kudos

Hi Kiran,

Thanks for the promp reply.

But i want to achieve following layout  :

   1              2                3          4

<Label> <Input Field> <Label> <Input field>

<Label> <Input Field> <Label>  <Input field>

There is one label and one related input field and thus in one row there are 4 columns,So if i hide one label and input element the next one should take it's position.

Former Member
0 Kudos

Try with Grid layout.

former_member184578
Active Contributor
0 Kudos

Hi,

So if i hide one label and input element the next one should take it's position.

If you hide one label and one input the next will not take that position as there are total 4 columns. but if you make the four columns in the first row hidden then the 2nd row will automatically takes the first row position.

So to achieve your requirement, you have to do it programatically:

In your case, say you first hide the label and input of first row and column 1,2. then you have to make the column 3 as Matrix Head data. this makes it to occupy the first row column 1,2

Similarily, if you make first row column 3,4 hidden, ten you have to make 2nd row column 1 as matrix data. and column 3 as matrix head data.

In simple, if you make a label and input hidden; you have to reverse the layout data of next UI elements( if it is matrix data change to matrix head data; if its is matrix head data change to matrix data)

Note that the above logic works for 2X2 matrix; if it is more columns you have to change it accordingly.

Hope you understand!

Regards,

Kiran

former_member184578
Active Contributor
0 Kudos

Hi chandra, It will be the same case with Grid as well!

vimal
Active Participant
0 Kudos

So how can we change the layout of an element dynamically ?

vimal
Active Participant
0 Kudos

Is there any more easy way to do it?

Former Member
0 Kudos

As Kiran suggested you can do it dynamically but I think that it's better insert the labels and input fields dynamically instead manage the layout. Based on your logic you set the labels and input fields so you won't face layout problems.

Regards,

Felipe

former_member184578
Active Contributor
0 Kudos

Hi,

Yes. Check this document:

Hope this helps u,

Regards,

Kiran

ramakrishnappa
Active Contributor
0 Kudos

Hi Vimal,

I have created a document to hide/show a view field and it works for all kind of layout data, also you can repeatedly hide or make the field visible again.

Please refer the below document.

Hope this resolves your issue

Regards,

Rama

Answers (0)