1 / 168

Report Layout

Report Layout. Report Heading. Report Title. Column Heading. Report Body. Standard Page Heading. Standard Page Heading. Execute. Report Statement : Standard Heading. REPORT < Report Name > [ NO STANDARD PAGE HEADING ]. REPORT ztest1 NO STANDARD PAGE HEADING. No Standard Page Heading.

umay
Download Presentation

Report Layout

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Report Layout Report Heading Report Title Column Heading Report Body

  2. Standard Page Heading Standard Page Heading Execute

  3. Report Statement : Standard Heading REPORT <Report Name> [NO STANDARD PAGE HEADING]. REPORT ztest1 NO STANDARD PAGE HEADING.

  4. No Standard Page Heading Execute

  5. WRITE …Column Number… WRITE: 10 ‘Hello’, 50 ‘World’.

  6. Report Statement : Line Size REPORT <Report Name> [LINE-SIZE no. of columns]. REPORT ztest LINE-SIZE 255 . sy-linsz

  7. Exercise Column : 50 Column : 170

  8. WRITE Statement • * Write data • WRITE ‘Hello World’. • WRITE: ‘OK’ , ‘Test data’. • WRITE:/15(10) ‘ABCDEFGHIJKLMNOPQ’. • WRITE /20 ‘Test data’.

  9. Breaking to a New Line * Write data WRITE: / ‘First Line’, ‘Data 1’, / ‘Second Line’,‘Data 2’, /(20) ‘Third Line’,‘Data 3’, /35 ‘Fourth Line’,‘Data 4’. sy-colno

  10. Exercise Column : 50 Line : 1 Column : 170 Line : 2

  11. Creating Lists ABAP statement that create list WRITE ULINE SKIP The complete report list will appears automatically at the end of the processing block

  12. List Buffer Local Memory • Dialog WP User Context TaskHandler Memory Space ABAP Processor Dynpro Processor List Buffer WRITE,SKIP,ULINE DB Interface

  13. Inserting Blank Lines(SKIP) • *Skip Statement • SKIP. • WRITE: ‘Hello World’, sy-linno. • SKIP. • WRITE: ‘Test 1’. • SKIP 5. • WRITE: ‘Test 2’. • SKIP TO LINE 20. • WRITE ‘This is line 20’.

  14. NEW-LINE • WRITE ‘Hello World’. • NEW-LINE. • WRITE ‘OK’. = • WRITE ‘Hello World’. • WRITE / ‘OK’.

  15. Exercise Column : 50 Line : 5 Column : 170 Line : 7

  16. Inserting Horizontal Lines(ULINE) • * Uline • WRITE: ‘Hello World’. • ULINE /1(20). • WRITE: /(20) sy-uline. • WRITE: / sy-vline, 20 sy-vline. • ULINE /(20). • WRITE: / ‘This is an underline’. • ULINE.

  17. Frame Example

  18. Frame • ULINE: /1(45). • WRITE: /1 sy-vline, 'Column #1', • 15 sy-vline, 'Column #2', • 30 sy-vline, 'Column #3', • 45 sy-vline. • ULINE /(45).

  19. Exercise I sy-uzeit sy-datum 20 55 80 80

  20. FORMAT Statement FORMAT [COLOR <color>]. [COLOR OFF].

  21. FORMAT Statement • FORMAT COLOR 1. • WRITE: / ‘Hello World’, ‘Test’ COLOR 7. • FORMAT COLOR OFF.

  22. FORMAT COLOR FORMAT COLOR col_heading. “color 1 FORMAT COLOR col_normal. “color 2 FORMAT COLOR col_total. “color 3 FORMAT COLOR col_key. “color 4 FORMAT COLOR col_positive. “color 5 FORMAT COLOR col_negative. “color 6 FORMAT COLOR col_group. “color 7 FORMAT COLOR col_background. “color 0

  23. Color Using Example

  24. Exercise I

  25. Text Symbol • Text Element • Text Symbols • Text Symbol Text REPORT ztest. WRITE: text-001, text-002. 001 Text 1 002 Text 2

  26. Text Symbol WRITE: / text-001. WRITE: / text-001. WRITE: / text-001. WRITE: / text-001. WRITE: / text-001.

  27. CONSTANTS • * Constant variable • CONSTANTS ctext TYPE string VALUE ‘Hello World’. • WRITE / ctext. • WRITE / ctext. • WRITE / ctext. • WRITE / ctext. • WRITE / ctext.

  28. Text Symbol : Language Translation

  29. Text Symbol : Language Translation

  30. Options of the WRITE Statement * Write Syntax WRITE var [NO-ZERO] [NO-SIGN] [NO-GROUPING] [NO-GAP] [DECIMALS no of decimals]

  31. Suppressing Zero With Blanks (NO-ZERO) • * No Zero • DATA: number(10) TYPE N VALUE 23. • WRITE: number, number NO-ZERO.

  32. Suppressing Number(+ / -) Sign • * No Sign • DATA: v_integer TYPE i VALUE -1. • WRITE: v_integer, v_integer NO-SIGN.

  33. NO-GROUPING • * No grouping • DATA: v_integer TYPE i VALUE 120000. • WRITE: v_integer, v_integer NO-GROUPING.

  34. NO-GAP • * No gap • WRITE: ‘Hello’ NO-GAP, ‘World’.

  35. DECIMALS • * Decimals • DATA: v_pack TYPE P DECIMALS 4 VALUE ‘1234.5678’. • WRITE: v_pack, v_pack DECIMALS 2.

  36. Formatting Options * Format options of WRITE statement * LEFT-JUSTIFIED for Numeric data * RIGHT-JUSTIFIED for Character data * CENTERED DATA tmp1(20) VALUE ‘test’. WRITE: tmp1 CENTERED. tmp1 test

  37. STRLEN Built-in Function • DATA: tmp(20) VALUE ‘Test String’, • count TYPE i. • count = strlen( tmp ). • WRITE count.

  38. Include Program You can create a program with program type include program in the program attribute Include program do not have to have an introductory statement During the syntax check and during program generation by the ABAP compiler, the INCLUDE statement is replaced by the source text of the defined include program • REPORT ztest1. • INCLUDE zinclude1. • … Include Program : ZINCLUDE1 DATA tmp(10). DATA tmp1 TYPE i. DATA tmp2 TYPE p. DATA tmp3. • REPORT ztest2. • INCLUDE zinclude1. • …

  39. Flow Control in ABAP

  40. Flow Control in ABAP • Branching ==> IF, CASE. • Looping ==> DO, WHILE.

  41. IF Statement • IF <Condition>. • <Statement Block> • ELSEIF <Condition>. • <Statement Block> • ELSEIF <Condition>. • <Statement Block> • ELSE. • <Statement Block> • ENDIF.

  42. IF Statement • IF sy-mandt = ‘100’. • WRITE: / ‘This is Production Client’. • ELSEIF sy-mandt = ‘800’ or sy-mandt = ‘805’. • WRITE: / ‘This is Training Client’. • WRITE / sy-mandt. • ELSE. • WRITE: / ‘This is Test Client’. • ENDIF.

  43. CASE Statement • CASE <field>. • WHEN <value1>. • <Statement Block> • WHEN <value2>. • <Statement Block> • ... • WHEN OTHERS. • <Statement Block> • ENDCASE.

  44. CASE Statement CASE sy-mandt. WHEN ‘100’. WRITE: / ‘This is Production Client’. WHEN ‘800’ or ‘805’. WRITE: / ‘This is Training Client’. WRITE / sy-mandt. WHEN OTHERS. WRITE: / ‘This is Test Client’. ENDCASE.

  45. DO Statement • DO. • WRITE sy-index. • IF sy-index = 3. • EXIT. • ENDIF. • WRITE: sy-index. • ENDDO. Loop Counter

  46. DO Statement • DO 10 TIMES. • WRITE / sy-index. • ENDDO. Loop Counter

  47. WHILE Statement • DATA: count TYPE i value 1. • WHILE count <> 4. • WRITE: sy-index. • count = count + 1. • ENDWHILE. Loop Counter WHILE sy-index <> 4. WRITE: sy-index. ENDWHILE.

  48. Logical Expressions • >,GT • <,LT • >=, =>, GE • <=, =<, LE • =, EQ • <>, ><, NE • BETWEEN <value1> AND <value2> • IS INITIAL

  49. Arithmetic Operators • + , - , * , / , ** • DIV • MOD • Example : • 9 / 2 = 4.5 • 9 DIV 2 = 4.0 • 9 MOD 2 = 1 • 2 ** 4 = 16

  50. ABAP : Data Retrieval • Open SQL (SELECT)

More Related