ABAP

INFOTYPES (ABAP keyword)

INFOTYPES is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. INFOTYPES Basic formINFOTYPES nnnn. nnnn between 0000 and 0999: HR master data info typesnnnn between 1000 and 1999: HR planning data info typesnnnn between 2000 and 2999: HR time data info typesnnnn between 3000 and 8999: Not yet […]

IMPORT (ABAP Keyword)

IMPORT is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. IMPORT IMPORT – Get data Variants 1. IMPORT f itab FROM MEMORY.2. IMPORT f itab FROM DATABASE dbtab(ar) ID key.3. IMPORT DIRECTORY INTO itab FROM DATABASE dbtab(ar) ID key.4. IMPORT f itab FROM DATASET dsn(ar) ID key. Variant […]

HIDE (ABAP keyword)

HIDE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. HIDE Basic formHIDE f. EffectHides the contents of the field f in relation to the current output line. If you select this line, the system automatically assigns the hidden value to f .Such a selection may result from […]

IF (ABAP Keyword)

IF is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. IF Basic formIF logexp. EffectUsed for case distinction. Depending on whether the logical expression logexp is true or not, this statement triggers the execution of various sections of code enclosed by IF and ENDIF . There are three […]

GENERATE (ABAP Keyword)

GENERATE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. GENERATE GENERATE – Generate a program Variants 1. GENERATE REPORT prog.2. GENERATE SUBROUTINE POOL itab NAME name. Variant 1GENERATE REPORT prog. Additions 1. … MESSAGE f12. … INCLUDE f23. … LINE f34. … WORD f45. … OFFSET f56. […]

GET (ABAP keyword)

GET is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. GET Basic form 1GET dbtab. Additions 1. … LATE2. … FIELDS f1 … fn EffectProcessing event. Gets the table dbtab for processing while the logical database is running. You can address all the fields from dbtab in the […]

FUNCTION-POOL (ABAP Keyword)

FUNCTION-POOL is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. FUNCTION-POOL EffectThe FUNCTION-POOL statement is equivalent to the REPORT statement and introduces a function group.A function group contains function modules introduced by the FUNCTION statement and called with the CALL FUNCTION statement.

FREE (ABAP keyword)

FREE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FREEFREE – Reset to correct initial value for type,including release of resources Basic formFREE f. EffectLike CLEAR f , FREE f resets any data object f to the correct initial value for its type. In contrast to CLEAR […]

FUNCTION (ABAP keyword)

FUNCTION is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FUNCTION Basic formFUNCTION func. EffectDefines a function module called by CALL FUNCTION . NoteTo create and edit function modules, select Tools -> ABAP/4 Workbench -> Function Library .

FORMAT (ABAP keyword)

FORMAT is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FORMAT Basic formFORMAT. Additions 1. … COLOR n [ON] or … COLOR OFF2. … INTENSIFIED [ON] or … INTENSIFIED OFF3. … INVERSE [ON] or … INVERSE OFF4. … HOTSPOT [ON] or … HOTSPOT OFF5. … INPUT [ON] or […]

FIELDS (ABAP keyword)

FIELDS is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FIELDS Basic formFIELDS f. EffectAddresses a field. The statement is used mainly to address fields statically which are otherwise accessed dynamically. By doing this, you explicitly specify to check programs such as the extended program check that the […]

FORM (ABAP Keyword)

FORM is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FORM Basic formFORM form. Additions 1. … TABLES itab1 … itabn2. … USING p1 … pn3. … CHANGING p1 … pn EffectDefines a subroutine called by PERFORM Example PERFORM WELCOME. FORM WELCOME.WRITE / ‘Hello world’.ENDFORM. The subroutine WELCOME […]

FIELD-SYMBOLS (ABAP Keyword)

FIELD-SYMBOLS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. FIELD-SYMBOLS Basic formFIELD-SYMBOLS . Additions 1. … STRUCTURE s DEFAULT wa2. … TYPE t3. … TYPE LINE OF t4. … LIKE s5. … LIKE LINE OF s EffectThis statement declares a symbolic field called . At runtime, you can […]

FETCH (ABAP Keyword)

FETCH is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. FETCH Basic formFETCH NEXT CURSOR c target. EffectUses the cursor c to read the next line or lines from the dataset of a database table determined by OPEN CURSOR . The cursor must be a variable of the […]

FIELD-GROUPS (ABAP Keyword)

FIELD-GROUPS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. FIELD-GROUPS Basic formFIELD-GROUPS fg. EffectDefines a field group. A field group combines several existing fields together under one name. You use the INSERT statement to determine which fields belong to a field group at runtime. Example FIELD-GROUPS: HEADER, ORDER, […]

EXTRACT (ABAP Keyword)

EXTRACT (ABAP Keyword) introduction & details EXTRACT Basic formEXTRACT fg. EffectWrites all fields of the field group fg (see FIELD-GROUPS) as one record to a sequential dataset (paging). If a field group HEADER has been defined, its fields prefix each record to form a sort key. You can sort this dataset with SORT and process […]

EXIT (ABAP Keyword)

EXIT (ABAP Keyword) introduction & syntax details EXIT EXIT in loops and modularization units Basic formEXIT. EffectIn loop structures: Leaves the loop processing (DO , WHILE , LOOP , SELECT ) In subroutines and other modularization units (but outside loop structures): Leaves the subroutine or modularization unit (FORM , MODULE , FUNCTION , TOP-OF-PAGE , […]

EXPORT (ABAP Keyword)

EXPORT (ABAP Keyword) introduction & syntax details EXPORT EXPORT – Export data Variants 1. EXPORT obj1 … objn TO MEMORY.2. EXPORT obj1 … objn TO DATABASE dbtab(ar) ID key.3. EXPORT obj1 … objn TO DATASET dsn(ar) ID key. Variant 1EXPORT obj1 … objn TO MEMORY. Additions1. … FROM g (for each field to be exported)2. […]

EXEC (ABAP Keyword)

EXEC (ABAP Keyword) introduction & syntax details EXEC Basic formEXEC SQL. Addition … PERFORMING form EffectExecutes the Native SQL command enclosed by the statements EXEC SQL and ENDEXEC . In contrast to Open SQL , addressed database tables do not have to be known to the ABAP/4 Dictionary and the ABAP/4 program does not have […]

ENDWHILE (ABAP Keyword)

ENDWHILE (ABAP Keyword) introduction & syntax details ENDWHILE Basic formENDWHILE. EffectCloses a loop introduced by WHILE .

ENDSELECT (ABAP Keyword)

ENDSELECT (ABAP Keyword) introduction & syntax details ENDSELECT Basic formENDSELECT. EffectCloses a loop introduced by SELECT . NoteSELECT is not concluded by ENDSELECT if it is a SELECT SINGLE command,if only aggregate functions appear in the INTO clause orif the INTO clause INTO TABLE itab or APPENDING TABLE itab does not include the addition PACKAGE […]

ENDPROVIDE (ABAP Keyword)

ENDPROVIDE (ABAP Keyword) introduction & syntax details ENDPROVIDE Basic formENDPROVIDE. EffectCloses a loop introduced by PROVIDE .

ENDMODULE (ABAP keyword)

ENDMODULE (ABAP keyword) introduction & syntax details ENDMODULE Basic formENDMODULE. EffectCloses a module definition introduced by MODULE .

ENDON (ABAP Keyword)

ENDON (ABAP Keyword) introduction & syntax details ENDON Basic formENDON. EffectThe ENDON statement closes a structure introduced by ON (CHANGE OF) .

ENDIF (ABAP Keyword)

ENDIF (ABAP Keyword) introduction & syntax details ENDIF Basic formENDIF. EffectThe ENDIF statement concludes a statement introduced by IF .

ENDLOOP (ABAP Keyword)

ENDLOOP (ABAP Keyword) introduction & details ENDLOOP Basic formENDLOOP. EffectThe ENDLOOP statement closes a loop introduced by LOOP .

ENDFUNCTION (ABAP Keyword)

ENDFUNCTION (ABAP Keyword) introduction & syntax details ENDFUNCTION Basic formENDFUNCTION. EffectCloses a subroutine definition introduced by FUNCTION .

ENDEXEC (ABAP Keyword)

ENDEXEC (ABAP Keyword) introduction & syntax details ENDEXEC Basic formENDEXEC. EffectCloses a processing block introduced by EXEC SQL .

ENDFORM (ABAP Keyword)

ENDFORM (ABAP Keyword) introduction & syntax details ENDFORM Basic formENDFORM. EffectCloses a subroutine definition introduced by FORM .

ENDCASE (ABAP Keyword)

ENDCASE (ABAP Keyword) introduction & syntax details ENDCASE Basic formENDCASE. EffectThe ENDCASE statement closes a case disinction introduced by CASE .

ENDDO (ABAP Keyword)

ENDDO (ABAP Keyword) introduction & syntax details ENDDO Basic formENDDO. EffectCloses a loop introduced by DO .

END-OF-SELECTION (ABAP Keyword)

END-OF-SELECTION (ABAP Keyword) introduction & syntax details END-OF-SELECTION Basic formEND-OF-SELECTION. EffectProcessing event Executes the code after END-OF-SELECTION when all the logical database records have been read and processed.Related START-OF-SELECTION , STOP , GET dbtab

ENDAT (ABAP Keyword)

ENDAT (ABAP Keyword) introduction & syntax details ENDAT Basic formENDAT. EffectThe ENDAT statement closes the control structure introduced by AT .

END-OF-PAGE (ABAP Keyword)

END-OF-PAGE (ABAP Keyword) introduction & syntax details END-OF-PAGE Basic formEND-OF-PAGE. EffectList processing event. The END-OF-PAGE event is executed whenever processing reaches that area when formatting a list page or if the RESERVE statement detects that there is insufficient space remaining on the current page. NoteThe size of the END-OF-PAGE area of list pages is defined […]

ELSE (ABAP Keyword)

ELSE (ABAP Keyword) introduction & syntax details ELSE Basic formELSE. EffectWithin an ” IF … ENDIF ” processing block, precedes the code to be executed if the logical expression specified by IF fails. Example DATA: RESULT TYPE I,OP1 TYPE I,OP2 TYPE I.…RESULT = OP1 – OP2.IF RESULT > 0.WRITE / ‘Result greater than zero.’.ELSE.WRITE / […]

ELSEIF (ABAP Keyword)

ELSEIF (ABAP Keyword) introduction & syntax details ELSEIF Basic formELSEIF logexp. EffectWithin a processing block enclosed by ” IF … ENDIF “, this statement indicates the processing to be executed if the logical expressions specified by IF and the preceding ELSEIF s are false, but the logical expression in this ELSEIF processing block is true.Between […]

EDITOR-CALL (ABAP Keyword)

EDITOR-CALL (ABAP Keyword) introduction & syntax details EDITOR-CALL EDITOR-CALL – call editor for internal tables Basic formEDITOR-CALL FOR itab. Additions 1. … TITLE text2. … DISPLAY-MODE EffectDisplays the internal table itab in the ABAP/4 Editor. You can then use normal editor functions (e.g. insert, delete, search, replace) to make changes. When you save (with F11 […]

DIVIDE-CORRESPONDING (ABAP Keyword)

DIVIDE-CORRESPONDING (ABAP Keyword) introduction & syntax details DIVIDE-CORRESPONDING Basic formDIVIDE-CORRESPONDING rec1 BY rec2. EffectInterprets rec1 and rec2 as field strings, i.e. if rec1 and rec2 are tables with header lines, the statement is executed for their header lines. Searches for all sub-fields that occur both in rec1 and rec2 and then generates, for all field […]

DO (ABAP keyword)

DO (ABAP keyword) introduction & syntax details DO Variants 1. DO.2. DO n TIMES. Variant 1DO. Addition … VARYING f FROM f1 NEXT f2 EffectRepeats the processing enclosed by the DO and ENDDO statements until the loop is terminated by EXIT , STOP or REJECT . You can use the CONTINUE statement to end the […]

DESCRIBE (ABAP Keyword)

DESCRIBE (ABAP Keyword) introduction & syntax details DESCRIBE DESCRIBE – return attributes of an internal table Basic formDESCRIBE TABLE itab. EffectReturns the attributes of the internal table itab . You must use at least one of the additions listed below. Additions 1. … LINES lin2. … OCCURS n Addition 1… LINES lin EffectPlaces the number […]

DIVIDE (ABAP Keyword)

DIVIDE (ABAP Keyword) introduction & syntax details DIVIDE Basic formDIVIDE n1 BY n2. EffectDivides the contents of n1 by n2 and places the result in n1 . This is equivalent to: n1 = n1 / n2. Example DATA: SUM TYPE P, NUMBER TYPE P.DIVIDE SUM BY NUMBER. NoteThe details regarding conversions and performance given under […]

DEFINE (ABAP Keyword)

DEFINE (ABAP Keyword) introduction and details and syntax DEFINE Basic formDEFINE macro. EffectDefines a program component (macro) under the name macro . It must consist only of ABAP/4 statements and is expanded at compilation time. A macro should always be concluded with the END-OF-DEFINITION statement. In the definition, you can use &n to reference positional […]

DELETE (ABAP Keyword)

DELETE (ABAP Keyword) introduction & syntax details DELETE Delete from a database table – DELETE FROM dbtab WHERE condition.– DELETE FROM (dbtabname) WHERE condition.– DELETE dbtab.– DELETE *dbtab.– DELETE (dbtabname) … .– DELETE dbtab FROM TABLE itab.– DELETE (dbtabname) FROM TABLE itab.– DELETE dbtab VERSION vers.– DELETE *dbtab VERSION vers.Delete from an internal table – […]

DATA (ABAP Keyword)

DATA (ABAP Keyword) introduction & details DATA Variants1. DATA f.2. DATA f(len).3. DATA: BEGIN OF rec,…END OF rec.4. DATA: BEGIN OF itab OCCURS n,…END OF itab.5. DATA: BEGIN OF COMMON PART c,…END OF COMMON PART. EffectDefines global and local variables. Variables allow you to address declared data objects . They always have a particular data […]

CONVERT (ABAP Keyword)

CONVERT (ABAP Keyword) introduction and details CONVERT Variants 1. CONVERT DATE f1 INTO INVERTED-DATE f2.2. CONVERT INVERTED-DATE f1 INTO DATE f2. EffectAllows conversion between different formats which do not have their own type (see also MOVE ). The field f1 is converted from the source format to the target format and placed in f2 . […]

CREATE (ABAP Keyword)

CREATE (ABAP Keyword) introduction & details CREATE Basic formCREATE OBJECT obj class. Addition … LANGUAGE langu EffectGenerates an object of the class class . To address an OLE automation server (e.g. EXCEL) from ABAP/4 , the server must be registered with SAP. The transaction SOLE allows you to assign an automation server to a class.The […]

CONTINUE (ABAP Keyword)

CONTINUE (ABAP Keyword) introduction & details CONTINUE Basic formCONTINUE. EffectWithin loop structures like DO … ENDDOWHILE … ENDWHILELOOP … ENDLOOPSELECT … ENDSELECT CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one. ExampleDO loop: Omit an area (10 … 20) […]

CONTROLS (ABAP Keyword)

CONTROLS (ABAP Keyword) introduction & Details CONTROLS Basic formCONTROLS ctrl TYPE ctrl_type. EffectDefines a control A control defines an ABAP/4 runtime object which displays data in a particular visual format, depending on the type. It offers the user standard processing options. At present, the following types of control are supported: ABAP/4 table control Basic formCONTROLS […]

CONDENSE (ABAP Keyword)

CONDENSE (ABAP Keyword) introduction & details CONDENSE Basic formCONDENSE c. Addition … NO-GAPS EffectShifts the contents of the field c to the left, so that each word is separated by exactly one blank. Example DATA: BEGIN OF NAME,TITLE(8), VALUE ‘Dr.’,FIRST_NAME(10), VALUE ‘Michael’,SURNAME(10), VALUE ‘Hofmann’,END OF NAME.CONDENSE NAME.WRITE NAME. produces the output: Dr. Michael Hofmann Addition… […]

CONSTANTS (ABAP Keyword)

CONSTANTS (ABAP Keyword) introduction & details CONSTANTS Variants 1. CONSTANTS c. … VALUE [ val | IS INITIAL ].2. CONSTANTS c(len) … VALUE [ val | IS INITIAL ].3. CONSTANTS: BEGIN OF crec,…END OF crec. EffectThe CONSTANTS statement defines global and local constants. Constants allow you to read statically declared data objects . They always […]

COMPUTE (ABAP Keyword)

COMPUTE (ABAP Keyword) introduction & details COMPUTE Basic formCOMPUTE n = arithexp. EffectEvaluates the arithmetic expression arithexp and places the result in the field n . Allows use of the four basic calculation types + , – , * and / , the whole number division operators DIV (quotient) and MOD (remainder), the exponentiation operator […]

CONCATENATE (ABAP Keyword)

CONCATENATE (ABAP Keyword) introduction & details CONCATENATE Basic formCONCATENATE f1 … fn INTO g. Addition … SEPARATED BY h EffectPlaces the fields f1 to fn after g . With the fields fi (1

COMMUNICATION ( ABAP Keyword)

COMMUNICATION ( ABAP Keyword) introduction & details COMMUNICATION Variants 1. COMMUNICATION INIT DESTINATION dest ID id.2. COMMUNICATION ALLOCATE ID id.3. COMMUNICATION ACCEPT ID id.4. COMMUNICATION SEND ID id BUFFER f.5. COMMUNICATION RECEIVE ID id…BUFFER f…DATAINFO d…STATUSINFO s.6. COMMUNICATION DEALLOCATE ID id. The COMMUNICATION statement allows you to develop applications which perform direct program-to-program communication. The […]

COLLECT ( ABAP keyword)

COLLECT ( ABAP keyword) introduction & details COLLECT Basic formCOLLECT [wa INTO] itab. Addition … SORTED BY f EffectCOLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab . If you use only COLLECT to fill an internal table, COLLECT makes sure that […]

COMMIT (ABAP Keyword)

COMMIT (ABAP Keyword) introduction & details COMMIT Basic formCOMMIT WORK. Addition … AND WAIT EffectExecutes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). This means that all database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and […]

CNT (ABAP Keyword)

CNT (ABAP Keyword) introduction & details CNT Basic form… CNT(h) … EffectCNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset . CNT(h) can only be addressed from within a LOOP on a sorted extract.Type Standard output length OutputC […]

CLEAR (ABAP Keyword)

CLEAR (ABAP Keyword) introduction & details CLEAR Basic formCLEAR f. Additions 1. … WITH g2. … WITH NULL EffectResets the contents of f to its initial value. For predefined types (see DATA ), the following initial values are used:Type C : ‘ … ‘ (blank character) Type N : ’00…0’ Type D : ‘00000000’ Type […]

CLOSE (ABAP Keyword)

CLOSE (ABAP Keyword) introduction & details CLOSE Basic form 1. CLOSE DATASET dsn.2. CLOSE CURSOR c. Basic form 1CLOSE DATASET dsn. EffectCloses the file dsn , ignoring any errors which may occur. CLOSE is required only if you want to edit dsn several times. For further details, see the documentation for OPEN DATASET . Basic […]

CHECK ( ABAP Keyword)

CHECK ( ABAP Keyword) introduction & Details CHECK – within loops Basic formCHECK logexp. EffectCHECK evaluates the subsequent logical expression . If it is true, the processing continues with the next statement. In loop structures like DO … ENDDOWHILE … ENDWHILELOOP … ENDLOOPSELECT … ENDSELECT CHECK with a negative outcome terminates the current loop pass […]

BREAK-POINT ( ABAP Keyword)

BREAK-POINT ( ABAP Keyword) introduction & Details BREAK-POINT Variants: 1. BREAK-POINT.2. BREAK-POINT f. Variant 1BREAK-POINT. EffectThe BREAK-POINT statement interrupts the processing and diverts the system to debugging mode. You can then display the contents of all the fields at runtime and also control the subsequent program flow.If the system is unable to branch to debugging […]

CASE ( ABAP Keyword)

CASE ( ABAP Keyword) introduction & Details CASE Basic formCASE f.Effect Case distinction. Depending on the current contents of a field, this statement executes one of several alternative processing branches. The field whose contents determine how the subsequent processing is specified after CASE ; the individual processing branches are introduced by WHEN , followed by […]

AUTHORITY-CHECK (ABAP Keyword)

AUTHORITY-CHECK (ABAP Keyword) introduction & Details AUTHORITY-CHECK Basic formAUTHORITY-CHECK OBJECT objectID name1 FIELD f1ID name2 FIELD f2…ID name10 FIELD f10. EffectExplanation of IDs:object Field which contains the name of the object for which the authorization is to be checked.name1 … Fields which contain the names of the name10 authorization fields defined in the object.f1 … […]

BACK ( ABAP Keyword)

BACK ( ABAP Keyword) introduction & details BACK Basic formBACK. EffectReturns output position to the first line of the current page after the TOP-OF-PAGE processing.When used in connection with RESERVE x LINES , the statement returns the output position to the first output line after RESERVE . Example DATA: TOWN(10) VALUE ‘New York’,CUSTOMER1(10) VALUE ‘Charly’,CUSTOMER2(10) […]

AT (ABAP Keyword) introduction & Details

AT (ABAP Keyword) introduction & details ATEvents in lists– AT LINE-SELECTION.– AT USER-COMMAND.– AT PFn.Events on selection screens– AT SELECTION-SCREEN.Control break with extracts– AT NEW f.– AT END OF f.– AT FIRST.– AT LAST.– AT fg.Control break with internal tables– AT NEW f.– AT END OF f.– AT FIRST.– AT LAST.

ADD-CORRESPONDING (ABAP Keyword)

ADD-CORRESPONDING (ABAP Keyword) introduction & Details ADD-CORRESPONDING Basic formADD-CORRESPONDING rec1 TO rec2. EffectInterprets rec1 and rec2 as field strings. If, for example, rec1 and rec2 are tables, executes the statement for their header lines.Searches for all sub-fields which occur both in rec1 and rec2 and then, for all relevant field pairs corresponding to the sub-fields […]

ASSIGN (ABAP Keyword)

ASSIGN (ABAP Keyword) introduction & details ASSIGN Variants 1. ASSIGN f TO .2. ASSIGN (f) TO .3. ASSIGN TABLE FIELD (f) TO .4. ASSIGN LOCAL COPY OF MAIN TABLE FIELD (f) TO .5. ASSIGN COMPONENT idx OF STRUCTURE rec TO .6. ASSIGN COMPONENT name OF STRUCTURE rec TO . Variant 1ASSIGN f TO . Additions […]

ADD (ABAP Keyword)

ADD (ABAP Keyword) introduction and details ADD Variants 1. ADD n TO m.2. ADD n1 THEN n2 UNTIL nz GIVING m.3. ADD n1 THEN n2 UNTIL nz TO m.4. ADD n1 THEN n2 UNTIL nz…ACCORDING TO sel …GIVING m.5. ADD n1 FROM m1 TO mz GIVING m. Variant 1ADD n TO m. EffectAdds the contents […]

ABAP Code Optimization Methods & Techniques

For all entries Nested selects Select using JOINS Use the selection criteria Use the aggregated functions Select with view Select with index support Select … Into table Select with selection list Key access to multiple lines Copying internal tables Modifying a set of lines Deleting a sequence of lines Linear search vs. binary Comparison of […]

Passing data using SAP Memory & ABAP Memory

There are two cross-program memory areas to which ABAP programs have access that you can use to pass data between programs. SAP Memory SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a […]

HIDE TECHNIQUE and statement in SAP ABAP

You use the HIDE technique while creating a list level to store line-specific information for later use. To do so, use the HIDE statement as follows: HIDE <f>. This statement places the contents of the variable <f> for the current output line (system field SY­LINNO) into the HIDE area. The variable <f> must not necessarily […]

Calling another program from list in ABAP

Sometimes we require to call  another  ABAP program from a current running ABAP program ( list ).  Here we are going to check the available methods for that.  There are two methods for  achieving  this. They are SUBMIT rep LEAVE Using SUBMIT method , we are calling another program and it will start execute immediately. And the current program […]

AT – Events on selection screens ( AT SELECTION-SCREEN)

asic form AT SELECTION-SCREEN. Additions 1. … ON psel 2. … ON END OF sel 3. … ON VALUE-REQUEST FOR psel_low_high . 4. … ON HELP-REQUEST FOR psel_low_high 5. … ON RADIOBUTTON GROUP radi 6. … ON BLOCK block 7. … OUTPUT Effect This event only makes sense in reports, i.e. in programs set to […]

List of SAP System Tables

Here is a list of most important SAP standard system tables. Its not complete list. This is just of a reference to know the name & purpose of important tables which used by widely used functional modules. SAP System tables for Sales orders Name Description Uses LIKP Shipped Lines header LIPS Shipped Lines detail VBAK […]

SAP Standard Reports List

List of Standard Reports in SAP.A quick reference for ABAP programmers , Functional consultants and Administrators.Each report and its description ( purpose of use ) has been listed. Report Description REKH0004 SAP demo program that shows how to do 2D, 3D, and 4D graphics. RGUGBR00 Substitution/Validation utility RHGEN00 Regen PD and PA inconsistencies RHGRENZ0 Delimit […]

List of ABAP Function Modules in SAP

Here is a list of important Function Modules in SAP.Function modules are re-usable programs ( codes ) that can be called via ABAP programs. Function Module Description ABAP_DOCU_DOWNLOAD Download ABAP documentation in HTML format. APPL_LOG_DELETE With this function module you delete logs in the database according to specified selection conditions APPL_LOG_DISPLAY With this function module […]

List of SAP Transaction codes for ABAP Development

Here is a list of important Tcodes used with ABAP development. Transaction codes ( showing in bold letters) are listed with its purpose of use. OSS1 SAP Online Service System OY19 Compare Tables S001 ABAP Development Workbench S002 System Administration. SA38 Execute a program. SCAT Computer Aided Test Tool SCU0 Compare Tables SE01 Old Transport […]

SAP System Fields list – Commonly used with ABAP programs

Here is a list of important SAP System fields which are commonly used in our ABAP programs.Each System Field ( shown as bold ) is given with its description for a quick reference. System Field Description ABCDE Constant: Alphabet (A,B,C,…) APPLI SAP applications BATCH Background active (X)IF SY-BATCH EQ SPACE. WRITE: / ‘Report was started […]

SQL TRACE

Use Initial Screen Starting the Trace   Stopping the Trace Analyzing Performance Data Display Filter  Displaying Trace Records SQL Trace Use The SQL Trace function is an on-demand log of selected SQL statements that are issued against the database through the Open SQL Engine. The SQL Trace can be switched on or off dynamically. The log […]

SAP Runtime Analysis Tool ( Transaction SE30 )

This run-time analysis tools ( Transaction code SE30) allows the ABAP/4 programmer to trace the tables used by the SAP dialog/reports programs. In the Analyze button, you can see four more buttons like:- Hit List Displays the execution time of each statement in the program. Tables Displays the tables accessed during run time. Group hit […]

‘Hello world’ ABAP program

Call Transaction ‘SE38’. Create a new program. To proceed in an SAP 3.x system you must be registered as a Developer. You get your Developer Key from your Sys. admin in a couple of minutes/hours/days after you applied for it. It must be entered once when you create your first program. Program attributes: Type: 1 […]

ABAP program for Mass Purchase Order History Display

This is a customized ABAP report for mass Purchase Order history display instead of checking one a time. * *  Mass display or print Purchase Order History * *  You can request report by : *  1.  Change date *  2.  User Name *  3.  Purchase Order Number *  4.  Vendor Code REPORT ZPOCHANGE LINE-SIZE […]

ABAP OBJECTS Programming Sample Project with Employee Class

This example is a step by step example, moving from a simple class to more sophisticated classes,and covers inheritance, interfaces and events. Simple class Inheritance and polymorphism Interfaces Events   1. Simple class This example shows how to create a simple employee class. The constructor method is used to initialize number and name of the […]

ABAP program for find the user-exits of a SAP transaction code

*Sample ABAP program for Find the user-exits of a particular SAP transaction code (Tcode) * Enter the transaction code in which you are looking for the user-exit * and it will list you the list of user-exits in the transaction code. * Also a drill down is possible which will help you to branch to […]

Source Code for create subscreen in your ABAP Program

* Source Code for create subscreen in your ABAP Program * * This report will display the user last login date and time. * * Subscreen selection 1 : User Name *                                2 : Last Login Date *                                3 : Class Belong To * REPORT ZSUBSCREEN. TABLES: USR02,       “Logon data         SSCRFIELDS.  “FIELDS ON SELECTION […]

Batch Input with ‘Call Transaction’ – Sample ABAP program Code

Requirement: Choose a transaction and write a Batch Input program with ‘Call Transaction’. Do not use the Message tab feature of ‘Call Transaction’. In this case the last error message will be at the SY-MSG* system fields. Recreate the complete error message from table T100! (This example is also used by the demonstration of SY-MSG* […]

ABAP SQL Examples – Select Query

Requirement: Select those MM tables which are language dependant (For example you want to translate the customizing in two languages) Solution: report zbctcb96. tables: dd03l, tadir. data: counter type i value 1. select * from tadir where pgmid eq ‘R3TR’ and object eq ‘TABL’ and devclass like ‘M%’. select * from dd03l where tabname eq […]

ABAP Interactive Reporting Sample Code

Requirement: List the first 100 purchase requisitions at the plant ‘PL01’ (table EBAN). Then make it possible to change the purchase requisition itself from the list by clicking twice on the row or by using a push-button. Solution: In the purchasing (MM module) you can process the purchase requisitions. The purchase requisitions define primarily the […]

ABAP program to load a database table from a UNIX file

Requirement: Write a program to load a database table from a UNIX file. ABAP Source Code: report zmjud001 no standard page heading. tables: z_mver. parameters: test(60) lower case default ‘/dir/judit.txt’. data: begin of unix_intab occurs 100, field(53), end of unix_intab. data: msg(60). ***open the unix file open dataset test for input in text mode message […]

ABAP program for Creating Extract Dataset

Requirement: Write a program that lists the Vendors and their Accounting documents. Create extract dataset from KDF logical database. Loop through the dataset to create the required report. Don’t list those vendors which has no documents ABAP Source Code: report zfwr0001 no standard page heading. tables: lfa1, bsik. field-groups: header, item1, item2. insert lfa1-lifnr bsik-belnr […]

ABAP program for Reading database tables using select

Requirement: Write the a report with a select statement. ABAP Source Code: report zselect1 no standard page heading. tables: lfa1. select * from lfa1 order by name1. write: / lfa1-name1, ‘ ‘, lfa1-lifnr. endselect

Reading logical database using ABAP program

Requirement: Read a logical database (you must have data in those tables, now LFA1), fill up an internal table. Sort the data by a given field and then display the internal table. ABAP program Source Code: report zldbread no standard page heading. tables: lfa1. data: begin of t occurs 0, linfr like lfa1-lifnr, name1 like […]