cancel
Showing results for 
Search instead for 
Did you mean: 

SAP SCRIPT - Terms and conditions in 1st page

Former Member
0 Kudos

I want to display terms and conditions in first page using SAP Script. This is conditional depending upon company code (Should be displayed only for few company codes). Is there any possibility with out changing driver program only using SAP Script commands?

This terms and conditions page should not be blank for company codes which are not required.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shravan,

Yes, thats possible.

But in my solution you need a z-report and a white bitmap.

You have to to 4 things:

1. Modifiy MAIN window

2. Add TERM window on FIRST page

3. create a white bitmap (1 bit) in your needed page size (to cover the other windows) / Upload with SE78

4. create z-report

1. Modifiy MAIN window

In the MAIN window you have to call the programm with the specified form you want to call.

You can add own conditions (e.g. company codes) to the page condition.


/:         IF &PAGE& EQ '1'

/:         &TEST&

/:          PERFORM WRITE_LINES IN PROGRAM ZTEST_WRITE_LINES

/:           USING &TEST&

/:          ENDPERFORM

/:          NEW-PAGE 'FIRST'

/:         ENDIF

2. Add TERM window on FIRST page

Add the following content to the window


/:         IF &PRINTED& EQ &SPACE&

/:         BITMAP 'BLANKP_DINA4' OBJECT GRAPHICS ID BMAP TYPE BMON DPI 300

/:         INCLUDE ZTERMS OBJECT TEXT ID ST

/:         ENDIF

/:         DEFINE &PRINTED& := 'X'

                                                     

3. create a white bitmap

Create a bitmap that covers all windows

This bitmap should be saved with 1bit-solution (But for DinA4 it will be still 1 MB large - Could be a problem for mass prinout)

4. create z-report


*&---------------------------------------------------------------------*
*&  Include           ZTEST_WRITE_LINES
*&---------------------------------------------------------------------*
REPORT ztest_write_lines.

*&---------------------------------------------------------------------*
*&      Form  WRITE_LINES
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM write_lines tables in_tab  structure itcsy
                         out_tab structure itcsy.

   DATA ls_thead TYPE thead.
   DATA ls_line  TYPE tline.
   DATA lt_lines TYPE TABLE OF tline.


   CALL FUNCTION 'READ_TEXT'
     EXPORTING
*     CLIENT                  = SY-MANDT
       id                      = 'ST'
       language                = 'D'
       name                    = 'ZTERMS'
       object                  = 'TEXT'
*     ARCHIVE_HANDLE          = 0
*     LOCAL_CAT               = ' '
     IMPORTING
       header                  = ls_thead
     TABLES
       lines                   = lt_lines
     EXCEPTIONS
       id                      = 1
       language                = 2
       name                    = 3
       not_found               = 4
       object                  = 5
       reference_check         = 6
       wrong_access_to_archive = 7
       OTHERS                  = 8.
   .
   IF sy-subrc <> 0.
* Implement suitable error handling here
   ENDIF.

   CALL FUNCTION 'WRITE_FORM_LINES'
     EXPORTING
       FUNCTION                       = 'SET'
       header                         = ls_thead
       TYPE                           = 'BODY'
       window                         = 'TERMS'
*    IMPORTING
*      FROMPAGE                      =
*    PENDING_LINES                   =
     TABLES
       lines                          = lt_lines
    EXCEPTIONS
      function                       = 1
      type                           = 2
      unopened                       = 3
      unstarted                      = 4
      window                         = 5
      bad_pageformat_for_print       = 6
      spool_error                    = 7
      codepage                       = 8
      OTHERS                         = 9.
   .
   IF sy-subrc <> 0.
* Implement suitable error handling here
   ENDIF.


ENDFORM.                    "WRITE_LINES

                   

Kind regrads

Silvio

Former Member
0 Kudos

Hi Shravan

forgive me if i tell you something you already know

In the sapscript you can add the if conditions based on field values and make calls to abap forms to retrieve further data

are you using standard code or custom for t&c?

Let me know so i can prototype something in my ecc

cheers

a