Control Break Report ALV Report

Slides:



Advertisements
Similar presentations
ABAP Data/Internal Tables ITP 321 Anthony Borquez & Jim Graver.
Advertisements

ABAP Chapter 5 Modularization Catch Statement.
 SAP AG2000 dvanced Advanced usiness Business rogramming Programming pplication Application / 4 Szkolenie ABAP.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 2Creating Forms and Reports Chapter 6Creating Reports and Mailing Labels.
 SAP AG CSU Chico MINS298c Fall 1998 Three Levels of ABAP Dictionary Chapter 5 & 6.
ABAP/4 PROGRAMMING Internal Table 講 師:呂 昇 燦 2000 年 9 月 26 日.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 10 – Designing.
ABAP Chapter 2 Report Statement Write & Format Statement Flow Control in ABAP Manipulating Character Data Report Driven : Page Report (List Header)
1.  Formatting is applied to spreadsheet components for the purpose of organizing and clarifying information.  Data that is presented in a uniform and.
ABAP Chapter 6 Message Debugging File Transfer Type Group.
Mark Dixon Page 1 05 – Database Design: Sub-forms.
Mark Dixon Page 1 06 – Expression Builder. Mark Dixon Page 2 Session Aims & Objectives Aims –To use expressions to perform more complex calculations in.
Microsoft Office 2007 Access Chapter 4 Creating Reports and Forms.
University of Southern California Enterprise Wide Information Systems ABAP/ 4 Programming Language Instructor: Richard W. Vawter.
Mark Dixon Page 1 07 – Reports. Mark Dixon Page 2 Session Aims & Objectives Aims –To use reports to produce more readable documents Objectives, by end.
ABAP and Stuff MINS298c-01 Fall Overview Control Break Logic in ABAP Nested Selects Debugger Extended Check Runtime Comparisons.
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
I.1 ii.2 iii.3 iv.4 1+1=. i.1 ii.2 iii.3 iv.4 1+1=
Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. 1 by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
Exporting Data and Creating Financial Reports with Excel and Crystal Slide 1 Exporting Data and Creating Financial Reports with Excel and Crystal By Peter.
Access 2007 ® Use Databases How can Access help you to find and use information?
CIS*1000*DE – Databases Microsoft Access (Part 2).
ABAP Chapter 3 Open SQL Internal Table. SAP System : 3 Tier Client/Server DB Server SAP Application Server SAP GUI Presentation Server SAP GUI.
ABAP 楊子青 List2-1 Interactive List Techniques n Detail Lists –Program Flow in Detail Lists –Events –Page Headings –SET TITLEBAR n Data Transport n Selecting.
SAP ABAP DemoNawin's Training Acadamy1. Enterprise Wide Information Systems ABAP/ 4 Programming Language Mr. RG Nawin Krishna, Bsc(cs);Msc(psychology);MBA(HR);SAP(HCM/HR),
Data Modeling for Integrating SAP with other Applications.
Reporting in Version 5 Application Reports AKA: In Context or Right Click AKA: In Context or Right Click Export to Excel from Listing pages Management.
0 UMN 2011 ERP Terapan Dialogs Programming Session # 11.
Reports 5.02 Understand database queries, forms, and reports used in business.
Microsoft Access 2007 Tutorial (Part II) CIS*1000*DE.
ITEC3612 Enterprise Architecture and Resource Planning (Lab) ABAP Programming (2)
Advanced Tables Lesson 8. Objectives 1. Work with long tables. 2. Use advanced table-formatting options. 3. Change the size of tables. 4. Work with multiple.
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
CERTIPORT EXCEL PRACTICE. EDITING SORT/FILTER/FIND & REPLACE In the Summary worksheet, sort the data in descending order by Order Number, and then in.
Report Layout Report Heading Report Body Column Heading Report Title.
AESuniversity Ad hoc Reporting Version 5. for the special purpose or end presently under consideration concerned or dealing with a specific subject, purpose,
Intro to Excel - Session 5.21 Tutorial 5 - Session 5.2 Working with Excel Lists.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Advanced Adhoc Reporting 2010 Visions Conference July 28, 2010.
SELECT-OPTIONS. SELECT-OPTIONS Syntax TABLES customers. SELECT-OPTIONS id FOR customers-id. START-OF-SELECTION.
1.  Formatting is applied to spreadsheet components for the purpose of organizing and clarifying information.  Added to present data in a uniform and.
Graphical Query Tools 5-ABAP.1 This is PricewaterhouseCoopers PROPRIETARY MATERIAL (hereafter, the Material) intended for internal use only. You may not.
Schoolnet Training Module 3 D. Tierney. Hover over Classrooms Click on Student Performance Click on tab Student Analysis Click on Advanced, create your.
John Ykema, Director of Sales & Marketing. Business Intelligence 201 Advanced Report Styling Pivot Tables Drill Down Reports Opening Records Smart Filters.
SAP DEVELOPMENT BASICS Bohuslav Tesar. TRAINING OVERVIEW Amazing life of ABAP developer ;) SAP introduction ABAP basics ABAP Reporting.
CRIBMASTER 101. WHAT’S INSIDE  Application Roles  Ribbons and Explorer  Heading and Grid Clicks  Standard Icons  Applying changes  Cool Features.
 May be times when we need calculations in a report. ◦ Total of how much a salesman has sold ◦ Report showing total inservice training hours an employee.
ACCESS REPORT GENERATOR. IT Fundamentals2 Reports Overview Reports are an important part of any computer business application. Features that are important.
Forms 5.02 Understand database queries, forms, and reports.
Adding Reports to a Database. Why do we use Reports? Reports are well-designed printed pages that offer several advantages: Reports are well-designed.
 / 1 Optimize Database Access From ABAP QL.  / 2 Copyright Please note: No part of this Training Session may be reproduced or transmitted in any form.
0 1. Upgrade 에 따른 File Controlling Issue - SAP 에서는 향후 ‘WS_’ 로 시작하는 기존의 Function Module 들을 사용하지 말고 CL_GUI_FRONTEND_SERVICES Class 의 Method 를 사용할 것을 권고함.
Microsoft® Access Generate reports quickly 1 Modify controls in layout view 2 Work with report sections 3 Work with controls in a report 4 Use Format.
SAP ECC 6.0 DEVELOPMENT ABAP ABAP DICTIONARY & Advanced Editor Abap
ABAP EVENTS & Interaction
Northern Arizona University College of Business
ABAP/4程序员之路——第3天 上海华和得易信息技术有限公司 王勇.
Spreadsheet Formatting
ABAP List Viewer 12/30/2018 7:06 PM.
How to Create Tables & Graphs in Excel
Microsoft Excel 101.
Spreadsheet Formatting
8.02 Spreadsheet Formatting
Microsoft Excel 101.
From and Report.
How to Create Tables & Graphs in Excel
Dialog Programming 整合實例
WALL COLMONOY NAME OF PRESENTATION DATE.
Interactive List Techniques
Presentation transcript:

Control Break Report ALV Report ABAP Advanced List Control Break Report ALV Report

Types of ABAP Report 1 3 4 1. Report Listing 2. Drill-down Report 3. Control-break Report 4. ALV Report 4

Internal Table Processing Technique Control-Break Report

Control Break Report Technique AT FIRST AT NEW <Control Break field> AT END OF <Control Break field> AT LAST ENDAT SUM

Program Structure name qty tab … LOOP AT tab. *Print Header AT FIRST. ENDAT. *Print Control Break Field AT NEW name. *Print Normal Data WRITE: / … *Sub Total AT END OF name. *Report Total AT LAST. ENDLOOP. name qty

Example I sales name qty A 10 20 30 B 5

Example I LOOP AT SALES. *Print Header AT FIRST. FORMAT COLOR 1. … LOOP AT SALES. *Print Header AT FIRST. FORMAT COLOR 1. WRITE: / 'Name', 23 'Qty', 35 ' '. ULINE: /(35). FORMAT COLOR OFF. ENDAT. *Print Control Break Field AT NEW NAME. WRITE: / SALES-NAME. ULINE: /(5). *Print Normal Data WRITE: /15 SALES-QTY.

Example I *Print Total for each group data AT END OF NAME. ULINE: /(35). SUM. WRITE: /5 'Total' ,15 SALES-QTY COLOR 3. ENDAT. *Print Grand Total for the report AT LAST. WRITE: /2 'Grand Total', 15 SALES-QTY COLOR 7. ENDLOOP.

Example II sales name qty A 10 20 30 B 5

Example II … LOOP AT SALES. AT FIRST. FORMAT COLOR 1. WRITE: / 'Name', 23 'Qty', 35 ' '. ULINE: /(35). FORMAT COLOR OFF. ENDAT. AT END OF NAME. SUM. WRITE: / SALES-NAME, 15 SALES-QTY. AT LAST. WRITE: /5 'Total', 15 SALES-QTY. ENDLOOP.

Exercise I ZSALES cust_id prod_id sale_date qty 1 A1 20020318 10 20020319 100 20020329 50 A2 200 3 X1 20020321 90

Exercise I ID Product ID Quantity 1 A1 10 A1 100 A1 50 A2 50 A2 200 ------------------------------ Total 410 3 X1 90 Total 90 Grand Total 500 ----------------------------------

Example Data for Example III spfli Carrid Connid Cityfrom cityto distance LH 0400 NY BK 100 0402 540 SQ 0110 250

Example III Data flight like spfli occurs 0 with Header line. Select * from spfli into table flight. loop at flight. at new carrid. write : / flight-carrid. endat. write flight-connid. at end of carrid. uline / (25). endloop. LH 0400 0402 ___________ SQ 0110

Internal Table Processing Example tab(internal table) ID Name prodno Month YTD Accum 1 A 01 100.00 400.00 1,000.00 02 50.00 03 2 B 2,000.00

200.00 1,100.00 2,100.00 ID Name Month Y-T-D Accumulated Product No. ------------------------------------------------------------------------------------ A ----------------- 01 100.00 400.00 1,000.00 02 50.00 100.00 100.00 03 100.00 100.00 100.00 ---------------------------------------------------- 250.00 600.00 1,200.00 2 B 02 100.00 1,000.00 2,000.00 03 100.00 100.00 100.00 200.00 1,100.00 2,100.00 Total 450.00 1,340.00 3,200.00

ABAP Program ... loop at tab. at first. write: / ‘ID’ , 10 ‘Name’, 30 ‘Month’, 50 ‘Y-T-D’ , 70 ‘Accumulated’. write: /5 ‘Product No’. uline /. endat. on change of tab-id. write: / tab-id, 10 tab-name. uline: /(20). endon. write: /5 tab-prodno, 30 tab-month, 50 tab-ytd, 70 tab-accum.

ABAP Program at end of id. uline /30(60). sum. write: /30 tab-month, 50 tab-ytd, 70 tab-accum. skip. endat. at last. write: /10 ‘Total’, 30 tab-month, 50 tab-ytd, 70 tab-accum. endloop.

Exercise II ZCUSTOMERS ZSALES id name city 1 John New York 2 Peter London 3 David Singapore cust_id prod_id sale_date qty 1 A1 20020318 10 20020319 100 20020329 50 A2 200 3 X1 20020321 90

Exercise II ID Name ____Product ID Quantity 1 John A1 10 A1 100 A1 50 ---------------------------- Total 410 3 Peter X1 90 Total 90 Grand Total 500 -------------------------------

Control Break Report > 1 Level Loop at tab. … at new f1. endat. at new f2. write: / … “normal data at end of f2. at end of f1. Endloop. tab sort tab by f1 f2. Group Header Level 1 f1 f2 f3 A 1 2 B 3 C 4 Group Header Level 2 Sub Total Level 2 Sub Total Level 1

Example IV (Control-break 2 Levels) sales name date qty A 20070126 10 20 20070128 30 B 5

Example IV (Control-break 2 Levels) … AT NEW NAME. WRITE: / SALES-NAME. ULINE: /(5). ENDAT. AT NEW DATE. WRITE: /10 SALES-DATE. ULINE: /10(10). WRITE: /30 SALES-QTY. AT END OF DATE. ULINE: /(50). SUM. WRITE: /15 'Sub Total(Date)' ,30 SALES-QTY COLOR COL_TOTAL. AT END OF NAME. WRITE: /5 'Sub Total(Name)' ,30 SALES-QTY COLOR COL_TOTAL.

Exercise III ZSALES cust_id prod_id sale_date qty 1 A1 20020318 10 20020319 100 20020329 50 A2 200 3 X1 20020321 90

Exercise III

ALV Report

ALV Report ALV Report Listing using Function Module ALV Report using Control (ABAP Object)

ALV Grid Listing Call function ‘REUSE_ALV_GRID_DISPLAY’

ALV Grid Listing Example REPORT ZALV01 NO STANDARD PAGE HEADING. * Internal table DATA: GT_TAB LIKE SFLIGHT OCCURS 0 WITH HEADER LINE. * Load Data from DB into internal table SELECT * FROM SFLIGHT INTO TABLE GT_TAB. * Call ABAP List Viewer function CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'SFLIGHT' TABLES T_OUTTAB = GT_TAB.

ALV Example I List/Grid Display

ALV List/Grid Display REPORT ZALV02 NO STANDARD PAGE HEADING. PARAMETERS: list radiobutton group grp1, grid radiobutton group grp1. DATA: gt_tab LIKE sflight OCCURS 0 WITH HEADER LINE. START-OF-SELECTION. SELECT * FROM sflight INTO TABLE gt_tab. IF list = 'X'. * Call ALV List Viewer CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'SFLIGHT' TABLES T_OUTTAB = GT_TAB. ELSE. * Call ALV Grid Viewer CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' T_OUTTAB = GT_TAB. ENDIF..

ALV Report : Exercise I

ALV Example II Using Field Catalog

ALV Field Catalog REPORT ZALV03 NO STANDARD PAGE HEADING. type-pools slis. types: begin of i_structure, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price, end of i_structure. data: gt_fieldcat type slis_t_fieldcat_alv, gt_outtab type i_structure occurs 0 with header line. initialization. perform field_cat_init using gt_fieldcat[].

ALV Field Catalog FORM field_cat_init using rt_fieldcat type slis_t_fieldcat_alv. data: ls_fieldcat type slis_fieldcat_alv, pos type i value 1. clear LS_FIELDCAT. *Column 1 ls_fieldcat-col_pos = pos. ls_fieldcat-fieldname = 'CARRID'. ls_fieldcat-ref_fieldname = 'CARRID'. ls_fieldcat-ref_tabname = 'SFLIGHT'. ls_fieldcat-key = 'X'. append ls_fieldcat to rt_fieldcat. clear ls_fieldcat. pos = pos + 1.

ALV Field Catalog *Column 2 ls_fieldcat-col_pos = pos. ls_fieldcat-fieldname = 'CONNID'. ls_fieldcat-ref_fieldname = 'CONNID'. ls_fieldcat-ref_tabname = 'SFLIGHT'. ls_fieldcat-key = 'X'. append ls_fieldcat to rt_fieldcat. clear ls_fieldcat. pos = pos + 1. *Column 3 ls_fieldcat-fieldname = 'FLDATE'. ls_fieldcat-ref_fieldname = 'FLDATE'.

ALV Field Catalog *Column 4 ls_fieldcat-col_pos = pos. ls_fieldcat-fieldname = 'PRICE'. ls_fieldcat-ref_fieldname = 'PRICE'. ls_fieldcat-ref_tabname = 'SFLIGHT'. append ls_fieldcat to rt_fieldcat. clear ls_fieldcat. pos = pos + 1. endform.

ALV Field Catalog START-OF-SELECTION. SELECT carrid connid fldate price FROM SFLIGHT INTO TABLE GT_OUTTAB. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'I_STRUCTURE' IT_FIELDCAT = gt_fieldcat[] TABLES T_OUTTAB = gt_outtab.

ALV Field Catalog

ALV Report : Exercise II

ALV Example III Using Field Catalog (Add Derived Column)

ALV Field Catalog – Add Field … types: begin of i_structure, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price, avail_seat like SFLIGHT-SEATSOCC, end of i_structure. START-OF-SELECTION. select * from sflight. move-corresponding sflight to gt_outtab. gt_outtab-avail_seat = sflight-seatsmax - sflight-seatsocc. append gt_outtab. endselect.

ALV Field Catalog – Add Field form field_cat_init using rt_fieldcat type slis_t_fieldcat_alv. … *Column 4 ls_fieldcat-col_pos = pos. ls_fieldcat-fieldname = 'PRICE'. ls_fieldcat-ref_fieldname = 'PRICE'. ls_fieldcat-ref_tabname = 'SFLIGHT'. append ls_fieldcat to rt_fieldcat. clear ls_fieldcat. pos = pos + 1. *Column 5 ls_fieldcat-fieldname = 'AVAIL_SEAT'. ls_fieldcat-SELTEXT_L = 'Available Seat'. ls_fieldcat-DDICTXT = 'L'. *ls_fieldcat-ref_fieldname = 'SEATSOCC'. *ls_fieldcat-ref_tabname = 'SFLIGHT'. endform.

ALV Field Catalog – Add Field

ALV Report : Exercise III

ALV Example IV Using Field Catalog (SELECT … INNER JOIN…)

ALV Field Catalog – Select … Inner Join … types: begin of i_structure, carrid LIKE spfli-carrid, connid LIKE spfli-connid, fldate LIKE sflight-fldate, cityto LIKE spfli-cityto, price LIKE sflight-price, end of i_structure. START-OF-SELECTION. SELECT spfli~carrid spfli~connid sflight~fldate spfli~cityto sflight~price INTO TABLE gt_outtab FROM spfli INNER JOIN sflight ON spfli~carrid = sflight~carrid AND spfli~connid = sflight~connid.

ALV Field Catalog form field_cat_init using rt_fieldcat type slis_t_fieldcat_alv. … *Column 4 ls_fieldcat-col_pos = pos. ls_fieldcat-fieldname = 'CITYTO'. ls_fieldcat-ref_fieldname = 'CITYTO'. ls_fieldcat-ref_tabname = 'SPFLI'. APPEND ls_fieldcat TO rt_fieldcat. CLEAR ls_fieldcat. pos = pos + 1. *Column 5 ls_fieldcat-fieldname = 'PRICE'. ls_fieldcat-ref_fieldname = 'PRICE'. ls_fieldcat-ref_tabname = 'SFLIGHT'. ENDFORM. "field_cat_init

ALV Report : Example IV

Exercise IV ZCUSTOMERS ZSALES ZPRODUCTS id name city p_id prod_name 1 John New York 2 Peter London 3 David Singapore cust_id prod_id sale_date qty 1 A1 20020318 10 20020319 100 20020329 50 A2 200 3 X1 20020321 90 ZPRODUCTS p_id prod_name on_hand A1 Pen 100 A2 Pencil 125 B1 Ruler 80 X1 Tape 120

ALV Report : Exercise IV zsales-sale_date zcustomers-id zcustomers-name zproducts-prod_name zsales-qty

ALV Technique

ALV : Variant

ALV : Variant REPORT ZALV06 NO STANDARD PAGE HEADING. type-pools slis. types: begin of i_structure, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price, end of i_structure. data: gt_fieldcat type slis_t_fieldcat_alv, isvariant like DISVARIANT. "ADD gt_outtab type i_structure occurs 0 with header line. initialization. perform field_cat_init using gt_fieldcat[]. isvariant-report = 'ZALV06'. "ADD

ALV : Variant I_SAVE = 'A' "ADD START-OF-SELECTION. SELECT carrid connid fldate price FROM SFLIGHT INTO TABLE GT_OUTTAB. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'I_STRUCTURE' IT_FIELDCAT = gt_fieldcat[] IS_VARIANT = isvariant "ADD I_SAVE = 'A' "ADD “ A = user&Global,U = user,X = global TABLES T_OUTTAB = gt_outtab.

ALV : Zebra

ALV : Zebra REPORT ZALV2 NO STANDARD PAGE HEADING. type-pools slis. types: begin of i_structure, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price, end of i_structure. data: gt_fieldcat type slis_t_fieldcat_alv, GT_LAYOUT TYPE SLIS_LAYOUT_ALV, "ADD gt_outtab type i_structure occurs 0 with header line. initialization. perform field_cat_init using gt_fieldcat[]. GT_LAYOUT-ZEBRA = 'X'. "ADD

ALV : Zebra IS_LAYOUT = GT_LAYOUT "ADD START-OF-SELECTION. SELECT carrid connid fldate price FROM SFLIGHT INTO TABLE GT_OUTTAB. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'I_STRUCTURE' IT_FIELDCAT = gt_fieldcat[] IS_LAYOUT = GT_LAYOUT "ADD TABLES T_OUTTAB = gt_outtab.

ALV : Title

ALV : Title REPORT ZALV2 NO STANDARD PAGE HEADING. type-pools slis. types: begin of i_structure, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price, end of i_structure. data: gt_fieldcat type slis_t_fieldcat_alv, GT_GID_TITLE TYPE LVC_TITLE, "ADD gt_outtab type i_structure occurs 0 with header line. initialization. perform field_cat_init using gt_fieldcat[]. concatenate 'Flight Information' ' for ALV Report' into GT_GID_TITLE. "ADD

ALV : Title I_GRID_TITLE = GT_GID_TITLE "ADD START-OF-SELECTION. SELECT carrid connid fldate price FROM SFLIGHT INTO TABLE GT_OUTTAB. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_STRUCTURE_NAME = 'I_STRUCTURE' IT_FIELDCAT = gt_fieldcat[] I_GRID_TITLE = GT_GID_TITLE "ADD TABLES T_OUTTAB = gt_outtab.

Exercise

Exercise : Sale Order KNA1 VBAK VBAP

Exercise : Control-break Report vbak-audat vbap-matnr vbak-vbeln vbak-kunnr kna1-name1 vbap-netwr

Exercise : ALV Report vbak-audat vbap-matnr vbap-netwr vbak-vbeln vbak-kunnr kna1-name1