‎2015 Jan 30 11:18 AM
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.
‎2015 Jan 30 11:27 AM
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.
‎2015 Jan 30 11:35 AM
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.
‎2015 Jan 30 12:03 PM
Hey Binod,
Extremely Sorry , i was talking about ALV.
Thanks
Rakesh
‎2015 Jan 30 1:12 PM
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