SlideShare una empresa de 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.
Pseudo Code Report Program

Más contenido relacionado

La actualidad más candente

Call transaction method
Call transaction methodCall transaction method
Call transaction methodKranthi Kumar
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modificationsscribid.download
 
Internal tables
Internal tables Internal tables
Internal tables Jibu Jose
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overviewsapdocs. info
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infosapdocs. info
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exitsKranthi Kumar
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handlinganil kumar
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Tablesapdocs. info
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.docKranthi Kumar
 
Internal tables in sap
Internal tables in sapInternal tables in sap
Internal tables in sapDharma Raju
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniquesJugul Crasta
 
Chapter 03 foreign key relationships1
Chapter 03 foreign key relationships1Chapter 03 foreign key relationships1
Chapter 03 foreign key relationships1Kranthi Kumar
 

La actualidad más candente (20)

Call transaction method
Call transaction methodCall transaction method
Call transaction method
 
Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
Reports
ReportsReports
Reports
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
 
Internal tables
Internal tables Internal tables
Internal tables
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.info
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
Bapi step-by-step
Bapi step-by-stepBapi step-by-step
Bapi step-by-step
 
Field symbols
Field symbolsField symbols
Field symbols
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handling
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.doc
 
Internal tables in sap
Internal tables in sapInternal tables in sap
Internal tables in sap
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
 
Chapter 03 foreign key relationships1
Chapter 03 foreign key relationships1Chapter 03 foreign key relationships1
Chapter 03 foreign key relationships1
 
Badis
Badis Badis
Badis
 

Destacado

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
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programmingSatheesh Kanna
 
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
 
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
 

Destacado (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
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
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
 
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
 

Similar a Pseudo Code Report Program

Similar a Pseudo Code 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
 
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
 
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
 
ERP process in Industry
ERP process in IndustryERP process in Industry
ERP process in Industry
 
Casnewb
CasnewbCasnewb
Casnewb
 

Último

Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Último (20)

Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

Pseudo Code 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.