SlideShare uma empresa Scribd logo
1 de 15
Pseudo code of the report program.
Get Country from User.
Select Required records from table: SCUSTOM into internal table:
ITABSCUSTOM Where country = country code.
Case Country.
When 'DE'.
Country Name = 'Germany'.
When 'GB'.
Country Name = 'Great Britain'.
When 'US'.
Country Name = 'USA'.
When 'CA'.
Country Name = 'Canada'.
When 'FR'.
Country Name = 'France'.
When 'AU'.
Country Name = 'Australia'.
When 'NZ'.
Country Name = 'New Zealand'.
When Others.
Print: Error Message.
End Case.
Print country, page and number.
Print system information – date, time, and user.
Loop of internal table itabscustom for Business Customer.
Count For number of Business customer.
Select records from Sbook where Customer id of internal table and
table are same.
Print records from internal table for business customer.
End Loop.
IF no records for business customer
Print message
Loop of internal table itabscustom for Business Customer.
Count For number of Private customer.
Select records from Sbook where Customer id of internal table and
table are same.
Print records from internal table for Private customers.
End Loop.
if no records for Private customer.
Print message
Print total number of business customers.
Print total number of private customers.
Print hidden id and name of customer selected
Select Required records from table: SBOOK into internal table:
itab_sbook
Where id = hidden id
Loop of internal table itab_sbook.
Select Agent Name from table: Stravelag to internal table: itab_sbook
where Agency number is same.
Modify the internal table for the Record.
End Loop.
Sort internal table: itab_sbook by name in ascending order
Print Required records from internal table: itab_sbook.
Print Class
If itab_sbook class ‘F’
Class name = 'FRST'
Else if class ‘C’.
Class name = 'BSNS'
Else if class ‘Y’
Class name= 'ECON'
End if.
IF No Bookings for the customer
Print message
Print: Total Bookings for the Customer
Hard Code of the Program:
*&---------------------------------------------------*
*&
*&---------------------------------------------------*
*& Customer Booking Report
*&
*&---------------------------------------------------*
REPORT YA4004A2.
*----------------------------------------------------*
* Tables.
*
*----------------------------------------------------*
TABLES: SCUSTOM, " Customer Detail Table.
SBOOK, " Booking Detail Table.
STRAVELAG. " Travel Agency Detail Table.
*-----------------------------------------------------*
* Variables.
*
*-----------------------------------------------------*
DATA: BOOKING TYPE I, " Number Of Bookings.
CUSTOMER_NO_B(3) TYPE P, " Total No of Business Customers.
CUSTOMER_NO_P(3) TYPE P, " Total No of Private Customers.
CUSTOMER_BOOK_NO TYPE I, " Total Customers Booking Numbers.
COUNTRY_NAME TYPE STRING, " Country Name.
AGENT_NAME TYPE STRING, " Agent Name.
AGENCY_NUMBER TYPE I, " Agency Number.
CLASS_NAME TYPE STRING. " Class Name For Ticket Class.
*-----------------------------------------------------*
* Internal Table of Scustom Table.
*-----------------------------------------------------*
DATA: BEGIN OF ITABSCUSTOM OCCURS 0,
ID LIKE SCUSTOM-ID,
NAME LIKE SCUSTOM-NAME,
POSTBOX LIKE SCUSTOM-POSTBOX,
POSTCODE LIKE SCUSTOM-POSTCODE,
CITY LIKE SCUSTOM-CITY,
DISCOUNT LIKE SCUSTOM-DISCOUNT,
CUSTTYPE LIKE SCUSTOM-CUSTTYPE,
END OF ITABSCUSTOM.
*-----------------------------------------------------*
* Internal Table of Sbook and Stravelag Tables.
*-----------------------------------------------------*
DATA: BEGIN OF ITAB_SBOOK OCCURS 0,
FLIGHT_DATE LIKE SBOOK-FLDATE,
BOOK_ID LIKE SBOOK-BOOKID,
CARR_ID LIKE SBOOK-CARRID,
CONN_ID LIKE SBOOK-CONNID,
CLASS LIKE SBOOK-CLASS,
AGENCY_NUMBER LIKE STRAVELAG-AGENCYNUM,
AGENT_NAME LIKE STRAVELAG-NAME,
END OF ITAB_SBOOK.
*-----------------------------------------------------*
* User Will Input Company Code Manually.
*-----------------------------------------------------*
PARAMETERS: Country LIKE SCUSTOM-COUNTRY.
*-----------------------------------------------------*
* Fatch the Required Data From Scustom Table to
* ItabScustom Internal Table.
*-----------------------------------------------------*
*-----------------------------------------------------*
SELECT ID NAME POSTBOX POSTCODE CITY DISCOUNT CUSTTYPE
FROM SCUSTOM INTO TABLE ITABSCUSTOM
WHERE COUNTRY = Country.
*-----------------------------------------------------*
*-----------------------------------------------------*
* Using Case, Country Names Deternined From
* Country Code and If the Country Code is Other Than
* Given Seven Contries, Display Appropriate Message.
*-----------------------------------------------------*
CASE Country.
WHEN 'DE'.
COUNTRY_NAME = 'Germany'.
WHEN 'GB'.
COUNTRY_NAME = 'Great Britain'.
WHEN 'US'.
COUNTRY_NAME = 'USA'.
WHEN 'CA'.
COUNTRY_NAME = 'Canada'.
WHEN 'FR'.
COUNTRY_NAME = 'France'.
WHEN 'AU'.
COUNTRY_NAME = 'Australia'.
WHEN 'NZ'.
COUNTRY_NAME = 'New Zealand'.
WHEN OTHERS.
SKIP 1.
ULINE AT /1(175).
WRITE: /1 SY-VLINE NO-GAP,'No' AS ICON,
'You cannot Search other than 7 countries.' color 6,
175 SY-VLINE NO-GAP.
ULINE AT /1(175).
EXIT.
ENDCASE.
*-----------------------------------------------------*
* Print the Report Heading With System Variables.
*-----------------------------------------------------*
TOP-OF-PAGE.
ULINE AT /1(175).
FORMAT COLOR COL_HEADING.
WRITE: / SY-VLINE NO-GAP,25 'Customer Booking Report for',
COUNTRY_NAME,110 'Page :', SY-PAGNO,
175 SY-VLINE NO-GAP.
ULINE AT /1(175).
WRITE: / SY-VLINE NO-GAP,'Run Date',
20 SY-DATUM,55 'At :',60 SY-UZEIT,
90 'By :',SY-UNAME,175 SY-VLINE NO-GAP.
ULINE AT /1(175).
WRITE: / SY-VLINE NO-GAP,'Customer ID',25 'Name',
55 'Post Box',69 'Post Code',90 'City',
119 'Discount',133 'Number of Bookings',
175 SY-VLINE NO-GAP.
FORMAT RESET.
ULINE AT /1(175).
*-----------------------------------------------------*
* Start of Selection starts from Here and Also
* Prints Some Messages With System Variables.
*-----------------------------------------------------*
START-OF-SELECTION.
WRITE: /175 SY-VLINE NO-GAP.
WRITE: 1 SY-VLINE NO-GAP,'Bussiness Customers' COLOR 7,
175 SY-VLINE NO-GAP.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
*-----------------------------------------------------*
* Loop Of Internal Table Itabscustom with
* Business Customers.
*-----------------------------------------------------*
LOOP AT ITABSCUSTOM WHERE CUSTTYPE = 'B'.
CUSTOMER_NO_B = CUSTOMER_NO_B + 1. " Counter For Total Number Of
" Customers with Type Business.
SELECT * FROM SBOOK " Check the Common ID's
WHERE CUSTOMID = ITABSCUSTOM-ID. " Between the Itabscustom
ENDSELECT. " and Table Sbook and Select Data.
BOOKING = SY-DBCNT.
*-----------------------------------------------------*
* Print the Report Lines.
*-----------------------------------------------------*
WRITE: / SY-VLINE NO-GAP,ITABSCUSTOM-ID,
25 ITABSCUSTOM-NAME,55 ITABSCUSTOM-POSTBOX,
70 ITABSCUSTOM-POSTCODE,90 ITABSCUSTOM-CITY,
120 ITABSCUSTOM-DISCOUNT,'%',130 BOOKING,
175 SY-VLINE NO-GAP.
*-----------------------------------------------------*
* Hidden fields Require For the Secondry List's
* Common fields.
*-----------------------------------------------------*
HIDE:ITABSCUSTOM-ID, ITABSCUSTOM-NAME. " Hidden fields Customer-ID
" and Customer-Name.
ENDLOOP.
SORT ITABSCUSTOM BY ID ASCENDING. " Sort By Customer ID
" in Ascending Order.
*-----------------------------------------------------*
* IF the Record not found with Bussines Customer,
* it will return Message.
*-----------------------------------------------------*
IF SY-SUBRC <> 0.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
FORMAT COLOR 6.
WRITE: /1 SY-VLINE NO-GAP,
5 'No Business Customers Records from',
COUNTRY_NAME,175 SY-VLINE NO-GAP.
FORMAT RESET.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
ENDIF.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
WRITE: 1 SY-VLINE NO-GAP,
'Private Customers' COLOR 7,175 SY-VLINE NO-GAP.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
*-----------------------------------------------------*
* Loop Of Internal Table Itabscustom with
* Private Customers.
*-----------------------------------------------------*
LOOP AT ITABSCUSTOM WHERE CUSTTYPE = 'P'.
CUSTOMER_NO_P = CUSTOMER_NO_P + 1. " Counter For Total Number Of
" Customers with Type Private.
SELECT * FROM SBOOK " Check the Common ID's
WHERE CUSTOMID = ITABSCUSTOM-ID. " Between the Itabscustom
ENDSELECT. "and Table Sbook and Select Data.
BOOKING = SY-DBCNT.
*-----------------------------------------------------*
* Print the Report Lines.
*-----------------------------------------------------*
WRITE: /1 SY-VLINE NO-GAP,ITABSCUSTOM-ID,
25 ITABSCUSTOM-NAME,55 ITABSCUSTOM-POSTBOX,
70 ITABSCUSTOM-POSTCODE,90 ITABSCUSTOM-CITY,
120 ITABSCUSTOM-DISCOUNT,'%',130 BOOKING,
175 SY-VLINE NO-GAP.
*-----------------------------------------------------*
* Hidden fields Require For the
* Secondry List's Common fields.
*-----------------------------------------------------*
HIDE:ITABSCUSTOM-ID, ITABSCUSTOM-NAME. " Hidden fields Customer-ID
" and Customer-Name.
ENDLOOP.
SORT ITABSCUSTOM BY ID ASCENDING. " Sort By Customer ID
" in Ascending Order.
*-----------------------------------------------------*
* IF the Record not found with Private Customer,
* it will return Message.
*-----------------------------------------------------*
IF SY-SUBRC <> 0.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
FORMAT COLOR 6.
WRITE: /1 SY-VLINE NO-GAP,
5 'No Private Customers Records from',
COUNTRY_NAME,175 SY-VLINE NO-GAP.
FORMAT RESET.
WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
ENDIF.
ULINE AT /1(175).
*-----------------------------------------------------*
* Prints Total Number Of Business Customers.
*-----------------------------------------------------*
FORMAT COLOR 3.
WRITE: /1 SY-VLINE NO-GAP,
'Total Business Customers:',
27 CUSTOMER_NO_B,175 SY-VLINE NO-GAP.
*-----------------------------------------------------*
* Prints Total Number Of Private Customers.
*-----------------------------------------------------*
WRITE: /1 SY-VLINE NO-GAP,'Total Private Customers:',
27 CUSTOMER_NO_P,175 SY-VLINE NO-GAP.
FORMAT RESET.
ULINE AT /1(175).
*-----------------------------------------------------*
* Prints Message At the Top Of the Page
* with Some System Varibles.
*-----------------------------------------------------*
TOP-OF-PAGE DURING LINE-SELECTION.
FORMAT COLOR COL_HEADING.
ULINE AT /1(175).
WRITE: /1 SY-VLINE NO-GAP,25 'Customer Flight Booking.',
110 'Page :', SY-PAGNO,175 SY-VLINE NO-GAP.
ULINE AT /1(175).
WRITE: /1 SY-VLINE NO-GAP,25 'Flight Booking for Customer',
ITABSCUSTOM-ID,':',ITABSCUSTOM-NAME,175 SY-VLINE NO-GAP.
ULINE AT /1(175).
WRITE: /1 SY-VLINE NO-GAP,'Travel Agent',
45 'Flight Date',67 'Booking ID',
85 'Carrier ID',105 'Flight Number',
127 'Ticket Class',175 SY-VLINE NO-GAP.
ULINE AT /1(175).
FORMAT RESET.
*-----------------------------------------------------*
* At Line Selection Part for the Drill Down
* from First List to Secondry List.
*-----------------------------------------------------*
AT LINE-SELECTION. " For Drill Down To Secondry List.
CHECK NOT ITABSCUSTOM-ID IS INITIAL. "Check the Initial Value Of the
"ID.
*-----------------------------------------------------*
* Fatch the Required Data From Sbook Table
* to ITAB_SBOOK Internal Table whose Customer ID's are Same.
*-----------------------------------------------------*
*-----------------------------------------------------*
SELECT FLDATE BOOKID CARRID CONNID CLASS AGENCYNUM FROM SBOOK
INTO TABLE ITAB_SBOOK
WHERE CUSTOMID = ITABSCUSTOM-ID.
*-----------------------------------------------------*
*-----------------------------------------------------*
* Loop Of Internal Table ITAB_SBOOK.
*-----------------------------------------------------*
LOOP AT ITAB_SBOOK.
CUSTOMER_BOOK_NO = SY-TABIX. " Gives the Total Number Of the
" Customer's Bookings.
SELECT SINGLE * FROM STRAVELAG
WHERE AGENCYNUM = ITAB_SBOOK-AGENCY_NUMBER.
ITAB_SBOOK-AGENT_NAME = STRAVELAG-NAME.
MODIFY ITAB_SBOOK INDEX SY-TABIX.
ENDLOOP.
SORT ITAB_SBOOK BY AGENT_NAME ASCENDING. "Sort Name in Ascending
"Order.
*-----------------------------------------------------*
* Loop Of Internal Table ITAB_SBOOK
* for Print the Records.
*-----------------------------------------------------*
LOOP AT ITAB_SBOOK.
*-----------------------------------------------------*
* Print the Report Lines.
*-----------------------------------------------------*
WRITE: /1 SY-VLINE NO-GAP,ITAB_SBOOK-AGENT_NAME,
40 SY-VLINE NO-GAP,45 ITAB_SBOOK-FLIGHT_DATE,
60 SY-VLINE NO-GAP,67 ITAB_SBOOK-BOOK_ID,
80 SY-VLINE NO-GAP,88 ITAB_SBOOK-CARR_ID,
100 SY-VLINE NO-GAP,110 ITAB_SBOOK-CONN_ID.
*-----------------------------------------------------*
* Using If Condition it Will Determine the class name
* from Characters and Print it.
*-----------------------------------------------------*
IF ( ITAB_SBOOK-CLASS = 'F' ).
CLASS_NAME = 'FRCT'.
WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME.
ELSEIF ( ITAB_SBOOK-CLASS = 'C' ).
CLASS_NAME = 'BSNS'.
WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME.
ELSEIF ( ITAB_SBOOK-CLASS = 'Y' ).
CLASS_NAME = 'ECON'.
WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME.
ENDIF.
WRITE: 175 SY-VLINE NO-GAP.
ENDLOOP.
*-----------------------------------------------------*
* If No Record Found For the Select Customer
* It will Return the Message.
*-----------------------------------------------------*
IF SY-SUBRC <> 0.
FORMAT COLOR 6.
WRITE: /1 SY-VLINE NO-GAP,'No Record found of',
ITABSCUSTOM-NAME,175 SY-VLINE NO-GAP.
ULINE AT /1(175).
EXIT.
ENDIF.
ULINE AT /1(175).
*-----------------------------------------------------*
* Prints the Total Number Of Customer Bookings.
*-----------------------------------------------------*
FORMAT COLOR 3.
WRITE: /1 SY-VLINE NO-GAP,
'Total Bookings for the Customer :',
CUSTOMER_BOOK_NO,175 SY-VLINE NO-GAP.
ULINE AT /1(175).
FORMAT RESET.
CLEAR ITABSCUSTOM. " Clear the Itabscustom table
" before end of selection.
*-----------------------------------------------------*
* End Of the Selection.
*-----------------------------------------------------*
END-OF-SELECTION.
CLEAR ITABSCUSTOM. " Clear the Itabscustom table
" After end of selection.
*-----------------------------------------------------*
* End OF The Report Program.
*-----------------------------------------------------*
Example:
The example of the output report of this program is given below.
Report Program output:
Output of the Customers (B and P).
Output of the Customer’s Bookings.
Sap abap report program

Mais conteúdo relacionado

Mais procurados

Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overviewsapdocs. info
 
ABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection ScreenABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection Screensapdocs. info
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programmingSatheesh Kanna
 
HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/sapdocs. info
 
Passing table to subroutine
Passing table to subroutinePassing table to subroutine
Passing table to subroutineRajee Chandru
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
Call transaction method
Call transaction methodCall transaction method
Call transaction methodKranthi Kumar
 
SAP Adding fields to dynamic selection for fbln transactions (2)
SAP Adding fields to dynamic selection for fbln transactions (2)SAP Adding fields to dynamic selection for fbln transactions (2)
SAP Adding fields to dynamic selection for fbln transactions (2)Imran M Arab
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantAnkit Sharma
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questionskssr99
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONKranthi Kumar
 
Enhancement framework the new way to enhance your abap systems
Enhancement framework   the new way to enhance your abap systemsEnhancement framework   the new way to enhance your abap systems
Enhancement framework the new way to enhance your abap systemsKranthi Kumar
 

Mais procurados (20)

Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
ABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection ScreenABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection Screen
 
Abap Questions
Abap QuestionsAbap Questions
Abap Questions
 
Field symbols
Field symbolsField symbols
Field symbols
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
Badis
Badis Badis
Badis
 
HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/
 
Passing table to subroutine
Passing table to subroutinePassing table to subroutine
Passing table to subroutine
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
SAP-ABAP/4@e_max
SAP-ABAP/4@e_maxSAP-ABAP/4@e_max
SAP-ABAP/4@e_max
 
Call transaction method
Call transaction methodCall transaction method
Call transaction method
 
SAP Adding fields to dynamic selection for fbln transactions (2)
SAP Adding fields to dynamic selection for fbln transactions (2)SAP Adding fields to dynamic selection for fbln transactions (2)
SAP Adding fields to dynamic selection for fbln transactions (2)
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
Mainframe - OPC
Mainframe -  OPCMainframe -  OPC
Mainframe - OPC
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questions
 
Sap abap
Sap abapSap abap
Sap abap
 
Sapscript
SapscriptSapscript
Sapscript
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Enhancement framework the new way to enhance your abap systems
Enhancement framework   the new way to enhance your abap systemsEnhancement framework   the new way to enhance your abap systems
Enhancement framework the new way to enhance your abap systems
 

Destaque

Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPnityaabap
 
Structuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayStructuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayBlackvard
 
Classical ABAP interactive report
Classical ABAP interactive reportClassical ABAP interactive report
Classical ABAP interactive reportRavi Kanudawala
 
Sap abap online training
Sap abap online trainingSap abap online training
Sap abap online trainingShalom Itschool
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation systemSandip Murari
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infosapdocs. info
 
Rotary op koers discon1600
Rotary op koers discon1600Rotary op koers discon1600
Rotary op koers discon1600Rotary-D1600
 
Como aprender a vivir
Como aprender a vivirComo aprender a vivir
Como aprender a vivirStiven Garcia
 
Emmy Award winning Sprague Theobald- Northwest Passage
Emmy Award winning Sprague Theobald- Northwest PassageEmmy Award winning Sprague Theobald- Northwest Passage
Emmy Award winning Sprague Theobald- Northwest PassagePamela Wise
 
Bricks clicks and flips NDM retail presentation
Bricks clicks and flips NDM retail presentationBricks clicks and flips NDM retail presentation
Bricks clicks and flips NDM retail presentationGuy Turner
 
Herramientas de internet iicyh 2
Herramientas de internet iicyh 2Herramientas de internet iicyh 2
Herramientas de internet iicyh 2smendoza18
 
The Learning Academy
The Learning AcademyThe Learning Academy
The Learning AcademyPankaj Wadhwa
 
Biomass Power For Energy and Sustainable Development
Biomass Power For Energy and Sustainable DevelopmentBiomass Power For Energy and Sustainable Development
Biomass Power For Energy and Sustainable DevelopmentZX7
 

Destaque (19)

Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAP
 
Structuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayStructuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal Way
 
Classical ABAP interactive report
Classical ABAP interactive reportClassical ABAP interactive report
Classical ABAP interactive report
 
Sap abap online training
Sap abap online trainingSap abap online training
Sap abap online training
 
Project Report on SAP
Project Report on SAPProject Report on SAP
Project Report on SAP
 
07.Advanced Abap
07.Advanced Abap07.Advanced Abap
07.Advanced Abap
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation system
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.info
 
Rotary op koers discon1600
Rotary op koers discon1600Rotary op koers discon1600
Rotary op koers discon1600
 
Como aprender a vivir
Como aprender a vivirComo aprender a vivir
Como aprender a vivir
 
Emmy Award winning Sprague Theobald- Northwest Passage
Emmy Award winning Sprague Theobald- Northwest PassageEmmy Award winning Sprague Theobald- Northwest Passage
Emmy Award winning Sprague Theobald- Northwest Passage
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
Bricks clicks and flips NDM retail presentation
Bricks clicks and flips NDM retail presentationBricks clicks and flips NDM retail presentation
Bricks clicks and flips NDM retail presentation
 
Herramientas de internet iicyh 2
Herramientas de internet iicyh 2Herramientas de internet iicyh 2
Herramientas de internet iicyh 2
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
The Learning Academy
The Learning AcademyThe Learning Academy
The Learning Academy
 
Biomass Power For Energy and Sustainable Development
Biomass Power For Energy and Sustainable DevelopmentBiomass Power For Energy and Sustainable Development
Biomass Power For Energy and Sustainable Development
 
Automatic vehicle locator
Automatic vehicle locatorAutomatic vehicle locator
Automatic vehicle locator
 

Semelhante a Sap abap report program

Alvedit programs
Alvedit programsAlvedit programs
Alvedit programsmcclintick
 
COBOL CICS EXAMPLE-SC52P52
COBOL CICS EXAMPLE-SC52P52COBOL CICS EXAMPLE-SC52P52
COBOL CICS EXAMPLE-SC52P52Jon Fortman
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfoliomaywoo
 
Alv interactive ABAPreport
Alv interactive ABAPreportAlv interactive ABAPreport
Alv interactive ABAPreportRavi Kanudawala
 
COBOL DB2 BATCH EXAMPLE-RPR6520
COBOL DB2 BATCH EXAMPLE-RPR6520COBOL DB2 BATCH EXAMPLE-RPR6520
COBOL DB2 BATCH EXAMPLE-RPR6520Jon Fortman
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Tablesapdocs. info
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02tabish
 
03 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp0103 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp01wingsrai
 
Single entry incomplete record
Single entry incomplete recordSingle entry incomplete record
Single entry incomplete recordKAZEMBETVOnline
 
Examples of-tca-apis
Examples of-tca-apisExamples of-tca-apis
Examples of-tca-apisMihai Fildan
 

Semelhante a Sap abap report program (20)

Alv grid
Alv gridAlv grid
Alv grid
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 
Alv barra her
Alv barra herAlv barra her
Alv barra her
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programs
 
COBOL CICS EXAMPLE-SC52P52
COBOL CICS EXAMPLE-SC52P52COBOL CICS EXAMPLE-SC52P52
COBOL CICS EXAMPLE-SC52P52
 
May Woo Bi Portfolio
May Woo Bi PortfolioMay Woo Bi Portfolio
May Woo Bi Portfolio
 
Report zalv
Report  zalvReport  zalv
Report zalv
 
Alv interactive ABAPreport
Alv interactive ABAPreportAlv interactive ABAPreport
Alv interactive ABAPreport
 
Alv Block
Alv BlockAlv Block
Alv Block
 
Zmalv output type_v1.1
Zmalv output type_v1.1Zmalv output type_v1.1
Zmalv output type_v1.1
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
CIN User Manual
CIN User ManualCIN User Manual
CIN User Manual
 
Classical report
Classical reportClassical report
Classical report
 
Alv a otro alv
Alv a otro alvAlv a otro alv
Alv a otro alv
 
COBOL DB2 BATCH EXAMPLE-RPR6520
COBOL DB2 BATCH EXAMPLE-RPR6520COBOL DB2 BATCH EXAMPLE-RPR6520
COBOL DB2 BATCH EXAMPLE-RPR6520
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02
 
03 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp0103 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp01
 
Single entry incomplete record
Single entry incomplete recordSingle entry incomplete record
Single entry incomplete record
 
Examples of-tca-apis
Examples of-tca-apisExamples of-tca-apis
Examples of-tca-apis
 

Último

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 

Último (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Sap abap report program

  • 1. Pseudo code of the report program. Get Country from User. Select Required records from table: SCUSTOM into internal table: ITABSCUSTOM Where country = country code. Case Country. When 'DE'. Country Name = 'Germany'. When 'GB'. Country Name = 'Great Britain'. When 'US'. Country Name = 'USA'. When 'CA'. Country Name = 'Canada'. When 'FR'. Country Name = 'France'. When 'AU'. Country Name = 'Australia'. When 'NZ'. Country Name = 'New Zealand'. When Others. Print: Error Message. End Case. Print country, page and number. Print system information – date, time, and user.
  • 2. Loop of internal table itabscustom for Business Customer. Count For number of Business customer. Select records from Sbook where Customer id of internal table and table are same. Print records from internal table for business customer. End Loop. IF no records for business customer Print message Loop of internal table itabscustom for Business Customer. Count For number of Private customer. Select records from Sbook where Customer id of internal table and table are same. Print records from internal table for Private customers. End Loop. if no records for Private customer. Print message Print total number of business customers. Print total number of private customers. Print hidden id and name of customer selected Select Required records from table: SBOOK into internal table: itab_sbook Where id = hidden id Loop of internal table itab_sbook. Select Agent Name from table: Stravelag to internal table: itab_sbook where Agency number is same. Modify the internal table for the Record. End Loop. Sort internal table: itab_sbook by name in ascending order Print Required records from internal table: itab_sbook.
  • 3. Print Class If itab_sbook class ‘F’ Class name = 'FRST' Else if class ‘C’. Class name = 'BSNS' Else if class ‘Y’ Class name= 'ECON' End if. IF No Bookings for the customer Print message Print: Total Bookings for the Customer
  • 4. Hard Code of the Program: *&---------------------------------------------------* *& *&---------------------------------------------------* *& Customer Booking Report *& *&---------------------------------------------------* REPORT YA4004A2. *----------------------------------------------------* * Tables. * *----------------------------------------------------* TABLES: SCUSTOM, " Customer Detail Table. SBOOK, " Booking Detail Table. STRAVELAG. " Travel Agency Detail Table. *-----------------------------------------------------* * Variables. * *-----------------------------------------------------* DATA: BOOKING TYPE I, " Number Of Bookings. CUSTOMER_NO_B(3) TYPE P, " Total No of Business Customers. CUSTOMER_NO_P(3) TYPE P, " Total No of Private Customers. CUSTOMER_BOOK_NO TYPE I, " Total Customers Booking Numbers. COUNTRY_NAME TYPE STRING, " Country Name. AGENT_NAME TYPE STRING, " Agent Name. AGENCY_NUMBER TYPE I, " Agency Number. CLASS_NAME TYPE STRING. " Class Name For Ticket Class. *-----------------------------------------------------* * Internal Table of Scustom Table. *-----------------------------------------------------* DATA: BEGIN OF ITABSCUSTOM OCCURS 0, ID LIKE SCUSTOM-ID, NAME LIKE SCUSTOM-NAME, POSTBOX LIKE SCUSTOM-POSTBOX, POSTCODE LIKE SCUSTOM-POSTCODE, CITY LIKE SCUSTOM-CITY, DISCOUNT LIKE SCUSTOM-DISCOUNT, CUSTTYPE LIKE SCUSTOM-CUSTTYPE,
  • 5. END OF ITABSCUSTOM. *-----------------------------------------------------* * Internal Table of Sbook and Stravelag Tables. *-----------------------------------------------------* DATA: BEGIN OF ITAB_SBOOK OCCURS 0, FLIGHT_DATE LIKE SBOOK-FLDATE, BOOK_ID LIKE SBOOK-BOOKID, CARR_ID LIKE SBOOK-CARRID, CONN_ID LIKE SBOOK-CONNID, CLASS LIKE SBOOK-CLASS, AGENCY_NUMBER LIKE STRAVELAG-AGENCYNUM, AGENT_NAME LIKE STRAVELAG-NAME, END OF ITAB_SBOOK. *-----------------------------------------------------* * User Will Input Company Code Manually. *-----------------------------------------------------* PARAMETERS: Country LIKE SCUSTOM-COUNTRY. *-----------------------------------------------------* * Fatch the Required Data From Scustom Table to * ItabScustom Internal Table. *-----------------------------------------------------* *-----------------------------------------------------* SELECT ID NAME POSTBOX POSTCODE CITY DISCOUNT CUSTTYPE FROM SCUSTOM INTO TABLE ITABSCUSTOM WHERE COUNTRY = Country. *-----------------------------------------------------* *-----------------------------------------------------* * Using Case, Country Names Deternined From * Country Code and If the Country Code is Other Than * Given Seven Contries, Display Appropriate Message. *-----------------------------------------------------* CASE Country.
  • 6. WHEN 'DE'. COUNTRY_NAME = 'Germany'. WHEN 'GB'. COUNTRY_NAME = 'Great Britain'. WHEN 'US'. COUNTRY_NAME = 'USA'. WHEN 'CA'. COUNTRY_NAME = 'Canada'. WHEN 'FR'. COUNTRY_NAME = 'France'. WHEN 'AU'. COUNTRY_NAME = 'Australia'. WHEN 'NZ'. COUNTRY_NAME = 'New Zealand'. WHEN OTHERS. SKIP 1. ULINE AT /1(175). WRITE: /1 SY-VLINE NO-GAP,'No' AS ICON, 'You cannot Search other than 7 countries.' color 6, 175 SY-VLINE NO-GAP. ULINE AT /1(175). EXIT. ENDCASE. *-----------------------------------------------------* * Print the Report Heading With System Variables. *-----------------------------------------------------* TOP-OF-PAGE. ULINE AT /1(175). FORMAT COLOR COL_HEADING. WRITE: / SY-VLINE NO-GAP,25 'Customer Booking Report for',
  • 7. COUNTRY_NAME,110 'Page :', SY-PAGNO, 175 SY-VLINE NO-GAP. ULINE AT /1(175). WRITE: / SY-VLINE NO-GAP,'Run Date', 20 SY-DATUM,55 'At :',60 SY-UZEIT, 90 'By :',SY-UNAME,175 SY-VLINE NO-GAP. ULINE AT /1(175). WRITE: / SY-VLINE NO-GAP,'Customer ID',25 'Name', 55 'Post Box',69 'Post Code',90 'City', 119 'Discount',133 'Number of Bookings', 175 SY-VLINE NO-GAP. FORMAT RESET. ULINE AT /1(175). *-----------------------------------------------------* * Start of Selection starts from Here and Also * Prints Some Messages With System Variables. *-----------------------------------------------------* START-OF-SELECTION. WRITE: /175 SY-VLINE NO-GAP. WRITE: 1 SY-VLINE NO-GAP,'Bussiness Customers' COLOR 7, 175 SY-VLINE NO-GAP. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. *-----------------------------------------------------* * Loop Of Internal Table Itabscustom with * Business Customers. *-----------------------------------------------------* LOOP AT ITABSCUSTOM WHERE CUSTTYPE = 'B'. CUSTOMER_NO_B = CUSTOMER_NO_B + 1. " Counter For Total Number Of " Customers with Type Business. SELECT * FROM SBOOK " Check the Common ID's WHERE CUSTOMID = ITABSCUSTOM-ID. " Between the Itabscustom ENDSELECT. " and Table Sbook and Select Data. BOOKING = SY-DBCNT. *-----------------------------------------------------*
  • 8. * Print the Report Lines. *-----------------------------------------------------* WRITE: / SY-VLINE NO-GAP,ITABSCUSTOM-ID, 25 ITABSCUSTOM-NAME,55 ITABSCUSTOM-POSTBOX, 70 ITABSCUSTOM-POSTCODE,90 ITABSCUSTOM-CITY, 120 ITABSCUSTOM-DISCOUNT,'%',130 BOOKING, 175 SY-VLINE NO-GAP. *-----------------------------------------------------* * Hidden fields Require For the Secondry List's * Common fields. *-----------------------------------------------------* HIDE:ITABSCUSTOM-ID, ITABSCUSTOM-NAME. " Hidden fields Customer-ID " and Customer-Name. ENDLOOP. SORT ITABSCUSTOM BY ID ASCENDING. " Sort By Customer ID " in Ascending Order. *-----------------------------------------------------* * IF the Record not found with Bussines Customer, * it will return Message. *-----------------------------------------------------* IF SY-SUBRC <> 0. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. FORMAT COLOR 6. WRITE: /1 SY-VLINE NO-GAP, 5 'No Business Customers Records from', COUNTRY_NAME,175 SY-VLINE NO-GAP. FORMAT RESET. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. ENDIF. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. WRITE: 1 SY-VLINE NO-GAP, 'Private Customers' COLOR 7,175 SY-VLINE NO-GAP.
  • 9. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. *-----------------------------------------------------* * Loop Of Internal Table Itabscustom with * Private Customers. *-----------------------------------------------------* LOOP AT ITABSCUSTOM WHERE CUSTTYPE = 'P'. CUSTOMER_NO_P = CUSTOMER_NO_P + 1. " Counter For Total Number Of " Customers with Type Private. SELECT * FROM SBOOK " Check the Common ID's WHERE CUSTOMID = ITABSCUSTOM-ID. " Between the Itabscustom ENDSELECT. "and Table Sbook and Select Data. BOOKING = SY-DBCNT. *-----------------------------------------------------* * Print the Report Lines. *-----------------------------------------------------* WRITE: /1 SY-VLINE NO-GAP,ITABSCUSTOM-ID, 25 ITABSCUSTOM-NAME,55 ITABSCUSTOM-POSTBOX, 70 ITABSCUSTOM-POSTCODE,90 ITABSCUSTOM-CITY, 120 ITABSCUSTOM-DISCOUNT,'%',130 BOOKING, 175 SY-VLINE NO-GAP. *-----------------------------------------------------* * Hidden fields Require For the * Secondry List's Common fields. *-----------------------------------------------------* HIDE:ITABSCUSTOM-ID, ITABSCUSTOM-NAME. " Hidden fields Customer-ID " and Customer-Name. ENDLOOP. SORT ITABSCUSTOM BY ID ASCENDING. " Sort By Customer ID " in Ascending Order. *-----------------------------------------------------* * IF the Record not found with Private Customer, * it will return Message. *-----------------------------------------------------* IF SY-SUBRC <> 0. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP.
  • 10. FORMAT COLOR 6. WRITE: /1 SY-VLINE NO-GAP, 5 'No Private Customers Records from', COUNTRY_NAME,175 SY-VLINE NO-GAP. FORMAT RESET. WRITE: /1 SY-VLINE NO-GAP,175 SY-VLINE NO-GAP. ENDIF. ULINE AT /1(175). *-----------------------------------------------------* * Prints Total Number Of Business Customers. *-----------------------------------------------------* FORMAT COLOR 3. WRITE: /1 SY-VLINE NO-GAP, 'Total Business Customers:', 27 CUSTOMER_NO_B,175 SY-VLINE NO-GAP. *-----------------------------------------------------* * Prints Total Number Of Private Customers. *-----------------------------------------------------* WRITE: /1 SY-VLINE NO-GAP,'Total Private Customers:', 27 CUSTOMER_NO_P,175 SY-VLINE NO-GAP. FORMAT RESET. ULINE AT /1(175). *-----------------------------------------------------* * Prints Message At the Top Of the Page * with Some System Varibles. *-----------------------------------------------------* TOP-OF-PAGE DURING LINE-SELECTION. FORMAT COLOR COL_HEADING. ULINE AT /1(175). WRITE: /1 SY-VLINE NO-GAP,25 'Customer Flight Booking.', 110 'Page :', SY-PAGNO,175 SY-VLINE NO-GAP. ULINE AT /1(175). WRITE: /1 SY-VLINE NO-GAP,25 'Flight Booking for Customer', ITABSCUSTOM-ID,':',ITABSCUSTOM-NAME,175 SY-VLINE NO-GAP. ULINE AT /1(175). WRITE: /1 SY-VLINE NO-GAP,'Travel Agent',
  • 11. 45 'Flight Date',67 'Booking ID', 85 'Carrier ID',105 'Flight Number', 127 'Ticket Class',175 SY-VLINE NO-GAP. ULINE AT /1(175). FORMAT RESET. *-----------------------------------------------------* * At Line Selection Part for the Drill Down * from First List to Secondry List. *-----------------------------------------------------* AT LINE-SELECTION. " For Drill Down To Secondry List. CHECK NOT ITABSCUSTOM-ID IS INITIAL. "Check the Initial Value Of the "ID. *-----------------------------------------------------* * Fatch the Required Data From Sbook Table * to ITAB_SBOOK Internal Table whose Customer ID's are Same. *-----------------------------------------------------* *-----------------------------------------------------* SELECT FLDATE BOOKID CARRID CONNID CLASS AGENCYNUM FROM SBOOK INTO TABLE ITAB_SBOOK WHERE CUSTOMID = ITABSCUSTOM-ID. *-----------------------------------------------------* *-----------------------------------------------------* * Loop Of Internal Table ITAB_SBOOK. *-----------------------------------------------------* LOOP AT ITAB_SBOOK. CUSTOMER_BOOK_NO = SY-TABIX. " Gives the Total Number Of the " Customer's Bookings. SELECT SINGLE * FROM STRAVELAG WHERE AGENCYNUM = ITAB_SBOOK-AGENCY_NUMBER. ITAB_SBOOK-AGENT_NAME = STRAVELAG-NAME. MODIFY ITAB_SBOOK INDEX SY-TABIX. ENDLOOP.
  • 12. SORT ITAB_SBOOK BY AGENT_NAME ASCENDING. "Sort Name in Ascending "Order. *-----------------------------------------------------* * Loop Of Internal Table ITAB_SBOOK * for Print the Records. *-----------------------------------------------------* LOOP AT ITAB_SBOOK. *-----------------------------------------------------* * Print the Report Lines. *-----------------------------------------------------* WRITE: /1 SY-VLINE NO-GAP,ITAB_SBOOK-AGENT_NAME, 40 SY-VLINE NO-GAP,45 ITAB_SBOOK-FLIGHT_DATE, 60 SY-VLINE NO-GAP,67 ITAB_SBOOK-BOOK_ID, 80 SY-VLINE NO-GAP,88 ITAB_SBOOK-CARR_ID, 100 SY-VLINE NO-GAP,110 ITAB_SBOOK-CONN_ID. *-----------------------------------------------------* * Using If Condition it Will Determine the class name * from Characters and Print it. *-----------------------------------------------------* IF ( ITAB_SBOOK-CLASS = 'F' ). CLASS_NAME = 'FRCT'. WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME. ELSEIF ( ITAB_SBOOK-CLASS = 'C' ). CLASS_NAME = 'BSNS'. WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME. ELSEIF ( ITAB_SBOOK-CLASS = 'Y' ). CLASS_NAME = 'ECON'. WRITE: 120 SY-VLINE NO-GAP,130 CLASS_NAME. ENDIF. WRITE: 175 SY-VLINE NO-GAP. ENDLOOP. *-----------------------------------------------------*
  • 13. * If No Record Found For the Select Customer * It will Return the Message. *-----------------------------------------------------* IF SY-SUBRC <> 0. FORMAT COLOR 6. WRITE: /1 SY-VLINE NO-GAP,'No Record found of', ITABSCUSTOM-NAME,175 SY-VLINE NO-GAP. ULINE AT /1(175). EXIT. ENDIF. ULINE AT /1(175). *-----------------------------------------------------* * Prints the Total Number Of Customer Bookings. *-----------------------------------------------------* FORMAT COLOR 3. WRITE: /1 SY-VLINE NO-GAP, 'Total Bookings for the Customer :', CUSTOMER_BOOK_NO,175 SY-VLINE NO-GAP. ULINE AT /1(175). FORMAT RESET. CLEAR ITABSCUSTOM. " Clear the Itabscustom table " before end of selection. *-----------------------------------------------------* * End Of the Selection. *-----------------------------------------------------* END-OF-SELECTION. CLEAR ITABSCUSTOM. " Clear the Itabscustom table " After end of selection. *-----------------------------------------------------* * End OF The Report Program. *-----------------------------------------------------*
  • 14. Example: The example of the output report of this program is given below. Report Program output: Output of the Customers (B and P). Output of the Customer’s Bookings.