Coding of rfc's

hai everybody,
iam new to RFC's. can you people send me the code regarding creation of RFC's, so that i can understand muchbetter about RFC's abap.
i need to learn about the RFC's i was badly in RFC's. I don't have  much knowledge  on RFC's .Tell  with detailed.
Thanks & Regards,
swapna.

Hi,
Steps for Implementing Remote Function Modules To implement a remote function module in ABAP, perform the following steps:
Register the module as remotely callable in the RFC server system.
In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
Write the code for the function module.
Guidelines for creating function modules in the R/3 Repository are given in the system documentation "Writing Function Modules".
Define the destination of the RFC server in the RFC client system that calls the remote function.
Either you or your system administrator can maintain the RFCDES table using transaction SM59 (Tools ® Administration, Administration ® Network ® RFC destinations). Maintaining this table is described in the topic Maintaining Remote Destinations.
For Programming Guidelines...click the link below
http://help.sap.com/saphelp_47x200/helpdata/en/22/04260c488911d189490000e829fbbd/content.htm
For Debudding the RFC Functions
http://help.sap.com/saphelp_47x200/helpdata/en/22/042619488911d189490000e829fbbd/content.htm
To know more about RFC Interface
http://help.sap.com/saphelp_47x200/helpdata/en/22/04250b488911d189490000e829fbbd/content.htm
RFC Interface in SAP
http://help.sap.com/saphelp_47x200/helpdata/en/22/042518488911d189490000e829fbbd/content.htm
Regards,
Vara

Similar Messages

  • ABAP Coding for RFC inputs

    Hi,
    I am new to ABAP coding. I use the WebDynpro ABAP . In that I need to call a RFC and get the data into the portal. I need to pass some input paramer to RFC. How could I do in the ABAP programming ?
    thanks
    Suresh

    Hi suresh,
    What you are asking is a not a wdbdynpro specific doubt but it is more related to abap.So i think you need to get some information about creating and using FM and RFC  in abap.
    Well i would just try to give you the steps that you should follow.
    Step 1) Create a function module by using T CODE se37 make it remote enable i.e make it a RFC (you will ust need to check a radio button in properties tab)
    Step 2) In rfc try to define the importing and exporting parameters and write your logic in the coding section.
    Step 3) After creating RFC successully now u craete your webdynpro component and create a view inside the component.In view accrding to your business requirement you call this RFC in any of the methods i.e either in hooks methods or your custom methods .And pass the parameters to that rfc and get the results from the rfc.
    Well i think i have just given you the overview of the process so while development if get any problem feel free to ask
    regards
    PG

  • FM for RFC destination

    Hi All,
    Iam working on CRM4.0 and SAPR3 4.6. I need to call a Function module which is RFC enabled in CRM from R3. currently iam hard coding the RFC destination. is there any FM that can get me a destination.
    could some help me with this?
    Thank u.
    Suresh.

    Hi Suresh,
    You check the FM 'SMOF_READ_SMOFERPSH' in CRM system.
    It should work...
    <b>code:</b>
    DATA: lv_oltp_destination TYPE rfcdest,
            lt_erpsites         TYPE TABLE OF smof_erpsh,
            ls_erpsites         LIKE LINE OF lt_erpsites.
    read OLTP destination
      CALL FUNCTION 'SMOF_READ_SMOFERPSH'
        EXPORTING
        I_ERPLOGSYS          =
        I_RFCDEST            =
        I_SITEID             =
          i_sitetypeid         = 'SMOF_ERPSITE'
        I_ALL_ERPSITES       =
        TABLES
          t_erpsites           = lt_erpsites.
      READ TABLE lt_erpsites INTO ls_erpsites INDEX 1.
      lv_oltp_destination = ls_erpsites-rfcdest.
      IF lv_oltp_destination IS INITIAL.
        RAISE no_data.
      ENDIF.
      CALL FUNCTION (RFC FMNAME)
        DESTINATION lv_oltp_destination
        TABLES

  • SenderAgreement not found in RFC to File

    Hi,
    In  RFC - File scenario, i am facing the following error:
    Error in processing caused by: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: senderAgreement not found: lookup of binding via CPA-cache failed for AdapterType RFC, AdapterNS http://sap.com/xi/XI/System, direction INBOUND, fromParty '', fromService 'DEC', toParty '', toService '', interface 'SLDJAVA_ACCESSOR_REQUEST', NS 'urn:sap-com:document:sap:rfc:functions' for channel 'CC_LOTUSNOTES_OUTBOUND_SND_RFC'
    I deleted the sender CC and created it again, did a CPACahe Refresh but nothing happened.
    could anybody help to solve this issue.
    in the ECC side I have coded a RFC which is included in the BAPI, then i am calling this RFC in ABAP program. i created a LS in ECC which has the PI details. RFC is called like below:
    CALL FUNCTION 'Z_HR_OUTBOUND_DATA2'
    IN BACKGROUND TASK DESTINATION 'DPICLNT100'    -
    > this is the PI server
    is this correct, or am i missing some steps?
    thanks

    Hi Siva,
    I have done the following for RFC to File scenario:
    ECC side:
    1. Created a RFC and tagged it to BAPI
    2. In the ABAP program, i am calling the RFC like below:
    CALL FUNCTION 'Z_HR_OUTBOUND_DATA2'
    IN BACKGROUND TASK DESTINATION 'Z_HR_OUTBOUND_DATA2'
                   EXPORTING
                     INTERFACE       =
    IMPORTING
       FILENAME        = FILENAME
       RETURN          = RETURN
    TABLES
       ITAB10          = ITAB10
       P_STATUS        = P_STATUS
    COMMIT WORK.
    3. Created a RFC destination using SM59
    RFC detination     : Z_HR_OUTBOUND_DATA2
    Connection type    : TCP/IP
    Enabled Registered Server Program
    Program ID : SAPSLDAPI_DPI -
    > not sure whether this correct. but took this vvalue in
    on the TCP/IP connection in PI (As mentioned if i am giving any other value say SAPECC etc, then it gives an error while Tst connection  * TP sapecc not registered* )
    Gateway host : ECC's host number
    Gateway service : ECC's service number.
    In PI side:
    I have created :
    1 DT for File Rcvr
    1 MT for File Rcvr
    1 SI for File Rcvr (async)
    1 MM (sender RFC and receiver File)
    1 OM
    1 CC with RFc as sender with the following parameters:
       Communication component : ECC's component
       application server (gateway) : ecc's gateway
       application server service(Gateway) : ecc's service number
       Program id : SAPSLDAPI_DPI -
    > not sure whether this correct.
    in on the TCP/IP connection in PI
       inital connections 1
       max. connections 1
    And also gave ecc's details in application server , s/y number, auth. mode, logon user ,
    pwd, ecc's client number
    1 CC with File adapter and file content conversion
    1 receiver determination
    1 interface determination
    1 sender agreement
    1 receiver agreement
    When i am executing the ABAP program in R/3 I am getting the following error:
    *Error in processing caused by: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException:
    lookup of alternativeServiceIdentifier via CPA-cache failed for channel
    'CC_LOTUSNOTES_OUTBOUND_SND_RFC' (f455111112de33bba4c3dc3dbf93ed1b, party '', schema
    'TechnicalSystem', identifier 'DEC#120')*
    Please let me know if any of my steps are wrong and how to rectify this error and make
    the scenario working.
    Thanks for your help

  • RFC fn module (SUBMIT)

    Hi All..
    I am creating a work schedule through BDC.
    then to generate work schedule rule. i am passing parameters through submit command..but its asking for a request. but i have done this coding in RFC fn module. so have to hand this request in backgriud. in foreground i can press yes button of that request..but for backgrnd i cant.
    plzz help me out.
    plzzz

    While recording the BDC you should be getting the same result. If so, record with that 'request' screen including your 'yes' command. Create your BDC with that additional step. It should work
    reward if useful

  • RFC fn module

    Hi All..
    I am creating a work schedule through BDC.
    then to generate work schedule rule. i am passing parameters through submit command..but its asking for a request. but i have done this coding in RFC fn module. so have to handle this request in backgrnd.... in foreground i can press yes button of that request..but for backgrnd i cant.
    plzz help me out.
    plzzz

    use  your bdc   okcode for   background  . as follows
    PERFORM BDC_OKCODE' '/00' .
    Girish

  • Data Upload into SAP from Microsoft Excel

    Hi Guys: I created a function module from a BDC program and made it RFC enabled. When I execute this in SAP, it works fine and creates a customer. But when I try to trigger it from Excel, it gives me the error “Object Variable or With Block Variable not set”.  Please HELP!...
    Here is my VB code
    Option Explicit
    ' Declaration for the necessary objects
    Dim objBAPICortrol, objConnection, objCreateCustomer, objAcctGr, objCoCode, objReturn As Object
    Dim objSalesOrg, objDistCh, objDiv, objName, objStreet, objPostalCode, objCity, objRegion, objCountry As Object
    Dim objCountycode, objCityCode, objReconAcnt, objPaymentHist, objCustPrPro, objCustStGrp, objIncoTerms, objSDPayTerms, objAcntAssGrp, objTaxClass As Object
    Dim vLastRow, vRows As Integer
    Private Sub CommandButton2_Click()
    ' Create an Email in Outlook
    Application.Dialogs(xlDialogSendMail).Show
    End Sub
    Private Sub CommandButton3_Click()
    ' Getting the last filled Row in Column A
    vLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    ' Setting the necessary variables for R/3 connection
    Set objBAPICortrol = CreateObject("SAP.Functions")
    Set objConnection = objBAPICortrol.connection
    ' Establish a connection
    If objConnection.Logon(0, False) Then
        MsgBox "Connection Established"
    End If
    On Error Resume Next
    ' Assign the Parameters
    Set objCreateCustomer = objBAPICortrol.Add("Z_RFC_CUSTOMER_CREATE_XLS")
    Set objAcctGr = objCreateCustomer.Exports("KTOKD_005")
    Set objCoCode = objCreateCustomer.Exports("BUKRS_001")
    Set objSalesOrg = objCreateCustomer.Exports("VKORG_002")
    Set objDistCh = objCreateCustomer.Exports("VTWEG_003")
    Set objDiv = objCreateCustomer.Exports("SPART_004")
    Set objName = objCreateCustomer.Exports("NAME1_006")
    Set objStreet = objCreateCustomer.Exports("STRAS_007")
    'Set objHouseNumber = objCreateCustomer.Exports("House Number")
    Set objPostalCode = objCreateCustomer.Exports("PSTLZ_009")
    Set objCity = objCreateCustomer.Exports("ORT01_008")
    Set objRegion = objCreateCustomer.Exports("REGIO_011")
    Set objCountry = objCreateCustomer.Exports("LAND1_010")
    Set objCountycode = objCreateCustomer.Exports("COUNC_013")
    'Set objPhone = objCreateCustomer.Exports("Phone")
    'Set objContact = objCreateCustomer.Exports("Contact")
    'Set objFax = objCreateCustomer.Exports("Fax")
    'Set objEmail = objCreateCustomer.Exports("Email")
    'Set objDirections = objCreateCustomer.Exports("Directions")
    Set objCityCode = objCreateCustomer.Exports("CITYC_014")
    Set objReconAcnt = objCreateCustomer.Exports("AKONT_015")
    Set objPaymentHist = objCreateCustomer.Exports("XZVER_017")
    Set objCustPrPro = objCreateCustomer.Exports("KALKS_019")
    Set objCustStGrp = objCreateCustomer.Exports("VERSG_020")
    Set objIncoTerms = objCreateCustomer.Exports("INCO1_021")
    Set objSDPayTerms = objCreateCustomer.Exports("ZTERM_023")
    Set objAcntAssGrp = objCreateCustomer.Exports("KTGRD_024")
    Set objTaxClass = objCreateCustomer.Exports("TAXKD_01_025")
    ' Now looping through all values create customer
    ' The data begin row is set to 2
    For vRows = 2 To vLastRow
    ' Set the Parameter Values
    objAcctGr.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 1).Value
    objCoCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 2).Value
    objSalesOrg.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 3).Value
    objDistCh.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 4).Value
    objDiv.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 5).Value
    objName.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 6).Value
    objStreet.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 7).Value
    'objHouseNumber.value = ThisWorkbook.ActiveSheet.Cells(vRows, 8).Value
    objPostalCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 9).Value
    objCity.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 10).Value
    objRegion.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 11).Value
    objCountry.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 12).Value
    objCountycode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 13).Value
    'objPhone.value = ThisWorkbook.ActiveSheet.Cells(vRows, 14).Value
    'objContact.value = ThisWorkbook.ActiveSheet.Cells(vRows, 15).Value
    'objFax.value = ThisWorkbook.ActiveSheet.Cells(vRows, 16).Value
    'objEmail.value = ThisWorkbook.ActiveSheet.Cells(vRows, 17).Value
    'objDirections.value = ThisWorkbook.ActiveSheet.Cells(vRows, 18).Value
    objCityCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 19).Value
    objReconAcnt.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 20).Value
    objPaymentHist.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 21).Value
    objCustPrPro.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 22).Value
    objCustStGrp.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 23).Value
    objIncoTerms.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 24).Value
    objSDPayTerms.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 25).Value
    objAcntAssGrp.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 26).Value
    objTaxClass.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 27).Value
    ' Function call
    objCreateCustomer.call
    ' Get return parameters & display in excel
    Set objReturn = objCreateCustomer.Imports("RETURN")
    ActiveSheet.Cells((vLastRow + vRows), 1) = objReturn.Value("MESSAGE")
    ' Error handling
    If Err Then
        MsgBox Err.Description
    End If
    Next vRows
    End Sub

    Hello,
    Whatz impossible ??
    Yes you can export the data from excel to SAP using VBA, but you need to create fome RFC in SAP as well that will handle the data you will send.
    1. Create a RFC function in R/3 that will read a file from specific location and perform the respective transaction.
    2. Create your excel file with respective file format and call the RFC function in SAP passing the parameters as file name and other required details.
    3. SAP coding for RFC will be a single time activity and then onwads you can just create excel file for upload and use VBA code to initiate the RFC call.
    Hope this make some sence. Tell me if you have more queries.
    Regards,
    Vishal
    Reward points.. if helpful

  • Excel to SAP using VBA

    I would like to know if there is any possible way of exporting data from excelt to SAP using VBA code. I was going through one of the blogs /people/kathirvel.balakrishnan2/blog/2006/05/09/data-upload-into-sap-from-microsoft-excel-150-vba-part
    where in the data was exported from excel to SAP with the help of table name. Can the same be done using trasaction codes in SAP? If so, how.
    Also, I would like to know,if I can record a particular session(as how we do for recording a macro in excel) and use the same recorded session for other entries too.
    Thanks a lot in advance.
    Regards,
    P.Yogesh

    Hello,
    Whatz impossible ??
    Yes you can export the data from excel to SAP using VBA, but you need to create fome RFC in SAP as well that will handle the data you will send.
    1. Create a RFC function in R/3 that will read a file from specific location and perform the respective transaction.
    2. Create your excel file with respective file format and call the RFC function in SAP passing the parameters as file name and other required details.
    3. SAP coding for RFC will be a single time activity and then onwads you can just create excel file for upload and use VBA code to initiate the RFC call.
    Hope this make some sence. Tell me if you have more queries.
    Regards,
    Vishal
    Reward points.. if helpful

  • BAPI_ADDRCONTPART_SAVEREPLICA Create contact person issue

    Dear SAP Gurus,
    I'm coding a RFC for create customer with contact person. I used BAPI_PARTNEREMPLOYEE_GETINTNUM and BAPI_ADDRCONTPART_SAVEREPLICA in order to create the contact person for the corresponding customer.
    The process is
    1. get customer number by BAPI
    2. create customer by BDC
    3. create contact person
    The issue is
    The BAPI is successfully called, and the address data is into the table, eg. ADRC.
    But in Tcode XD03 contact person view, I can not find the contact person information for this customer.
    Could you please kindly advise?
    BTW, the BAPI input parameters are all correct I think, I also did the test in SE37
    Best Regards,
    Shiliang
    null

    Dears,
    Could you please kindly help?
    BR

  • Change log in HR (Table PCL4 Cluster LA)

    Hi @ all,
    when infotype logging is activated changes made in infotypes are logged into table PCL4 cluster LA.
    We have the following problem:
    HR masterdata is stored into our system from an external system via ALE. But the problem is that no change logs are written. But we absolutely need this information!!!
    Now I have coded a RFC function module which reads the log data from the external system. This also works fine. But how do I have to store the data into <b>our</b> PCL4(LA)???

    nope - I didn't try this because I don't know about the data which is needed to store the change log correct.
    Other question: I've found the function module "HR_INFOTYPE_LOG_CREATE" which seems to do what I want. But the problem is that there is no documentation available. The FM has four table parameters - does anyone how how to fill them? Has anyone used this FM? It is not used within standard programs - the "where used" function does not report any hits.
    Thx in advance

  • BDC for VL10B

    Hai to all,
    I am creating RFC for VL10B using BDC recording, I coded the RFC as it was in the recording, but when i tested my RFC with option 'A', I came to known that STO document number hasn't been select for background to create delivery order. Can anybody suggest the code for that, or even tell me how to capture screen data in BDC,
                                Thank you in advance,
                                  srinivas

    Can you paste the part of the code which contains the population of the BDC table.

  • Ext. ITS: programm-logic for "/BBPGLOBAL/Login.html"

    Hi,
    i search the programm-logic for BBPGLOBAL/Login.html (ext. ITS!), not the HTML-Code.
    <u>My two problems:</u>
    a)
    Transmit an challenge-key (md5) from SAP to the login-form
    before the User take an log-in.
    b)
    Then 'crypt' the username and passwort with this challange-key and decrypt in the SAP coding.
    But i don't find the coding (proccessed after the login-button)
    - Coding with RFC-Call from/to?
    <u>Why this:</u>
    - i can't use SSL but Username and Pass MUST crypted (lite) transfered to ITS
    ITS, Version 6200.1018.52123.0, Build 752463
    regards
    Roland

    Thank's for the hint:
    ext. ITS: programm-logic for "/BBPGLOBAL/Login.html"
    Mod/Admin -> please del this posting here in SRM...

  • BAPI structure as TYPE?

    In case of coding a RFC shall I have to always use BAPI structure as TYPE?  or I can use other things also. Please let me know.
    Regards,
    Subho

    Hi
    To the best of my knowledge you can use any dictionary type structures for more info take F1 help. or Take F1 help on
    CALL FUNCTION key word.
    go to SE84 and select the Radio Button of RFC and execute you can find many RFC function Modules, Check their Import Parameters
    All the Imprort Parameters must be PASS BY VALUE only.
    For more info you can search Forums or Web
    Cheers
    Ram

  • How to find RFC names in e-commerce application JSPs or in Java coding.

    Hi Experts.
    Please explain me ,how to find RFC names which were used in e-commerce b2b/b2c applications in Java coding using SAP NWDS IDE.
    Thanks in Advance!!!!
    Regards,
    Kiran

    There are two ways to do this.
    I. Create your own Session Log file
    1. Go to http://url:port/b2b/admin/index.jsp
    2. Login with Admin user id and password.
    3. Click on 'Logging' from the left hand navigation
    4. Click on 'Session Logging' tab
    Here you can start your e-commerce application using a URL and 'Start' session logging when you need it. When you 'Stop' the session logging, you will see a log file for download.
    II. View ISA Log files in the system
    The path varies based on how the log config was done. But usually, if you look in this folder structure on the Java Stack, you will see log files.
    .../JC00/j2ee/cluster/server0/log/applications/..
    I hope this helps.
    Pavan

  • How to close RFC connection in one script coding

    In one script, I am using the REF command to call another 2 scripts and these called scripts shd be run on same C36 ( test system). I shd close RFC connection between these 2 scripts.
    That is , once the 1s script over the RFC shd be closed and the user has to give usename and pwd  then  2nd script shd run.
    I have tried with the following code…. But it says RFC is not open……
    REF ( Y04S_FC_RM_CJ88_112 , Y04S_FC_RM_CJ88_1 , C36_999 ).   (when execute this script RFC to C36 will be created and after execution that RFC shd be closed so I included following ABAP code)
    ABAP.
      data : dest type RFCDEST.
      move 'S4_SAPC36999' to dest.                                       
      move dest to v_dest.
    *--Close the connection before opening it incase it is opened
              call function 'RFC_CONNECTION_CLOSE'
                   exporting
                        destination          = dest
                   exceptions
                        destination_not_open = 1
                        others               = 2.
              if sy-subrc <> 0.
              endif.
              move sy-subrc to v_subrc.
    ENDABAP.
    REF ( Y04S_FC_RM_CJ44_112 , Y04S_FC_RM_CJ44_1 , C36_999 ). (here agagin the RFC will be created and this script will be exectued.)

    In one script, I am using the REF command to call another 2 scripts and these called scripts shd be run on same C36 ( test system). I shd close RFC connection between these 2 scripts.
    That is , once the 1s script over the RFC shd be closed and the user has to give usename and pwd  then  2nd script shd run.
    I have tried with the following code…. But it says RFC is not open……
    REF ( Y04S_FC_RM_CJ88_112 , Y04S_FC_RM_CJ88_1 , C36_999 ).   (when execute this script RFC to C36 will be created and after execution that RFC shd be closed so I included following ABAP code)
    ABAP.
      data : dest type RFCDEST.
      move 'S4_SAPC36999' to dest.                                       
      move dest to v_dest.
    *--Close the connection before opening it incase it is opened
              call function 'RFC_CONNECTION_CLOSE'
                   exporting
                        destination          = dest
                   exceptions
                        destination_not_open = 1
                        others               = 2.
              if sy-subrc <> 0.
              endif.
              move sy-subrc to v_subrc.
    ENDABAP.
    REF ( Y04S_FC_RM_CJ44_112 , Y04S_FC_RM_CJ44_1 , C36_999 ). (here agagin the RFC will be created and this script will be exectued.)

Maybe you are looking for

  • Production Order qty in Report Painter

    Can we get Production Order qty in Report Painter? I have tried and used couple of Libaries but the values are not getting updated in report. Can anybody please tell me which Library and Table combination to to get the result. Kami

  • Tnsping version problem

    Hi all, I have installed oracle 10g database when i give "lsnrctl start" command it gives message as follows : LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 27-OCT-2005 14:35:02 Copyright (c) 1991, 2004, Oracle. All rights reserved.

  • Unable to see 2nd and 3rd pages on the report

    Hi - I am facing an issue while developing a simple report. This report is based on a table called PROD. DDL statement of PROD is: CREATE TABLE PROD    (PID VARCHAR2(6),     PNAME VARCHAR2(6),     PCOST NUMBER(4,2),     PPROFIT NUMBER(3,0),     CONST

  • When saving a file i don't see the progress

    When saving Numbers files I use to see the progress of the save.  I no longer see its progress.  The files are being saved.  Any reason why this is happening?? tj

  • Combine Values by Hour

    I am doing something and I believe I am doing it quite wrong. When I plug the data into a light switch app in Visual Studio, I get a JSON error. I am getting my data every 15 minutes. I need to present this data by the hour. Here is my design at the