Regarding the RFC Function Module call from PI

Hi All,
I am working on one File to RFC interface, in which File adapter picks the file, this file data has to goto  2 function modules in SAP system. For this i added 2 Inbound interfaces in INTERFACE DETERMINATION and I developed 2 RECEIVER AGREEMENTS. In 2 RECEIVER AGREEMENTS i added single receiver RFC Communication Channel.
Now i want assurance that once 1 st function module will execute completely, then only my second function module should be called. Is there any setting that i can do to make this sync?????.
what is the use of  Send 'Confirm Transaction' in receiver RFC Communication Channel under Adavanced Mode.
Thanks,
Balu

Hi,
As per you requirement I would suggest to change your scenario as File To Proxy. It will much more easier and 100% sure to process second BAPI only after first gets successful inside the proxy.
Pass the data from file adapter to inbound proxy and then inside proxy code you first call the first BAPI and use commit wrok. Once commit work is successful then you call the second BAPI otherwise rollback the changes.
Example:
Call First_BAPI
<pass the data to it's import export parameters>
Commit work.
if sy-subrc =0.
Call Second_BAPI.
<pass the data to it's import export parameters>
Commit work.
endif.
Note: If you are not very much comfortable with ABAP the discuss this with your ABAP team mate.
Regards,
Sarvesh

Similar Messages

  • Is it possible to call custom designed RFC function module, apart from BAPI

    Hi Friends,
    1.     Is it possible to call custom designed RFC function module, apart from BAPI.
    2.     Why we call it Adaptive RFC layer, Since every time the JCO layer updated with SAP, Why can’t be dynamic.
    Thanx for Ur time.
    Cheers,
    Sam

    Also check <a href="http://help.sap.com/saphelp_nw04/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm">here</a> for more information on aRFC. Here you can find why it is called adaptive.
    Regards,
    Christophe

  • Where should i call the rfc function module? in xi or in r/3

    where should i call the rfc function module?
    for the synch scenario: file < -- >  xi <---> rfc
    i know the type of rfc is tcp/ip; but i'm not sure with the followings,
    and with some trials i can not even see any message via rwb even all the setting
    can be activated without errors.
    where should i create the rfc destination? in r/3 or xi
    where should i call the rfc via abap program? in r/3 or xi
    i guess the calling program should belong to the different server with the rfc itself....
    so confused....
    Thanks for your reply!!
    Jun

    if i create the destination in xi point to r/3, then i call the rfc use the destination in r/3 right ?
    The call doesnt use the destination in R3. XI has the RFC destination which is just used to connect to the R3 system
    but where i need to create the fm via se37? in xi or r/3 ?
    In R3
    Regards,
    Prateek

  • Regarding the Remote Function Module

    hi,
            Can any body can provide the brief information regarding the Remote Function Module.
    1)How to create the remote function module
    2)how it differ from the normal function module
    3)any special features about this.
    Thanks in advance

    Hi
    RFC (Remote Function Call) is similar to the general SAP fun module: except that in the attributes you click the radio button: RFC enabled;
    and you will be passing an Import parameter DESTINATION to it.
    Other code and usage will be similar to any fun module;
    Have a look at any fun module in SE37 to understand better about the different components of Fun modules;
    Refer this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/22/042518488911d189490000e829fbbd/frameset.htm
    check out the following link it might help you
    http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCFESDE2/BCFESDE2.pdf
    Function Modules;
    Check this matter.
    Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
    You can create them from TCode SE37.
    Go through the following doc:
    Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
    Function Module Interfaces
    The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
    Syntax
    ... [IMPORTING parameters]
    [EXPORTING parameters]
    [CHANGING parameters]
    [TABLES table_parameters]
    [{RAISING|EXCEPTIONS} exc1 exc2 ...]
    The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
    Interface parameters
    The interface parameters are defined on the relevant tab pages in the Function Builder.
    IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
    EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
    CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
    TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
    Exceptions
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    Note
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    RFC is a technology which is used to access a functions (Modules) from
    the remote systems.
    If a function module is set as remote enabled which can be access from
    the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
    A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
    But Normal function modules can not accessd from the remote system.
    Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
    Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
    CALLING A FUNCTION MODULE:
    1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
    --> Write the Corresponding FM name --> Hit Enter
    2)The appropriate import ,export Parameters will be displayed in ur editor
    3)Pass the Values Here.
    Also check these links.
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    Check this link:
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    See the following links:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Rfc function module call error

    Hi Abaper,
    I'm doing upgrade from 4.7 to ecc 6.0 currently and encounter problem in one of the rfc function module that we used. I've tested the connection to destination using sm59 and the connection is successful.
    As an information, in the rfc setting, the target system is not Unicode system.
    When I test using se37 and put the rfc destination in my function module call, I always encountered system_error exception. There's no issue with this rfc call before in 4.7 system.
    Please help me on this. Thank you.
    Edited by: Abraham Bukit on Sep 3, 2008 2:36 AM

    Hi,
    I had the same issue in the past and solved it in the following way.
    If the destination system is not Unicode please try to set the password for the communication user set in SM59 using only upper-case characters and taking into account that the password shouldn't be longer than 8 characters.
    Hope this will help.

  • Unable to find the RFC function module in the impoting list in IR

    HI
    I am trying to import a RFC function module from the R/3 system.
    I am not able to find the RFC in the list that comes for the RFC  function modules that can be imported.
    The RFC is present in the destination system and is actiated too
    If anyone has and idea why is such a thing happning
    Regards
    Nikhil

    Hi Nikhil,
    The Checklist,
    1. Check the connection parameter at XI
    2. Make sure ur function module is remote enabled
    3. Make sure ur RFC exists for the same user, client credentials
    Regards,
    Prateek

  • RFC remote function module call from XI

    hi
    I am trying to call a remote function module directly from XI which is not a bespoke module.
    And i am getting the following error:
    com.sap.aii.af.ra.ms.api.DeliveryException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.af.rfc.util.bapi.BapiException: Parameter with name RETURN not found.
    Please help me in this.
    Thanks in advance.

    Hi Naina,
    Normally RFC are synchronous, they do have return parameter as export parameter.
    If return parameter is missing then , you can create Wrapper RFC.
    Wrapper RFC:
    It is nothing but you just  create BAPI in SE37 transaction with Return parameter as export parameter and make it remote enabled by clicking on Radio button.
    Under source code, CALL BAPI which XI has to call.
    Thats it!
    I hope this helps.
    Let me know if any help required.

  • How to debug a RFC function module remotely from another R/3 system?

    Hi experts,
       I have RFC function module in one R/3 system. I am calling this from another R/3 system that is cross apps (Xapps).
       This function module is Synchronous.
      Is it possible to debug this function module from cross apps?
      Can somebody give me the steps?
    Thanks & Regards
    Gopal

    Hi Shree,
       Can you explain it bit more?
       Do I have to call the function  module with "IN BACKGROUND TASK"?
       Or is it that I have to just put external breakpoint in the function module?
       Please help
    Thanks
    Gopa

  • ABAP Dump due to RFC Function module call in another thread

    Hi,
    I am facing some problem since yesterday. In one of my executable program I am calling a RFC fm as below mentioned    
    REPORT ZREPORT.
    CALL FUNCTION 'Z_XXXXXXXXX'
          STARTING NEW TASK L_NAME
          DESTINATION IN GROUP 'TASK'
          PERFORMING RETURN_INFO ON END OF TASK
          EXPORTING
            P_exp1       = l_emp
          TABLES
            R_VBELN      = r_it_vbeln
          EXCEPTIONS
            NO_DATA_TO_PROCESS = 1
            OTHERS             = 2.
    wait until v_task = 1.
    update ztable.
    Due to some data inconsistence one of the SAP function
    module which I am calling in my function module Z_XXXXXXXXX
    is generating dump with message type X. Since there is data inconsistence it is generating dump that's OK.
    But the problem i am getting is, report ZREPORT is generating dump at WAIT statement saying illegal statement even though I am calling that function module
    Z_XXXXXXXXX as a separate new task.
    Can somebody help me.
    Thanks,
    Amara.

    hi, Amara
    I agree with Rich said, and do a simulate test in my server, here is the analysis.
    Assume we have a RFC, like this:
    FUNCTION ZGZL_DUMPTEST.
    *"*"Local interface:
    *"  EXPORTING
    *"     VALUE(OUT) TYPE  I
    *"  EXCEPTIONS
    *"      CONVERT_FAIL
      data:a  type  i.
      a = 'A'.
    ENDFUNCTION.
    And call this RFC like you way:
    REPORT ZGZL_DUMPTEST .
    DATA:
      SEMAPHORE(1) VALUE SPACE,
      LC_OUT       TYPE  I.
    CALL FUNCTION 'ZGZL_DUMPTEST'
    STARTING NEW TASK 'DUMP'
    PERFORMING RETURN_INFO ON END OF TASK.
    WAIT UNTIL SEMAPHORE = 'X'.
    WRITE: 'OVER'.
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'ZGZL_DUMPTEST'
              IMPORTING  OUT = LC_OUT.
      SEMAPHORE = 'X'.
    ENDFORM.                    " RETURN_INFO
    if we run the RFC in se37 directly, obviously it will occur a rumtime error CONVT_NO_NUMBER, and dump.
    But if we run the above application to call the RFC, we will get a different runtime error CALL_FUNCTION_REMOTE_ERROR.
    Error Analysis in ST22 like this:
    An error occurred when executing a REMOTE FUNCTION CALL.
    It was logged under the name "CONVT_NO_NUMBER"
    on the called page.
    I think that means the application receive the runtime error from RFC when call  <b>RECEIVE RESULTS</b>.
    In normal CALL FUNCTION, the external application will accept the rumetime error throw from FM, that's correct, because it let the caller can handle these runtime errors.
    In you case, you said RFC run in a new task, yes, that's true, so you can call the RFC like this:
    CALL FUNCTION 'ZGZL_DUMPTEST'
    STARTING NEW TASK 'DUMP'
    PERFORMING RETURN_INFO ON END OF TASK.
    WAIT UNTIL SEMAPHORE = 'X'.
    WRITE: 'OVER'.
    FORM RETURN_INFO USING TASKNAME.
      SEMAPHORE = 'X'.
    ENDFORM.                    " RETURN_INFO
    It will goes well, no dump. Why? because we don't use RECEIVE RESULT. RECEIVE RESULT will bring the result from FM, also bring the runtime error from FM.
    So if you want to call the FM and receive the result, handle the runtime error in FM inside at first.
    like this:
      CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.
        a = 'A'.
      ENDCATCH.
      IF SY-SUBRC = 1.
        RAISE CONVERT_FAIL.
      ENDIF.
    And then you call FM like this:
    CALL FUNCTION 'ZGZL_DUMPTEST'
    STARTING NEW TASK 'DUMP'
    PERFORMING RETURN_INFO ON END OF TASK.
    WAIT UNTIL SEMAPHORE = 'X'.
    WRITE: 'OVER'.
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'ZGZL_DUMPTEST'
              IMPORTING  OUT = LC_OUT
              EXCEPTIONS CONVERT_FAIL = 1.
      SEMAPHORE = 'X'.
    ENDFORM.                    " RETURN_INFO
    That's will be ok for your scenario.
    Hope my reply is useful.
    thanks

  • Error in Functional module calling from XI!!!

    Hi All,
    I'm using XI to pick data from ORACLE write it in SAP and take the response from SAP and write it back in ORACLE database. I'm using a custom functional module in SAP and calling it from XI .
    The custom functional module create the CUSTOMER and ORDER .
    Customer is getting created in SAP but order is not created. We are using two different functional modules for customers and orders.
    The above functional modules are executing in SAP but while calling from XI only the customer is getting created in SAP.
    Please post your views and suggestions on this issue.
    Thanks in advance.
    LN

    First put the commit work after successfuly executing the order creation in the custom function module.
    If you already put and doesn't know why it is not creating the orders, debug the function module by putting the same data which you are passing from XI in test tab.
    Suppose, the Orders are creating in the dubug mode. Then debug the custome function module dynamically using SM50.
    Regards,
    Krishnaraju.

  • RFC function module called inside an enhancment section

    Hi All,
    I am calling a RFC function module in background task as a separate unit. I am calling this FM within an enhancement section. Is it alright to use a commit work inside this RFC enabled FM even if I am calling it within an enhancemnt? Please help

    Hi,
    Yes,  you can use a commit work inside this RFC enabled FM even if I am calling it within an enhancemnt. Please refer below link regaring this. Thanking you.
    Commit within an enhancement point

  • Regarding the obsolute function modules

    Hi All,
    below function module are obsolute in 4.6c ,what are the new function modules in ECC 6.0.
    1.GRAPH_RECEIVE
    2.GRAPH_SET_CUA_STATUS
    already i search in sdn but i didnt get exact answer................
    plz help me.....
    Regards,
    Madhu

    Hi
    Though these function modules are set to obsolete,they are still maintained and supported by SAP and can be used in your application further.  They are set as obsolete in order to avoid the usage in new development projects.       When starting new developments it is recommended to use class 'cl_gui_chart_engine' .
    Hope this is helpful.

  • Raise exception in function module call from SAP owned program

    I need to raise an exception in a function module to terminate a transaction, display a error message and return to to previous selection screen so the user can fix the error before moving forward.......  
    How do you do this when the program using the function module is SAP owned?
    Thank You!
    Jeff

    Hi,
    After calling the function module, you can do something like this.
    IF SY-SUBRC <> 0.
      RAISE EXCEPTION.
    ENDIF.
    Regards,
    Ferry Lianto

  • Issue with the RFC function module - parameters

    Hi,
        When i am creating RFC enabled function module, it was throwing an error like <b>'Reference parameters are not allowed with RFC'.</b>. I am implementing the test scenario to create BAPI, for that i have created table with 2 fields. My main intension is through RFC enabled function module planning to update the ztable.
       When i was creating RFC enabled function module, it was giving error. I remembered that  i need to use new structure when i create RFC enabled function module, so even i created structure also with the same fields of table fields.
       can you please let me know the solution for this.
    Thanks
    jaya

    Hi Ferry,
        Your solution is perfect. can you please explain the below information...
    Call by value                                                                               
    You pass the parameter with values. This means that the parameter     
         contents are copied both when the parameter is passed and when it is  
         transferred back to the calling parameter. For structures that contain
         tables, performance may be reduced considerably. Therefore, you should
         not do this.                                                                               
    I created the parameters with reference to table-fields, what do you mean by 'Call by value'check box usage there.
    Is it mean ...if i change the contents of the field in FM will it pass back to the structure which i refered to this parameter, in this case its table-field.
    Thanks
    jaya

  • Remote Function Module call from ECC to CRM (how to pass parameters?)

    Hi there,
    I have a remote FM that I would like to call from ECC to CRM. The FM is remote-enabled, so I assume that I can call this from CRM. However, in CRM some of the table structures that is required are not available. Hence, my export/import parameters won't be match, unless I create those types in CRM, but this is going to major work!! 
    How do we pass/import the parameters since the data type in ECC is vastly different/not available in CRM?
    Cheers

    The structure will need to be defined in CRM.

Maybe you are looking for