SAP Learning Log-RFC remote function call

Source: Internet
Author: User
Tags rfc

RFC remote function call is a basic interface technology for program communication between SAP systems and non-SAP systems.For example, bapi and ale are all implemented based on RFC.

The SAP system provides three external interfaces.

1. Communication Interface)

2. file I/O interface)

3. Database Interface)

 

RFC is located in the program communication interface to allow external programs to access the internal data of the SAP system.

RFC is implemented based on CPI-C)

In system communication, there are sending and receiving systems. The system that sends requests is called the RFC client during communication, and the other is called the RFC server.

RFC communication is divided into three types:

1. Communication between two independent SAP Systems

2. As a call system, SAP communicates with external remote systems (non-sap abap systems;

3. The external system acts as the calling system and communicates with the SAP system.

RFC Communication Mode

1. Synchronize RFC (SRFC synchronous RFC)

2. asynchronous RFC (ARFC asynchronous RFC)

3. Transactional RFC (trfc transactioanl RFC)

4. Queue RFC (qrfc queued RFC)

5. Parallel RFC (prfc parallel RFC)

RFM Overview

RFM is a function module that can be remotely called.

RFM cannot determine the parameter type at runtime. Therefore, you must refer to the data dictionary type declaration when defining the parameter.

The parameters in RFM must be pass values. For table type parameters, the system also implicitly transfers values.

Remote Maintenance target

Tcode sm59

You can add a connection type, which includes the following types:

1. Type 2 (R/2 connection), specifying the R/2 system as the target system

2.Type 3 (ABAP connection or R/3 connection), specifying the sap ABAP system as the target system

3.Type I (internal connection), which is connected to the ABAP System of the same database as the current system

4. Type L (logical target): This entry is generated by referring to the physical target instead of specifying the connection system.

Technical settings

1. Target System: Target System name

2. Message Server the message server with the "M" character in the T-CODE rz03 service bar of the Message Server Target System

3. group server group tcodeSmlgYou can view

4. Host Name field in sm51 of target host (host or IP address of Target System)

5. system number (system number of the target system)

 

Set the logon/Security Tab

Trusted System. For remote targets of Type 3, you can set the server system as a trusted system. RFC users do not need to set a login password for the system.

Synchronous RFC method RFM call

To synchronize the RFC, the remote system is required to be available during the call. The processing of the calling program is suspended. Wait until the remote function module calls the returned structure and continue.

Syntax

Call functioan rfm_name

Destination dest

.....

Asynchronous call

Asynchronous RFC also requires that the RFC server system be available during calls. The called function module starts and runs immediately. Unlike synchronous calls, the calling program continues to run without waiting for remote call results, remote function processing is separated from the processing process of the calling program. The returned results can be received later.

Syntax

Call function rfm_name

Start new task taskname

....

Receive results during asynchronous RFC call

Call function rfm_name

Start new task taskname

Ming return_form on end of task

The subroutine must exist in the program.

 

Form return_form using taskname

....

Receive results from function rfm_name

....

Enform

RFM call in parallel RFC Mode

Parallel RFC is actually one of the applications of asynchronous RFC calls.

1. asynchronous RFC calls are applicable to parallel processing between multiple sap ABAP systems (non-SAP systems are not supported)

2. asynchronous RFC calls can be used within the same system and some processing loads can be transferred to other application servers.

3. If the asynchronous RFC call target is not specified, the local asynchronous RFC call can be used within the same application server for parallel processing of multiple working processes.

Group parallel processing syntax

Call function rfm_name

Starting new task taskname

Destination in group G1

....

Exception

Resource_failure = ..

 

Parallel Processing Conditions

Logically-independent units of work: parallel processing is not suitable for data processing that requires sequential processing. Each data processing process cannot have dependencies.

ABAP requirements

The called function module program cannot contain remote function calls using the target back.

The caller cannot generate a new internal session after an asynchronous call.

You cannot use the call function starting new task destination in group statement to start an external program.

System Resource requirements

To process parallel jobs, the SAP system must have at least three dialogs. the scheduling Queue (dispatcher Queue) must be less than 10% full load, and at least one idle conversation workflow must be used to process tasks in parallel jobs, and keep two idle working processes for system login and management tasks.

Transactional RFC

The transaction RFC call can bind multiple logical remote calls to a luw. in this luw, all calls are executed in the same program context of the target system in the order of their calls, either in the form of a single transaction, or in full rollback.

Syntax

Call function rfm_name

In background task

....

Or

Call function rfm_name

In background unit oref

....

The transaction RFC call cannot directly receive or receive RFM return results through receive results from fucntion.

No export type parameter should be specified in the module.

Queue RFC Method

To ensure that the luws In the transactional RFC are executed in accordance with their creation magnetism, you need to use the queue RFC to create the luw sequence.

SAP Learning Log-RFC remote function call

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.