Friday, 17 July 2020

SAP Smartforms - Add T&C Pages

Some of you might have come across this requirement in your years of doing ABAP. T&C page might be easy in most cases, just set a COMMAND from PAGE main window but if we've some other stuff like printing a secondary window at end of page, we might missed that.

Since many developers overlapped their final windows to save some empty spaces rather than wasted it for reserving the last footer, this becomes a problem when trying to jump to a T&C page.

To achieve this, we need to do the following:

  1. Create two global variables (flags), e.g. GV_FLAG1 and GV_FLAG2.
  2. In the main window, after you've done all the processing, you need to create a program lines, here we set the first flag, GV_FLAG1 = 'X'. No conditions need to be added or ticked.
  3. After the above program lines, create a COMMAND and this is to be set to jump to the T&C page.
  4. In your secondary window (e.g. footer printed at last page), under the conditions tab, do a check on GV_FLAG1 EQ 'X' and GV_FLAG2 NE 'X'. Do not set any additional event/condition.
  5. Create a program line in the secondary window, make it the last one after all other processing, here you set the second flag, GV_FLAG2 = 'X'. Important, no condition needed and any event should be unticked. 
The above should print the last footer window and jump to your T&C page. Good luck!

 

No comments:

TOUCHTAB report, regenerate all ABAPs related to changed/modified structure

I was working on S4HANA OnPremis and tried to do an enhancement to BP's additional info structure by appending fields, but decided that ...