ABAP Basics II

Northern Arizona University College of Business

1

Printing
 To print the program code, copy the code into

Notepad and then print.
 To print the screens (data entry or output),

capture the screen (Alt/print screen) and paste into Word. Then print from word.

2

Defining variables – Data Types C I P Character Integer Packed Decimal ‘Whatever’ 25 19.95 D T Date Time ‘20030121’ ‘143000’ 3 .

4 .  The data type is determined dynamically at runtime from the like field .Data Statement Data D_num Type I value 1 . Data D_num LIKE sy-subrc .

D_ID Type I . 5 . D_Name(30) Type C .Records Data Begin of Demo_Record. End of Demo_Record .

C_Name(20) Type C value ‘Joe’ . 6 .Constants Constants: C_Number Type I value 1 .

Write ‘Whatever’ . Write: ‘Whatever: ‘.  Goes to column (position) 20 . Whatever .Write statement Write Whatever . 7 . Write 20 Whatever .

Write statement Write 20(6)Whatever . and prints for a length of 6 .  8 . Advances to the next line .  Goes to position 20. Write / .

Text Elements  Three types of Text Elements  List Headings  Selection Texts  Text Symbol 9 .

Text Elements GoTo Text Elements List Headings Selection Texts Text Symbol 10 .

Text Symbols  Alternate method of defining character variables. 11 . Length 001 Hi There 10 Write Text-001 .  Number. Text.

 Must make the program ACTIVE  Select REPS for the program from the worklist.Selection Texts  Text identifiers for parameter fields (replaces parameter name). and click on the continue icon 12 .

Selection Texts  Must SAVE the program 13 .

Now type T . Today = sy-datum . Now = sy-uzeit .System Date and Time Data: Today type D . 14 .

Formatting Write Today mm/dd/yyyy . 15 . Write Now Using Edit Mask ‘__:__’ .

Write: / Field2 under Field1 . Write Field3 Right-Justified . Write Field2 Centered . Write: /20 Field1 .Alignment Write Field1 Left-Justified . 16 .

No Gaps Write: Field1 No-Gap. Field2 . 17 .

Uline /20 . Uline /20(10) . Uline: /20(10) .Horizontal Lines Uline . 18 .

Skip to line 20 . Skip 3 . 19 .Line Spacing Skip .

20 .Column Spacing Position 20 .

21 .Case Data: F1(6) F2(6) type C value ‘abcdef’ . Translate F2 to Lower Case . Translate F1 to Upper Case .Character Data . type C value ‘ABCDEF’ .

Character Data .nau’ . Split F1 at ‘.’ into F2 F3 . type C .Split Data: F1(7) F2(3) F3(3) type C value ‘cba. 22 . type C .

value ‘nau’ . Concatenate F2 ‘-’ F3 into F1 .Concatenate Data: F1(7) F2(3) F3(3) type C .Character Data . 23 . type C type C value ‘cba’ .

Character Data . Condense F1 No-Gaps .Condense Data: F1(7) type C value ‘cba nau’. 24 .

Date & Time Fields Data: Today Next_Week type D . type D . Next_Week = Today + 7 . “days 25 .

Now_Plus1 = Now + 3600 . “seconds 26 . type T .Time Fields Data: Now Now_Plus1 type T .

If Statement If Else . EndIf . A=B. Whatever = 0 . 27 . Whatever = 1 .

Sign up to vote on this title
UsefulNot useful