ABAP/4

How to insert standard text in SAPscript

You can insert standard text(Transaction SO10) in SAPscript as following:

  • Go to editor of SAPscript form  
    img86
  • Select menu Insert -> Text -> Standard
    img87

    img88
  • Input text object.
    img89

ABAP/4 Example Code: SELECT ... PACKAGE SIZE

Example

DATA: it_spfli TYPE TABLE OF SPFLI WITH HEADER LINE.

START-OF-SELECTION.
  SELECT * FROM spfli
           INTO TABLE it_spfli PACKAGE SIZE 5.
    LOOP AT it_spfli.
      WRITE:/ it_spfli-CARRID, it_spfli-CONNID,
              it_spfli-CITYFROM, it_spfli-AIRPFROM,
              it_spfli-CITYTO, it_spfli-AIRPTO.
    ENDLOOP.
    SKIP 1.
  ENDSELECT.

How to upload smartforms from PC

The SAP system provides service for upload smartforms with system as follows:

Method 1: Upload and create new form

  • Go to transaction ’SMARTFORMS’
    img72
  • Go to menu Utilities(M) -> Upload Form for download form from PC.
    img73
  • System popup windows for input new form name and select img69.
    img74

How to download smartforms to PC

The SAP system provides service for download smartforms with system as follows:

  • Go to transaction ’SMARTFORMS’
    img64
  • Go to menu Utilities(M) -> Download Form for download form to PC.
    img79
  • System popup windows for input form name and select img69.
    img67

CASE command in SAPscript

Syntax

CASE symbol
...
[WHEN value|WHEN OTHERS]
...
ENDCASE

Example

/: CASE &NAME&
/: WHEN ’ROBERT’
* He is ROBERT.
/: WHEN ’JOHN’
* He is JOHN.
/: WHEN OTHERS
* Who is he? &NAME
/: ENDCASE

 img63

Technorati Tags:

IF command in SAPscript

Syntax

IF 
...
[ELSE|ELSEIF ]
...
ENDIF

Example

/: IF &NAME& = ’ROBERT’
* He is ROBERT.
/: ELSEIF &NAME& = ’JOHN’
* He is JOHN.
/: ELSE
* Who is he? &NAME&
/: ENDIF
img62
Technorati Tags: