SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overviewsapdocs. info
 
SAP ABAP - Needed Notes
SAP   ABAP - Needed NotesSAP   ABAP - Needed Notes
SAP ABAP - Needed NotesAkash Bhavsar
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionarySmartGokul4
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exitsKranthi Kumar
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Tablesapdocs. info
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap 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
 
SAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechSAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechVikram P Madduri
 
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
 
Technical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingTechnical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingJoshiRavin
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programmingSatheesh Kanna
 
Type casting in ooabap
Type casting in ooabapType casting in ooabap
Type casting in ooabapbiswajit2015
 
ABAP Open SQL & Internal Table
ABAP Open SQL & Internal TableABAP Open SQL & Internal Table
ABAP Open SQL & Internal Tablesapdocs. info
 

Was ist angesagt? (20)

ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
SAP ABAP OVERVIEW
SAP ABAP OVERVIEWSAP ABAP OVERVIEW
SAP ABAP OVERVIEW
 
SAP ABAP - Needed Notes
SAP   ABAP - Needed NotesSAP   ABAP - Needed Notes
SAP ABAP - Needed Notes
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionary
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
Sap abap
Sap abapSap abap
Sap abap
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
 
ABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection ScreenABAP Event-driven Programming &Selection Screen
ABAP Event-driven Programming &Selection Screen
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
SAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechSAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH Softech
 
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)
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Technical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingTechnical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_Processing
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
07 sap scripts
07 sap scripts07 sap scripts
07 sap scripts
 
Type casting in ooabap
Type casting in ooabapType casting in ooabap
Type casting in ooabap
 
ABAP Open SQL & Internal Table
ABAP Open SQL & Internal TableABAP Open SQL & Internal Table
ABAP Open SQL & Internal Table
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie Pseudo Code Report Program

Ähnlich wie 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
 
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
 
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
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
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
 
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
 
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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
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
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Kürzlich hochgeladen (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
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
 
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
 
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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

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.