Monday, May 1, 2023

Function Module Creation

 Function Modules are an essential aspect of SAP ABAP development. They are pre-defined blocks of reusable code that perform a specific task or set of tasks. These modules can be called from within ABAP programs or external applications using remote function calls (RFCs).

The Function Builder (transaction code SE37) is used to create Function Modules in ABAP, which can have both input and output parameters. Function Modules can be created with a specific set of parameters or can be flexible with the use of generic parameters. They can also be made available for external applications to use via RFCs.

One of the benefits of using Function Modules in ABAP is their reusability. As code can be used multiple times within an application or across several applications, it can significantly reduce development time. Also, changes made to a Function Module are automatically reflected wherever the Function Module is used, making it easy to maintain.

Function Modules in SAP ABAP can perform different tasks, including database operations, data conversion, and date calculations.

 Examples of commonly used Function Modules include:

CONVERT_TO_LOCAL_CURRENCY: used to convert amounts in foreign currency to the local currency.

GUI_DOWNLOAD: used to download internal tables into a file on the user's PC.

GUI_UPLOAD: used to upload data from a file on the user's PC into an internal table.

RFC_READ_TABLE: used to read data from an SAP database table.

To summarize, Function Modules in SAP ABAP are reusable blocks of code that perform specific tasks or a set of tasks. They offer several advantages, such as reusability and maintainability. These modules can perform various functions and can be called from within ABAP programs or external applications using RFCs.

Video show steps to create a Function Module in SAP 



Video show steps to call a Function Module in Report






Message Class in SAP ABAP

 In SAP ABAP, a message class is a set of messages that can be utilized in an ABAP program or application. These messages are important in providing users with information, warnings, and error messages during the execution of a program.

Transaction SE91 is used in creating a message class, and it contains one or more messages. Each message has a message type, message number, unique identifier, short and long text. The message text can also be written in different languages to support internationalization.

In ABAP programs, messages are called using the MESSAGE statement. It includes the message class, message number, and any variables needed for the message text. The MESSAGE statement can be used to write messages to the system log or display messages to the user.

Using message classes in SAP ABAP can enhance program consistency, simplify message maintenance, and support multi-language applications. By defining and using message classes, developers can guarantee that messages are consistently displayed throughout the application and that message changes can be made easily and efficiently.


Steps shown in the below video 



Database Tables in DDIC

 In SAP ABAP, Database Tables are a fundamental component for storing and organizing data in a structured manner. These tables are defined in the ABAP Data Dictionary (DDIC) using transaction code SE11. The DDIC is a central repository for all data definitions in SAP ABAP, including Database Tables.

Each Database Table is defined with a name, description, and fields that determine the table's structure. The fields are defined with a data type, length, and other properties that specify how the data is stored. Data Types can be elementary, like numbers and characters, or structured, like Structures and Table Types.

Database Tables are classified based on their usage. The classifications include transparent, pooled, and clustered tables. Transparent tables are used to store application data, while pooled and clustered tables are used to store system data and can only be accessed by SAP System Programs.

To maintain data integrity, Database Tables can have various constraints, such as Primary Keys, Foreign Keys, and Check Constraints. Primary Keys are used to uniquely identify rows in a table, while Foreign Keys define relationships between tables. Check Constraints are used to validate data stored in a table.

Database Tables can be accessed and modified using SQL statements or ABAP programming. They are used in various SAP application components, such as SAP ERP, SAP CRM, and SAP BW, and play a critical role in the functioning of the SAP system.

Creation of Database Table - 

  1. Open the ABAP Development Workbench using the transaction code SE80.
  2. Navigate to the ABAP Dictionary by selecting Tools → ABAP Dictionary or using the transaction code SE11.
  3. In the ABAP Dictionary screen, select "Database table" and click on the "Create" button.
  4. Enter a unique name for the table and select the "Delivery and maintenance" tab. Ensure that "Display/Maintenance Allowed" is selected and save the table.
  5. Define the fields of the table by clicking on the "Fields" tab and adding the required fields along with their data types, lengths, and attributes.
  6. Specify the Key Fields of the table by selecting the "Key" checkbox next to the fields.
  7. Add any additional properties for the table, such as Texts and Documentation.
  8. Once all the fields and properties are defined, save the table.
  9. Activate the table by selecting "Utilities" from the menu and clicking on the "Activate" option.
  10. Following these steps will create and activate a Database Table in SAP ABAP. The table can then be accessed and utilized by various SAP programs and applications.
 Refer to the below video for the complete steps for table creation and activation 



In Conclusion , Database Tables in ABAP are an essential component for storing and organizing data. They are defined in the ABAP Data Dictionary, and fields are defined with a data type, length, and other properties. Database Tables can be classified as transparent, pooled, or clustered and have various constraints to maintain data integrity. They are accessed and modified using SQL statements or ABAP programming and are used in various SAP application components.


Saturday, June 22, 2019

Introduction to ERP and SAP



Enterprise Resource Planning (ERP) is a software system that businesses use to manage their operations and automate back-office functions. ERP software can help streamline workflows, improve efficiency, and provide real-time visibility into business operations.


SAP (Systems, Applications, and Products in Data Processing) is a popular ERP software provider that offers solutions for businesses of all sizes and industries. SAP software includes modules for finance, human resources, supply chain management, customer relationship management, and more.


To simplify the process of updating SAP systems, SAP provides a software tool called Software Update Manager (SUM). SUM automates and centralizes the update process, making it easier to update all SAP components, including the database, application server, and front-end components. SUM also provides features like planning, performing, and monitoring the update process, and allows users to perform a trial update to check for errors before committing to the actual update.


In summary, ERP systems help organizations manage their business processes, and SAP is a leading ERP software provider. SAP's Software Update Manager (SUM) simplifies the process of updating SAP systems. 

Modules in SAP

One of the reasons that SAP is popular is because it is very flexible and easily
customizable. To achieve this flexibility, an SAP system is divided into various
modules. Each SAP module maps to a business process of a business unit. For
example, the SAP ERP MM module maps to the Material Management business
unit of the organization, the HR module maps to the Human Resources business
unit of the organization, and so on.
All SAP modules can be integrated with one another or with third-party systems.
For example, you can integrate SAP ERP PP with an HR module from PeopleSoft.
Based on the organization, you can implement either one or several SAP modules
and integrate them with other ERP systems.
SAP modules are classified into two categories: functional or technical.
Functional Modules
Functional modules cover business processes and functional areas that carry out
day-to-day activities of a business, such as the following:
  • Financial Accounting (FI)
  • Controlling (CO)
  • Human Resource (HR)
  • Sales and Distribution (SD)
  • Materials Management (MM)
  • Plant Maintenance (PM)
  • Production Planning (PP)
  • And more
Technical Modules
Technical modules cover the technical side of the SAP system that are required to
customize the system based on business needs, including setting up and maintaining
the SAP system.
Technical modules include the following:
  • SAP Basis
  • ABAP
  • SAP BusinessObjects Business Intelligence (BI)/SAP Business Warehouse (BW)
  • SAP Exchange Infrastructure (XI)/SAP Process Integration (PI)
  • SAP Enterprise Portal
  • SAP HANA

Monday, February 11, 2019

TOP OF PAGE IN OOPS ALV

*&---------------------------------------------------------------------*
*& REPORT YDEMO_TEST
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT YDEMO_TEST.
PARAMETERSP_MATNR TYPE MARA-MATNR.
TYPESBEGIN OF TYPE_MARA,
        MATNR TYPE MARA-MATNR,
        ERSDA TYPE MARA-ERSDA,
        ERNAM TYPE MARA-ERNAM,
      END OF TYPE_MARA.
DATAT_MARA TYPE STANDARD TABLE OF TYPE_MARA,
      W_MARA TYPE TYPE_MARA.

DATAO_CONTAIN TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      O_GRID    TYPE REF TO CL_GUI_ALV_GRID.


DATAT_FCAT    TYPE LVC_T_FCAT,
      W_FCAT    TYPE LVC_S_FCAT.


 DATADG_PARENT_GRID     TYPE REF TO CL_GUI_CONTAINER,
       DG_PARENT_HTML     TYPE REF TO CL_GUI_CONTAINER,
       DG_SPLITTER          TYPE REF TO CL_GUI_SPLITTER_CONTAINER,

       DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,

       DG_HTML_CNTRL        TYPE REF TO CL_GUI_HTML_VIEWER.

CLASS LCL_EVENT DEFINITION.
  PUBLIC SECTION.
  METHODSEVENT_HANDLE FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
           TOP_OF_PAGE1 FOR EVENT TOP_OF_PAGE   OF CL_GUI_ALV_GRID IMPORTING E_DYNDOC_ID.
ENDCLASS.
*&---------------------------------------------------------------------*
*&       CLASS (IMPLEMENTATION)  LCL_EVENT
*&---------------------------------------------------------------------*
*        TEXT
*----------------------------------------------------------------------*
CLASS LCL_EVENT IMPLEMENTATION.
METHOD EVENT_HANDLE.
 CASE E_COLUMN_ID-FIELDNAME.
   WHEN 'MATNR'.
    READ TABLE T_MARA INTO W_MARA INDEX E_ROW_ID-INDEX ."TRANSPORTING MATNR.
     IF SY-SUBRC EQ 0.
      SET PARAMETER ID 'MAT' FIELD W_MARA-MATNR.
      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    ENDIF.
   WHEN OTHERS.
  ENDCASE.
ENDMETHOD.

METHOD TOP_OF_PAGE1 .
  DATA DL_TEXT(255TYPE C"TEXT
  DATALV_DATE TYPE CHAR10.

CALL METHOD DG_DYNDOC_ID->ADD_TEXT
  EXPORTING
    TEXT          'THIS IS DEMO OF TOP OF PAGE THIS IS DEMO OF TOP OF PAGE THIS IS DEMO OF TOP OF PAGE THIS IS DEMO OF TOP OF PAGE THIS IS DEMO OF TOP OF PAGE THIS IS DEMO OF TOP OF PAGE'
    SAP_STYLE     CL_DD_AREA=>HEADING.
  CALL METHOD DG_DYNDOC_ID->NEW_LINE.

  CONCATENATE SY-DATUM+6(2SY-DATUM+4(2SY-DATUM+0(4INTO LV_DATE SEPARATED BY '.'.
  CONCATENATE 'DATE : ' LV_DATE INTO DL_TEXT SEPARATED BY SPACE.
  CALL METHOD DG_DYNDOC_ID->ADD_TEXT
  EXPORTING
    TEXT          DL_TEXT
    SAP_STYLE     CL_DD_AREA=>HEADING.

  PERFORM F_SET_HEADER_HTML USING DG_DYNDOC_ID.
ENDMETHOD.
ENDCLASS.               "LCL_EVENT

START-OF-SELECTION.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*&      MODULE  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
  IF O_CONTAIN IS INITIAL.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'TITLE'.
    CREATE OBJECT O_CONTAIN
      EXPORTING
        CONTAINER_NAME              'CONT'.
  ENDIF.
  CREATE OBJECT DG_DYNDOC_ID
  EXPORTING    STYLE  'ALV_GRID'.
CREATE OBJECT DG_SPLITTER
  EXPORTING
    PARENT            O_CONTAIN
    ROWS              2
    COLUMNS           1.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD DG_SPLITTER->GET_CONTAINER
  EXPORTING
    ROW       1
    COLUMN    1
  RECEIVING
    CONTAINER DG_PARENT_HTML.
CALL METHOD DG_SPLITTER->GET_CONTAINER
  EXPORTING
    ROW       2
    COLUMN    1
  RECEIVING
    CONTAINER DG_PARENT_GRID
    .
CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
  EXPORTING
    ID                1
    HEIGHT            20.
IF SY-SUBRC <> 0.
* IMPLEMENT SUITABLE ERROR HANDLING HERE
ENDIF.

 CREATE OBJECT O_GRID
         EXPORTING I_PARENT DG_PARENT_GRID.
*  CALL METHOD O_GRID->REGISTER_EDIT_EVENT
*    EXPORTING
*      I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
PERFORM F_FETCH.
  IF T_MARA IS  NOT INITIAL.
    PERFORM F_BUILD_FCAT.
    PERFORM F_REGISTER_HANDLER.
    PERFORM F_DISPLAY_TABLE.
  ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      MODULE  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.

  CASE SY-UCOMM.
    WHEN 'EXIT' .
      LEAVE PROGRAM.
*    WHEN .
    WHEN OTHERS.
  ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      FORM  F_FETCH
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*  -->  P1        TEXT
*  <--  P2        TEXT
*----------------------------------------------------------------------*
FORM F_FETCH .
 SELECT
   MATNR
   ERSDA
   ERNAM
 FROM MARA INTO TABLE T_MARA UP TO 30 ROWS..
ENDFORM.
*&---------------------------------------------------------------------*
*&      FORM  F_BUILD_FCAT
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*  -->  P1        TEXT
*  <--  P2        TEXT
*----------------------------------------------------------------------*
FORM F_BUILD_FCAT .
W_FCAT-FIELDNAME 'MATNR'.
W_FCAT-KEY 'X'.
W_FCAT-COLTEXT 'MATERIAL NUMBER '.
W_FCAT-HOTSPOT 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.

W_FCAT-FIELDNAME 'ERSDA'.
W_FCAT-COLTEXT 'CREATED DATE '.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.

W_FCAT-FIELDNAME 'ERNAM'.
W_FCAT-COLTEXT 'NAME '.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
ENDFORM.
*&---------------------------------------------------------------------*
*&      FORM  F_REGISTER_HANDLER
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*  -->  P1        TEXT
*  <--  P2        TEXT
*----------------------------------------------------------------------*
FORM F_REGISTER_HANDLER .
DATAO_HANDLE TYPE REF TO LCL_EVENT.
CREATE OBJECT O_HANDLE.
SET HANDLER O_HANDLE->EVENT_HANDLE FOR O_GRID.
SET HANDLER O_HANDLE->TOP_OF_PAGE1 FOR O_GRID.

ENDFORM.
*&---------------------------------------------------------------------*
*&      FORM  F_DISPLAY_TABLE
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*  -->  P1        TEXT
*  <--  P2        TEXT
*----------------------------------------------------------------------*
FORM F_DISPLAY_TABLE .
 CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
   EXPORTING
     I_BUFFER_ACTIVE               SPACE
     I_BYPASSING_BUFFER            'X'
     I_STRUCTURE_NAME              'TYPE_MARA'
     I_SAVE                        'A'
   CHANGING
     IT_OUTTAB                     T_MARA
     IT_FIELDCATALOG               T_FCAT
*     IT_SORT                       =
*     IT_FILTER                     =
   EXCEPTIONS
     INVALID_PARAMETER_COMBINATION 1
     PROGRAM_ERROR                 2
     TOO_MANY_LINES                3
     OTHERS                        4
         .
 IF SY-SUBRC <> 0.
*  IMPLEMENT SUITABLE ERROR HANDLING HERE
 ENDIF.
  "DO THESE..{
* INITIALIZING DOCUMENT
  CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.

* PROCESSING EVENTS
  CALL METHOD O_GRID->LIST_PROCESSING_EVENTS
    EXPORTING
      I_EVENT_NAME 'TOP_OF_PAGE'
      I_DYNDOC_ID  DG_DYNDOC_ID.
ENDFORM.
*&---------------------------------------------------------------------*
*&      FORM  F_SET_HEADER_HTML
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*  -->  P1        TEXT
*  <--  P2        TEXT
*----------------------------------------------------------------------*
FORM F_SET_HEADER_HTML USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
 DATA DL_LENGTH  TYPE I,                           " LENGTH
        DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE" BACKGROUND_ID
* CREATING HTML CONTROL
  IF DG_HTML_CNTRL IS INITIAL.
    CREATE OBJECT DG_HTML_CNTRL
         EXPORTING
              PARENT    DG_PARENT_HTML.
  ENDIF.
* REUSE_ALV_GRID_COMMENTARY_SET
  CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
    EXPORTING
      DOCUMENT DG_DYNDOC_ID
      BOTTOM   SPACE
    IMPORTING
      LENGTH   DL_LENGTH.
* GET TOP->HTML_TABLE READY
  CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
* SET WALLPAPER
  CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
    EXPORTING
      PICTURE_ID DL_BACKGROUND_ID.
* CONNECT TOP DOCUMENT TO HTML-CONTROL
  DG_DYNDOC_ID->HTML_CONTROL DG_HTML_CNTRL.
* DISPLAY TOP DOCUMENT
  CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
    EXPORTING
      REUSE_CONTROL      'X'
      PARENT             DG_PARENT_HTML
    EXCEPTIONS
      HTML_DISPLAY_ERROR 1.
  IF SY-SUBRC NE 0.
    MESSAGE 'ERROR IN DISPLAYING TOP-OF-PAGE' TYPE 'E'.
  ENDIF.
ENDFORM.

Thursday, September 13, 2018

INVERVIEW QUESTION AND ANSWERS ON SAP ABAP


      I have collected a huge set of Interview Questions from different interview panels of MNCs ,  these questions and answers will be very beneficial for you guys to crack any interview on SAP ABAP. Once you have completed your course learning on SAP ABAP you can assist your self by these sets of Questions. Lets Go On...

***Will update more questions very soon...please follow this blog. Do comment .


1.      What is an ABAP data dictionary?
       ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.

2.      What are domains and data element? - 
       Domains: Domain is the central object for describing the technical characteristics of an attribute of a business objects. It describes the value range of the field. Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.

3.      What is foreign key relationship?
       A relationship which can be defined between tables and must be explicitly defined at field level. Foreign keys are used to ensure the consistency of data. Data entered should be checked against existing data to ensure that there are now contradiction. While defining foreign key relationship cardinality has to be specified. Cardinality mentions how many dependent records or how referenced records are possible.

4.      Describe data classes.
      Master data: It is the data which is seldomly changed. Transaction data: It is the data which is often changed. Organization data: It is a customizing data which is entered in the system when the system is configured and is then rarely changed. System data:It is the data which R/3 system needs for itself.

5.      What are indexes?
      Indexes are described as a copy of a database table reduced to specific fields. This data exists in sorted form. This sorting form ease fast access to the field of the tables. In order that other fields are also read, a pointer to the associated record of the actual table are included in the index. The indexes are activated along with the table and are created automatically with it in the database.

6.      Difference between transparent tables and pooled tables.
      Transparent tables: Transparent tables in the dictionary has a one-to-one relation with the table in database. Its structure corresponds to single database field. Table in the database has the same name as in the dictionary. Transparent table holds application data. Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the table in database. Table in the database has the different name as in the dictionary. Pooled table are stored in table pool at the database level.

7.      What is an ABAP/4 Query?-
       ABAP/4 Query is a powerful tool to generate simple reports without any coding. ABAP/4 Query can generate the following 3 simple reports: Basic List: It is the simple reports. Statistics: Reports with statistical functions like Average, Percentages. Ranked Lists: For analytical reports. - For creating a ABAP/4 Query, programmer has to create user group and a functional group. Functional group can be created using with or without logical database table. Finally, assign user group to functional group. Finally, create a query on the functional group generated.

8.      What is BDC programming?
      Transferring of large/external/legacy data into SAP system using Batch Input programming. Batch input is a automatic procedure referred to as BDC(Batch Data Communications).The central component of the transfer is a queue file which receives the data vie a batch input programs and groups associated data into “sessions”.

9.      What are the functional modules used in sequence in BDC?
      These are the 3 functional modules which are used in a sequence to perform a data transfer successfully using BDC programming: BDC_OPEN_GROUP - Parameters like Name of the client, sessions and user name are specified in this functional modules. BDC_INSERT - It is used to insert the data for one transaction into a session. BDC_CLOSE_GROUP - This is used to close the batch input session.

10.  What are internal tables?-
       Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.

11.  What is ITS? What are the merits of ITS?
       ITS is a Internet Transaction Server. ITS forms an interface between HTTP server and R/3 system, which converts screen provided data by the R/3 system into HTML documents and vice-versa. Merits of ITS: A complete web transaction can be developed and tested in R/3 system. All transaction components, including those used by the ITS outside the R/3 system at runtime, can be stored in the R/3 system. The advantage of automatic language processing in the R/3 system can be utilized to language-dependent HTML documents at run-time.

12.  What is DynPro?
      DynPro is a Dynamic Programming which is a combination of screen and the associated flow logic Screen is also called as DynPro.

13.  What are screen painter and menu painter?-
       Screen painter: Screen painter is a tool to design and maintain screen and its elements. It allows user to create GUI screens for the transactions. Attributes, layout, filed attributes and flow logic are the elements of Screen painter. Menu painter: Menu painter is a tool to design the interface components. Status, menu bars, menu lists, F-key settings, functions and titles are the components of Menu painters. Screen painter and menu painter both are the graphical interface of an ABAP/4 applications.

14.  What are the components of SAP scripts?
       SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. - Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program.

15.  What is ALV programming in ABAP? When is this grid used in ABAP?
       ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

16.  What are the events in ABAP/4 language?- Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.

17.  What is CTS and what do you know about it?- The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.

18.  What are logical databases? What are the advantages/ dis-advantages of logical databases?
       To read data from a database tables we use logical database. A logical database provides read-only access to a group of related tables to an ABAP/4 program. Advantages: i)check functions which check that user input is complete, correct,and plausible. ii)Meaningful data selection. iii)central authorization checks for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages: i)If you donot specify a logical database in the program attributes,the GET events never occur. ii)There is no ENDGET command,so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).

19.  What is a batch input session?-
      BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.

20.  How to upload data using CATT ?
      These are the steps to be followed to Upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.

21.  What is Smart Forms?-
      Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution.

22.  How can I make a differentiation between dependent and independent data?
      Client dependent or independent transfer requirements include client specific or cross client objects in the change requests. Workbench objects like SAPscripts are client specific, some entries in customizing are client independent. If you display the object list for one change request, and then for each object the object attributes, you will find the flag client specific. If one object in the task list has this flag on, then that transport will be client dependent.

23.  What is the difference between macro and subroutine?
      Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program the are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

Wednesday, September 12, 2018

Performance tuning in ABAP Reports

To Improve Performance in SAP ABAP Reports
here are some tips:

  • Avoid SELECT *: Instead, select only the required fields to reduce unnecessary data retrieval and to speed up the report execution.

  • Use a WHERE clause: This limits the number of records retrieved and reduces the load on the database, improving performance.

  • Use internal tables: Storing data in internal tables instead of accessing database tables directly reduces the number of database accesses, which can improve performance.

  • Use field symbols: Using field symbols instead of data objects to access the data reduces memory consumption and can improve performance.

  • Avoid nested SELECT statements: Nested SELECT statements can increase the load on the database and negatively impact performance.

  • Use FOR ALL ENTRIES: Use the FOR ALL ENTRIES statement to retrieve data based on a set of keys instead of using nested SELECT statements, which can improve performance.

  • Optimize loops: Optimize loops to reduce the number of iterations, such as by using the LOOP AT … ASSIGNING statement instead of LOOP AT … INTO.

  • Use SORT and DELETE ADJACENT DUPLICATES: Use SORT and DELETE ADJACENT DUPLICATES statements to eliminate duplicates from internal tables, which can improve performance.

  • Use AT NEW and AT END statements: Use AT NEW and AT END statements to reduce the number of loops required to perform calculations on internal tables.

  • Use buffering: Use buffering to reduce database accesses by buffering data in memory, which can improve performance.

By implementing these tips, SAP ABAP reports can be improved to provide a better user experience.

Reset Launchpad and Applications Cache


Reset Launchpad and Applications Cache


  1. Transaction: /IWFND/CACHE_CLEANUP on Gateway
  2. Transaction: /IWBEP/CACHE_CLEANUP on Backend and Gateway
  3. Clear local browser cache
  4. Run report /UI2/CHIP_SYNCHRONIZE_CACHE
  5. Run report /UI2/DELETE_CACHE_AFTER_IMP
  6. Optional: Run report /UI2/DELETE_CACHE
  7. Optional: Run report /UI2/PAGE_CACHE_RESET
  8. Run report /UI2/INVALIDATE_GLOBAL_CACHES
  9. Run report /UI2/INVALIDATE_CLIENT_CACHES
  10. Run report /UI5/APP_INDEX_CALCULATE
  11. Run transaction SMICM -> HTTP Plug-In -> Server Cache -> Invalidate Locally
  12. Run transaction SMICM -> HTTP Plug-In -> Server Cache -> Invalidate Globally

Tuesday, September 11, 2018

Transport of Copies (TOC)

Transport of Copies (TOC) is a functionality in SAP ABAP that allows developers to copy objects between different systems or clients. This is particularly useful when developers need to transport objects, such as programs or tables, from a development system to a quality assurance or production system. It enables developers to make changes to the copied objects without affecting the original objects.


When using TOC, a developer creates a copy of an object in the source system and transports the copy to the target system. The copied object can then be modified in the target system without affecting the original object in the source system. Any changes made to the copied object in the target system can be transported back to the source system if necessary.


TOC can be used to copy a variety of objects in SAP ABAP, including programs, function modules, tables, views, and more. When transporting the copied objects, the developer can choose to include dependent objects such as data elements or domains to ensure that the copied objects are fully functional in the target system.


Overall, the TOC feature in SAP ABAP makes it easier for developers to transport copies of objects between systems or clients, simplifying the transport process and ensuring consistency across systems.







How to Enable Database Table Logging and analyze the log records using Transaction Code SCU3

You can log the changes of data like append, modification or delete fields in a table.
When you create your transparent table, you can go to the technical settings screen and set the flag "Log data changes". 
SE11 -> Technical Settings -> tick the Log data changes
Remember that you must have the parameter rec/client set in the system profile. 
RZ10 - Extended Maintenance
  • rec/client = ALL (log all clients)
  • rec/client = 000(,...) (log all specified clients)
  • rec/client = OFF (do not log)
You can see the changes to the table in the transaction OY18 or SCU3.
Logging is independent of update. Obviously, it will slow down the accesses when you change the table as record have to be written into the log table for each change.

Steps to be followed:
1)     Check if your SAP R/3 system has the logging option enabled or not
This is very important step because if it is disabled and if you activate the table logging in Technical Settings for any table, it won’t log the data changes to that table.
In order to verify if our R/3 System has the table logging flag set or not, we can use the REPORT  RSPARAM which displays all profiles in the system with their values.

The parameter rec/client is used for controlling table logging at R/3 system level.


3)     Enable LOG DATA CHANGES FLAG in Technical Settings of Table using SE13
In this step, set the Log data changes flag for the tables that we want to have logged. Once this enabled, the table log changes will be logged in the table DBTABPRT.





4)     Check logs using the transaction SCU3.
Finally, if there are any data changes made to the customizing table, we can view the logs.

In case, the given selection criteria (Date Range, Table Name) does not contain any data changes, it will show the result as follows: