Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SLDB (tcode) -> name the Logical Data base (ZLDB19301) -> Click on Create -> opens
an interface , Enter description for LDB ( any ) -> Click on Create -> Save the LDB
under a package -> Opens Another Interface -> Name the Node ( MARA[node name and
table name must be same])
-> Enter Description for the Node -> ASSIGN THE DATA BASE TABLE (MARA) ->
Click on Continue -> Opens LDB editor -> Select the Node -> Click on Selections
pushbutton from Application toolbar to add GUI for the Node -> Prompts a message ,
click on yes to create -> say no to the search help -> click on continue -> Opens LPS
screen with List of Checkboxes -> select all Checkboxes -> click on Transfer -> Open
ABAP editor with Code Generated by SAP. SAP prompts a message as code generated
should be modified by abaper, with * Replace the ? with suitable variable name
* activate GUI statements ( Select-options, parameters )
* Save the Code
* Activate the code
-> COME BACK -> select the Node -> Click on Source Code to add Select statement
code for the node -> Click on yes to Create -> Opens ABAP editor with Two Include files
-> double click on Top Include file , declare an internal table as
* create a program using SE38 -> Enter the Title ( any ) -> set the type of program as
"Executable" -> Name the Logical Data base ( ZLDB19301) -> GENERATE THE CODE
AS FOLLOWS ->
REPORT ZINVOKE_LDB_930.
NODES MARA.
GET MARA.
-> SAVE -> ACTIVATE -> EXECUTE.
Advantage of LDB :
Using this special Programming technique Report effiency is very faster.
SYNTAX OF MACRO.
DEFINE <STMT_NAME>.
ABAP STATEMENTS.
END-OF-DEFINITION.
PROGRAM 1 : ABAP INCLUDE FILE WITH OWN MACROS AS USER DEFINE
STATEMENTS.
DEFINE PRINTF.
WRITE &1.
END-OF-DEFINITION.
DEFINE INCREMENT.
ADD 1 TO &1.
END-OF-DEFINITION.
DEFINE DECREMENT.
SUBTRACT 1 FROM &1.
END-OF-DEFINITION.
INCLUDE ZINCL_PRG.
DATA : A TYPE I VALUE 100.
PRINTF 'WELECOME TO C STATEMENT IN ABAP'.
INCREMENT A.
INCREMENT A.
INCREMENT A.
INCREMENT A.
PRINTF A.
DECREMENT A.
DECREMENT A.
PRINTF A.
SE30 : Is the tcode used to Test the Coding efficiency of programs , Transactions or
Function modules.
SQ01 : Is also One of the tool to generate a report by sap based on Info Sets.
Using this tool SAP Generates a report based on fields selections, while selecting fields
abaper can select fields to be listed in lps and fields list for GUI.
SQ01 -> NAME THE QUERY ( Z930QRY1 ) -> Click on Create -> Opens an interface
with List of Infoset objects -> select the required infoset from the list -> Enter the title
( any ) -> Click on basic List From application toolbar -> Displays the list of tables which
are added to the infoset -> expand the required table -> select the required fields to be
listed in LPS and fields list for GUI ( selection-screen ) -> To test the code -> Click on
"Test" pushbutton from application toolbar -> Opens an interface -> Click on Continue ->
Opens the selection screen GUI -> Click on Execute to the report.
Note : using this tool if the report is created, output type is basic ALV ( GRID
DISPLAY).
This output is similer to REUSE_ALV_GRID_DISPLAY function module output.
Using this tool abaper can't generate Classical Reports , Group Reports , Interactive
reports , Interactive ALV reports and Graphical reports.
SQ02 -> Name the Infoset ( ZIS930 ) -> click on Create -> Opens an interface -> Enter
description in Name field (any) -> Specify table to be assigned for Infoset -> Click on
Continue -> Opens another Interface with list of Fields in the specified table -> select the
required fields to be added in infoset -> save the info set under a package -> come back
-> Click on "generate" from application toolbar to activate the infoset -> When ever
infosets are activated these can be used by "SAP Query" for report generations.
example code.
DB view
Projection Views
Maintenance views : is used to allow DML Operations and also DRL operations on
Multiple tables.
1. CREATE maintenance view -> activate the view -> Click on utilities menu -> table
maintenace generator -> Opens an interface -> set the authorization Group as "ATES" so
every body can access the view code ->Name the Function Group to be created
( ZFGM930 ) -> select maintenance step as "one step" -> Number the screen to be
created ( 654 ) -> Click on Create From Application Toolbar -> Save the Function Group
under a package -> Prompts a message as code generated without any error.
SE54 -> NAME THE VIEW TO BE TESTED ( ZMV930 ) -> CLICK ON "TEST"
PUSHBUTTON -> OPENS ANOTHE INTERFACE -> CLICK ON MAINTAIN
PUSHBUTTON -> OPENS THE ACTUAL SCREEN GENERATED BY SAP -> CLICK
ON NEW ENTRIES FROM APPLICATION TOOLBAR -> ACCEPT THE DATA ->
SAVE THE ENTIRES -> DATA IS INSERTED INTO SPECIFIED TABLES.
All GUI Screens in abap are created with Lables refering to The Data elements Field
Labels.
if we make any changes to the Fields lables of Data element, these will be reflected in all
screens of SAP.
The data elements created by SAP can't be customized directly , unless until we have
access key.
If ABAPer is making changes for the objects in SAP using "CMOD" tcode, for each
objects sap creates a customer version. The changes which are performed are in Customer
version. Original code of object remains same in SAP data base. If we need to see the
changes then ABAPer has to load SAP with customer versions, else if the sap is loaded
with SAP versions original settings will be added by SAP.
Use Following navigations to make changes for the Field lables using Data elements.
CMOD ( TCODE ) -> NAME THE PROJECT ( ZPR9301) -> CLICK ON CREATE ->
OPENS AN INTERFACE -> ENTER DESCRIPTION ( ANY ) -> SAVE THE OBJECT
UNDER A PACKAGE -> COME BACK -> Click on GOTO menu -> Text
Enhancements -> key words -> Change -> Opens an interface -> name the data element
to be modified ( customized ) ( MATNR ) -> Click on Continue -> opens the label
screen of the data element in change mode -> Change Long Field label ( enter proper
description ) -> save the Entries -> assign with a request Number -> Close the Interface
-> Activate the project.
* Load the SAP Software with Customer version Changes to effect these changes on
Screen.
CMOD -> GOTO menu -> Text Enhancements -> keywords -> Restore Customer
Version -> SET THE RELEASE VERSION AS "620" -> Click on Continue -> Sap
Executes one background job with name as "SAPUSER22:16:54" ( USERNAME WITH
APPLICATION SERVER SYSTEM TIME ) -> Click on Continue.
* Check the status of background job , if the status is finished , see the changes in SAP
applications.
SM36 ( tcode) -> Click on Own Jobs to the status of background job -> By default
display all job status -> Find for the JOB name (SAPUSER22:16:54) -> if the status is
"finished" then see the changes in SAP Applications.
CMOD -> GOTO menu -> Text Enhancements -> Keywords -> Restore SAP Version ->
Set the Release version as ( 620) -> click on Continue -> Sap Executes a background job
, when ever job is finished orginal setting will be added to all SAP applications.
User Exits
* Field Customization or Field Exits.
Making Chagens of the Field lables on SAP Applications is called as Field Exits.
* Making Changes for The Function Modules in SAP Using CMOD is called as
Function Exits.
* If we make changes for Existing Applications menu using CMOD is called as Menu
Exits.
* If we make the changes for the Screen Using The CMOD is called as Screen Exits.
As the Customer is making modifications for Fields , Menus , Function modules and
Screen using CMOD these are called customer Exits or User Exits.
CMOD -> Click onUtilities menu -> Select SAP Enhancements -> Opens an Inter to see
the list of Exits used for Customizing SAP Applications -> specify name of Exit ( * ) ->
Set Number of Entries as (2500) -> Click on execute from Application toolbar -> Display
a report with all Exit names in SAP , Based on The Description Provided we can identify
the exit is for type of Application ( This knowledge is known to Function Consultants
who has Technical Experience ) -> Note down Name of Exit from the List ( BG000001:
User Exit for Warrent Check ) -> Come back .
* To customize the Exit Defined by SAP use Following Navigations.
CMOD -> Name the project ( zprj9303) -> Click on Create -> Enter Short Text (any) ->
Save the Project Under a package -> Click on Enhancment Assignments pushbutton from
application toolbar -> Name the Enhancements to be customized ( BG000001 ) -> Click
on Components From Application toolbar -> Opens the List of Function which are
assigned to The user exit -> Double Click on Function Module name -> Opens SE37
editor with Function Module Code , internally Generated with an include file starting
with "Z". As Z programs can be customized in by the ABAPer , double click on program
name -> opens the Source code of the program , make the changes according the
company Requirements -> save -> activate -> come back.
BADI's are advanced concepts of User Exits. user exits are used to Customize the
Existing Program with help of Exit names using CMOD.
SE18 AND SE19 ARE the tcodes for BADI creation and Implementations.
SE18 -> NAME THE BADI (Z9301BADI) -> CLICK ON CREATE -> ENTER
DESCRIPTION FOR BADI -> SAVE THE OBJECT UNDER A PACKAGE -> CLICK
ON INTERFACE TAB BUTTON -> DOUBEL CLICK ON INTERFACE NAME
GENERATED BY SAP ( ZIF_EX_9301BADI ) -> OPENS SE24 TCODE -> DEFINE A
METHOD FOR INTERFACE -> NAME THE METHOD ( TOUPPER ) -> SET THE
LEVEL AS "Instance Method" -> CLICK ON PARAMETERS PUSHBUTTON ->
DEFINE THE ARGUMENT AS "STR" -> SET THE TYPE AS "Changing" -> SET THE
ASSOCIATED TYPE AS TYPE "C" -> SAVE THE INTERFACE ->ACTIVATE ->
COME BACK.
* Generate the code for the method defined in Inteface using "SE19" tcode.
SE19 -> Name the Implementation ( Z9301BADI ) -> click on Create -> assign the
Definition ( Z9301BADI ) -> click on Continue -> Enter description for Implementation (
any ) -> Click on Interface tab button -> Double click on method name -> Click on Yes
to create the Object -> Save the Object under a package -> Opens the method code
Interface -> Generate the code between method and endmethod as follows
method ZIF_EX_9301BADI~TOUPPER .
TRANSLATE STR TO UPPER CASE.
endmethod.
-> SAVE THE OBJECT -> COME BACK -> ACTIVATE THE Interface.
* When ever we need to communicate the variable data between different programs we
can use SET PARAMETER ID AND GET PARAMETER ID STATEMENTS.
SYNTAX:
SET PARAMETER ID <PID> FIELD <VAR>.
GET PARAMETER ID IS USED TO GET THE STORED VALUE FROM SHARED
MEMORY INTO CURRENT PROGRAM.
SYNTAX:
GET PARAMETER ID <PID> FIELD <VAR>.
EXAMPLE CODE.
* FIRST PROGRAM
REPORT ZP1 NO STANDARD PAGE HEADING.
DATA : STR(20) TYPE C VALUE 'SUBBARAO'.
SET PARAMETER ID 'AAA' FIELD STR.
WRITE : STR.
* SECOND PROGRAM.
REPORT ZP2 .
DATA : S1(20).
GET PARAMETER ID 'AAA' FIELD S1.
WRITE : S1.
* In the same program even if values are cleared then data should be retrived.
EXAMPLE CODE.
data : str(20) value 'india is great'.
write : str.
EXPORT STR TO MEMORY ID 'AA'.
clear str.
write : / ' CHECK ', str COLOR 6.
IMPORT STR FROM MEMORY ID 'AA'.
WRITE : / STR COLOR 7.