Hi,

In this document i’ll elaborate the process of printing the watermark in the SAP Script outputs. Though, there are few posts in SCN which will help for the same but the developers usually get stuck when it comes to print the same watermark on the NEXT Pages (after the First Page)

1st, you need to upload the watermark image (BMP Format) in SAP using Txn Code SE78.

In my case, I have used below Image as watermark:

Not Approved.PNG

Now, Once you have uploaded the image in SAP repository, you need to modify the Script Form & use this image as watermark during the output

For instance, lets assume you need to print this watermark in case the Purchase Order is not yet released.

To achieve this we follow below Steps :

  1. Go to SE71 & open the Script in Change mode :

WM1.PNG

    2. Enter below line of code in the very beginning of MAIN Window :

/* START Of Change by Bharat Bajaj for Watermark
/: IF &EKKO-FRGKE& EQ ‘S’ AND &PAGE& EQ 1
/: BITMAP ‘ZMCG_NA_WMARK’ OBJECT GRAPHICS ID BMAP TYPE BCOL DPI 100
/: ENDIF
/: NEW-WINDOW
/* END Of Change by Bharat Bajaj for Watermark

Here, the NEW-WINDOW command is to trigger a new window along with the main window which will hold the watermark image along with the Original Content of output. The Image is stored in SAP as ZMCG_NA_WMARK. You can give it any name & use the same in the script.

WM2.PNG

This part was to add the water mark on the First page & its quite easy & straight forward.

Now, the Tricky part is to use the same watermark to be printed on subsequent pages for that Purchase order.

For this, you need to perform below additional Steps :

  1. Create a Copy of Main Window in the FIRST Page :

          In the Page Window section of the form, Click on EDIT->Create Element -> MAIN Window. See below screenshots :

/wp-content/uploads/2014/08/wm3_517710.png

WM4.PNG

WM5.PNG

Please note that for the new Main Window ( MAIN 01 ) in the FIRST Page, you can keep the dimensions same as of (MAIN 00) or change it as per your output layout.

Now, the tricky part is, in MAIN window, where to add the code to print the watermark, as the previous code will not work in this case.

In my case, the water mark was required to be printed at the back of item header data, & thus, the code needs to be placed just in the beginning of the page element which prints the Item header (In my script form, the Element is ITEM_HEADER_F). You need to check your driver program or the script code to identify this element.

Once Identified, you need to put below Code in MAIN Window at the Page Element like below:

/E ITEM_HEADER_F
/* START Of Change by Bharat Bajaj for Watermark
/: IF &EKKO-FRGKE& EQ ‘S’ AND &PAGE& GE 2
/: BITMAP ‘ZMCG_NA_WMARK’ OBJECT GRAPHICS ID BMAP TYPE BCOL DPI 100
/: NEW-WINDOW
/: ENDIF
/* END Of Change by Bharat Bajaj for Watermark
/*                                                                        

WM6.PNG

Once this is done, save the form & activate it.

Now open an unreleased PO & trigger the Print Preview and you’ll see the watermark like below :

PAGE 1 :

WM8.PNG

PAGE 2 :

WM9.PNG

As you can see above, the water appears on every page of the output.

I hope this will be helpful for you.

Regards,

Bharat Bajaj

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Rob Becht

    Hi Bharat,

    Thanks very much for the useful article. I successfully implemented the solution, but found a simpler method.

    I left the page number out and inserted the code in one place, directly where I needed it invoked, which is under the element ITEM_HEADER_F. The watermark was displayed correctly on each page, without having to specifically cater for the FIRST, NEXT and subsequent pages.

    I also did not need to specify the NEW-WINDOW statement.

    This is an example of the code:

    In my case I had to display a watermark if the PO has been amended, and another watermark for when it gets re-printed.

    Regards,

    Rob

     

    (0) 

Leave a Reply