+ All Categories
Home > Documents > SAP Class Int Reports Theory

SAP Class Int Reports Theory

Date post: 04-Jun-2018
Category:
Upload: millan100
View: 229 times
Download: 0 times
Share this document with a friend
13
CLASSICAL REPORTS A report with single input screen (selection screen) and single output screen (list screen) is called a classical report. Events in Classical Reports : - All the ABAP programs are develope d using events beca use ABAP is EVENT DRIVEN PROGRAMMING LANGUAGE ” i.e. the entire ABAP program execution is based on order of events. The List of the events is: Load of Program Initialization At Selection-sc reen output At Selection-screen on field At Selection-screen on value request At Selection-screen on Help Request At Selection-screen Start of selection End of selection Top of page End of page Load of Program: - This event is used to load the program into memory for execution. This is internal event, which we cannot see. Initialization: - This event is used to initialization the default values to program variables and selection-scree n variables. Examples: v_land1 = ‘IN’ 
Transcript
Page 1: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 1/13

CLASSICAL REPORTS

A report with single input screen (selection screen) and single output screen (list screen) is called a

classical report.

Events in Classical Reports: - All the ABAP programs are developed using events because ABAP is

“EVENT DRIVEN PROGRAMMING LANGUAGE” i.e. the entire ABAP program execution is based on

order of events.

The List of the events is:

Load of Program

Initialization

At Selection-screen output

At Selection-screen on field

At Selection-screen on value request

At Selection-screen on Help Request

At Selection-screen

Start of selection

End of selection

Top of page

End of page

Load of Program: - This event is used to load the program into memory for execution. This is inter

event, which we cannot see.

nitialization: - This event is used to initialization the default values to program variables and

selection-screen variables.

Examples: v_land1 = ‘IN’ 

Page 2: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 2/13

v_bukrs = ‘1001’ 

p_werks = ‘US’ 

p_mtart = ‘FERT” 

AT Selection-screen output: - This event is used to modify the selection screen dynamically based

user actions on the selection screen.

This event is triggered (or) executed for every action on the selection screen.

AT Selection-screen on field: - This event is used to validate a single input field on the selection-

screen.

AT Selection-screen on value request: - This event is used to provide a search help for an input fie

This event is triggered whenever the user click on search help button.

AT Selection-screen on help request: - This event is used to provide help information for an input

field.This event is triggered whenever the user click on Help button i.e. F1 button. 

AT Selection-screen: - This event is used to validate multiple fields of the selection-screen,wherea

AT Selection-screen on field is used to validate a single input field.

Start of selection: - This event is used to write the original business logic statements i.e all select

statements. It is also used to indicate the starting point of a program.It is the default event.

End of selection: - It is used to indicate the start of selection as been ended. It

doesn’t have any importance in ABAP. It is mainly used with logical database, which are absolute i

ABAP (LDB’s are used inold version of ABAP). But LDB’s are stilled used in HR-ABAP, so end of

selection is mainly used in HR-ABAP.

Top of page: - This event is use to display constant page heading for all the pages of list screen. Th

event is triggered after the first WRITE statement.

End of page: - This event is used to provide constant footer information across the all pages of the

ist-screen.To display end of page (or) footer information we have to reserve some lines as footer

ines using the statement.

Report <Report Name> Line Count Total Lines(Footer Lines)

Ex Program: Will be discussed separately.

Page 3: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 3/13

Page 4: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 4/13

 

A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOF

IF P_DLOAD = 'X' . 

PERFORM DOWNLOAD_DATA .

ENDIF . 

PERFORM DISPLAY_DATA . 

TOP-OF-PAGE . 

PERFORM DISPLAY_HEADING . 

END-OF-PAGE . 

PERFORM DISPLAY_FOOTER . 

*&---------------------------------------------------------------------*  

*& Form INIT_VARIBALES  

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------*  

*  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------*  

FORM INIT_VARIBALES . 

V_TITLE = 'CUSTOMER MASTER REPORT' .

P_LAND1 = 'DE' . 

ENDFORM. " INIT_VARIBALES  

*&---------------------------------------------------------------------*  

*& Form VALIDATE_LAND1 

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------*  

*  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------*  

FORM VALIDATE_LAND1 . 

SELECT LAND1 

FROM KNA1 

INTO V_LAND1 

UP TO 1 ROWS 

WHERE LAND1 = P_LAND1.

ENDSELECT .IF SY-SUBRC <> 0 . MESSAGE 'INVALID COUNTRY CODE' TYPE 'E' .

ENDIF .

ENDFORM. " VALIDATE_LAND1 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page 2 

Page 5: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 5/13

 

A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOF

*&---------------------------------------------------------------------*  

*& Form GET_DATA  

*&---------------------------------------------------------------------*  

* text *----------------------------------------------------------------------*  

* --> p1 text 

* <-- p2 text 

*----------------------------------------------------------------------*  

FORM GET_DATA . 

SELECT KUNNR LAND1 NAME1 ORT01 

FROM KNA1 

INTO TABLE I_KNA1 

WHERE LAND1 = P_LAND1 .

IF SY-SUBRC <> 0 . 

MESSAGE 'NO DATA FOUND' TYPE 'I' . 

ENDIF . 

ENDFORM. " GET_DATA  

*&---------------------------------------------------------------------*  

*& Form DISPLAY_HEADING  

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------*  

* --> p1 text 

* <-- p2 text 

*----------------------------------------------------------------------*  

FORM DISPLAY_HEADING . 

WRITE : / SY-ULINE . 

WRITE : /45 V_TITLE COLOR 5 .

WRITE : / SY-ULINE . 

ENDFORM. " DISPLAY_HEADING  

*&---------------------------------------------------------------------*  

*& Form DISPLAY_FOOTER 

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------* *  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------* 

FORM DISPLAY_FOOTER .WRITE : / SY-ULINE .

WRITE : /45 'IBM INDIA PVT.LTD' COLOR 5 .

WRITE : / SY-ULINE .ENDFORM. " DISPLAY_FOOTER 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page 3 

Page 6: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 6/13

 

A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOF

*&---------------------------------------------------------------------*  

*& Form DISPLAY_DATA  

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------*  

*  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------*  

FORM DISPLAY_DATA . 

LOOP AT I_KNA1 INTO WA_KNA1 . 

WRITE : / WA_KNA1-KUNNR , WA_KNA1-LAND1 , WA_KNA1-NAME1 , WA_KNA1-

ORT01 . 

ENDLOOP . 

ENDFORM. " DISPLAY_DATA  

*&---------------------------------------------------------------------*  

*& Form DOWNLOAD_DATA  

*&---------------------------------------------------------------------*  

* text 

*----------------------------------------------------------------------*  

*  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------*  

FORM DOWNLOAD_DATA . 

V_FNAME = P_FNAME . 

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING 

FILENAME = V_FNAME "'C:\KNA1.TXT' 

FILETYPE = 'DAT' "ASC MEANS NOTEPAD FILE/DAT MEASN EXCEL F  

ILE  

WRITE_FIELD_SEPARATOR = 'X'

TABLES 

DATA_TAB = I_KNA1. 

IF SY-SUBRC = 0. 

MESSAGE 'DATA IS SUCCESSFULLY DOWNLOADED' TYPE 'I'.

ENDIF.ENDFORM. " DOWNLOAD_DATA  

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page 4 

Page 7: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 7/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 7

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 

A B A P & W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT 

*&---------------------------------------------------------------------* 

*& Form GET_FILE_NAME  

*&---------------------------------------------------------------------* 

* text 

*----------------------------------------------------------------------* 

* --> p1 text 

* <-- p2 text 

*----------------------------------------------------------------------* 

FORM GET_FILE_NAME . 

CALL FUNCTION

'KD_GET_FILENAME_

ON_F4' EXPORTING 

PROGRAM_NAME = SYST-REPID 

DYNPRO_N

UMBER =

SYST-

DYNNR

FIELD_NA

ME =

'P_FNAME

CHANGING 

FILE_N

AME =

P_FNAME.

IF SY-

SUBRC <>

0. 

ENDIF. 

ENDFORM. " GET_FILE_NAME  

*&---------------------------------------------------------------------* 

*& Form GET_HELP  

*&---------------------------------------------------------------------* 

* text 

*--------------------------------------------------------------------

Page 8: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 8/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 8

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 

--* 

*  -->    p1  text *  <--   p2  text *----------------------------------------------------------------------* 

FORM GET_HELP . 

MESSAGE 'PLEASE CLCIIK ON F4 FORFILE NAME' TYPE 'I'. ENDFORM.

" GET_HELP  

------------------------------------------------------------------------------------------------

Using AT Selection-screen output: - This event is used to modify the selection

screen dynamically based on user actions on the selection screen.

This event is triggered (or) executed for every action on the selection screen.

Modification ID: - It is an ID assigned to a group of Selection- screen fields, So that

the properties of all the selection screen fields can be modified directly with the

help of modification ID.

Suppose if Modification ID is not available then we have to modify each selection-

screen field individually which makes program very complex.

Syntax: -

Parameters: <p_name> type <table-fname> MODIF ID <modification ID name>.

Ex Program: Will be discussed separately.

What is difference between AT Selection-screen on field and AT selection-screen?

 AT Selection-screen on field AT selection-screen

Page 9: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 9/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 9

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 

1) It is used to validate a single filed 1)It is used to validate multiple fields

2) Whenever there is an error on a field, 2)Whenever there is an error on a field

the entire screen will be disabled the entire screen will be enabled.

Except the error field,

Ex Program: Will be discussed separately.

INTERACTIVE REPORT

Display the basic information on the basic list and the detailed information in the

Secondary list is called Interactive report.

The first list is called basic list and the number is 0.

Page 10: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 10/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 10

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 

The remaining lists are called as secondary lists and the number start from 1 to

20.So totally there are 21 lists.

The lists no are stored in a system variable SY-LSIND.

If you select any line, then the selected line data is stored in SY-LISEL.

Interactive Reports Events:- 

AT Line selection

AT User command

Top of page during line selection

AT PF<Function Key>.

AT Line Selection: - This event is triggered whenever the user double clicks on any

list line.To know the selected line contents, we have two keywords or statements

1)HIDE

2)GET CURSOR

At User command: - This event is triggered whenever the user clicks on custom

GUI buttons.

Top of page during line selection: - This event is used for providing the constant

page heading for all the secondary lists.

AT PF <Function Key>:- This event is used or triggered whenever the user clicks

on function keys (f1, f2, .etc)

This event is absolute in new versions (ECC 5.0 or 6.0)

HIDE: - It is a keyword which is used to hide the data into a temporarily memory

called as hide area. The hide statement must be used within loop….end loop. So

that it will hide the value into hide area.

Page 11: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 11/13

Page 12: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 12/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 12

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 

Conversion exits are maintained at domain level.

Go to the domain and double click on conversion exit.

Conversion exit function module will be displayed

Example: -

Conversion_exit_Alpha_input  :- used to convert a value from exeternal format

to internal format.

Conversion_exit_Alpha_output:- used to convert a value from internal format to

external format

AT user command: - This event is triggered whenever the user clicks on Custom

GUI button. 

Custom GUI: - It is used to create our menus in the menu bar, our own buttons in

the application toolbar, enabling or disabling the standard buttons on the

standard toolbar.

Syntax: - SET PF-status <CustomGUIMenuName> 

‘SE41’is the tcode for creating custom GUI (also called as MENU PAINTER)

FCT CODE (Function code):-It is a shortcut code assigned to a button or menu to

identify the button or menu which is clicked.

The FCT codes are automatically stored in a system variable SY-UCOMM.

Page 13: SAP Class Int Reports Theory

8/13/2019 SAP Class Int Reports Theory

http://slidepdf.com/reader/full/sap-class-int-reports-theory 13/13

 

A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E   Page 13

A B A P & W E B D Y N P R O A B A P @ A R J U N  IGROWSOF

 


Recommended