Showing posts sorted by relevance for query calling. Sort by date Show all posts
Showing posts sorted by relevance for query calling. Sort by date Show all posts

Subscreen Tab Strips in ABAP Lesson Forty One

A sub screen area is a reserved rectangular area on a screen, into which you place another screen at run time. Sub screen areas may not contain any other screen elements. To use a sub screen, you create a second screen (with the type sunscreen), and display it in the sub screen area you defined on the main screen.A sub screen is an independent screen that you display within another screen. You may want to use a sub screen as a way of displaying a group of objects in certain circumstances, but not in others. You can use this technique to display or hide extra fields on the main screen, depending on the entries the user has made.A second use for sub screens is that different programs can use the same sub screens. To do this, you must execute other screen programs within your main program.You can include more than one sub screen on a single main screen. You can also determine the sub screens dynamically at run time.

You can use sub screens in the following circumstances:

In screen enhancements (screen exits), Within other screen objects (tabstrip control)
In the Modification Assistant In Web transactions.

If the sub screen is larger than the sub screen area in which it is called, the system only displays as much of it as will fit onto the screen. However, you can use the Scrollable attribute to ensure that, if the screen is too big, the system will display scroll bars.

The resizing attributes control whether the size of a sub screen area can be changed vertically and horizontally. You should set these attributes if you want the size of the sub screen area to change with the size of the whole window. You can use the minimum size attribute to set a lower limit beyond which the sub screen area cannot be re sized.The Context menu attribute allows you to assign a context-sensitive menu to the output fields on the sub screen screen.

The following restrictions apply to sub screens:

CALL SUBSCREEN ... is not allowed between LOOP and ENDLOOP or between
CHAIN and ENDCHAIN.

A sub screen may not have a named OK_CODE field.
Object names must be unique within the set of all sub screens called in a single main screen.

Sub screens may not contain a module with the AT EXIT-COMMAND addition.
You cannot use the SET TITLEBAR, SET PF-STATUS, SET SCREEN, or LEAVE
SCREEN statements in the modules of a sub screen.

To create a sub screen area, choose subscreen from the object list in the Screen Painter and place it on the screen. Fix the top-left hand corner of the table control area, and then drag the object to the required size.

In the Object text field, enter a name for the sub screen area. You need this to identify the area when you call the sub screen.

To use a sub screen, you must call it in both the PBO and PAI sections of the flow logic of the main screen. The CALL SUBSCREEN statement tells the system to execute the PBO and PAI processing blocks for the sub screen as components of the PBO and PAI of the main screen. You program the ABAP modules for sub screens in the same way as for a normal screen (apart from the restrictions already mentioned).

If the sub screen is not in the same module pool as the "main program", the global data of the main program is not available to the sub screen, and the data from the screen will not be transferred back to the program. You must program the data transfer yourself (for example, using a function module that exports and imports data, with an appropriate MOVE statement in the sub screen coding).

If you want to use sub screens in the screens of several different programs, you should encapsulate the sub screens in a function group and use function modules to transport data between the program in which you want to use the sub screen and the function group.You can pass data between the calling program and the function group using the interfaces of the function modules.This is the technique used for customer sub screens (screen enhancements).You use function modules to transport data between the calling program and the function group.

To declare the data from the calling program to the sub screen of the function group, use a module before the sub screen call. This should call a function module whose interface you can use to pass the required data to the function group.

The function module call must occur before the sub screen call. This ensures that the data is known in the function group before the PROCESS BEFORE OUTPUT processing block of the sub screen is called.

In the PAI module of the calling screen, the sequence is reversed: You call the PROCESS AFTER INPUT processing block of the sub screen before calling a function module to pass the data from the function group back to the calling program.For the data from the calling program to be available globally in the function group, you must transfer the interface parameters from the function module into global data fields of the function group.The function module that you use to transfer the data from the calling program into the function group must copy its interface parameters into the global data in the function group.

The function module that you use to transfer data from the function group to the calling program must copy the corresponding data from the global data of the function group into its interface parameters.Tab strip controls provide you with an easy, user-friendly way of displaying different components of an application on a single screen and allowing the user to navigate between them. Their intuitive design makes navigation much easier for end users.

Tab strip controls are a useful way of simplifying complex applications. You can use tab strip controls wherever you have different components of an application that form a logical unit. For example, you might have a set of header data which remains constant, while underneath it, you want to display various other sets of data.

You should not use tab strip controls if

You need to change the screen environment (menus, push buttons, header data, and so on) while processing the application components. The screen surrounding the tab strip must remain constant.The components must be processed in a certain order. Tab strips are designed to allow users to navigate freely between components.The components are processed dynamically, that is, if user input on one tab page leads to other tab pages suddenly appearing.

Tab strip controls are compatible with batch input processing.A tab strip control consists of individual pages. These consist of the page area and the tab title.The tab may only have one row of tab titles.If the tab strip control contains too many pages, it will not be possible for all of the tab titles to be displayed at once. If this happens, the system displays a scroll bar with which you can scroll through the remaining tab pages. In the top right-hand corner of the tab is a push button. If the user clicks this, a list of all of the tab titles is displayed. The active tab title is marked with a tick.A tab strip control consists of individual pages. These consist of the page area and the tab title.The tab may only have one row of tab titles.

If the tab strip control contains too many pages, it will not be possible for all of the tab titles to be displayed at once. If this happens, the system displays a scroll bar with which you can scroll through the remaining tab pages. In the top right-hand corner of the tab is a push button. If the user clicks this, a list of all of the tab titles is displayed. The active tab title is marked with a tick.A tab page consists of a tab title, a sub screen area, and a sub screen.From a technical point of view, the system handles tab titles like push buttons.The contents of tab pages are displayed using the sub screen technique. You assign a sub screen area to each tab page, for which you can then call a sub screen.

As well as the general "Object name", "Starting position" and static size attributes, tab strip controls also have special tab strip attributes.You create a tab strip control in the following three steps:

  1. Define the tab area
  2. Define the tab titles and, if necessary, add further tab titles
  3. Assign a sub screen area to each tab page.

To create a tab strip area, choose Tab strip from the object list in the Screen Painter and place it on the screen. Fix the top-left hand corner of the table control area, and then drag the object to the required size.Assign a name to the tab strip control in the "Object name" attribute. You need this name to identify your tab strip control.

In your ABAP program use the CONTROLS statement to declare an object with the same name. Use TAB STRIP as the type.The type TAB STRIP is defined in the type pool CXTAB. The field ACTIVETAB contains the function code of the tab title of the currently active tab page. The other fields are reserved for internal use.The default number of tab pages for a tab strip control is two.

Technically, tab titles are treated in the same way as push buttons. They have an object name, a text, a function code, and a function type. You enter these in the "Object name", "Object Text", "FctCode" and "FctType" fields of the obje ct attributes.

A tab title can have the function type ' ' (space) or 'P'. If the function type is ' ' (space), the PAI processing block is triggered when the user chooses that tab, and the function code of the tab title is placed in the OK_CODE field. If the function type is 'P', the user can scroll between the different tab pages with the same type without the PAI processing block being triggered. For further details, refer to the following pages.If you want your tab strip control to have more than two pages, you must create further tab titles. To do this, choose Push button from the object list in the Screen Painter and place it in the tab title area.You must assign a sub screen area to each tab page.The sub screen area assigned to a tab page is automatically entered as the "Reference object" (in the Dictionary attributes) for the tab title of that page.

To assign a sub screen area to one or more tab pages, choose the relevant tab title in the full screen editor, choose the Sub screen object, and place it on the tab page.Alternatively, you can assign a single sub screen area to several tab pages by entering the name of the sub screen area directly in the "Reference object" field of the attributes of the relevant tab pages.If you have assigned a different sub screen area to each tab page in a tab strip control, you can scroll between the pages locally at the front end.To do this, you must send all of the sub screens to the front end when you send the main screen itself.All of the tab titles in the tab strip control must also have function type 'P'.

Now, when you scroll between the different tab pages, there is no communication between the presentation server and the application server.When the user chooses a function on the screen that triggers PAI processing, the system processes the PAI blocks of all of the sub screens as well. This means that all of the field checks are run. In this respect, you could regard the tab strip control as behaving like a single large screen.Local scrolling in tab strip controls is more appropriate for display transactions.

To program a tab strip control to scroll locally at the front end, you must:

Assign a separate sub screen area to each tab page; a sub screen will be sent to each of these when the screen is processed.Call all of the sub screens from the flow logic.Assign function code type 'P' to all of the tab titles.

The system hides any tab page whose sub screen contains no elements that can be displayed.If there are no tab pages containing elements that can be displayed, the system hides the entire tab strip control.

If all of the tab pages share a single sub screen area, the program analyzes the function code of the chosen tab title to determine which screen is displayed.

There are two steps in this process:

In the PAI processing block, the program determines which tab page needs to be active, based on the tab title chosen by the user.

When the PBO processing block is processed again, the program displays the corresponding Screen .

During this process, the system only checks the fields of the sub screen that is actually displayed.

If you want the application program to process scrolling in a tab strip control,
All of the tab pages must share a common sub screen area
All of the tab titles must have the function code type ' ' (space), and
In the flow logic, you must use a variable to call the screen that is to be displayed in the sub screen area.


In the PAI block, you must call a module in which the function code of the active tab title is placed in the field ACTIVETAB of the structure you created in your program with type TABSTRIP. In the example above, this is MY_TAB_STRIP.

The PBO processing block must contain a module, before the sub screen is called, in which you place the number of the sub screen in the corresponding variable. In order for the screen to be processed the first time (before the user has had a chance to choose a tab title), you must assign an initial value to this field.

You can hide a tab page at run time by setting the corresponding tab title to inactive using the system table SCREEN (SCREEN-ACTIVE = '0'). You should do this before processing the tab strip control for the first time, to ensure that the screen environment remains constant.You can now create tab strip controls on selection screens. They allow you to create logical groups of fields, and make large selection screens more user-friendly.


LESSON 42 SCREEN ELEMENTS AND TABLE CONTROLS

SAP CRM Marketing Segmentation

SAP SCRIPT CONTROLS 3

Initializing Numbered Paragraphs: RESET

The RESET control command is used to reset the numbering of an outline paragraph to its initial value. If the RESET command is not used, then the numbering of all outline paragraphs in a text will be continuous. If the name of an outline paragraph is specified in the RESET command, then its paragraph numbering and that of subordinate paragraphs will be reinitialized.


Syntax:
/: RESET paragraph_format
The paragraph format specifies the outline paragraph to be reset.

Assume that the paragraph N1 is defined in the style you are using. This kind of paragraph is intended for enumerated lists and causes a sequential number to be output.


* Proceed as follows if you want to work with the SAP R/3 system:

N1 Ensure that you have a PC
N1 Switch the PC on
N1 Click on the SAP icon using the mouse.
* You will then enter the SAP logon screen. In order to log
on here, you must carry out the following actions:
/: RESET N1
N1 Enter your user name
N1 Enter your password
N1 Select the application you want to use
This text specification would be output as follows:


Proceed as follows if you want to work with the SAP R/3
system:
1. Ensure that you have a PC
2. Switch the PC on
3. Click on the SAP icon using the mouse.


You will then enter the SAP logon screen. In order to log on here, you must carry out the following actions:


1. Enter your user name
2. Enter your password
3. Select the application you want to use


If there were no RESET command between the two sections, then the two lists would be numbered in a single sequence:

Proceed as follows if you want to work with the SAP R/3
system:
1. Ensure that you have a PC
2. Switch the PC on
3. Click on the SAP icon using the mouse.
You will then enter the SAP logon screen. In order to log on here, you must carry out the following actions:
4. Enter your user name
5. Enter your password
6. Select the application you want to use


Including Other Texts: INCLUDE

You can use the INCLUDE control command to include the contents of another text into the current text. The text to be included continues to be treated as a separate text and is copied over only at the point at which the output is formatted.

Thus the use of the INCLUDE command always ensures that the most current version of a text is included into the output, since the text is not read and inserted until the output is formatted.
Syntax:
/: INCLUDE name [OBJECT o] [ID i] [LANGUAGE l] [PARAGRAPH p]
[NEW-PARAGRAPH np]


The name of the text to be inserted must be specified and can be up to 70 characters long. If the name of the text contains spaces, then it must be enclosed in quotes as a literal value. The name may alternatively be specified via a symbol. All remaining parameters in the INCLUDE command are optional.If an optional parameter is not specified, then SAPscript uses default values as applicable for the calling environment.

/: INCLUDE MYTEXT
The text MYTEXT is included in the language of the calling text.
/: INCLUDE MYTEXT LANGUAGE 'E' PARAGRAPH 'A1'
The text with the name MYTEXT and the language E is included, regardless of the language of the calling text. The paragraph format A1 will be used as the standard paragraph type for this call.

Optional parameters:

• LANGUAGE

If this parameter is not specified, then the language of the calling text or the layout set language are used for the text to be included. If the language is specified, then the text will be fetched in this language, regardless of the language of the calling text.

• PARAGRAPH

The text to be included is formatted using the style allocated. The PARAGRAPH parameter can be used to redefine the standard paragraph for this style for the current call. All *-paragraphs in the included text will then be formatted using the paragraph specified here.

• NEW-PARAGRAPH

The first line of the text to be included will be given this format indicator, as long as it is not a comment or command line. If the optional PARAGRAPH parameter (see above) is not specified, then all *-paragraphs of the included text will also be formatted using the paragraph np specified in the NEW-PARAGRAPH command.

• OBJECT

In order to completely specify a text, information about the text object is also required. There are a number of restrictions and other rules that depend on the object type of the calling text:

- Any kind of text can be included in a layout set. If no object is specified, then TEXT will be used (standard texts).
- In the case of a document text (DOKU object), you can include only document texts. This object type will also be assumed if no object is specified in this environment.
- Only hypertexts and document texts can be included in a hypertext (DSYS object). If the OBJECT parameter is missing, then DSYS is used as the default value.
- In the other kinds of text you can include only standard texts (TEXT object), document texts or hypertexts. If there is no specification, then the default object is TEXT.

• ID

The text-ID is a part of the text key which permits further text objects within a given object. If no ID is specified, then the default include ID is used from the TTXID table for the calling text. If there is no entry in this table, then the text-ID of the calling text is used.

The following consistency check is applied both to the ID and the object:

• All text-IDs are allowed in a layout set.
• In document texts only document texts may be included which have text-IDs TX (general texts) or UO (authorization objects) and also other document texts which have the same text-ID as the calling document text.


• In DSYS texts all DSYS texts can be included, whatever ID they have. Document texts to be included must have one of the IDs TX and UO.
• Standard texts with any allowable text-ID, DSYS texts with all IDs and document texts with the IDs TX and UO can be included into the other texts.

The INCLUDE command returns a status code in the SAPSCRIPT-SUBRC symbol:

• 0: the text include was successful.
• 1: the command could not be executed because it contained syntax errors.
• 2: the rules governing the text to be included were not followed (see above).

This value cannot occur if the command is used in a SAPscript layout set.

• 4: the specified text could not be found.


Changing the Style: STYLE

The STYLE control command allows you to change the style within a text. The new style is in force until another STYLE command is issued. If * is specified as the name of style, then the system reverts to the original style.


Syntax:
/: STYLE style
/: STYLE *
The STYLE command is automatically set in the text editor if another text module is inserted and immediately expanded using the menu option Include ® Text. The same thing happens if the contents of texts that have been included using INCLUDE are copied into the text via Edit ® Selected area ® Expand INCLUDE.


RELATED POSTS

SAP SCRIPT CONTROLS 6
SAP SCRIPT CONTROLS 5
SAP SCRIPT CONTROLS 4
SAP SCRIPT CONTROLS 2
SAP SCRIPT CONTROLS 1

ABAP Frequently asked questions on Modulization

What is Modularization and its benefits?


If the program contains the same or similar blocks of statements or it is required to process the same function several times, we can avoid redundancy by using modularization techniques. By modularizing the ABAP/4 programs we make them easy to read and improve their structure. Modularized programs are also easier to maintain and to update.


How can we create callable modules of program code within one ABAP/4 Program?

A. By defining macros.
B. By creating include programs in the library.

What are subroutines?

Subroutines are program modules which can be called from other ABAP/4 programs or within the same program.

What are the types of Subroutines?

A. Internal Subroutines: The source code of the internal subroutines will be in the same ABAP/4 program as the calling procedure (internal call).B. External Subroutines: The source code of the external subroutines will be in an ABAP/4 program other than the calling procedure.

What are the different types of parameters?

Formal parameters: Parameters which are defined during the definition of subroutine with the FORM statement.

Actual parameters: Parameters which are specified during the call of a subroutine with the PERFORM statement.

How can one distinguish between different kinds of parameters?

A. Input parameters are used to pass data to subroutines.
B. Output parameters are used to pass data from subroutines.

What are the different methods of passing data?

A. Calling by reference: During a subroutine call, only the address of the actual parameter is transferred to the formal parameters.The formal parameter has no memory of its own, and we work with the field of the calling program within the subroutine. If we change the formal parameter, the field contents in the calling program also change.

B. Calling by value: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have memory of their own. Changes to the formal parameters have no effect on the actual parameters.

C. Calling by value and result: During a subroutine call, the formal parameters are created as copies of the actual parameters. The formal parameters have their own memory space. Changes to the formal parameters are copied to the actual parameters at the end of the subroutine.

The method by which internal tables are passed is By Reference.

What is the difference between the function module and a normal ABAP/4 subroutine?

In contrast to normal subroutines function modules have uniquely defined interface.Sub routines do not return values.

Sub routines do not return exceptions.
Sub routines cannot be tested independently.
Declaring data as common parts is not possible for function modules. Function modules are stored in a central library.

What is a function group?

A function group is a collection of logically related modules that share global data with each other. All the modules in the group are included in the same main program. When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime. Every function module belongs to a function group.

what is the difference between internal tables and extract datasets?

A. The lines of an internal table always have the same structure. By using extract datasets, you can handle groups of data with different structure and get statistical figures from the grouped data.
B. You have to define the structure of the internal table at the begining. You need not define the structure of the extract dataset.
C. In contrast to internal tables, the system partly compresses extract datasets when storing them. This reduces the storage space required.
D. Internal tables require special work area for interface whereas extract datasets do not need a special work area or interface.

LOGICAL DATABASE


What are logical databases? What are the advantages/disadvantages of logical databases?


Ans :- A Logical Database is a hierarchical structure of tables. Use the GET statement to process Logical Databases.LDB consists of logically related tables grouped together - used for reading and processing data.

Advantages

1. No need of programming for retrieval , meaning for data selection
2. Easy to use standard user interface, have check completeness of user input.

Disadvantages

1. Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.

Preparation of the data records by the L.D.B and reading of the data records in the actual report are accomplished with the command pair.
Put and Get.
The three main elements of LDB are
Structure, Selections, Database Program.
What sort of tables one can use in designing the hierarchy of a LDB ?

Tables which are having Foreign key relations.
The structure of Logical Databases relfects the ________________ dependencies of hierarchical tables in the SAP System.

Foreign key

If you want to improve the response time ( time to access data ) Logical DataBases permits you to achieve this using ______________

VIEWS.


What are the advantages of Logical Data Bases ?
It offers an easy-to-use selection screen. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections.It contains central authorization checks for database accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.

RELATED POSTS

ABAP FAQ'S ON INTERACTIVE REPORTS
SAP Project blueprint

My SAP Project safety and security

REMOTE FUNCTION CALL 1

REMOTE FUNCTION CALL:

The character conversion of the data to be transmitted is performed automatically.

Both single parameters and structures are supported for conversion.

The logon for remote SAP partner systems is automatic. The user and password are stored in the table RFCDES.

RFC calls in C are available for communicating with external programs (RFC-SDK). The RFC Generator also helps you when generating RFC programs in C.


If a function module is called remotely, it runs in its own work process (its own SAP LUW) if the remote system is an R/3 System.

The remote destination can be another application server in the same or a different R/3 System, an When you call a function module locally, it runs in the same work process as the calling program.

R/2 System, or an non-SAP system.

Note that the calling program is rolled out for each remote function call, which triggers an implicit database-commit.

You maintain RFC destinations that must specify an ABAP program when calling remote function modules in the RFC sideinfo table RFCDES using Transaction SM59.
For each partner system, you need to maintain one entry in the sideinfo table.


SAP delivers the RFC Library for all current external platforms, in which RFC calls are contained for C programs. After installing the RFC Library on your external platform, you can implement RFC client or RFC server programs using RFC calls.


With synchronous RFC, processing stops in the calling program until the called remote function is processed and its output is returned. Then in the calling program, the processing continues after the call.

In an asynchronous Remote Function Call, the called remote function is started and then continues processing on its own immediately in the calling program. Remote function processing is separate from the calling program. The function output can be received later in the program.

Asynchronous RFC is intended for parallel processing of processes.


Whereas with synchronous and asynchronous RFC each call makes up a single logical unit of work (LUW) in the remote system, you can use transactional RFC to bundle several remote functions into one LUW (with an automatic rollback mechanism in case of error).
With tRFC, generated LUWs are processed independently of each other. This means, the order in which they are processed is not always the order in which they are generated.

To ensure that tRFC-LUWs are processed in the same order as they were generated, you can use qRFC as an extension of tRFC.

qRFC is available as of Release 4.6A and can be used in R/3-R/3 connections as well as R/3-external connections.

RELATED POSTS

RFC PART 2

RFC Remote Function Call

A remote function call RFC enables a computer to execute a program an a different computer within the same LAN, WAN or Internet network. RFC is a common UNIX feature, which is found also in other object-oriented operating systems. R/3 provides special DLLs for WINDOWS, NT and UNIX to allow RFC calls from and to R/3.

A Remote Function Call enables a computer to execute a program an another computer. The called program is executed locally on the remote computer using the remote computer’s environment, CPU and data storage.Remote function call is one of the great achievements of TCP/IP networks. Every computer within the network can accept an RFC-call and decides whether it wants to execute the request. Every modern FTP server implementation includes the RFC calling feature.

A classical network server stores the program code in a central location. When the program is called, the code will be transported via the network to the calling computer workstation and executed on the calling computer, consuming the caller’s resources of CPU, memory and disk.

An RFC calls the program on the remote computer. It is just like stepping over to the remote computer, typing in the program command line with all parameters and waiting for the result to be reported back to the calling computer. The calling computer does not provide any resources other than the parameters specified with the call.Here is again what an RFC does.

• It calls the program on a remote computer and specify parameters if and as necessary.

• The remote computer decides whether to fulfil the request and execute the program.

• Every manipulation done by the called program is effective in the same way as if the program had started on the remote system.

• The calling program task waits meanwhile for the called program to terminate.

• When the RFC program terminates, it returns result values if applicable.

• The called program needs not to be present on the calling computer.

• The called program can be run under a completely different operation system,so you can call a WINDOWS program from UNIX and vice versa.A typical RFC example is the internet with a web browser as the RFC client and the web server as the RFC server. Executing a server applet e.g. via CGI or a JAVA or JAVASCRIPT server side applet is actually a remote function call from the web browser to the HTTP server.If R/3 is doing RFC calls into another system, then it does exactly what a browser does when performing a request on the HTTP or FTP server.

related post

BAPI for SAP ABAP Three

After you have carried out the review of the BAPI concept and it has been accepted, you can start defining the BAPI itself.In this step, you will decide on the names, parameters, and characteristics of the BAPI and determine the structures in the ABAP Dictionary, which the BAPI will be based on. Only after you have planned and defined these required details can you start to implement the BAPI and create the required programming objects.The table below illustrates where the planned information is written and how it fits together.
Information in the BOR, Function Builder and ABAP Dictionary



Some BAPIs and methods provide basic functions and can be used for most SAP business object types. Such BAPIs are known as "standardized" BAPIs.

Features

With object methods and especially with BAPIs, you can differentiate between instance methods and class methods. Instance methods refer to precisely one instance (one specific occurrence) of an SAP Business Object type, for example, to one explicitly specified customer order. Whereas class methods are instance-independent.

BAPIs for Reading Data

The following BAPIs provide you with read-only access to data in the associated business object type:

GetList()
With the BAPI GetList() you can select a range of object key values, for example, company codes and material numbers. The BAPIs GetList() is a class method.

Programming GetList() BAPIs

With the BAPI GetList() you can select a range of object key values, for example, company codes and material numbers. The key values returned by this BAPI can be passed on to another BAPI for further processing, for example, the BAPI GetDetail().
The BAPIs GetList() is a class method (instance-independent).

Features

Provide all the relevant fields in the interface of the GetList() BAPI. How complex and extensive you structure the interface, depends on the requirements the BAPI is to fulfill.

Import Parameters

The interface of a GetList() BAPI must provide selection parameters, in which the required selection criteria can be passed on by the calling program. The structure of selection parameters is described in the section Selection Parameters.

You must also create the parameter MaxRows that enables you to limit the number of entries selected. This parameter prevents too large a value set from being selected, if the selection parameter specification is not very precise. Use the data element BAPIMAXROW as the reference type for the MaxRows parameter.

Export Parameters

The key values selected by the BAPI GetList() are returned to the calling program in a table, together with other useful information, for example, short texts.To report messages from the method call back to the calling program, you should create the export parameter RETURN. For more information about this parameter see Return Parameters (Error Handling).

Extension parameters

You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.

GetDetail()
The BAPI GetDetail() uses a key to retrieve details about an instance (one specific occurrence) of a business object type and returns this data to the calling program. Then this information is reported back to the calling program. The BAPI GetDetail() is an instance method.

Programming GetDetail() BAPIs

Use

The BAPI GetDetail() is used to read details of specific object instances.
The BAPI GetDetail() is an instance method.

Features

Import Parameters

The import parameters of the GetDetail() BAPI must contain the key fields of the business object type.For the associated method definition in the BOR, the key fields must not also be specified as method parameters. For this reason, the BOR/BAPI Wizard does not include the function module parameters for the key fields in the method definition, when it creates a BAPI.

Export Parameters

The export parameters of a BAPI contain details of the instance. According to the amount of information, this should be structured in several parameters with meaningful names.To report messages from the method call back to the calling program, you should create the export parameter Return. For more information about this parameter see Return Parameters (Error Handling).

Extension Parameters

You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.

GetStatus()

The BAPI GetStatus() is used to query the status of an SAP business object instance, for example, the processing status of a sales order. This BAPI is used only for displaying the status of an object and does not retrieve full details like the BAPI GetDetail(). The BAPI GetStatus() is an instance method.

Programming GetStatus() BAPIs

Use

With the BAPI GetStatus() you can retrieve information about the status of a particular object instance.The BAPI GetStatus() is an instance method.

Features

Import Parameters
The import parameters of the GetStatus() BAPI must contain the key fields of the business object type.

For the associated method definition in the BOR, the key fields must not also be specified as parameters. For this reason, the BOR/BAPI Wizard does not include the function module parameters for the key fields in the method definition, when it creates a BAPI.

Export Parameters

The export parameters of the BAPI contain information about the status of an object instance.To report messages from the method call back to the calling program, you should create the export parameter RETURN. For more information about this parameter see Return Parameters (Error Handling).

Extension Parameters

You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.

ExistenceCheck()

The BAPI ExistenceCheck() checks whether an entry exists for a business object instance, for example, whether the customer master has been created. The ExistenceCheck() BAPI is an instance method.

Programming ExistenceCheck() BAPIs

Use

The BAPI ExistenceCheck() checks whether an entry exists in the database for an SAP business object type, for example, whether the customer master has been created.
The ExistenceCheck() BAPI is an instance method.

Features

You can implement this method as a BAPI and/or as a method of SAP Business Workflow. If you implement this method as a BAPI, it only has to be implemented once, because an ExistenceCheck() BAPI can also be used by SAP Business Workflow.

To get the highest possible performance from the BAPI ExistenceCheck(), you should reduce the number of columns to as few as possible before selecting the table rows.
select single bukrs from bkpf into lv_bukrs
where bukrs = bkpf-bukrs
and belnr = bkpf-belnr
and gjahr = bkpf-gjahr.
instead of
select single * from bkpf
where bukrs = bkpf-bukrs
and belnr = bkpf-belnr
and gjahr = bkpf-gjahr.

Import Parameters

The BAPI's import parameters in the function module only contain the key fields of the business object type.

Export Parameters

To report messages from the method call back to the calling program, you should create only the export parameter Return . For more information about this parameter see Return Parameters (Error Handling).

Activities

When a business object type is created, as the default, it inherits a definition of the method ExistenceCheck() through the interface IFSAP. For this reason, you can create an ExistenceCheck() BAPI using the BOR/BAPI Wizard, as the method name ExistenceCheck() already exists for the business object type.

We recommend therefore, that you redefine the existing method ExistenceCheck() manually in the BOR, via the menu path Edit  Redefine.

• Enter the function module that implements the ExistenceCheck() BAPI.
• Create the method parameter RETURN (the key fields of the business object type are not included in the method definition in the BOR).

BAPIs for Creating or Changing Data

The following BAPIs can create, change or delete instances of a business object type:
Create() or CreateFromData()
The BAPI Create() or CreateFromData() creates an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.

Programming Create() BAPIs

Use

The BAPI Create() creates one instance of an SAP business object type. Likewise, the BAPI CreateMultiple() creates several instances of a business object type simultaneously.

If a workflow method called Create already exists for the business object type in question, you can use the name CreateFromData() for your BAPI. Create() is the preferred name for this BAPI.

The BAPIs Create() and CreateMultiple() are class methods (instance-independent).
For each Create() BAPI a method must be provided with which the created business object instance can be deleted or cancelled. To do this, depending on the business application practice, you should implement one of the BAPIs below:

• Delete(), which deletes a business object instance from the database. For more information see Programming Delete() BAPIs.
• Cancel() which cancels a business object instance. For more information see Programming Cancel() BAPIs.

Features

Import Parameters

The BAPI's import parameters in the function module contain the data required to uniquely identify an instance. For this you can either enter all object keys or else you must ensure that these can be derived.If required, you can also use a test run parameter to check the entry for an object instance before actually creating the instance in the database. For further information see Test Run Parameters.You can create a change parameter to identify the values to create the instance with and to tell differentiate these values from the initial values when the BAPI is called. We recommend that you identify the change-relevant fields by flagging them.
For more information see Change Parameters.

Export Parameters

To make the object key available to the calling program, the entire key fields must be returned in the export parameters.To report messages from the method call back to the calling program, you should create the export parameter RETURN. For more information about this parameter see Return Parameters (Error Handling).

Extension parameters

You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.

Avoiding Incompatibilities with Customizing Settings

It could be possible that certain values set by Customizing appear differently in the BAPI interface. These values cannot be overwritten by a Create() BAPI.To avoid any incompatibility with Customizing settings, you should implement a Create() BAPI in the following way:

• The BAPI should transfer all the fields and check them against the Customizing settings. If the Customizing settings write-protect a field, the data in this field cannot be overwritten by data in the BAPI interface.
• For every incidence of incompatibility an error message must be returned to the calling program. For example, "Customizing settings do not allow the field 'MyAsset-AssetName' to be modified ".
• All the fields that are assigned default values by Customizing and are therefore write-protected, must be documented.

External Key Assignment

For Create() BAPIs with an external key assignment the caller transfers the key (ID) to the object instance to be created, for example, to a document number.Keep in mind that you have to convert the specified keys explicitly in upper case letters in the source code of this type of Create() BAPIs. Otherwise keys are created that cannot be used in dialog applications. This is because with dialog applications external keys are always converted implicitly in upper case letters.

Locking

We recommend that you implement Create() BAPIs without the locking function and create your own BAPIs instead that lock the relevant data.

Change()
The BAPI Change() changes an existing instance of a SAP business object type, for example, a purchase order. The Change() BAPI is an instance method.


Programming Change() BAPIs

Use

The BAPI Change() changes an existing instance of an SAP business object type, for example, a sales order.The BAPI Change() is an instance method, whereas the BAPI ChangeMultiple() is a class method (instance-independent).

Features

Import Parameters

The import parameters of the Change() BAPI must contain the key fields of the business object type.

If required, you can create also create these parameters:

• A test run parameter for checking the entry for an object instance before actually creating/changing the instance in the database.
• A change parameter to identify parameter fields containing modified values and parameter fields that have not been modified.
 
Export Parameters
to make the object key available to the calling program, the entire key fields must be returned in the export parameters.
To report messages from the method call back to the calling program, you should create the export parameter RETURN. For more information about this parameter see Return Parameters (Error Handling).
Extension parameters
You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.
Avoiding Incompatibilities with Customizing Settings
It could be possible that certain values set by Customizing appear differently in the BAPI interface. These values cannot be overwritten by a Change() BAPI.

To avoid incompatibility with Customizing settings, you should implement a Change() BAPI in the following way:

• The BAPI should transfer all the fields and check them against the Customizing settings. If the Customizing settings write-protect a field, the data in this field cannot be overwritten by data in the BAPI interface.
• For every incidence of incompatibility an error message must be returned in the return parameter to the calling program. For example, "Customizing settings do not allow the field 'MyAsset-AssetName' to be modified ".
• All the fields that are assigned default values by Customizing and are therefore write-protected, must be documented.

Locking

We recommend that you implement Change() BAPIs without the locking function and create your own BAPIs instead that lock the relevant data.

Delete() and Undelete()
The BAPI Delete() deletes an instance of an SAP business object type from the database, for example, a purchase order.
The BAPI Undelete() removes a deletion flag.
These BAPIs are instance methods.

Programming Delete() BAPIs

Use

The BAPI Delete() deletes an instance of an SAP business object type from the database. Likewise, the BAPI DeleteMultiple() deletes several instances of a business object type. Delete() BAPIs must always delete entire instances, for example, a whole material master.

(Whereas the BAPI Cancel() cancels an instance of a business object, that is the instance to be cancelled remains in the database and an additional instance is created that is canceled. For more information see Programming Cancel() BAPIs).

A delete() BAPI can delete immediately or at a later time by setting the deletion flag. The type of deletion you use in your BAPI is irrelevant to the caller, so you do not have to include these details in the BAPI interface.

The BAPI Undelete() is used to reset a deletion flag that has been set for a specific object.

The BAPIs Delete() and Undelete() are instance methods, whereas the BAPIs DeleteMutliple() and UndeleteMutliple() are class methods (instance-independent).

Features

The interfaces of the Delete() and Undelete() BAPIs should be identical.
Import Parameters
The BAPI's import parameters have to identify the business object instances to be deleted.

• If an instance is to be deleted, you have to create a parameter for each key field in the business object type.
• If several instances are to be deleted, you must create a table for the key fields of the business object type. You can do this using a range table.
If required, you can create also create these parameters:
• A test run parameter for checking the entry for an object instance before actually deleting the instance from the database.
• When the BAPI DeleteMultiple() is used, it must be possible to use the selection criteria to select the object instances to be deleted. To do this you can create selection parameters.


Implement the interface of a Delete() BAPI so that it is not possible to delete all the instances simply by parameterizing the interface, for example by specifying default settings.

Export Parameters

To report messages from the method call back to the calling program, you should create only the export parameter Return . For more information about this parameter see Return Parameters (Error Handling).

Extension parameters

You can create extension parameters to enable customers to enhance the functionality of BAPIs without making modifications. For information about extension parameters see Customer Enhancement Concept for BAPIs.

Locking

We recommend that you implement Delete() BAPIs without the locking function and create your own BAPIs instead that lock the relevant data.


Cancel()
Unlike the BAPI Delete () the BAPI Cancel() cancels an instance of a business object, that is the instance to be cancelled remains in the database and an additional instance is created that is canceled).
The Cancel() BAPI is an instance method.

Programming Cancel() BAPIs
Use
The Cancel() BAPI cancels one instance of a business object.
Unlike the BAPI Delete(), which deletes an object instance from the database, with the BAPI Cancel():

• The canceled instance of the business object is not deleted
• An additional instance is created with which the instance of the business object is deleted
The Cancel() BAPI is used to cancel business processes such as goods movements or invoice receipts.
The Cancel() BAPI is an instance method.

Features

Import Parameters

The data of the instance to be created comes from the data of the business object instance to be cancelled.You can also create further parameters to specify information relevant for the actual cancellation process, for example, the name of the user performing the cancellation.If required, you can also create a test run parameter, which can check the details of the object instance before it is actually canceled. For more information about this parameter see Test Run Parameters.

Export Parameters

To report messages from the method call back to the calling program, you should create the parameter Return. For more information about this parameter see Return Parameters (Error Handling).
You have to put the key of the created instance in another export parameter.
Locking
We recommend that you implement Cancel() BAPIs without the locking function and create your own BAPIs instead that lock the relevant data.

Add and Remove
The BAPI Add adds a sub-object to an existing object instance and the BAPI and Remove removes a sub-object from an object instance. These BAPIs are instance methods.

RELATED POSTS

BAPI PART 4

Challenges in implementing ERP
ERP implementation

R F C 3 TYPES OF RFC'S

SYNCHRONOUS R F C:


With synchronous RFC, processing stops in the calling program until the called remote function is processed and its output is returned. Then in the calling program, the processing continues after the call.


The statement CALL FUNCTION ... DESTINATION enables you to call remote ABAP function modules or C routines in external server programs.

When you call a function in this way, always include handling for the standard exceptions COMMUNICATION_FAILURE and SYSTEM_FAILURE.

The exception COMMUNICATION_FAILURE is resolved by the system if the specified destination in the sideinfo table RFCDES is not maintained, or if the connection to the remote system cannot be established.

The exception SYSTEM_FAILURE is resolved if the function module or C routine that you want to start in the remote system is not available.


The connection to a remote destination remains intact for as long as the context of the calling program remains active. The function groups addressed in the remote destination remain active for as long as the calling program itself remains active (this is the same as with local calls). This means that if you call two function modules from the same function group one after the other, they can both access the same global data of the function group.

Each function module called using synchronous RFC forms its own logical unit of work (LUW) (exception:

You can debug function modules called remotely in R/3 - R/3 connections.

If a remotely-called function module uses dialogs (for example, CALL SCREEN,
CALL TRANSACTION or lists), they are executed in the session of the caller (and are fully functional).

Note that RFC dialogs in background processing lead to a program termination with the exception SYSTEM_FAILURE (but you can use RFC within background processing).


ASYNCHRONOUS RFC :

In an asynchronous Remote Function Call, the called remote function is started and then continues processing on its own immediately in the calling program. Remote function processing is separate from the calling program. The function output can be received later in the program.

Asynchronous RFC is intended for parallel processing of processes.


With the addition STARTING NEW TASK you can call a remote function module asynchronously. You can use any task name.

The function module that you call is executed in its own work process.

You can also use aRFC in background processing. Note, however, that even here, each aRFC call occupies a dialog work process.

In the sideinfo table RFCDES, you can set the number of aRFC calls for each destination using the aRFC options. After these aRFC calls an automatic load check is performed on the target server. If resource bottlenecks are detected, the system waits for a short time for the next aRFC call,
meant for the same remote system, and the client program is rolled out of its work process. It can then receive results from previous aRFC calls.

During the call, you may not specify an IMPORTING addition since the call does not wait for the end of the function module. Here, you can only handle the two system exceptions, COMMUNICATION_FAILURE and SYSTEM_FAILURE for the same reason. The function module output must be received and the function module-specific exceptions must be handled later on in a different place. (See following slides)

Receiving the function module output and handling the function module-specific exceptions are optional, however.


A program can receive output (parameters and exceptions) from a function module that is running asynchronously.

To implement this, when you call use the addition "PERFORMING ON END OF TASK", where the specified subroutine must exist in your program, and through which the output of the function module is received using command "RECEIVE RESULTS FROM FUNCTION . .". When the function module ends, the subroutine is called automatically.

The subroutine must also have a formal parameter with any name you choose. When the subroutine is called, it receives the accompanying task name. This parameter lets you see which aRFC call just ended, and you can receive the relevant
output using the RECEIVE RESULTS FROM FUNCTION command.

The subroutine may not contain any statements that interrupt the program execution (such as CALL SCREEN, SUBMIT, COMMIT WORK, WAIT, RFCs, W or I messages). WRITE statements in this subroutine specially defined for aRFC have no effect.

The subroutine can only be executed automatically if the calling program is in rollout status. -> "WAIT UNTIL" statements (see next slide).

The addition KEEPING TASK with the RECEIVE statement causes the function group context that was loaded remotely to wait until the calling program has ended. This lets you use the old remote context with later aRFC calls with the same task name.

The language element WAIT UNTIL with the addition PERFORMING is only useful with aRFC, and otherwise has no effects.

When the WAIT UNTIL statement is executed, the conditions specified are checked.

If it is fulfilled, the program processing continues directly after the WAIT UNTIL statement.

Otherwise the system waits in rollout status for the output from the aRFCs. If the aRFC output is now returned, the form routine specified during the call is executed and is sent back to the WAIT UNTIL statement.
This check/wait procedure repeats until the WAIT conditions are fulfilled, or until there are no more open RFC calls.

Note that the WAIT UNTIL statement sets the SY-SUBRC. Therefore, store the SY-SUBRC value (set in the form routine by exceptions-handling in RECEIVE RESULTS) in its own global variable before leaving the form routine, if you need this value again later (after WAIT UNTIL).


aRFC is particularly suited for implementing parallel processing in several R/3 Systems.

You can also use aRFC within the same SAP R/3 System, for example, to move some of the processing load to an application server specially used for this.

Enter the RFC destination that refers to the corresponding application server. (You can find this under Internal connections in Transaction SM59.)

You can also use aRFC locally within the same application server to implement parallel processing in several work processes.

Here you do not need to specify a destination.

Note, however, that several work processes will be occupied by your program at the same time.


LOAD BALANCING USING RFC GROUPS:

You can divided the application servers for an SAP R/3 System into different RFC groups using Transaction SM59.

When calling a function module within this R/3 System, you can specify one of the defined RFC groups using the addition DESTINATION IN GROUP , which selects the server that has the lowest load in order to execute the function module.
Instead of specifying a specific RFC group, you can also enter the word DEFAULT. The server is selected from all the application servers of the R/3 System.

If all the servers of the specified group are overloaded (see next slide), the exception RESOURCE_FAILURE is triggered.

Note that:
- You have to specify the addition DESTINATION IN GROUP after STARTING NEW TASK as opposed to the DESTINATION addition.
- You can only use this addition within the current SAP R/3 System (you cannot have additional DESTINATION entries).

For each server in the specified RFC group, the system checks if the application server has:

- a dispatcher queue load of <> No IMPORTING . . . / PERFORMING . . . ON END OF TASK when calling;
-> No RECEIVE RESULTS FROM FUNCTION . . .

In the source system, you can use the administration transaction SM58 that lets you display and modify tRFC-LUWs.

EXECUTION:

tRFC calls are first stored in the local tRFC tables ARFCSSTATE and ARFCSDATA. The execution status of the LUWs is logged in table ARFCSSTATE, while ARFCSDATA contains the input data for the tRFCs.

If you do not want to execute a remote LUW immediately, rather trigger it at a later time, call the function module START_OF_BACKGROUNDTASK before the COMMIT WORK statement locally. Here, you must enter the date and time of execution.

The COMMIT WORK statement automatically schedules an immediate job or a job set for a later start time to remotely call the LUW. In the job execution, the relevant data is read from the tRFC tables, and the corresponding tRFCs are transmitted. If the remote LUW is executed successfully, the accompanying entries are deleted from the tRFC tables. If an error occurs, an automatic repeat mechanism, or rollback mechanism is activated (see next slide).

If the update is triggered locally because of the COMMIT WORK statement, the tRFCs are only executed when the local update is successfully completed.

WHEN ERROR COMES:

If a connection cannot be made to the partner, this is logged in the tRFC status table ARFCSSTATE (which you can see by using Transaction SM58), and the job is rescheduled. You can set in the destination the number of times the system repeats the effort to connect, and the time intervals, by using the tRFC options. The default is a maximum 30 times with a 15 minute interval.

If, after a tRFC-LUW is successfully executed in the partner system in one of the function modules, the program terminates with an A/X-message (MESSAGE A/X...) or triggers an exception (RAISE...),

- all the changes made in the current LUW are automatically rolled back in the remote system, and

- the remote program termination is logged in the tRFC status table ARFCSSTATE (viewable using SM58) in the source system.
The entries relevant to the LUW remain in the tRFC tables and the execution job is not rescheduled. In this case, you can find the remote error using Transaction SM58, and you have to correct the problem in the remote system. Afterward you must trigger the remote execution again also in Transaction SM58.

If you want to cancel and roll back this remote execution from a remote function module of a tRFC-LUW, but you also want to reschedule the job in the source system (for example, because a master record that is to be processed is locked and the LUW must be executed again), call the function module RESTART_OF_BACKGROUNDTASK in the remote function module instead of MESSAGE A... or RAISE...


LUW BUILDING:

If tRFCs are transmitted with different destinations before the COMMIT WORK, they are grouped into different LUWs according to their destination.

A tRFC call with the addition AS SEPARATE UNIT is always processed as a separate LUW independently of the other tRFCs.

Each tRFC-LUW is assigned a unique transaction ID (viewable with Transaction SM58).
The function module ID_OF_BACKGROUNDTASK (which is called before the COMMIT WORK) returns this ID.

You can determine the LUW execution status using the function module STATUS_OF_BACKGROUNDTASK under the transaction ID (which is called after the COMMIT WORK).

If you also called the update function modules locally before the COMMIT WORK, tRFC calls are only processed when the local update function modules have been processed successfully.

You can also call transactional C functions. However, you must use the rollback mechanism in the external server program .

RELATED POSTS

QUEUED RFC
RFC PART 2
RFC PART 1

ABAP Frequently asked questions on Tables and Internal Tables

How do you read selected lines of database table into an internal table in packages of predefined size.

SELECT * FROM SPFLI INTO TABLE ITAB PACKAGE SIZE N. where 'n' is variable.
Name the WILDCARD characters which are used for comparisions with character strings & numeric strings.
• '%' and '_'.

How to specify a client for database table processing.
TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED
WHERE MANDT BETWEEN '001' AND '003'.
...
ENDSELECT.

Activation

During activation, the run time object of aggregate object or tables is created. The run time object is buffered so that the application program can access it quickly. Run time object has information about the following objects of table domain - data elements - field definition - table definition

Lock Mechanism

prevents a new database operation being started an existing one has been correctly completed. When conversion is done, lock is created automatically and released only when conversion is successful.

Clearing of locks

restart adjustment - attempt is made to continue conversion at the point of termination
Cancel adjustment - lock entry is simply deleted from table
Version Management functions -

Canceling changes - reset revised version to active version

Storing changes - active version will be temporarily stored in version
Switching changes - switch between active and revised versions

Version catalog - list of all existing versions of an object

Revised version - produced when we edit an existing object
Active version - produced when we activate an object
Temporary version - produced when we copy the active version temporarily to the database with store version functions

Historical versions - created when 1. Correction is created 2 correction is
released

Table Buffering : Possible buffering types

full buffering - either, whole table or none of the table is located in the buffer (Tables up to 30 kb done in client dependent fully buffered tables)
Generic buffering - generic areas of the table are fully buffered.

Generic key - left justified section of primary key of a table.

generic area - all records for which fields of generic key correspond
Single record buffering - records actually being accessed are loaded to buffers, large records where few records are accessed.

Internal Tables ? Types ?

STANDARD table

Key access to a standard table uses a linear search. This means that the time required for a search is in linear relation to the number of table entries.
You should use index operations to access standard tables.

SORTED table

Defines the table as one that is always saved correctly sorted.
Key access to a sorted table uses a binary key. If the key is not unique, the system takes the entry with the lowest index. The runtime required for key access is logarithmically related to the number of table entries.

HASHED table

Defines the table as one that is managed with an internal hash procedure
You can only access a hashed table using the generic key operations or other generic operations ( SORT, LOOP, and so on). Explicit or implicit index operations (such as LOOP ... FROM oe INSERT itab within a LOOP) are not allowed.

INDEX table

A table that can be accessed using an index.
Index table is only used to specify the type of generic parameters in a FORM or FUNCTION. That means that you can't create a table of type INDEX.
Standard tables and sorted tables are index tables.

Syntax :

DATA itab TYPE table type of line type [WITH UNIQUE/NON-UNIQUE KEY ] [Iinitial size n] [WITH HEADER LINE]

What are DATA CLUSTERS ?

You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in ABAP/4 memory or for longer periods in databases. You can store data clusters in special databases of the ABAP/4 Dictionary. These databases are known as ABAP/4 cluster databases and have a predefined structure.Storing a data cluster is specific to ABAP/4. Although you can also access cluster databases using SQL statements, only ABAP/4 statements are able to decode the structure of the stored data cluster.


Describe the functions of the debugger screen.

Single step(F5) - Use this option to step through the program statement by statement. This allows you to branch into subroutines and function modules, and to execute these routines step by step as well. Once a subroutine or function module has been processed, control returns to the statement following the CALL FUNCTION or PERFORM statement.

Execute(F6)- Use this option to process a program line by line. All of the statements on the current line are processed in a single step. If you are positioned on a line that calls a subroutine and you choose Execute, the Debugger processes the whole subroutine and then moves on to the line following the subroutine call. This allows you to jump through the statements within the subroutine.


Return(F7) - The Debugger returns from a routine to the point at which control returns to the main program. Use this option to return from a subroutine, function module, or called program to the calling program.


Continue(F8)- Use this option to process the program up to the next dynamic or static breakpoint or up to the cursor position. If there are no more breakpoints in the program and no cursor has been set, the system exits debugging mode and executes the rest of the program normally.

Tables - Display the contents of internal tables.
Problem:How to run a program in background?
Solution

In the selection screen :After filling the screen fields press F9.A screen appears requesting U to print the Background Parameters

Enter the output device(Eg HPLJ /SAP2 etc)
In the spool options Uncheck Print immedietly,Uncheck delete after output,and new
spool request.
Press enter.
Another screen appears with heading start time .U can press start immly ,then save
Now the Background job is scheduled for the given program .
To View the status of background Job,The transaction code is SM37.
Execute from the resulting screen .Job overview -->From the Job list select U’r program and select Spool from the application toolbarOutput Controller :List of Spool RequestsSelect U’r Spool request and click Display icon from the overview screen .

U will be displayed with the List.

Caution :See to that the list with does not exceed 255 columns ,If it exceeds the extra columns will be truncated in Background

What are presentation and application servers in SAP?

A presentation server is actually a program named Sapgui.exe. It is usually installed on a user’s workstation.Application server is a set of executable that collectively interpret the ABAP/4 programs and manage the input & output for them.

In an ABAP/4 program how do you access data that exists on a presentation server v/s on an application server?

For presentation server use UPLOAD or WS_UPLOAD function modules.For application server use OPEN DATASET, READ DATASET and CLOSE DATASET commands.

Describe the syntax and function of the AUTHORITY CHECK command?

Ans :- AUTHORITY - CHECK OBJECT

IF SY-SUBRC NE 0.
The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

Explain the EXPORT and IMPORT commands? How can you pass more than one group of data by using IMPORT commands?

EXPORT :-
To read data objects from an ABAP program into ABAP memory, use the following statement:
Syntax
EXPORT ... TO MEMORY ID .

This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM , the data object is saved under its own name. If you use the FROM option, the data object is saved under the name . The name identifies the cluster in memory. It may be up to 32 characters long.The EXPORT statement always completely overwrites the contents of any existing data cluster with the same name .

IMPORT :-
To read data objects from ABAP memory into an ABAP program, use the following statement:
Syntax
IMPORT ... FROM MEMORY ID .

This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO option, the data object in memory is assigned to the data object in the program with the same name. If you do use the option, the data object is read from memory into the field . The name identifies the cluster in memory. It may be up to 32 characters long.

You do not have to read all of the objects stored under a particular name . You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name , SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name , SY-SUBRC is always 0, regardless of whether it contained the data object .If the cluster does not contain the data object , the target field remains unchanged.

Explain the READ LINE and MODIFY LINE commands.

READ LINE :- Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.

MODIFY LINE :- To modify the lines of a completed list from within the program, use the MODIFY LINE statement. 

What are the differences between calling a program, transaction ‘with return’ and ‘without return’ and how can each be accomplished?

Program
SUBMIT.

If you use AND RETURN, the system stores the data of the calling executable program and returns to the calling after processing the called program. The system resumes executing the calling program at the statement following the call.If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal session) are deleted. After the called executable program has finished, control returns to the level from which you started the calling program.

Transaction

CALL TRANSACTION [AND SKIP FIRST SCREEN] [USING ].
This statement saves the data of the calling program, and starts transaction . At the end of the transaction, the system returns to the statement following the call in the calling report.

LEAVE TO TRANSACTION [AND SKIP FIRST SCREEN].
This statement ends the calling program and starts transaction . This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.

What are the differences between the parameter SET and GET?

SET PARAMETER ID FIELD .

This statement saves the contents of field under the ID in the SAP memory. The code can be up to 20 characters long. If there was already a value stored under , this statement overwrites it. If the ID does not exist, double-click in the ABAP Editor to create a new parameter object.
GET PARAMETER ID FIELD .

This statement fills the value stored under the ID into the variable . If the system does not find a value for in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.

WHAT are the commands that allow you to process sequential file? And what is their syntax?

READ DATASET (reading) and TRANSFER (writing)
OPEN DTASET for mode at POSITION MESSAGE

READ DATASET INTO
CLOSE DATASET

DELETE DATASET
TRANSFER

What is the difference between opening a dataset for input, output, appending?

FOR OUTPUT: Opens the file for writing if exists it is overwritten if not then it is created.

FOR INPUT: Opens an existing file for reading.

FOR APPENDING: Opens the file for writing at the end of the file .If it does not exist, it is
created, if opened, you return to the end.
When an internal table is created, the settings criteria for the value of occurs?
The objective of setting the value of an occurs for an internal table is a question of optimization.

The following facts should be taken into account when making such decision.

1) The complete data area of a program is 64000 bytes.
2) The initial size declared is kept in roll area (quicker access to program)
3) Data entered that exceeds the initial size stores in the roll file (Slower access to program)

You should also analyze the expected volume and access rates before making the decision.

Define "Check " statements, how it works?

To terminate a single loop pass conditionally, use the CHECK statement in the statement block of the loop.If the condition is not true, any remaining statements in the current statement block after the CHECK statement are ignored, and the next loop pass starts. can be any logical expression.

Explain Field Group(extract dataset)?

An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement.

FIELD-GROUPS .

This statement defines a field group . A field group combines several fields under one name. For clarity, you should declare your field groups at the end of the declaration part of your program.A field group does not reserve storage space for the fields, but contains pointers to existing fields. When filling the extract dataset with records, these pointers determine the contents of the stored records.

What is the difference between Move & assign statement?

Move :- To assign the value of a data object to a variable , use the following statement:
MOVE . or the equivalent statement does not have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the user’s personal settings.
Multiple value assignments in the form
Assign :- ASSIGN TO .
When you assign the data object, the system checks whether the technical attributes of the data object correspond to any type specifications for the field symbol . The field symbol adopts any generic attributes of that are not contained in its own type specification. Following the assignment, it points to in memory.

How do you run a report for a row in table?

Using Graphics Multiplexer. There is an option some thing similar to screen capture which captures data only. Using that data you can draw graphs (3D and 2D). This option is available all the time from Menu! -> Generate Graphics which captures the data then you need to drag and select the data you want to draw a graph on. Once you select you can click on Graphics, which launches graphics multiplexer.

RELATED POSTS

FAQ'S ON SAP BASIS LAYER
FAQ'S ON RFC

My SAP Project safety and security