startup reporting
DESCRIPTION
vhgfffhTRANSCRIPT
Satyam Computer Services Ltd, Pune, India 1999
Startup - Reporting
Satyam Computer Services Ltd, Pune, India 1999
Agenda
DISPLAYING DATA
TEXT ELEMENT
MOVE & COMPUTE
STRING OPERATION
MESSAGES
USER INTERFACE
Satyam Computer Services Ltd, Pune, India 1999
Displaying Data
WRITE statement
Syntax
WRITE <field>.
Example
WRITE “BASIC is too OLD”.
WRITE “COBOL is structued”.
WRITE “But ABAP/4 is ABAP/4”.
Satyam Computer Services Ltd, Pune, India 1999
Write
WRITE : / ‘text 1’, fig1 , ‘text2’.
WRITE : /5 ‘position 5’.
WRITE AT pos(len) ‘position & length’.
WRITE ...<f1> <option>
LJ,RJ,UNDER <g> , NO-GAP,NO-ZERO,USING EDIT MASK, DECIMALS <d>
WRITE : ‘text1’ COLOR col_key.
Satyam Computer Services Ltd, Pune, India 1999
Write contd.
ULINE or WRITE SY-ULINE
prints horizontal line on screen
WRITE SY-VLINE
NEW-PAGE line-size n.
Output on next page with width n
NEW-LINE
Output on next line
SKIP n and SKIP TO LINE <n>
produces n empty lines (default 1) , move upwards and downwards
Satyam Computer Services Ltd, Pune, India 1999
Write contd.
WRITE <f> AS CHECKBOX
If the first character of the field <f> is an "X", the checkbox is displayed filled. If the first character is SPACE, the checkbox is displayed blank.
WRITE<Symbol-name> AS SYMBOL
WRITE <icon-name> AS ICON
The names of symbols and icons (<symbol-name> and <icon-name>) are system-defined constants which are specified in the include programs <SYMBOL> and <ICON>
WRITE text-002.
Satyam Computer Services Ltd, Pune, India 1999
Write
WRITE text-002.
WRITE : / ‘text 1’, fig1 , ‘text2’.
WRITE AT 5 ‘position 5’.
WRITE AT pos(len) ‘position & length’.
WRITE f1 UNDER f2.
WRITE : ‘text1’ COLOR col_key.
Satyam Computer Services Ltd, Pune, India 1999
Write contd.
ULINE
prints horizontal line on screen
NEW-PAGE line-size n.
Output on next page with width n
NEW-LINE
Output on next line
SKIP n
produces n empty lines (default 1)
Satyam Computer Services Ltd, Pune, India 1999
TEXT ELEMENT
You can store these text elements outside the program in language-dependent text pools ,Your program automatically uses the text elements of the user's logon language.
You can create and maintain text elements without changing the program coding.
Satyam Computer Services Ltd, Pune, India 1999
Move & Compute
MOVE source TO target.
COMPUTE target = source.
DATA : d1(4),
d2 TYPE I VALUE 75,
d3 TYPE I.
MOVE ‘SAP’ TO d1.
COMPUTE d3 = d2 + 125.
If source & target fields have different type then source is converted in the format of target.
Satyam Computer Services Ltd, Pune, India 1999
Move & Compute
MOVE source TO target.
COMPUTE target = source.
DATA : d1(4), d2 TYPE I VALUE 75, d3 TYPE I.
MOVE ‘SAP’ TO d1. COMPUTE d3 = d2 + 125.
If source & target fields have different type then source is converted in the format of target.
Satyam Computer Services Ltd, Pune, India 1999
Arithmetic Expression
Basic operations +,-, / and * along with functions like sin, sqrt etc. are supported
Priority of the operations
functions ,
exponention
multiplication ,division
addition , subtraction
Satyam Computer Services Ltd, Pune, India 1999
STRING OPERATION
SEARCH <c> FOR <str> <options>.
This statement searches the field <c> for the character string in <str>. If successful, the return code value of SY-SUBRC is set to 0 and SY-FDPOS is set to the offset of the string in the field <c>. Otherwise SY-SUBRC is set to 4.
To determine the length of a character string up to the last character other than SPACE, use the built-in function STRLEN as follows:
[COMPUTE] <n> = STRLEN( <c> ).
Satyam Computer Services Ltd, Pune, India 1999
STRING OPERATION
To concatenate separate character strings into one, use the CONCATENATE statement as follows:
CONCATENATE <c1> ... <cn> INTO <c> [SEPARATED BY <s>].
To split a character string into two or more smaller strings, use the SPLIT statement as follows:
SPLIT <c> AT <del> INTO <c1> ... <cn>.
Satyam Computer Services Ltd, Pune, India 1999
String Operations
CONCATENATE f1 f2 f3 INTO f4 SEPARATED BY f5.
SPLIT f1 AT f2 INTO f3 f4.
SPLIT f1 AT f2 INTO TABLE t1.
SHIFT f1
SHIFT f1 BY 3 PLACES.
SHIFT f1 UP TO f2.
Satyam Computer Services Ltd, Pune, India 1999
String Operations contd.
REPLACE string1 WITH string2 INTO string3.
replaces first occurrence of string1 with string2
TRANSLATE string1 USING string2.
replaces all occurrence ( string2 always in pair )
Ex: expression = ‘a ** 2 + b ** 2’.translate expression using ‘axby’.
expression = ‘x ** 2 + y ** 2’.
Satyam Computer Services Ltd, Pune, India 1999
String Operations contd.
SEARCH string1 FOR string2
SEARCH string1 FOR string2 STARTING AT position1 ENDING AT position 2.
position1 and position2 are starting ending line of internal tables.
Partial String Move
MOVE string+offset1(length1) TO string+offser2(length2).
Satyam Computer Services Ltd, Pune, India 1999
STRING COMPARISONS
For comparisons with character strings (type C) and numeric text (type N), you can use the following operators in logical expressions.
<operator> Meaning
CO Contains Only
CN Contains Not only
CA Contains Any
NA Contains Not Any
Satyam Computer Services Ltd, Pune, India 1999
STRING COMPARISONS
CS Contains String
NS Contains No String
CP Contains Pattern
NP Contains No Pattern
Satyam Computer Services Ltd, Pune, India 1999
INTRODUCTION TO MESSAGE
MESSAGE ID msgid TYPE msgtype NUMBER msgno.
Displays message on the screen
Types are A - Abnormal End E - Error
W - Warning I - information
S - Success
Message Number is 3 digit
Message ID can be given along with REPORT
Satyam Computer Services Ltd, Pune, India 1999
User interface of report
PARAMETERS :
p_city LIKE cust_city,
p_flag AS CHECKBOX DEFAULT ‘X’.
End user can enter input values into these fields during execution of program.
Initial values are declared by using DEFAULT.
Every parameter has associated language dependent label.
Satyam Computer Services Ltd, Pune, India 1999
User interface of report contd
SELECT-OPTIONS s_name FOR cust-name. SELECT * FROM cust WHERE name in s_name. WRITE : / cust-name. ENDSELECT.
Select option allows you to specify additional selection criteria without changing program.
Internal table corresponding to a select-option is created
Satyam Computer Services Ltd, Pune, India 1999
User interface of report contd
SELECTION-SCREEN.
BEGIN OF LINE.
END OF LINE.
COMMENT POS(LEN) TEXT.
SKIP n.
BEGIN OF BLOCK n.
END OF BLOCK n.
Satyam Computer Services Ltd, Pune, India 1999
User interface of report contd.
Selection-screen Events
initialization : immediately when starting the report & before processing selection screen.
at selection-screen output : before contents of the selection screen are displayed.
at selection-screen on p/s : after the user has specified the parameter p or select-option s.
at selection-screen : after the user has specified all selection criteria.
Satyam Computer Services Ltd, Pune, India 1999
Import/Export
IMPORT field FROM MEMORY IDmemid
Field value is retrived from temporary memory using memory id and stored in field
EXPORT field TO MEMORY ID memid.
Field value is stored in ABAP/4 memory - temporary memory using memory id.
Memory variables are available to user till user is logged on to the system. Memory variables are NOT available once user is logged out.