sap rfc

Upload: shivi

Post on 06-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/17/2019 SAP RFC

    1/9

    Introduction to RFC (Remote Function Call)

    What is RFC?

    For business applications, it is necessary to communicate and exchange information (in pre-

    dened formats) with other systems. Hence, there are well dened mechanisms to enable thiscommunication. S! has also pro"ided us with such mechanism called RFC, which stands for

    #Remote Function Call#.

     

    $F% is a S! protocol to handle communications between systems to simplify the related

    programming. &t is the process of calling a function module which is residing in a di'erent

    machine from the caller program. $F%s can be used to call a di'erent program in the same

    machine as well, but usually it is used when #calling# and #called# function modules programs arerunning on separate machines.

     

    &n S!, $F% &nterface system is used for setting-up $F% connections between di'erent S!

    systems, and also between an S! and an external (non-S!) system.

     

    Must Know Details About RFC

    • S! ses %!&% (%ommon !rogramming &nterface for %ommunication) !rotocol to transfer

    data between Systems. &t is S! Specic protocol. $emote Function %all ($F%) is acommunications interface based on %!&-%, but with more functions and easier for application

    programmers to use

  • 8/17/2019 SAP RFC

    2/9

    •  *he $F% library functions support the % programming language and +isual asic (on

    indows platforms)

    • $F% connections can always be used across the entire system. *his means that an $F%

    connection you ha"e dened in client can also be used from client / (without any

    di'erence).

    • $F% is the protocol for calling special subroutines (function modules) o"er the networ0.

    Function modules are comparable with % functions or !S%1 procedures. *hey ha"e a dened

    interface through which data, tables and return codes can be exchanged. Function modules are

    managed in the $2 System in their own function library, called the Function uilder.

    •  *he Function uilder (transaction S324) pro"ides application programmers with a useful

    en"ironment for programming, documenting and testing function modules that can be called

    locally as well as remotely. *he $2 System automatically generates the additional code ($F%

    stub) needed for remote calls.

    •  5ou maintain the parameters for $F% connections using transaction S367. *he $2 System

    is also deli"ered with an $F%-S89 (Software 8e"elopment 9it) that uses extensi"e % libraries toallow external programs to be connected to the $2 System.

    •  *he only di'erence between a remote call of a function module to another ser"er and a

    local call is a special parameter (destination) that species the target ser"er on which the

    program is to be executed.

    The RFC Advantaes!

    $F% helps to reduce the e'orts of programmers, by letting them a"oid the re-de"elopment of

    modules and methods at remote systems. &t is capable enough to:

    • %on"ert the data into the format understandable by the remote (target) system.

    • %all up certain routines which are necessary to start communication with remote system.

    • Handle errors that might occur in the process of communication.

    T"#es o$ RFC!

    %"nchronous

    re;uires both the systems (client and ser"er) to be a"ailable at the time of communication or data

    transfer. &t is the most common type and is re;uired when result is re;uired immediately after the

    execution of s$F%.

  • 8/17/2019 SAP RFC

    3/9

    s$F% is a means of communication between systems where ac0nowledgements are re;uired. *he

    resources of the Source System wait at the target system and ensure that they deli"er the

    messagedata with %98. *he 8ata is consistent and reliable for communication.

     *he issue is if the target system is not a"ailable, the source system resources wait until target

    system is a"ailable. *his may lead to the !rocesses of source system to go into Sleep$F%%!&%

    3ode at target systems and hence bloc0s these resources.

    &sed $or

    • For communication between systems

    • For communication between S! eb pplication Ser"er to S!

  • 8/17/2019 SAP RFC

    4/9

    @ueued $F% is an extension of t$F%. &t also ensures that indi"idual steps are processed in

    se;uence.

     *o guarantee that multiple 1s (1ogical nit of or0 *ransaction) are processed in the order

    specied by the application. t$F% can be serialiAed using ;ueues (inbound and outbound ;ueues).

    Hence the name ;ueued $F% (;$F%). sed For-

    Extension of the Transactional RFC• For a dened processing sequence

    • &mplementation of ;$F% is recommended if you want to guarantee that se"eral

    transactions are processed in a predened order.

    T"#es o$ RFC Connections %M*+

     

    T"#e , - entries specify connection between ! systems. Here, we must specify the host name

    &! address. 5ou can, howe"er, specify logon information if desired. *his is applicable for both

    type of $F%s, between ! systems and external calls to ! systems

    T"#e I ' entries specify ! systems connected to the same data base as the current system.

     *hese entries are pre-dened and cannot be modied. >xample entry name: ws/6B9/=BCD

    • ws/6Ehost name

    • 9/=Esystem name (data base name)

    • CDE*%!-ser"ice name

      T"#e T - destinations are connections to external programs that use the $F% !& to recei"e

    $F%s. *he acti"ation type can be either Start  or Registration. &f it is Start , you must specify the

    host name and the pathname of the program to be started.

    -ow to Con.ure and Test RFC/

     *his tutorial is di"ided into D sections

    /. Setup a $F% connection

    C. *rusted $F% connection

    2. *esting a $F% connection

  • 8/17/2019 SAP RFC

    5/9

    D. >rror $esolution

    0rocedure to setu# an RFC connection!

    >nter *ransaction %ode %M*+

     

    &n the S367 screen, you can na"igate through already created $F%s connection with the help of

    option tree, which is a menu based method to organiAe all the connections on the basis of

    categories.

     

    %lic0 the #CREATE# button. &n the next screen , >nter -

    • RFC Destination Game of 8estination (could be *arget System &8 or anything rele"ant)

    • Connection T"#e here we choose one of the types (as explained pre"iously) of $F%

    connections as per re;uirements.

    • Descri#tion  *his is a short informati"e description, probably to explain the purpose of

    connection.

     

    fter you1%A231the connection, the system will ta0e you to #*echnical Settings# tab, where we

    pro"ide the following information:

  • 8/17/2019 SAP RFC

    6/9

    • Taret -ost Here we pro"ide the complete hostname or &! address of the target system.

    • %"stem 4umber  *his is the system number of the target S! system.

    • %lic0 Sa"e

     

    &n the 15oon and %ecurit"1  *ab, >nter *arget System information

    • 5anuae s per the target system#s language

    • Client  &n S! we ne"er logon to a system, there has to be a particular client always,therefore we need to specify client number here for correct execution.

    • &ser ID and 0assword preferably not to be your own login &8, there should be some

    generic &8 so that the connection should not be a'ected by constantly changing end-user &8s

    or passwords. Mostly, a user of type System or Communication is used here! !lease note that

    this is the ser &8 for the target system and not the source system where we are creating this

    connection.

     

    %lic0 Sa"e. $F% connection is ready for use

    4ote: y default a connection is dened as a$F%. *o dene a connection as t$F% or ;$F% go to

    3enu ar - 8estination a$F% options t$F% options I pro"ide inputs as per re;uirements. *o

    dene ;$F% , use the special options tab.

    Trusted RFC connection

     *here is an option to ma0e the $F% connection as 1Trusted1/ Jnce selected, the calling (trusted)

    system doesn#t re;uire a password to connect with target (trusting) system.

  • 8/17/2019 SAP RFC

    7/9

    Following are the ad"antages for using trusted channels:

    %ross-system Single-Sign-Jn facility• !assword does not need to be sent across the networ0

    •  *imeout mechanism for the logon data pre"ents misuse.

    • !re"ents the mishandling of logon data because of the time-out mechanism.

    • ser-specic logon details of the callingtrusted system is chec0ed.

    The RFC users must ha"e the required authori#ations in the trusting system $authori#ation

    o%&ect S_RFCACL '! *rusted connections are mostly used to connect S! Solution

    3anager Systems with other S! systems (satellites)

    Testin the RFC Connection

    fter the $F%s are created (or sometimes in case of already existing $F%s) we need to test,

    whether the connection is established successfully or not.

     

    s shown abo"e we go to S367 to choose the $F% connection to be tested and then we expand

    drop down menu - K&tilities'6Test'67K. e ha"e three options:

    Connection test '6 *his attempts to ma0e a connection with remote system and hence

    "alidates &! address Hostname and other connection details. &f both systems are not able to

    connect, it throws an error. Jn success it displays the table with response times. *his test is Lust

    to chec0 if the calling system is able to reach the remote system.

     

    http://www.guru99.com/overview-of-sap-solution-manager.htmlhttp://www.guru99.com/overview-of-sap-solution-manager.htmlhttp://www.guru99.com/overview-of-sap-solution-manager.htmlhttp://www.guru99.com/overview-of-sap-solution-manager.html

  • 8/17/2019 SAP RFC

    8/9

     

    Authori8ation Test '6 &t is used to "alidate the ser &8 and !assword (pro"ided under #logon

    and security# tab for the target system) and also the authoriAations that are pro"ided. &f test is

    successful, then same screen will appear as shown abo"e for the connection test.

    &nicode Test '6 &t is to chec0 if the *arget system is a nicode or not.

     

    Remote 5oon 6 *his is also a 0ind of connection test, in which a new session of the target

    system is opened, and we need to specify a login &8 and !assword (if not already mentioned

    under #1ogon and Security# tab). &f the user is of type #8ialog# then a dialog session is created. *o

     Lustify the successful connection test, output will be the response times for the communication

    pac0ets, else error message will appear.

     

  • 8/17/2019 SAP RFC

    9/9

     

    What went wron?

    &f somehow the $F% connection is not established successfully, we can chec0 the logs (to analyAe

    the issue) at JS le"el in the #J$9# director. *here we can nd the log les with the naming

    con"ention as Kde"(rfc)sequence no!*K and the error description can be read from such les.