Showing posts with label SAP. Show all posts
Showing posts with label SAP. Show all posts

Sunday, 13 October 2013

SAP : R/3 System Architecture & Components

R/3 System Architecture

R/3 system is a 3 tier architecture having
1. Presentation Server
2. Application Server
3. Database Server

  • Presentation server 
The local desktop serves as the presentation server, which is nothing but SAP GUI where the user logon to the client and work from the local machine
  • Application server
The server/computer on which the programs are run or executed is the application server. Application server receives the input from the presentation server and interpret the ABAP code and sends back the result to the presentation server
  • Database server
  1. The server/computer which receivers the request from the application server and interprets it and sends the request to RDBMS and collect the data requested from the RDBMS and sends back to the application server.
  2. All objects such as source code/generated binary code, tables etc. are physically present in the RDBMS
  3. R/3 is having the single database, which makes the operation of entire architecture faster and results in better performance

R/3 Architecture Components

List of R/3 components are as follows
  • DISPATCHER
  • WORK PROCESS
  • DATABASE CONNECTIVITY
DISPATCHER:
This is a component which acts as an interface between Presentation Layer and the Application Server. It receives the request from the user from the Presentation Server/Layer and allocates work area for each request from the user.

WORK PROCESS:
This is a Component which allocates memory area for each request received from dispatcher on roll-in and roll-out basis. Once the request is process, the memory area is rolled out to allocate the next request from the dispatcher.

DATABASE CONNECTIVITY:
OPEN SQL - It receives the SAP R/3 specific OPEN SQL statement from the user and converts it into database specific NATIVE SQL format (Database used at the backend)

NATIVE SQL – It checks for the syntax in the request received and passes the request to the database through the gateway service

SAP Basis - An Overview

SAP Basis is the technological platform that supports the entire range of SAP applications. Basis is similar to an operating system for R/3. It provide run-time environment for ABAP code.

One cannot execute ABAP/4 program without BASIS. Syntax checking, binary code generation will be done by the SAP basis

It is a layer of abstraction between the business applications and the operating system and database, which ensures that applications can be run on any platform (Portability).

SAP Basis supports following Operating Systems:
  • UNIX (AIX, HP-UX, Solaris, Linux)
  • Microsoft - Windows
  • Apple - i5/OS
  • Z/OS


SAP Basis Supported Database is
  • IBM DB2
  • Informix 
  • MaxDB
  • Oracle
  • Microsoft SQL Server


Friday, 27 September 2013

How to delete breakpoints system wide in SAP ABAP

Breakpoints are kept in the source code for debugging purpose.

Sometimes we might have forgot in which all places breakpoints are kept.

So, in such cases breakpoints can be deleted by executing standard report "RSBREAKPOINTS" from SE38 transaction.

Wednesday, 19 June 2013

How to download the source code to local directory in SAP?

SAP has provided a standard report ‘REPTRAN’ using which we can downloads the source code into local directory.

Steps:
  • Execute the program REPTRAN in SE38.
  • In selection screen, give the program name and the directory path to which you wanted to download and execute.

Regards,
Venugopal M N

Monday, 17 June 2013

How to get the components of structure i.e. list of fields of a structure in SAP-ABAP?

Sometime it might be required to get the components of the structure i.e. list of fields present in structure.


Use function module GET_COMPONENT_LIST to get the components of the structure.

Example:

REPORT ZVENU_TEST4.

DATA: t_components TYPE STANDARD TABLE OF RSTRUCINFO,
      x_components 
TYPE RSTRUCINFO.

TYPES: BEGIN OF ty_tab,
        kunnr 
type kna1-kunnr,
        name1 
type kna1-name1,
       
END OF ty_tab.

DATA: x_kna1 TYPE ty_tab.

*--CAll FM to get hte components of structure
CALL FUNCTION 'GET_COMPONENT_LIST'
  
EXPORTING
    
PROGRAM          = sy-repid
    FIELDNAME        = 
'X_KNA1'
  
TABLES
    COMPONENTS       = t_components.

LOOP AT t_components INTO x_components.
  
WRITE:/  sy-tabix ,' - Field Name : ', x_components-COMPNAME.
ENDLOOP. Output:

Output:


Similarly, using this functional module we can get the components of structure which is present in another program. In such a case pass the program name to PROGRAM field and structure name to FIELDNAME field.

NOTE: This FM give the components of internal table with header line, whereas using this FM we cannot get the component of structure without header line.

Regards,
Venugopal M N

How to get the value of the internal table in F4 help - SAP ABAP?

In this tutorial we will see how to get the value of the internal table in the F4 help.

Case-I:
  • In the above program, we have declared a parameter of type BUKRS (Company Code). Upon pressing the F4 in the selection screen we will get a popup listing all company codes as shown below.
  • This will happen because of the standard Search Help - C_T001 associated with data element BUKRS.



Case-II:
Sometimes the functional requirement will be such that upon pressing the F4, it should display only few company codes (say AC01, AC02, AC03 and US01).

To achieve the above requirement we need to follow below steps.
  • Populate the required values (AC01, AC02, AC03 and US01) of company code into internal table (T_BUKRS)
  • Call FM F4IF_INT_TABLE_VALUE_REQUEST in AT SELECTION-SCREEN ON VALUE-REQUEST section to get the values of internal tables. Refer the below code for the same.
*&---------------------------------------------------------------------*
REPORT ZVENU_TEST3.

*--Declaration of Structures
TYPES: BEGIN OF ty_bukrs,
        bukrs TYPE knb1-bukrs,
       END OF ty_bukrs.

*--Declaration of data
DATA: t_bukrs  TYPE STANDARD TABLE OF ty_bukrs,
      x_bukrs  TYPE ty_bukrs,
      t_return TYPE STANDARD TABLE OF ddshretval,
      x_return TYPE ddshretval.

REFRESH: t_bukrs, t_return.
CLEAR:   x_bukrs, x_return.

*--Selecetion Screen Parameter
PARAMETERS: p_bukrs TYPE bukrs.

*--Populatin the values to internal table
INITIALIZATION.
  x_bukrs-bukrs = 'AC01'.
  APPEND x_bukrs TO t_bukrs.
  CLEAR x_bukrs.

  x_bukrs-bukrs = 'AC02'.
  APPEND x_bukrs TO t_bukrs.
  CLEAR x_bukrs.

  x_bukrs-bukrs = 'AC03'.
  APPEND x_bukrs TO t_bukrs.
  CLEAR x_bukrs.

  x_bukrs-bukrs = 'US01'.
  APPEND x_bukrs TO t_bukrs.
  CLEAR x_bukrs.
*--Upon pressing the F4 buttion following code will be called
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
   RETFIELD               = 'BUKRS'   " Field Name Structure
   DYNPPROG               = sy-repid  " Program Name
   DYNPNR                 = sy-dynnr  " Current Screen Number
   DYNPROFIELD            = 'P_BUKRS' " Selection Screen Field
   VALUE_ORG              = 'S'       " Structure
   CALLBACK_PROGRAM       = sy-repid  " Program Name
  TABLES
   VALUE_TAB              = t_bukrs   " Internal table containing values
   RETURN_TAB             = t_return  " Return Table
 EXCEPTIONS
   PARAMETER_ERROR        = 1
   NO_VALUES_FOUND        = 2
   OTHERS                 = 3.
IF SY-SUBRC NE 0.
  MESSAGE 'Error in F4 help.' TYPE 'E'.
ENDIF.
*&---------------------------------------------------------------------*

Upon pressing the F4 in selection screen we'll get below pop-up as below.


Regards,
Venugopal M N


Sunday, 16 June 2013

How to find the program name based on the transaction code (T-Code) in SAP?

Sometimes during documentation functional/technical consultants require name of the program associated with T-code.

In SE93 transaction we can find out the program name which is associated with the t-code.

Say, you wanted to find the program associated with transaction code PFAL. Follow below steps to get the program name.

Steps:
  • Go to SE93 and enter T-code (PFAL)
  • Click on display button

Regards,
Venugopal M N



How to write a simple ABAP program in SAP?

In the following post we will see how to write a simple ABAP program.
  • Login to SAP
  • Go to transaction SE38
  • Enter new program name (Say ZTEST1) starting with Y or Z (All custom programs will start with Y or Z in SAP).
  • Enter program name and click on CREATE button.

  • In the next screen, enter the program TITLE and select the type of the program as ‘Executable Program’ and click on SAVE.
  • In the editor screen write the below code.

WRITE in SAP is similar to PRINTF statement in C.
  • Press ‘F8’ for executing the programs. Below is the output of the program.


Refer the below video.


Regards,
Venugopal M N






How to get the list of internal tables, work area & constants details declared in another program in SAP?

We can get the list of internal tables, work area & constants declared in another program in SAP using the standard function module  ‘GET_GLOBAL_SYMBOLS’.


Demo Example:
Let us create a test program ‘ZVENU_TEST1’ having the structure TY_TAB, T_KNA1 AND X_KNA1.



Now, our aim is access the structures & internal tables declared in ‘ZVENU_TEST1’ program from another program ‘ZVENU_TEST2’. This can be achieved by using the FM‘GET_GLOBAL_SYMBOLS’.


Upon executing the above program the internal table T_FIELDLIST will have the required details.

Regards,
Venugopal M N