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

Background colour smartform

maria_merino
Active Participant
0 Likes
1,790

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:

MonTuesWedThuFriSatSun
1234567
des4des1152
891011121314
desdes1717171717
15161718192021
5555desdesdes
22232425262728
RTRT343434desdes
293031
vacvacvac

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

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,683

Hi,

As   mention SAP is not the solution for all the problem in the world...

HTML can do a better job .

Here is HTML calendar that was generated using Java .

You can also generate HTML using ABAP and then use cl_gui_html_viewer .

This HTML can be opened by Excel .

Or a browser

Regards.

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:

MonTuesWedThuFriSatSun
1234567
des4des1152
891011121314
desdes1717171717
15161718192021
5555desdesdes
22232425262728
RTRT343434desdes
293031
vacvacvac

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

5 REPLIES 5
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,683

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.

Read only

rosenberg_eitan
Active Contributor
0 Likes
1,684

Hi,

As   mention SAP is not the solution for all the problem in the world...

HTML can do a better job .

Here is HTML calendar that was generated using Java .

You can also generate HTML using ABAP and then use cl_gui_html_viewer .

This HTML can be opened by Excel .

Or a browser

Regards.

Read only

ipravir
Active Contributor
0 Likes
1,683

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.

Read only

maria_merino
Active Participant
0 Likes
1,683

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 !!!




Read only

0 Likes
1,683

Hi,

A sample usage of CL_GUI_HTML_VIEWER

See here How to refresh HTML container from HTML button ... | SCN

Regards.