ABAP

SAP ABAP OData References & PDF Tutorials

This article contains introduction about SAP ABAP OData,  tcodes, tables, table fields, function modules, application components & OData PDF tutorials. OData stands for Open Data Protocol. This http based protocol is used for building and consuming RESTful Application Programming Interfaces (APIs). An API is used for interacting between two applications. In SAP, OData is used […]

Upload and Download ABAP Source Code

Sample program source code for Uploading /Downloading  ABAP reports complete with texts Source Code Listing *———————————————————————-* * Report: ZKBPROGS * *———————————————————————-* * Function : Up/Download ABAP reports complete with texts * *———————————————————————-* * Change Log : * * July 5, 1999 * * – Combined existing programs that did the upload and download into* * […]

Solution for some real time problems | SAP ABAP Troubleshooting helps

Solution for the problems like System gets stuck ,Short dump,Field exits are completely ignored,Transaction SE16 does not work properly,Rollback segments are too small,Files for rollback segments are already enormous,Extended help under windows does not link correctly,Release procedure with classification does not work,Transport area is overloaded,Instance does not establish communication. System gets stuck It happens mostly […]

Web Dynpro for ABAP | webdynpro samples and tutorial

WebDynpro for ABAP (WD4A, WDA) is the SAP standard UI ( user interface) technology for developing Web applications in the ABAP language. It consists of a runtime environment and a graphical development environment with special Web Dynpro tools that are integrated in the ABAP Workbench (SE80). Web Dynpro offers the following advantages for application developers: […]

ABAP program to send a report to an external mail-id

This source code is an ABAP Program o send a report to an external mail-id REPORT ZREPORT_TO_EMAIL NO STANDARD PAGE HEADING LINE-SIZE 200. DATA : BEGIN OF ITAB OCCURS 0, PERNR LIKE PA0001-PERNR, ENAME LIKE PA0001-ENAME, END OF ITAB. DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE, receiver_list LIKE soos1 OCCURS 5 WITH HEADER […]

ABAP Program for Execute Unix command from within SAP

This source code is an ABAP Program for Execute Unix command from within SAP REPORT YSMT018AMESSAGE-ID YL.* ABAP to append ribesnsl to ribes* and remove input file using sxpg_command_execute DATA: FILE1(25) VALUE ‘/vmedata/???/file1nsl’.DATA: FILE2(25) VALUE ‘/vmedata/???/file2’.DATA: W_MESSAGE(50).DATA: RLBES LIKE RLBES.FILE1+9(3) = SY-SYSID.FILE2+9(3) = SY-SYSID.* sxpg_command_execute parametersDATA: REMOVE_FILE LIKE SXPGCOLIST-PARAMETERS.DATA: PROTOCOL LIKE BTCXPM OCCURS 0.*OPEN DATASET […]

ABAP Program to DIALOGUE FLOW LOGIC

This source code is an ABAP Program to DIALOGUE FLOW LOGIC PROCESS BEFORE OUTPUT.MODULE STATUS_0100.*PROCESS AFTER INPUT.MODULE EXIT_COMMAND AT EXIT-COMMAND.* Data is not in the screen fields until after the field statemeCHAIN.FIELD:S_TANUM,S_TAPOS MODULE VAL_TANUM.ENDCHAIN.* chain ensures all fields are open after an error CHAIN.FIELD: S_ZZTRACKING,S_EXIDV,S_TANUM,S_TAPOS MODULE VAL_ZZTRACKING.ENDCHAIN.* process data enteredMODULE USER_COMMAND_0100

ABAP Program to Get Output in EXCEL

This source code is an ABAP Program to Get Output in EXCEL REPORT YLMM015A MESSAGE-ID YL. *———————————————————————– * * EDI FORECASTING INTERFACE – SHEILA TITCHENER JAN 1998 * L_IDOC_HEADER_CREATE, L_IDOC_SEGMENT_CREATE & L_IDOC_SEND * left idoc ready to send but did not send automatically. * these were replaced by ALE_MODEL_DETERMINE_IF_TO_SEND * ALE_MODEL_INFO_GET & MASTER_IDOC_DISTRIBUTE * ‘in […]

Source Code of ABAP Program to Browse a file on the application server

Source Code of ABAP Program to Browse a file on the application server REPORT ZBROWSE MESSAGE-ID Z1NO STANDARD PAGE HEADING* LINE-COUNT 65LINE-SIZE 255. *———————————————————————** Topic: Browse a file on the appication server* ** Author: Sheila Titchener* **———————————————————————*DATA: BEGIN OF TAB1 OCCURS 0,LINE(5000),END OF TAB1. DATA: BEGIN OF TAB2 OCCURS 0,LINE(5000),END OF TAB2.DATA: PARCOM_LOC(100) TYPE C.DATA: […]

ABAP Program for Output Table Fields to a List

When you’re looking at the structure of a table, SAP will let you print the structure, but it won’t let you save the structure. This can be annoying. This report outputs the table structure to a list. At this point the user can use the System->List->Save->Local file command to save the list to a file. […]

ABAP Program to Upload table using new function GUI_UPLOAD

Sample ABAP Program to learn how to Upload table using new function GUI_UPLOAD in ABAP programming *& Report ZUPLOAD **& **&———————————————————————**& This program uses the new function GUI_UPLOAD **& Input must be TAB delimited with a blank column at the start **& to allow for MANDT. **& To use this program for any Database Table […]

ABAP Program for Sending SAP Mail

Sample ABAP program to show Sending SAP Mail using ABAP programming. *&———————————————————————**& Form SEND_MAIL*&———————————————————————** send email to current user **———————————————————————-*FORM SEND_MAIL. * PARAMETERS FOR SO_NEW_DOCUMENT_SEND_API1DATA: W_OBJECT_ID LIKE SOODK, W_SONV_FLAG LIKE SONV-FLAG.DATA: T_RECEIVERS LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE, W_OBJECT_CONTENT LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE, W_DOC_DATA LIKE SODOCCHGI1 OCCURS 0 WITH HEADER LINE.*DATA: […]

ABAP Program for Submitting report with selection table

Sample ABAP Program for learning how to Submit report with selection table REPORT submit_with_selection_table.TABLES QMSM.* Work area for internal table IQMSMDATA: BEGIN OF WQMSM, QMNUM LIKE QMSM-QMNUM, MNGRP LIKE QMSM-MNGRP, MNCOD LIKE QMSM-MNCOD, ZZSTAT LIKE QMSM-ZZSTAT, END OF WQMSM. * WORK Area for internal table iseltab.DATA: WSELTAB LIKE RSPARAMS.*———————————————————————-** Internal tables*———————————————————————-** selection table to pass […]

ABAP Program for Search Layout sets for given String

Sample ABAP program to show how to search in Layout sets for a given string. REPORT Ysearchl LINE-SIZE 132. ************************************************************************** Program : Ysearchl* Authors : Chris Harrop (chris.harrop@bigfoot.com)* Date : March 1999* Purpose : Searches all Y and Z layout sets for a given string*************************************************************************** maintenance history** date author purpose************************************************************************* TABLES: STXL. PARAMETERS:STRING(128). DATA: BEGIN […]

ABAP Program for Sapscript PerForm Module

sample ABAP program to show how to use Sapscript PerForm Module in ABAP programs. REPORT YLSD999A.DATA W_LENGTH TYPE I.* GENERAL PURPOSE SUBROUTINES FOR CALLING FROM SAPSCRIPTS*———————————————————————–*———————————————————————-FORM DISPLAY_POUND TABLES IN_TAB STRUCTURE ITCSYOUT_TAB STRUCTURE ITCSY.DATA: COUNT TYPE P VALUE 16.DATA: W_VALUE(17) TYPE C. “defined as 7 chars to remove penceDATA: W_CHAR TYPE C.DATA: W_DUMMY TYPE C.DATA: W_CURR(3) […]

ABAP Program for Module Pool containing screen loop processing

Sample ABAP program for showing how to program Module Pool containing screen loop processing PROGRAM YLSDM004.TABLES: LTAP, “Transfer order itemLIPS, “SD doc delivery: item dataMAKT, “material descriptionVEPO, “SD Document: Shipping Unit ItemVEKP, “SD Document: Shipping Unit HeaderUSR01, “USER defaultsZPACKMAT, “Packing material tableT646M, “hazard class descriptionsZCASHAZLAB. “SCasehazardous label tableDATA: OK_CODE(4). DATA: C LIKE SY-INDEX, ” cursor […]

ABAP Program for Create IDOC

Sample ABAP program to show how to create IDOC using ABAP programs. FUNCTION Y_ISSUE_ROCO_IDOC.*”———————————————————————-*”*”Local interface:*” IMPORTING*” VALUE(I_MODE) LIKE Z1ROCO-ZMODE*” VALUE(I_ROUTE) LIKE Z1ROCO-ROUTE*” VALUE(I_CUT_OFF) LIKE Z1ROCO-CUT_OFF OPTIONAL*” VALUE(I_BEZEI) LIKE Z1ROCO-BEZEI OPTIONAL*” VALUE(I_TROUTE_MON) LIKE Z1ROCO-TROUTE_MON OPTIONAL*” VALUE(I_TROUTE_TUE) LIKE Z1ROCO-TROUTE_TUE OPTIONAL*” VALUE(I_TROUTE_WED) LIKE Z1ROCO-TROUTE_WED OPTIONAL*” VALUE(I_TROUTE_THU) LIKE Z1ROCO-TROUTE_THU OPTIONAL*” VALUE(I_TROUTE_FRI) LIKE Z1ROCO-TROUTE_FRI OPTIONAL*” VALUE(I_TROUTE_SAT) LIKE Z1ROCO-TROUTE_SAT OPTIONAL*” VALUE(I_TROUTE_SUN) […]

ABAP Program of FTP Function Module

A sample ABAP program for understanding how to program with FTP function Module in ABAP. FUNCTION Y_FTP.*”———————————————————————-*”*”Local interface:*” IMPORTING*” VALUE(USER)*” VALUE(PWD)*” VALUE(HOST)*” TABLES*” COMMANDS*” EXCEPTIONS*” NO_SUCH_FILE*”———————————————————————- DATA: W_USER(12) TYPE C ,W_PWD(20) TYPE C ,W_HOST(64) TYPE C. DATA: HDL TYPE I,KEY TYPE I VALUE 26101957,DSTLEN TYPE I. DATA: BEGIN OF RESULT OCCURS 0,LINE(100) TYPE C,END OF […]

ABAP Program for MB1B Call Transaction

A sample ABAP program to understand how to use MB1B call transaction in ABAP. REPORT YMBIE096 LINE-SIZE 80. *———————————————————————-** Program: YMBIE096* Author: Sheila Titchener* Date: Mar 1999* Purpose: To move stock to new plant*———————————————————————-*TABLES: MCHB. * internal tableDATA: BEGIN OF I_MCHB OCCURS 0,MATNR LIKE MCHB-MATNR,LGORT LIKE MCHB-LGORT,CHARG LIKE MCHB-CHARG,J_2CTRNR LIKE MCHB-J_2CTRNR,J_2CELNG LIKE MCHB-J_2CELNG,CLABS LIKE MCHB-CLABS,END […]

ABAP Program for Lock All Users

This program (un)locks all the users in a client, except for the current user, and the SAP* user. You might want to add somthing like SELECT-OPTIONS EXEMPTUS FOR USR02-BNAME to allow a list of usernames not to be processed. Sometimes it is useful to be able to lock all the users out of a client; […]

WRITE – Output to a list ( SAP ABAP Keyword)

WRITE ( Output to a list ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output to a list Basic form WRITE f. Additions 1. … AT pl (position and length specification,before the field)2. … option (formatting option)3. … ofmt (output format by field)4. … AS […]

WRITE – Output to a variable ( SAP ABAP keyword)

WRITE ( Output to a variable ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output to a variable Variants 1. WRITE f TO g[+off][(len)].2. WRITE f TO itab[+off][(len)] INDEX idx. Variant 1WRITE f TO g[+off][(len)]. Addition … option EffectAssigns the contents of the source field […]

WRITE – Output as line ( SAP ABAP keyword)

WRITE ( Output as line )is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output as line EffectOn list output, automatically links certain characters together to form continuous lines or boxes, if there is no space between them: vertical lines, output with the system field SY-VLINE or […]

WRITE – Output formatting options ( SAP ABAP Keyword)

WRITE ( Output formatting options ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output formatting options Options … NO-ZERO… NO-SIGN… DD/MM/YY… MM/DD/YY… DD/MM/YYYY… MM/DD/YYYY… DDMMYY… MMDDYY… YYMMDD… CURRENCY w… DECIMALS d… ROUND r… UNIT u… EXPONENT e … USING EDIT MASK mask… USING NO EDIT […]

WRITE – Output as icon ( SAP ABAP Keyword)

WRITE ( Output as icon ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output as icon EffectYou can output certain characters as icons using the addition …AS ICON . You should only address these characters with their system-defined names. The include (or the more comprehensive […]

WRITE – Output as checkbox (ABAP keyword)

WRITE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output as checkbox EffectOutputs the field f as a checkbox. The contents of the first character of f is interpreted as the “status”: ‘ ‘ = not selected‘X’ = selected The user can change this as required. […]

WRITE – Output as symbol (ABAP keyword)

WRITE ( – Output as symbol )is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WRITE – Output as symbol EffectYou can output certain characters as symbols using the addition … AS SYMBOL . You should only address these characters with their system-defined names. The include (or the more […]

WINDOW ( SAP ABAP keyword)

WINDOW is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WINDOW Basic formWINDOW STARTING AT x1 y1. Addition … ENDING AT x2 y2 EffectDisplays the current secondary list as a modal dialog box (see CALL SCREEN ). The same rules apply as for displaying a list on the full […]

WHEN ( SAP ABAP Keyword)

WHEN is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WHEN Variants 1. WHEN f. 2. WHEN OTHERS. Effect See CASE

WHILE ( SAP ABAP Keyword)

WHILE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. WHILE Basic formWHILE logexp. Addition … VARY f FROM f1 NEXT f2. EffectRepeats the processing enclosed between the WHILE and ENDWHILE statements as long as the logical expression logexp is true. Checks the condition before each loop pass. If […]

UPDATE ( SAP ABAP Keyword)

UPDATE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.  UPDATE Variants 1. UPDATE dbtab SET s1 … sn.2. UPDATE dbtab. orUPDATE *dbtab. orUPDATE (dbtabname) … .3. UPDATE dbtab FROM TABLE itab. orUPDATE (dbtabname) FROM TABLE itab. EffectUpdates values in a database table (see Relational database ). You can […]

ULINE ( SAP ABAP Keyword)

ULINE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. ULINE Variants 1. ULINE.2. ULINE AT pl. Variant 1ULINE. EffectOutputs an unbroken underline. NoteThe underline extends across the entire line depending on the list width. Then, the cursor is positioned at the beginning of the next line. Variant 2ULINE […]

UNPACK ( SAP ABAP Keyword)

UNPACK is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.  UNPACK Basic formUNPACK f TO g. EffectUnpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left. Example DATA: P_FIELD(2) TYPE P VALUE 103, […]

TYPES ( SAP ABAP Keyword)

TYPES is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TYPES Variants 1. TYPES typ.2. TYPES typ(len).3. TYPES: BEGIN OF rectyp,…END OF rectyp. EffectThe TYPES statement introduces user-defined data types . As with standard data types, you can use them when creating data objects and when assigning types to […]

TYPE-POOLS ( SAP ABAP keyword)

TYPE-POOLS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TYPE-POOLS Basic formTYPE-POOLS typepool. EffectIncludes the types and constants of a type group. If the type group typepool has already been included, the statement is ignored. You can only maintain a type group via the ABAP/4 Dictionary (using Transaction […]

TRANSLATE ( SAP ABAP Keyword)

TRANSLATE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TRANSLATE Variants 1. TRANSLATE c TO UPPER CASE.2. TRANSLATE c TO LOWER CASE.3. TRANSLATE c USING c1.4. TRANSLATE c FROM CODE PAGE g1 TO CODE PAGE g2.5. TRANSLATE c FROM NUMBER FORMAT n1 TO NUMBER FORMAT n2. Variant 1TRANSLATE […]

TYPE-POOL ( SAP ABAP Keyword)

TYPE-POOL is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TYPE-POOL Basic formTYPE-POOL typepool. EffectIntroduces a type group. You can only maintain a type group via the ABAP/4 Dictionary (using Transaction SE11 ). The name typepool must match the name in the ABAP/4 Dictionary . You can only define […]

TRANSFER ( SAP ABAP Keyword)

TRANSFER is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TRANSFER Basic formTRANSFER f TO dsn. Addition … LENGTH len EffectTransfers the field f (usually a field string) to the sequential file specified in dsn (this may be a literal or a field). Binary mode (addition IN BINARY MODE […]

TABLES ( SAP ABAP Keyword)

TABLES is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TABLES Basic form TABLES dbtab. Effect Makes the database table ,view or structure dbtabknown to the program. These objects are created by selectingDevelopment -> ABAP/4 Dictionary . This transactionautomatically defines an identical field string – the table workarea – […]

TOP-OF-PAGE ( SAP ABAP Keyword)

TOP-OF-PAGE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. TOP-OF-PAGE Basic formTOP-OF-PAGE. Addition … DURING LINE-SELECTION EffectTOP-OF-PAGE is a list processing event which is executed before the the first data is output on a new page. NotesWithout the addition … DURING LINE-SELECTION , TOP-OF-PAGE is processed only when […]

SYNTAX-TRACE ( SAP ABAP Keyword)

SYNTAX-TRACE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SYNTAX-TRACE Variants 1. SYNTAX-TRACE ON.2. SYNTAX-TRACE ON OPTION CODING.3. SYNTAX-TRACE ON OPTION EXPAND.4. SYNTAX-TRACE OFF. Variant 1SYNTAX-TRACE ON. EffectThis statement has no effect at runtime except to switch on the syntax check or the generation of the program it […]

SUPPRESS ( SAP ABAP Keyword)

SUPPRESS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUPPRESS Basic formSUPPRESS DIALOG. EffectSuppresses output of the current screen. However, flow control continues normally and dialog resumes on the next screen. NoteSUPPRESS DIALOG should only be used in a PBO ( PROCESS BEFORE OUTPUT ) module.

SYNTAX-CHECK ( SAP ABAP Keyword)

SYNTAX-CHECK is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SYNTAX-CHECK Basic formSYNTAX-CHECK FOR itab …MESSAGE f …LINE g …WORD h. Additions 1. … PROGRAM f12. … INCLUDE f23. … OFFSET f34. … TRACE-TABLE t15. … DIRECTORY ENTRY f46. … REPLACING f57. … FRAME ENTRY f68. … MESSAGE-ID f79. […]

SUMMARY ( SAP ABAP Keyword)

SUMMARY is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUMMARY Basic formSUMMARY.This key word corresponds to FORMAT INTENSIFIED ON which should be used instead for the sake of clarity. NoteWhen outputting data to a list, you can use the addition INTENSIFIED ON of the WRITE statement to modify […]

SUBTRACT-CORRESPONDING ( SAP ABAP Keyword)

SUBTRACT-CORRESPONDING is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUBTRACT-CORRESPONDING Basic formSUBTRACT-CORRESPONDING rec1 FROM 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 […]

SUM ( SAP ABAP Keyword)

SUM is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUM Basic formSUM. EffectWhen processing an internal table in a block starting with LOOP and concluded by ENDLOOP , SUM calculates the control totals of all fields of type I , F and P (see also ABAP/4 number types […]

SUBTRACT ( SAP ABAP Keyword)

SUBTRACT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUBTRACT Basic formSUBTRACT n1 FROM n2. EffectSubtracts the contents of n1 from the contents of n2 and stores the result in n2 . This is equivalent to: n2 = n2 – n1. Example DATA NUMBER TYPE P VALUE 3, […]

STOP ( SAP ABAP Keyword)

STOP is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. STOP Basic formSTOP. EffectCancels all data selection. No further tables are read. NoteSTOP is followed immediately by the END-OF-SELECTION processing. If you do not want this, you may have to use EXIT instead.

SUBMIT ( SAP ABAP Keyword)

SUBMIT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SUBMIT Basic formSUBMIT rep. Additions1. … LINE-SIZE col2. … LINE-COUNT lin3. … TO SAP-SPOOL4. … VIA SELECTION-SCREEN5. … AND RETURN6. … EXPORTING LIST TO MEMORY7. … USER user VIA JOB job NUMBER n8. … Various additions for parameter transfer […]

START-OF-SELECTION ( SAP ABAP Keyword)

START-OF-SELECTION is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. START-OF-SELECTION Basic formSTART-OF-SELECTION. EffectThis is an event key word. Before the first logical database table access, it introduces any initial processing to be executed prior to the block specified under the next event key word NoteThe REPORT statement automatically […]

STATICS ( SAP ABAP Keyword)

STATICS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. STATICS Variants 1. STATICS f.2. STATICS f(len).3. STATICS: BEGIN OF rec,…END OF rec.4. STATICS: BEGIN OF itab OCCURS n,…END OF itab. EffectThe STATICS statement is a variation of the DATA statement. It allows you to define variables in a […]

SORT ( SAP ABAP Keyword)

SORT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SORT Variants 1. SORT itab.2. SORT. Variant 1SORT itab. Additions 1. … DESCENDING2. … ASCENDING3. … BY f1 f2 … fi EffectSorts the entries of the internal table itab in ascending order. The default key is used as the […]

SPLIT (ABAP Keyword)

SPLIT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SPLIT Variants 1. SPLIT f AT g INTO h1 … hn.2. SPLIT f AT g INTO TABLE itab. Variant 1SPLIT f AT g INTO h1 … hn. EffectSplits the contents of the f according to the delimiter g and […]

SKIP (ABAP Keyword)

SKIP is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SKIP Variants 1. SKIP.2. SKIP n.3. SKIP TO LINE lin. Variant 1SKIP. EffectOutputs a blank line. ExampleThe statements WRITE: ‘Text 1 ……’.SKIP.WRITE: ‘Text 2 ……’. produce the following output: Text 1 …… Text 2 …… Variant 2SKIP n. EffectOutputs […]

SET ( SAP ABAP Keyword)

SET is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SET EffectSets different processing parameters Basic forms ————————————————SET Basic form 1SET PF-STATUS pfstat. Additions 1. … EXCLUDING f or … EXCLUDING itab2. … IMMEDIATELY EffectSets a GUI (Graphical User Interface) status pfstat which can be up to 8 characters […]

SHIFT (ABAP Keyword)

SHIFT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SHIFT Variants 1. SHIFT c.2. SHIFT c BY n PLACES.3. SHIFT c UP TO c1.4. SHIFT c LEFT DELETING LEADING c1.5. SHIFT c RIGHT DELETING TRAILING c1. Variant 1SHIFT c. Additions 1. … CIRCULAR2. … RIGHT3. … LEFT EffectShifts […]

SELECT-OPTIONS ( SAP ABAP Keyword)

SELECT-OPTIONS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SELECT-OPTIONS Basic formSELECT-OPTIONS sel FOR f. Additions 1. … DEFAULT g2. … DEFAULT g … OPTION xx … SIGN s3. … DEFAULT g TO h4. … DEFAULT g TO h … OPTION xx … SIGN s5. … MEMORY ID […]

SELECTION-SCREEN ( SAP ABAP Keyword)

SELECTION-SCREEN is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SELECTION-SCREEN Variants 1. SELECTION-SCREEN BEGIN OF LINE.2. SELECTION-SCREEN END OF LINE.3. SELECTION-SCREEN SKIP n.4. SELECTION-SCREEN ULINE.5. SELECTION-SCREEN POSITION pos.6. SELECTION-SCREEN COMMENT fmt name.7. SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.8. SELECTION-SCREEN BEGIN OF BLOCK block.9. SELECTION-SCREEN END OF BLOCK block.10. […]

SELECT clause ( SAP ABAP Keyword)

SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SELECT clause Variants 1. SELECT [SINGLE [FOR UPDATE] | DISTINCT] *2. SELECT [SINGLE [FOR UPDATE] | DISTINCT] s1 … sn3. SELECT [SINGLE [FOR UPDATE] | DISTINCT] (itab) EffectThe result of a SELECT statement is itself a table . […]

SEARCH ( SAP ABAP Keyword)

SEARCH is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SEARCH Variants 1. SEARCH f FOR g.2. SEARCH itab FOR g. Variant 1SEARCH f FOR g. Additions 1. … ABBREVIATED2. … STARTING AT n13. … ENDING AT n24. … AND MARK EffectSearches the field f for the string in […]

SELECT ( SAP ABAP Keyword)

SELECT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SELECT Basic formSELECT result [target] FROM source [where] [GROUP BY fields] [ORDER BY order]. EffectRetrieves an extract and/or a set of data from a database table or view (see Relational database ). SELECT belongs to the OPEN SQL command […]

SCROLL ( SAP ABAP keyword)

SCROLL is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SCROLL Program-driven scrolling in lists Variants 1. SCROLL LIST TO FIRST PAGE.2. SCROLL LIST TO LAST PAGE.3. SCROLL LIST TO PAGE pag.4. SCROLL LIST TO COLUMN col.5. SCROLL LIST FORWARD.6. SCROLL LIST BACKWARD.7. SCROLL LIST LEFT.8. SCROLL LIST RIGHT. […]

ROLLBACK (SAP ABAP Keyword)

ROLLBACK is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. ROLLBACK Basic formROLLBACK WORK. EffectCloses a logical processing unit by reversing all database changes made since the last COMMIT . You use this statement if you cannot be certain that all the database changes have been executed correctly. The […]

SCAN ( SAP ABAP Keyword )

SCAN is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. SCAN Basic formSCAN ABAP-SOURCE itab1 TOKENS INTO itab2STATEMENTS INTO itab3. Additions1. … FROM n12. … TO n23. … KEYWORDS FROM itab44. … LEVELS INTO itab55. … OVERFLOW INTO c16. … WITH ANALYSIS7. … WITH COMMENTS8. … WITH INCLUDES9. … […]

RESERVE (ABAP Keyword)

RESERVE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. RESERVE Basic formRESERVE n LINES. EffectIf there is not enough space left on the current page for at least n lines, this statement starts a new page. n can be a constant (1,2,3,…) or a variable. NotesBefore starting a […]

REPLACE (ABAP Keyword)

REPLACE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. REPLACE Basic formREPLACE f WITH g INTO h. Addition … LENGTH len (length specification for field f ) EffectReplaces the first occurrence of the contents of field f in field h with the contents of field g . All […]

REPORT (ABAP Keyword)

REPORT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. REPORT Basic formREPORT rep. Additions 1. … NO STANDARD PAGE HEADING2. … LINE-SIZE col3. … LINE-COUNT lin(n)4. … MESSAGE-ID xx5. … DEFINING DATABASE ldb EffectIntroduces the report. You can choose any name you like up to 8 characters long. […]

REJECT (ABAP Keyword)

REJECT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. REJECT Variants 1. REJECT.2. REJECT dbtab. Variant 1REJECT. EffectStops processing the current database table line and resumes with the next line of the table on the same hierarchy level. Unlike the CHECK statement, you can also use REJECT within […]

RECEIVE (ABAP Keyword)

RECEIVE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. RECEIVE Basic formRECEIVE RESULTS FROM FUNCTION func. Additions 1. … IMPORTING p1 = f1 … pn = fn2. … TABLES p1 = itab1 … pn = itabn3. … EXCEPTIONS except1 = rc1 … exceptn = rcn EffectUsed within a […]

REFRESH (ABAP Keyword)

REFRESH is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. REFRESH REFRESH – Delete an internal table Variants 1. REFRESH itab.2. REFRESH itab FROM TABLE dbtab.3. REFRESH itab FROM SELECT-OPTIONS. Variant 1REFRESH itab. EffectThe internal table itab is reset to its initial state, i.e. all table entries are deleted. […]

RANGES (ABAP Keyword)

RANGES is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. RANGES Basic formRANGES sel FOR f. EffectDefines an internal table similar to a selection criterion sel defined using the SELECT-OPTIONS sel FOR f statement. The above statement is identical to: DATA: BEGIN OF sel OCCURS 10, SIGN(1), OPTION(2), LOW […]

READ (ABAP Keyword)

READ is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. READ READ – Read an internal table Basic formREAD TABLE itab.READ TABLE itab INTO wa. Additions 1a. … WITH KEY k1 = v1 … kn = vn1b. … WITH KEY = value1c. … WITH KEY key2. … BINARY SEARCH3. […]

PUT (ABAP Keyword)

PUT is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PUT Basic formPUT dbtab. EffectThis statement is only to be used in the access program of the logical database where the table dbtab occurs.” PUT dbtab. ” triggers the event ” GET dbtab. ” in the relevant report. Then, […]

RAISE (ABAP Keyword)

RAISE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. RAISE Basic formRAISE except. EffectThis statement only makes sense if used in conjunction with function modules. It triggers the exception except . If the program calling the function module is to handle the exception (see CALL FUNCTION ), control […]

PROGRAM (ABAP Keyword)

PROGRAM is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.  PROGRAM EffectThe PROGRAM statement is equivalent to the REPORT statement.

PROVIDE (ABAP Keyword)

PROVIDE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PROVIDE Basic formPROVIDE f1 f2 … FROM itab1g1 g2 … FROM itab2…* FROM itabi…BETWEEN f AND g. EffectRetrieves the contents of the specified fields from the internal tables ( itab1 , itab2 , …) and places them in the […]

PRINT-CONTROL (ABAP Keyword)

PRINT-CONTROL is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PRINT-CONTROL Variants 1. PRINT-CONTROL.2. PRINT-CONTROL INDEX-LINE f. Variant 1PRINT-CONTROL. Additions 1. … CPI cpi2. … LPI lpi3. … SIZE size4. … COLOR… BLACK… RED… BLUE… GREEN… YELLOW… PINK5. … LEFT MARGIN col6. … FONT font7. … FUNCTION f8. … […]

PERFORM (ABAP Keyword)

PERFORM is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PERFORM Variants 1. PERFORM form.2. PERFORM form(prog).3. PERFORM form IN PROGRAM prog.4. PERFORM n OF form1 form2 form3 … .5. PERFORM n ON COMMIT. Variant 1PERFORM form. Additions 1. … USING p1 p2 p3 …2. … CHANGING p1 p2 […]

POSITION (ABAP Keyword)

POSITION is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. POSITION Basic formPOSITION col. EffectThe contents of the field col sets the output position (column) of the subsequent WRITE statement. NotesIf the column defined by POSITION lies in the part of the line already described, it will be overwritten […]

PACK (ABAP Keyword)

PACK is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PACK Basic formPACK f TO g. EffectPlaces the character field f in packed format in the field g . Reverse of the UNPACK command. Example DATA C_FIELD(4) TYPE C VALUE ‘0103’,P_FIELD(2) TYPE P.PACK C_FIELD TO P_FIELD. C_FIELD: C’0103′ –> […]

PARAMETERS (ABAP Keyword)

PARAMETERS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. PARAMETERS Basic formPARAMETERS p Additions 1. … DEFAULT f2. … TYPE typ3. … DECIMALS4. … LIKE g5. … MEMORY ID pid6. … MATCHCODE OBJECT mobj7. … MODIF ID key8. … NO-DISPLAY9. … LOWER CASE10. … OBLIGATORY11. … AS CHECKBOX12 […]

OVERLAY (ABAP keyword)

OVERLAY is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. OVERLAY Basic formOVERLAY c1 WITH c2. Addition … ONLY c3 EffectThe contents of the field c2 overlay the field c1 in all positions where c1 has the value SPACE ; c2 itself remains unchanged. The return code value is […]

NEW-SECTION (ABAP keyword)

NEW-SECTION is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. NEW-SECTION NEW-SECTION continues to be supported only for reasons of compatibility, but it is processed internally after NEW-PAGE PRINT ON . Instead of ” NEW-SECTION “, use ” NEW-PAGE PRINT ON”. You can select the previous standard function of […]

ON (ABAP Keyword)

ON is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. ON Basic formON CHANGE OF f. Addition … OR f1 EffectExecutes the processing block enclosed by the ” ON CHANGE OF f ” and ” ENDON ” statements whenever the contents of the field f change (control break processing). […]

NEW-PAGE (ABAP Keyword)

NEW-PAGE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. NEW-PAGE Basic formNEW-PAGE. Additions 1. … NO-TITLE2 … WITH-TITLE3. … NO-HEADING4. … WITH-HEADING5. … LINE-COUNT lin6. … LINE-SIZE col EffectStarts a new page during list processing. Terminates the current page and continues output on a new page. NotesNEW-PAGE does […]

MULTIPLY-CORRESPONDING (ABAP Keyword)

MULTIPLY-CORRESPONDING is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. MULTIPLY-CORRESPONDING Basic formMULTIPLY-CORRESPONDING rec1 BY 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 […]

NEW-LINE (ABAP Keyword)

NEW-LINE is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. NEW-LINE Basic formNEW-LINE. Addition … NO-SCROLLING… SCROLLING EffectGenerates a new line during list processing. Terminates the current list line and moves the cursor to the next list line. If there has been no output (with WRITE or SKIP ) […]

MOVE-CORRESPONDING (ABAP keyword)

MOVE-CORRESPONDING is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. MOVE-CORRESPONDING Basic formMOVE-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 the sub-fields which occur both in rec1 and rec2 and […]

MULTIPLY (ABAP Keyword)

MULTIPLY is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. MULTIPLY Basic formMULTIPLY n1 BY n2. EffectMultiplies the contents of n1 by the contents of n2 and places the result in n1 . This is equivalent to: n1 = n1 * n2. Example DATA: DAYS_PER_YEAR TYPE P VALUE 365,HOURS_PER_DAY […]

MOVE (ABAP Keyword)

MOVE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. MOVE Variants 1. MOVE f TO g.2. MOVE f+off1(len1) TO g+off2(len2).3. MOVE c1 TO c2 PERCENTAGE n. Variant 1MOVE f TO g. EffectMoves the contents of field f to field g . Field f remains unchanged.This statement is […]

MODIFY (ABAP Keyword)

MODIFY is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. MODIFY MODIFY – Change a database table Variants 1. MODIFY dbtab. orMODIFY *dbtab. orMODIFY (dbtabname) … . .2. MODIFY dbtab FROM TABLE itab. orMODIFY (dbtabname) FROM TABLE itab.3. MODIFY dbtab VERSION vers. orMODIFY *dbtab VERSION vers. EffectInserts new […]

MODULE (ABAP Keyword)

MODULE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. MODULE Basic formMODULE modl. Additions 1. … OUTPUT2. … INPUT EffectThe processing block between the ” MODULE modl. ” and ” ENDMODULE. ” statements is known as a module . You call the module modl in the screen […]

MESSAGE (ABAP Keyword)

MESSAGE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. MESSAGE Variants 1. MESSAGE xnnn.2. MESSAGE ID mid TYPE mtyp NUMBER mnr. Variant 1MESSAGE xnnn. Additions 1. … WITH f1 … f42. … RAISING exception EffectOutputs the message no. nnn for the MESSAGE-ID specified in the REPORT statement […]

LOCAL (ABAP Keyword)

LOCAL is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. LOCAL Basic formLOCAL f. EffectCan only be used after the FORM statement.Saves the current value of the field f when you enter the routine and restores it when you leave the routine.You can also use LOCAL for field […]

LOOP (ABAP Keyword)

LOOP is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. LOOP LOOP – Loops on an internal table Basic formLOOP AT itab.LOOP AT itab INTO wa. Additions 1. … FROM n12. … TO n23. … WHERE logexp4. … TRANSPORTING NO FIELDS EffectProcesses an internal table (DATA ) in […]

LEAVE (ABAP Keyword)

LEAVE is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. LEAVE EffectLeave processing. LEAVE PROGRAM. EffectLeaves the current program and continues processing after CALL TRANSACTION , CALL DIALOG or SUBMIT prog AND RETURN .If you use LEAVE TO TRANSACTION , SUBMIT prog or start the program via the […]

LOAD (ABAP Keyword)

LOAD is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. LOAD Basic formLOAD REPORT prog PART part INTO itab. Variants 1. LOAD REPORT prog PART ‘HEAD’ INTO itab.2. LOAD REPORT prog PART ‘TRIG’ INTO itab.3. LOAD REPORT prog PART ‘CONT’ INTO itab.4. LOAD REPORT prog PART ‘DATA’ INTO […]

INPUT (ABAP keyword)

INPUT is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. INPUT Basic formINPUT.This key word will only be supported for a limited period (for the sake of compatibility with R/2). Instead, please use FORMAT INPUT (see FORMAT ) or the addition … INPUT of the WRITE statement.

INSERT (ABAP Keyword)

INSERT is a keyword used in SAP ABAP programming. This tutorial covers its introduction & syntax details. INSERT INSERT – Insert in a database table Variants 1. INSERT INTO dbtab VALUES wa. orINSERT INTO (dbtabname) VALUES wa.2. INSERT dbtab. orINSERT *dbtab. orINSERT (dbtabname) …3. INSERT dbtab FROM TABLE itab. orINSERT (dbtabname) FROM TABLE itab. EffectInserts […]

INITIALIZATION (ABAP keyword)

INITIALIZATION is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. INITIALIZATION Basic formINITIALIZATION. EffectProcessing event. Executed before the selection screen is displayed. The parameters (PARAMETERS ) and selection criteria (SELECT-OPTIONS ) defined in the program already contain default values (if specified). You can assign different values here and also […]