cancel
Showing results for 
Search instead for 
Did you mean: 

resize column dynamically on smartform depending on data

Former Member
0 Kudos

Hi,

How would you resize the column in smartforms dynamically? example if i have a text field, i don't want the whole char60 to be the fixed value of the column instead get the maximum size (probably looping the field using STRLEN to get which is maximum) then how would I resize the column of my table accordingly?

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi CZ,

Column size cannot be dynamic as it will affect the Layout of that form,

If it is so necessary, You can do one thing find the length of the variable using ABAP function STRLEN,

Create two templates one for small text and other for longer text use condition b/w them.

Code for finding length of the variable

data: len type i.

len = STRLEN(ls_mara-matnr).

This is my solution to your query, There might be other easier way too..

Rgds,

Hani

Former Member
0 Kudos

Hi C Z,

Column size can't be dynamic ,but we can create dynamic number of columns as the size is concerned it will fixed always.

Thanks,

Deb

Former Member
0 Kudos

Hi,

Thanks but can you explain a bit further? means when you create a dynamic column it will also have a dynamic size following the size of the longest text for example you mean?

Thanks.

Former Member
0 Kudos

hey debdas subudhi,

As you said Column size can't be dynamic ,but we can create dynamic number of columns as the size is concerned it will fixed always.

 

Can you tell me how to create dynamic number of columns.

Thanks & Regards

Former Member
0 Kudos

Hi,

Just create differnt table line with no of columns  and based on condition u can use the same.

Regards.

Former Member
0 Kudos

hey debdas Subudhi,

thanks for your response, but i still not able to understand. If I am not wrong you want to say that we have to create different line types without any column and in condition tab we have to specify condition for which all fields should be displayed.

Pls can you give an example.

Thanks & Regards

faiz khan