Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic coloring in smartforms

Former Member
0 Likes
1,181

Hi Experts,

Actually I got a requirement for dynamic background coloring in smartforms based on some conditions.(e.g Suppose you want to display the sales order details with the sales order value and you want to highlight those record in smartforms  whose sales order value is greater than 10,000(suppose)). So how I will achieve this task.

Thanking you all.

4 REPLIES 4
Read only

Former Member
0 Likes
839

Hi Binod,

Yes, it is very much possible. Please see that for this, you need to have a additional structure ( complex structure) in your data internal table. Now you need to fill this structure for each row depending on the condition. Please see demo code for putting hyperlink depdning on the condition. you can modify the code and enahnce it.

please define one element in your data table structure which is of type " lvc_t_styl". This is a complex structure.

Now

Loop at data_table.

data-table-lvc_t_style-fieldname = "Whatever field color you want to do":"

data-table-lvc_t_style-style = cl_gui_alv_grid=>mc_style_hotspot " you can search for color and put it here

Your layout structure must have this line

layout-stylefname = 'TCOLR' here tCOLR is the name of element which you have declared in your data table


Please let me know if still not able to make it.


Thanks

Rakesh.

Read only

0 Likes
839

Hi Rakesh,

I have tried in this way. But i haven't achieved the exact requirement. Can you please tell me exactly how you will do this one.

Read only

0 Likes
839

Hey Binod,

Extremely Sorry , i was talking about ALV.

Thanks

Rakesh

Read only

rajkumarnarasimman
Active Contributor
0 Likes
839

Hi Binod,

We can create the dynamic background color in smart form, Please find the link below.

Dynamic Background Colors in SmartForms - Code Gallery - SCN Wiki

Regards

Rajkumar Narasimman