Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
naimesh_patel
Active Contributor

On the other day, I was reading through SCN and this question came up. There wasn’t any suitable answer, which can get the watermark in SAPScript. So, I decided to give a try. I have tried couple of times with different techniques like calling the subroutine which SmartForm uses for background processing from SAPScript, putting the graphics in various windows and call them from driver program, etc. But today, I got a good solution, which I thought would be useful to everybody.

How it looks with Watermark?


There are couples of hurdles in the way to get it working:

First is the Graphics:
Watermark Graphics should have some specific property. This kind of graphics should not have the “Reserve Height Automatically” as ON in their attributes.


Whenever we import any .bmp file as the graphics in the SE78, system by default sets the indicator “Reserve Height Automatically” as ON. So, when we include this graphics in our SAPScript, system will reserve predefined space on the page which will prevent the next line to print in that space.

The Graphics with the “Reserve Height Automatically” as ON generates output like this:

Second is how to get the watermark on each page:
To get the graphics on every page we have couple of options:
Option 1: Create a GRAPHICS window on the center of the page and include the watermark.
This option is not working because: System starts the processing of the windows in the sequence maintained on the page window of SAPScript. So, Main window will be executed before Graphics window. This will overlap the content of the main window by the Graphics (which is not our purpose).

Option 2: Call a Graphics inside the MAIN window.
This option seems to work with little logic to print the watermark on each page.

I have attached my SAPScript, Little driver program code and the test watermark image for your reference.

SAPScript:
You can save this block as .txt file and use report RSTXSCRP to import into your system. You need to save this SAPScript with name ZTEST_WATERMARK.

Code:
Here is the simple driver program.



Watermark Image:
I have used this image for my testing:


Note: I have tried this on ECC 5.0. I am not sure about other systems.

14 Comments