2016 Feb 22 12:44 PM
Hi experts,
I have this requirement: I have to create a new smartforms contaning 12 tables, one for each month of the year the user indicates in selection data.
For each day I paint the day and another cell with some additional data, so if the month has 5 weeks I paint 10 rows, as shown below:
| Mon | Tues | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| des | 4 | des | 1 | 1 | 5 | 2 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| des | des | 17 | 17 | 17 | 17 | 17 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 5 | 5 | 5 | 5 | des | des | des |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| RT | RT | 34 | 34 | 34 | des | des |
| 29 | 30 | 31 | ||||
| vac | vac | vac |
As each month is different from the rest and starts/finish in a differente day of the week, I used 12 loops within the smartform, one for each month. And it works fine. But now they fant this format for the calendar:
The user wants sundays to be shadow in red (I did it) and the empty cells painted in grey, and here is my problem. As it is an internal table, I can't paint in grey dinamically the cells.
Is there any way to do that ? Should I have done the smartform different ?
Thanks in advance,
María
2016 Feb 23 5:07 AM
Hi experts,
I have this requirement: I have to create a new smartforms contaning 12 tables, one for each month of the year the user indicates in selection data.
For each day I paint the day and another cell with some additional data, so if the month has 5 weeks I paint 10 rows, as shown below:
| Mon | Tues | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| des | 4 | des | 1 | 1 | 5 | 2 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| des | des | 17 | 17 | 17 | 17 | 17 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 5 | 5 | 5 | 5 | des | des | des |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| RT | RT | 34 | 34 | 34 | des | des |
| 29 | 30 | 31 | ||||
| vac | vac | vac |
As each month is different from the rest and starts/finish in a differente day of the week, I used 12 loops within the smartform, one for each month. And it works fine. But now they fant this format for the calendar:
The user wants sundays to be shadow in red (I did it) and the empty cells painted in grey, and here is my problem. As it is an internal table, I can't paint in grey dinamically the cells.
Is there any way to do that ? Should I have done the smartform different ?
Thanks in advance,
María
2016 Feb 22 9:14 PM
Smartforms are not really great for this kind of artwork, unfortunately. As you noted, there is no option to change color dynamically, so the only thing that comes to mind is a very ugly solution with multiple templates and conditions.
I'm not sure if PDF forms have something more suitable. But why such calendar has to be included in a form? Forms in SAP are meant mostly for rather simple document output. It's hard to imagine a scenario where multiple month calendar would be a "must have" in a business document. Perhaps the users should look for some third party tools if they require such elaborate outputs.
2016 Feb 23 5:07 AM
2016 Feb 23 5:18 AM
HI Maria,
Why are you looking for the calendar solution in Smartform?
I would suggest go with HTML solution, there you can got lot's of option to do all color related artwork.
It will display cool in HTML view.
User cl_gui_html_viewer class for display HTML views in SAP fronted.
For help you can refer below demo programs from SAP.
SAPHTML_DEMO_CN
SAPHTML_EVENTS_DEMO
SAPHTML_LONGTEXT_DEMO
Regards,
Praveer.
2016 Feb 23 7:25 AM
Thanks Jelena, Eitan and Praveer for your answers. I know it's not the best solution for the requirements but the consultant told me to use an smartform even although I said it was not a good idea.
I've never used cl_gui_html_viewer class, I'll look for some examples that suits my problem..
Thanks a lot !!!
2016 Feb 23 8:46 AM
Hi,
A sample usage of CL_GUI_HTML_VIEWER
See here How to refresh HTML container from HTML button ... | SCN
Regards.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |