Remote call function and destination

Hi all @SAPforums,
I used to call remotely a custom function, in a report, from many backends:
CALL FUNCTION ZFOO destination mydest
where mydest is a string containing the name of an RFC destination.
My question is: is there a way, on the destination machine, to get the name/id of the "caller" ?
The question arises from this task: I have to use the caller ID in a WHERE clause of a SELECT statement I have to write in ZFOO. I can - of course - pass the caller ID by adding a new parameter to the function, but this would make necessary a change on the CALL FUNCTION in every backend (quite expensive task, in terms of time). So if it's possible, from the callee, to get the name of the caller, I could just modify the function leaving the calls in every backend as they are.
Thanks in advance

>
Matteo Montalto wrote:
> Hello Wolfgang,
> sorry for the stupid question... what does "destination" stands for?
> Thanks for the help
Hi ,
they are two types of RFC calling is ther..
1......
CALL FUNCTION "function0module-name' DESTINATION "DEST" 
--that means you are picking data from another r/3 sytem using detination from 'DEST'..
2....
CALL FUNCTION "function0module-name' IN BACKGROUND TASK DESTINATION "DEST" 
--that means you are sending data to another r/3 sytem or any other sytem XI or and EDI
using detination from 'DEST'..
for 1 and 2..
--go to t-code SM59 and see the DEST what type of connection is and what system it is connected..
Regards,
Prabhudas

Similar Messages

  • Call Function using DESTINATION

    Hi there!
    Abapers, I'm needing some help here with RFCs.
    My destinations (SM59):
    ERP_100
    ERP_120
    ERP_130
    PI_200
    PI_300
    I have to call a function in PI from ERP. I'm doing in this way:
    CALL FUNCTION 'pi_function_module' DESTINATION 'PI_200' ...
    It's working. But the destination can not be hard coded. With the program in ERP_100 (DEV) and ERP_120 (QAS) the destination is PI_200 (PI DEV) and with the program in ERP_130 (PRD) the destination is PI_300 (PI PRD).
    How can I handle this?
    Thanks in advance!
    Best regards,
    Charles

    Hi Charles,
    Refer [this|Re: Deciding RFC destination dynamically; thread.
    I quote the last post by Micky Oestreich - "This solely depends on the naming conventions you are using. Since the name of the RFC destination is arbitrary, there is 'no' way of determining the name of the destination."
    So, your design approach could either be by building a customizing table where you maintain the destination values or use a 'CASE' statement in your code before calling the remote function module....something like:
    DATA:
      lv_own_system  TYPE logsys,
      lv_rfcdest     TYPE rfcdest.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
      IMPORTING
        own_logical_system             = lv_own_system
      EXCEPTIONS
        own_logical_system_not_defined = 1
        OTHERS                         = 2.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CASE lv_own_system.
      WHEN 'ERP_100' or 'ERP_120'.
         lv_rfcdest = 'PI_200'.
      WHEN 'ERP_130'.
        lv_rfcdest = 'PI_300'.
      WHEN OTHERS.
    ENDCASE.
    "Now call the remote function
    CALL FUNCTION 'pi_function_module' DESTINATION lv_rfcdest ...
    Hope this helps,
    Cheers,
    Sougata.

  • Call function..Destination

    Hi Experts,
    My requirement is to call a RFC Java function in SAP. The Java function is an encryption function which has 4 parameters (Password, Message, Strength128, Strength256). I need to pass the data for the parameters from SAP to JAVA. With the help of SDN, I tried to call this function in ABAP. A destination named 'INTEGRATION' is created in SM59, with the registered Program ID 'ASEncryptionHelper'. ASEncryptionHelper is the Java function name and the program ID is registered with this name only. The following is the code I wrote in my report
    DATA: XPASS TYPE STRING.
    XPASS = 'PASS'.
    CALL FUNCTION 'ASENCRYPTIONHELPER' DESTINATION 'INTEGRATION'
      EXPORTING
        PASSWORD          = XPASS
        MESSAGE             = XML_RESULT
        STRENGTH128       = ' '
        STRENGTH256       = 'X'
    I have created a RFC function module in my SAP system with the name ASENCRYPTIONHELPER
    FUNCTION ASENCRYPTIONHELPER.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(PASSWORD) TYPE  STRING
    *"     VALUE(MESSAGE) TYPE  STRING
    *"     VALUE(STRENGTH128) TYPE  BOOLEAN
    *"     VALUE(STRENGTH256) TYPE  BOOLEAN
    ENDFUNCTION.
    When I execute the program I get a runtime error "Bean ASENCRYPTIONHELPER not found on host HOSTNAME".
    I am not able tofigure out the exact problem.
    Also I wanted to know whether the way I am coding is right. Do I need to create a RFC function module in SAP also as I did above?
    Does the Uppercase of the function 'ASENCRYPTIONHELPER' matter? In SM59 the program id is mentioned as 'ASEncryptionHelper'.
    I tried to change the function name with 'ASEncryptionHelper' in the CALL FUNCTION, but then I get another error, "JCO.Server could not find server function 'ASEncryptionHelper' '. What is wrong? I am confused.
    Please guide.
    Thanks
    Anu.

    Hi,
    I didn't get your requirement wxatly but you can do as below,
    What I am assuming is you have a java batch file at your desktop and you want to encrypt the file through this batch file execution from SAP.
    Now to execute the batch file at runtime and to pass data at runtime you can use below function module
    W_RFCENCRY = 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'.
    W_RFCDEST = 'ZRFC'.
    CALL FUNCTION 'RFC_REMOTE_PIPE'
          DESTINATION W_RFCDEST
          EXPORTING
            COMMAND               = W_RFCENCRY
          EXCEPTIONS
            COMMUNICATION_FAILURE = 1
            SYSTEM_FAILURE        = 2
            OTHERS                = 4.
    Here ZRFC is the RFC created in SM59 as below
    1) select TCP/IP and create ZRFC
    in program option type as below C:\RfcSdk\bin\rfcexec.exe
    Note: RFCDSK folder is required to execute the batch file at your workstation at path specified as above
    2) In activation type select start on front end work station radio button.
    Now save the RFC and check the connection, same will be there if RFC SDK folder is available as specified in the program option
    In W_RFCENCRY give the inputs that you want to pass with the batch file.
    here I have mentioned as 'C:\Encrypt\enc.exc C:\Encrypt\test.txt'. in the program where C:\Encrypt\enc.exc is the path for batch file and C:\Encrypt\test.txt is the path of the file on the work station which is to be encrypted.
    Hope this will help you, I think at your end batch file can be different and inputs to be passed in the batch file can also be different.

  • Call function and call customer function

    Hi
    Can anybody let me know what is the difference between CALL FUNCTION AND CALL CUSTOMER- FUNCTION .
    i know call customer- function is used while we r working on user exits .
    but is their any specific reason of difference ...
    Thanks

    CALL CUSTOMER-FUNCTION function_exit parameter_list.
    Effect
    This statement can be used in programs delivered by SAP. It includes the function module exit specified in function_exit . The function module exit is a customer exit. In an SAP program, it enables you to call a function module provided by SAP and implemented by the customer.
    The indicator function_exit must be a three-digit text field literal. A function module exit is specified by SAP using the transaction SMOD and can be activated using the transaction CMOD in customer systems.
    Specifications by SAP
    An empty or partly implemented function module must be assigned to the function module exit using the transaction SMOD. The name of the function module consists of EXIT_, the program name, which contains the statement CALL CUSTOMER-FUNCTION, and the three-digit indicator in function_exit. The interface of the function module is completely defined by SAP.
    Activation in the customer system
    The transaction CMOD enables the customer to implement the source code of the function module within an enhancement project and to activate the function module exit. If the function module exit is not activated, the statement CALL CUSTOMER-FUNCTION is ignored. If the function module is activated, the corresponding function module is called in the same way as the general function module call.
    Syntax and meaning of the parameter_list for the assignment of the actual parameters to formal parameters and for the exception handling are the same as in a general function module call. It is not possible to dynamically fill the interface.
    CALL FUNCTION func
    Syntax
    CALL FUNCTION func { parameter_list
                       | parameter_tables }.
    Effect
    This statement calls the function module specified in func. The identifier func must be a character-type data object, which contains the name of a function module in uppercase letters during the statement execution. Each function module of an SAP system has a unique name, which is why you need not specify the function group.
    Use additions parameter_list or parameter_tables (as of release 6.10) to statically or dynamically assign actual parameters to the formal parameters of the function module and return values to the non-class-based exceptions.
    Note
    If the name of a function module is specified by a constant or as a literal, the extended syntax check can check the statement.
    Exceptions
    Catchable Exceptions
    CX_SY_DYN_CALL_ILLEGAL_FUNC
    Cause: The called function is known but not active.
    Runtime Error: CALL_FUNCTION_NOT_ACTIVE
    Cause: The called function is unknown.
    Runtime Error: CALL_FUNCTION_NOT_FOUND
    CX_SY_DYN_CALL_ILLEGAL_TYPE
    Cause: The type of the actual parameter does not fulfill the requirements of the function interface.
    Runtime Error: CALL_FUNCTION_CONFLICT_GEN_TYP
    Cause: The actual parameter does not have the length expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_LENG
    Cause: The actual parameter does not have the type expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_TYPE
    Cause: Only those functions can be called in the update task that are intended for it.
    Runtime Error: CALL_FUNCTION_NO_VB
    Cause: An actual parameter does not fulfill the alignment requirements of the respective formal parameter.
    Runtime Error: CALL_FUNCTION_WRONG_ALIGNMENT
    CX_SY_DYN_CALL_PARAM_MISSING
    Cause: The function expects a parameter, which has not been passed by the caller.
    Runtime Error: CALL_FUNCTION_PARM_MISSING
    CX_SY_DYN_CALL_PARAM_NOT_FOUND
    Cause: The caller has passed a parameter, which is not known to the function.
    Runtime Error: CALL_FUNCTION_PARM_UNKNOWN
    plz reward points if it helps

  • Remote call function troubleshooting

    I am trying to connect to a target ECC6.0 system from 46c system using SM59 (remote logon). For some reason it keeps displaying the login screen everytime even though I have specified the user and password details. The login screen shows up evertime with current user id in source system.
    Is there any configuration that needs to be done in source or target system so that the user details are passed correctly?

    >
    Matteo Montalto wrote:
    > Hello Wolfgang,
    > sorry for the stupid question... what does "destination" stands for?
    > Thanks for the help
    Hi ,
    they are two types of RFC calling is ther..
    1......
    CALL FUNCTION "function0module-name' DESTINATION "DEST" 
    --that means you are picking data from another r/3 sytem using detination from 'DEST'..
    2....
    CALL FUNCTION "function0module-name' IN BACKGROUND TASK DESTINATION "DEST" 
    --that means you are sending data to another r/3 sytem or any other sytem XI or and EDI
    using detination from 'DEST'..
    for 1 and 2..
    --go to t-code SM59 and see the DEST what type of connection is and what system it is connected..
    Regards,
    Prabhudas

  • Calling functions and inserting tables based on values entered

    Hello Everyone,
    I am creating a function as below:
    create or replace function func(flags in number,Ctry in varchar2) return number
    is
    maxv number;
    flagv number;
    begin
    flagv:=1;
    select max(num) into maxv from A;
    if flags =1 then
    insert into A(num,nam) values(maxv+1,Upper(Ctry));
    else
    flagv:=0;
    end if;
    return flagv;
    end;
    The function takes two parameters-The first one will be either 0 or 1.The second one will be name of a country.
    If the first parameter is 1 then we would insert the country name passed, to the table name A.If its 0 then no insertion occurs and the function would return a value 0.
    On compiling the function I get a success!.
    When I do a
    SQL>select distinct func(0,'UK') from B;
    it works well and returns 0
    However when I do
    SQL>select distinct func(1,'UK') from B;
    I expect an output of 1 & also expect UK to be inserted as anew row in the table A.However It throws an error saying "ORA-14551: cannot perform a DML operation inside a query .."
    It is very important for me to use select to call the function, as my application would fire a select with that function and based on the value entered would insert or not insert at the back end.
    Is there any way out to do this??
    variable temps number
    exec :number :=func(1,'UK');
    does work but I cant use this in my application.
    Hope you can help! Thanks!

    create or replace function func(flags in number,Ctry in varchar2) return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    maxv number;
    flagv number;
    begin
    flagv:=1;
    select max(num) into maxv from A;
    if flags =1 then
    insert into A(num,nam) values(maxv+1,Upper(Ctry));
    COMMIT;
    else
    flagv:=0;
    end if;
    return flagv;
    end;
    Is the above changes in BOLD enough or I need to do something else too in order to incorporate the autonomous transaction??
    I am not too familiar with autonomous transaction.Could you please suggest the changes I need if any more required??
    Thanks a ton for your suggestions!
    Message was edited by:
    user579245
    Message was edited by:
    user579245

  • Plain call function versus destination 'none'

    we have an RFC enabled function module which is being used as an rfc by external calls but is also used within the same sap system as a conventional function mdoule.
    Currently the call in the same sap system uses a DESTINATION 'NONE' clause and I have noticed that in the SE30 Runtime analysis there is sometimes an expensive 'WAIT for RFC' against this function module call.
    Can I simply remove the DESTINATION 'NONE'  clause or is there a good reason for it being there?
    Will a call without the clause always be more efficient than one with it or is there no difference?

    Currently the call in the same sap system uses a DESTINATION 'NONE' clause and I have noticed that in the SE30 Runtime analysis there is sometimes an expensive 'WAIT for RFC' against this function module call.
    I wish I had a running SAP system to quickly test this. Did you enable also profiling of RFC calls in SE30? Couldn't the trivial reason just be that the function module takes some time and since it's a synchronous calls the calling program has to wait for it to return?
    Can I simply remove the DESTINATION 'NONE' clause or is there a good reason for it being there?
    Well, I'd be really careful and first make sure that I understand why somebody put it there. Note that an RFC call is executed in it's own context (e.g. see comments in ABAP online documentation on [RFC destination|http://help.sap.com/abapdocu_70/en/ABENRFC_DESTINATION.htm]), so if that was the reason why the destination 'NONE' was introduced you probably shouldn't change it.
    Also, a [synchronous RFC call|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DESTINATION.htm] triggers an implicit database commit. In theory a program shouldn't rely on that, but I've seen my fair share of programs where developers were not aware of some side effects (and actually relied on them).
    Or how about a funky setup where your RFC module actually has coding to call the original system back (i.e. usage of RFC destination 'BACK'); so removing the 'NONE' should cause trouble in this case as well...
    There's probably lots of other possible traps once you start thinking about it. Most likely they are not relevant, but it definitely helps a lot if you can judge the skill set of the programmer who introduced this possibly unnecessary  RFC call...
    As far as performance is concerned I doubt that you'd gain much if it's a synchronous RFC (and the function module runs for some time and is not executed tons of times). Note though that RFC calls are limit to some stricter resource management (e.g. they can be controlled via quite a few profile parameters), so your RFC might timeout due to lack of resources, where your direct function call wouldn't do that. But if your RFC does some substantial work I doubt that the overhead for the RFC calls will be measurable.
    Cheers, harald

  • Remote call function by linkserver

    Hi Every Body
    I am running remote function  by linkserver ,My problem is that i want to set out put of function in variable as below:
    Declare @DBRemote [nvarchar](100);
    Declare @SqlRemote [nvarchar](500);
    Declare @result INT;
    set @DBRemote = '[TfiAutomationMain]'
    set @SqlRemote = 'SELECT * FROM OPENQUERY([10.0.0.139], ''SELECT ' + @DBRemote +  '.dbo.fn_GetInStock('+ CONVERT(NVARCHAR(50),1395) +')'')'
    SELECT @result
    EXEC @result = @SqlRemote --<= instead of EXEC  @SqlRemote
    SELECT @result
    but it makes error.
    Thanks for any guides.
    Regards
    Ali

    Try
    Declare @DBRemote [nvarchar](100);
    Declare @SqlRemote [nvarchar](500);
    Declare @Output table (Result INT);
    set @DBRemote = '[TfiAutomationMain]'
    declare @Result int
    set @SqlRemote = 'SELECT * FROM OPENQUERY([10.0.0.139], ''SELECT ' + @DBRemote + '.dbo.fn_GetInStock('+ CONVERT(NVARCHAR(50),1395) +')'')'
    --print @SQLRemote
    insert into @Output (Result)
    execute (@SQLRemote);
    select @Result = result from @Output
    select @Result as myResult -- remote execution result of the scalar function
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Problem  of  javafx2   remote  call  ejb3 and jndi data source

    netbean7.2 javafx2 glassfish3.1.2.2
    My javafx2 project through jndi remote access the ejb and data source,
    I select to run as an independent in netbeans ,without problems!
    However, When I select it to run as the web start. Or in the browser inside always error!
    Want a lot of ways it is not solved, especially to help!
    Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
    at sun.plugin2.applet.Plugin2ClassLoader $ 2.run (Unknown Source)
    at java.security.AccessController.doPrivileged (Native Method)
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper (Unknown Source)
    at sun.plugin2.applet.JNLP2ClassLoader.findClass (Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0 (Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass (Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass (Unknown Source)
    at java.lang.ClassLoader.loadClass (ClassLoader.java: 356)
    at java.lang.Class.forName0 (Native Method)
    at java.lang.Class.forName (Class.java: 264)
    at com.sun.naming.internal.VersionHelper12.loadClass (VersionHelper12.java: 63)
    at javax.naming.spi.NamingManager.getInitialContext (NamingManager.java: 671)
    ... 47 more

    The program has been signed (unlimited access). This is jvm tracking information, What can I do?
    java.io.FileNotFoundException: \D:\eejj\JavaFXApplication18\dist\modules\jsr173_1.0_api.jar
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.access$000(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$1.next(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$1.hasMoreElements(Unknown Source)
         at java.net.URLClassLoader$3$1.run(Unknown Source)
         at java.net.URLClassLoader$3$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader$3.next(Unknown Source)
         at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
         at sun.misc.CompoundEnumeration.next(Unknown Source)
         at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
         at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.getNextElement(Unknown Source)
         at com.sun.naming.internal.VersionHelper12$InputStreamEnumeration.hasMore(Unknown Source)
         at com.sun.naming.internal.ResourceManager.getApplicationResources(Unknown Source)
         at com.sun.naming.internal.ResourceManager.getInitialEnvironment(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
    java.io.FileNotFoundException: \D:\eejj\JavaFXApplication18\dist\lib\grizzly-websockets.jar
    java.io.FileNotFoundException: \D:\eejj\JavaFXApplication18\dist\lib\grizzly-http-ajp.jar
    eg.....(<font color=red > a lot of *.jar find nothing </font> )
    java.lang.RuntimeException: java.lang.ExceptionInInitializerError
         at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:251)
         at com.sun.glass.ui.View.handleMouseEvent(View.java:528)
         at com.sun.glass.ui.View.notifyMouse(View.java:922)
         at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
         at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
         at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:67)
         at java.lang.Thread.run(Unknown Source)
    <font color=red >
    Caused by: java.lang.ExceptionInInitializerError
    </font>
         at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesRegistry.java:79)
         at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesRegistry.java:67)
         at com.sun.enterprise.module.single.StaticModulesRegistry.<init>(StaticModulesRegistry.java:66)
         at org.glassfish.internal.api.Globals.getStaticHabitat(Globals.java:84)
         at com.sun.enterprise.naming.impl.SerialInitContextFactory.<init>(SerialInitContextFactory.java:236)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at javafxapplication18.NewClass.v(NewClass.java:51)
         at javafxapplication18.JavaFXApplication18$1.handle(JavaFXApplication18.java:50)
         at javafxapplication18.JavaFXApplication18$1.handle(JavaFXApplication18.java:42)
         at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
         at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
         at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
         at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
         at javafx.event.Event.fireEvent(Event.java:171)
         at javafx.scene.Node.fireEvent(Node.java:6863)
         at javafx.scene.control.Button.fire(Button.java:179)
         at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
         at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
         at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
         at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
         at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
         at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
         at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
         at javafx.event.Event.fireEvent(Event.java:171)
         at javafx.scene.Scene$MouseHandler.process(Scene.java:3324)
         at javafx.scene.Scene$MouseHandler.process(Scene.java:3164)
         at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3119)
         at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1559)
         at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2261)
         at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:228)
         ... 6 more
    <font color=red>
    Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.class.path" "read")
    </font>
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at com.sun.enterprise.module.single.ProxyModuleDefinition.<clinit>(ProxyModuleDefinition.java:185)
         ... 59 more
    帖子经 user7993481编辑过
    帖子经 user7993481编辑过
    帖子经 user7993481编辑过
    帖子经 user7993481编辑过

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Calling a remote enabled function module which does not exist in caller sys

    Hi,
    I have a a system ABC from which I am trying call a rfc enabled fm(Test) present in system XYZ.
    The fm(Test) does not exist in the system ABC so I am getting generation errors and dumps.
    Is there a way for me to call these remote enabled function modules which does not exist in the caller system without the obvious errors etc.
    Is there any special way.
    Thanks

    Hi,
    please check this sample:
    REPORT  zcallfm                                 .
    DATA: xv_return TYPE sysubrc.
    CALL FUNCTION 'DOESNOTEXIST'
    DESTINATION   'NOWHERE'
    EXPORTING     caller                = sy-sysid
    IMPORTING     return                = xv_return
    EXCEPTIONS    system_failure        = 1
                  communication_failure = 2
                  OTHERS                = 4.
    It shouldn't throw any generation errors in your system!
    Regards,
    Klaus

  • Call function destination XI exception

    Hello,
    in R3 i call to function in XI, it's follow:
    call function 'XXX'
    --destination 'XI'
    --exporting
    AA = aa
    --importing
    BB = bb
    --exceptions
    system_failure = 1
    communication_failure = 2
    other = 3
    when this call produce a exception, why sometimes I can not see anything in XI - SXMB_MONI / runtime workbench -?
    thank you very much

    HI,
    If in case the message failed at entry point i.e. RFC sender communication channel, then it would not be available in SXMB_MONI.
    You may trace it from Communciation Channel Monitoring from RWB..
    Thanks
    Swarup

  • Doubt in call function

    Hi,
    Call Function 'FM' starting new task task-name
    Exporting
    What does this statement does.

    Hi
    chk this out
    CALL FUNCTION STARTING NEW TASK
    Variant 2
    CALL FUNCTION func ...STARTING NEW TASK task name.
    Extras:
    1. ... DESTINATION dest
    2. ... DESTINATION IN GROUP group name
    3. ... DESTINATION IN GROUP DEFAULT
    4. ... PERFORMING form ON END OF TASK
    5. ... EXPORTING  p1 = f1    ... pn = fn
    6. ... TABLES     p1 = itab1 ... pn = itabn
    7. ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    Starts the function module func asynchronously in a new session. In contrast to normal function module calls, the calling program resumes processing as soon as the function module is started in the target system. It does not wait until the function module has finished. Using CALL SCREEN, the called function module can, for example, display a screen and thus interact with the user. Note that taskname must be a valid string of at least 2 characters, preferably fewer than 8 characters. You cannot use either ' ' or SPACE as tasknames.
    Notes
    Note that under certain circumstances, an RFC may cause a database commit. For this reason, do not insert an RFC between two OpenSQL statements that open and close a database cursor (such as SELECT...ENDSELECT).
    This variant applies only from R/3 Release 3.0, so both the client system and the server system must have Release 3.0 at least.
    With this variant, the called function module must also be flagged in the Function Builder as externally callable, even if it is executed locally (without the addition Destination).
    There can be no function call to the destination 'BACK' in the called function module (for more information about the destination 'BACK', see CALL FUNCTION func DESTINATION dest).
    This variant does not allow you to execute external programs that you access from a TCP/IP-type detination asynchronously. (See the Transaction Tools -> Administration, Administration -> Network -> RFC destinations for maintaining destinations).
    Neither does this variant allow you to display images such as lists or screens in a separate window during RFC communication using a SAProuter.
    From Release 4.0 onwards, you can carry out a new, stricter system load check on RFC destinations. (In RFC destination maintenance of an R/3 connection, choose Destination -> ARFC-Optionen). Before the function module is executed, the system checks that the destination has sufficient resources available. If not, the system delays execution of the function module for a given period of time. The algorithm used to determine the system load on the target machine is the same as that used for an asynchronous RFC with the DESTINATION IN GROUP addition. Note that this option is only available for target systems from Release 3.1H onwards. This procedure is active as default.
    In principle, parallel processing makes sense whenever application servers have the necessary resources. In this case, the application servers must be configured with at least 3 dialog work processes.
    A program that is run in the background and uses RFC parallel processing requires at least 1 dialog work process per application server (because parallel processing takes place in a dialog work process).
    If the instance profile parameter 'auth/rfc_authority_check' is set to 1, the system automatically performs an RFC authorization check. The authorization check refers to the relevant function group for the function module to be called. If no authorization is found, a runtime error occurs. You can check the authorization in advance with the function module AUTHORITY_CHECK_RFC. If the RFC communication takes places in one system and in the same user context (that is, the same client and User ID) the system does not perform an RFC authority check. For more information, see: RFC Authorization Concept.
    When you are using asynchronous RFC to implement parallel windows, all these windows are closed if the caller session is the only session and terminates.
    Note that asynchronous tasks that have been started are not necessarily closed when the calling program ends.
    See also RFC Logons to the Target System (Remote Logon).
    Addition 1
    ... DESTINATION dest
    Effect
    Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable. The R/3 System where the function module is executed depends on the specified destination. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Note
    If the destination is not explicitly specified, the system uses the default destination 'NONE'.
    Note
    If, during a Remote Function Call, an error occurs in the target system, details of the error message are passed back to the calling system in the following system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields are initialized before every RFC. If a short dump or a type X message occurs, the short text of the dump is transferred to the caller, and the contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.
    In RFC-enabled function modules, no ABAP statements are allowed that would end the RFC connection (for example, either LEAVE or SUBMIT without the AND RETURN addition).
    Note
    Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you cannot use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
    Addition 2
    ... DESTINATION IN GROUP group name
    Addition 3
    ... DESTINATION IN GROUP DEFAULT
    Effect
    You use this addition to perform parallel execution of function modules (asynchronous calls) on a predefined group of R/3 System application servers.
    You use addition 2 (DESTINATION IN GROUP group name) to perform parallel execution of function modules on a predefined group of application servers. To maintain the RFC groups, choose Tools -> Administration -> Administration ->Network -> RFC destinations -> RFC -> RFC groups. The application programmer is responsible for the availability of RFC groups in the production system. In this case the group name variable must be of the type RZLLITAB-CLASSNAME
    You use addition 3 (DESTINATION IN GROUP DEFAULT) to perform parallel execution of function modules (asynchronous calls) on all currently available R/3 System application servers. However, instead of this variant, you are recommended to use an RFC group with appropriate resources for parallel processing of asynchronous calls (at least for performance reasons). Please note that the addition DESTINATION IN GROUP ' ' has the same effect as the addition DESTINATION IN GROUP DEFAULT.
    When you first call a function module with these additions, the system initializes the specified RFC group (unless the group has already been explicitly identified).
    To obtain current information about resources (that is, the resources available to process function modules), you can also initialize the RFC group explicitly in the program using the function module SPBT_INITIALIZE. You must perform this action before the first function module call.
    In both cases, the system first ascertains the currently available resources (work processes) on the available application servers (either a group of servers or all servers). By checking the current system load of each application server, the system determines how many work processes are available to execute asynchronous calls.
    After ascertaining the available resources, the asynchronous call is executed to one of the
    destinations. If no resources are available at that particular time, the system executes the
    exception routine RESOURCE_FAILURE (see the addition EXCEPTIONS). In the case of
    an asynchronous function module call, this exception must be handled by the application
    program (see example).
    No resources are made available by the system if resource availability limits are exceeded:
    Notes
    To be taken into consideration for RFC parallel processing, an application server must have at least 3 free dialog processes.
    The system triggers the exception RESOURCE_FAILURE only for asynchronous RFCs with the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT.
    At present, only one RFC group per program environment is supported for parallel execution of asynchronous calls. Using both the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT in a program is thus not allowed.
    To find out which destination was automatically selected, call the function module SPBT_GET_PP_DESTINATION immediately after the function module call with the two additions. This returns the selected RFC destination.
    If you want to delete an application server from the list of the configured RFC group at runtime (for example, when the application server is not accessible for technical reasons), use the function module SPBT_DO_NOT_USE_SERVER.
    Addition 4
    ... PERFORMING form ON END OF TASK
    While the parameters for receiving results (that is IMPORTING and TABLES parameters) are specified directly as additions in the case of "conventional" function modules (see variant 2), these are logged in the FORM routine form when making an asynchronous call (see RECEIVE).
    Notes
    If a function module returns no result, and you are not interested in error messages that arise when executing the function module, this addition (... PERFORMING form ON END OF TASK) can be omitted.
    If you want to handle the error messages that arise when executing the asynchronous function module call, you must use this addition. Also, when receiving the results in the FORM routine (see RECEIVE), you must react accordingly to the system exceptions SYSTEM_FAILURE and COMMUNICATION_FAILURE.
    With asynchronous RFC, the task name uniquely identifies the asynchronous connection and thus the context called.
    If several asynchronous function modules are executed consecutively to the same destination, you must assign a different task name to each.
    A calling program that starts an asynchronous RFC with the PERFORMING form ON END OF TASK addition cannot switch roll areas or change to an internal mode. This is because the asynchronous function module call reply cannot be passed on to the relevant program. You can perform a roll area switch with SUBMIT or CALL TRANSACTION.
    If a calling program makes asynchronous calls, finishes, and then expects responses, it cannot receive these responses.
    To wait for the reply to a started asynchronous function module, use the WAIT command with the addition PERFORMING form ON END OF TASK. Here, WAIT must be in the same program context (mode).
    Note that executing asynchronous calls is subject to a roll area change.That is, subroutines performed to receive asynchronous calls can take place while other asynchronous calls are being made. Thus as a developer you must ensure that subroutines can be executed at any time. You must not make assumptions about the implicit processing sequence.
    Addition 5
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    Passes values of fields and field strings from the calling program to the function module. In the function module, the formal parameters are defined as import parameters.
    Addition 6
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    Passes references to internal tables.
    Addition 7
    ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    While any exceptions arising in the called function module are handled by the second
    addition (see the FORM subroutine RETURN_INFO), this addition can handle two special
    system exceptions, (as with function module calls with the DESTINATION addition):
    SYSTEM_FAILURE
    is triggered, if a system crash occurs on the receiving side.
    COMMUNICATION_FAILURE
    is triggered if there is a connection or communication problem.
    In both cases, you can get a description of the error with the optional ... MESSAGE messaddition
    Note
    In principle, you should always react to these two system exceptions, whether you are making an asynchronous function module call or receiving results.
    Examples
    Calling a transaction in a seperate session.
    DATA: MSG_TEXT(80) TYPE C. "Message text
    Asynchronous call to Transaction SM59 -->
    Create a new session
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'
      DESTINATION 'NONE'
      EXPORTING
          TCODE = 'SM59'
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
        SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
      IF SY-SUBRC NE 0.
        WRITE: MSG_TEXT.
      ELSE.
        WRITE: 'O.K.'.
      ENDIF.
    Using RFC groups to parallelize function module calls(RFC parallel processing)
    TYPES: BEGIN OF TASKLIST_TYPE,
             TASKNAME(4) TYPE C, "Verwaltung der Tasks
             RFCDEST     LIKE RFCSI-RFCDEST,
          END OF TASKLIST_TYPE.
    DATA: INFO LIKE RFCSI, C,  "Message text
          JOBS TYPE I VALUE 10,  "Number of parallel jobs
          SND_JOBS TYPE I VALUE 1,  "Sent jobs
          RCV_JOBS TYPE I VALUE 1,  "Received replies
          EXCP_FLAG(1) TYPE C,  "Number of RESOURCE_FAILUREs
          TASKNAME(4) TYPE N VALUE '0001',  "Task name administration
          TASKLIST TYPE TABLE OF TASKLIST_TYPE,
          WA_TASKLIST TYPE TASKLIST_TYPE.
    DO.
      CALL FUNCTION 'RFC_SYSTEM_INFO'
           STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT
           PERFORMING RETURN_INFO ON END OF TASK
           EXCEPTIONS
             COMMUNICATION_FAILURE = 1
             SYSTEM_FAILURE        = 2
             RESOURCE_FAILURE      = 3.
      CASE SY-SUBRC.
        WHEN 0.
    Administration of asynchronous tasks
            WA_TASKLIST-TASKNAME = TASKNAME.
            CLEAR WA_TASKLIST-RFCDEST.
            APPEND WA_TASKLIST TO TASKLIST.
            WRITE: /  'Started Task: ', WA_TASKLIST-TASKNAME COLOR 2.
          TASKNAME = TASKNAME + 1.
          SND_JOBS = SND_JOBS + 1.
          JOBS     = JOBS - 1.  "Number of existing jobs
          IF JOBS = 0.
            EXIT.  "Job processing finished
          ENDIF.
        WHEN 1 OR 2.
    Handling of communication and system failure
        WHEN 3.  "No resources available at present
    Receive reply to asynchronous RFC calls
          IF EXCP_FLAG = SPACE.
             EXCP_FLAG = 'X'.
    First attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.01' SECONDS.
          ELSE.
    Second attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.1' SECONDS.
          ENDIF.
          IF SY-SUBRC = 0.
            CLEAR EXCP_FLAG.  "Reset flag
          ELSE.  "No replies
            "Endless loop handling
          ENDIF.
        ENDCASE.
    ENDDO.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST INTO WA_TASKLIST.
        WRITE:/   'Received Task:', WA_TASKLIST-TASKNAME COLOR 1,
              30  'Destination: ', WA_TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
        IMPORTING RFCSI_EXPORT = INFO
        EXCEPTIONS
          COMMUNICATION_FAILURE = 1
          SYSTEM_FAILURE        = 2.
      RCV_JOBS = RCV_JOBS + 1.  "Receiving data
        IF SY-SUBRC NE 0.
    Handling communication and system failure
       ELSE.
         READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME
                    INTO WA_TASKLIST.
         IF SY-SUBRC = 0. "Daten registrieren
           WA_TASKLIST-RFCDEST = INFO-RFCDEST.
           MODIFY TASKLIST INDEX SY-TABIX FROM WA_TASKLIST.
         ENDIF.
       ENDIF.
    ENDFORM.
    plz reward if useful

  • Standard Remote-Enabled Function Module to display data.

    Good afternoon,
    Is there any Standard Remote-Enabled Function Module which can be used to display a list of material, supplier or stocks data?
    First time, I was trying to use FM link to BW Extractor as MDEX_MATERIAL_MD for Material Attributes, but these kind of FM are not Remote-Enabled and not released.
    My second solution is to find a Standard Remote-Enabled Function Module which can be used to display a list of material, supplier or stocks data, but I haven't it yet.
    May someone help me in this?
    Thanks in advance for your answers.
    Best regards,
    Paul d'ORIGNY

    Hi,
    Suppose you want to read data from the vbrk table in ECC through a function module, then you can define the function module as "remote-enabled"(attribute tab in se37-processing type). You can try the following code out:
    FUNCTION Z_EM_INVOICE.
    *""Local Interface:*
    *"  IMPORTING
    *"     VALUE(I_FKDAT) TYPE  FKDAT OPTIONAL
    *"  TABLES
    *"      E_VBRK STRUCTURE  VBRK
    *select * from vbrk into table*
    e_vbrk where fkdat = i_fkdat.
    ENDFUNCTION.
    From BI you can call the function odule as follows:Supposing that you are calling the function module in the start routine of a dso:
    data : v_dest_system TYPE char255.
    data: l_vbrk type table of vbrk.
    v_dest_system = 'DRDCLNT010'
    CALL FUNCTION 'Z_EM_INVOICE''
    destination v_dest_system
    EXPORTING
    i_fkdat = <passing variable>
    e_vbrk = l_vbrk.
    Regards,
    Anjana.

  • How to call function module/ class method of another system.

    Suppose now i am working in System A. And i need to check the system Status of System B, System C, System D....
    my design is to provide an interface. and each system realize the interface individually.now my question is how cani call the interface, because they are in different systems.
    of course i know about the host name, port and logon information over these systems.
    who can give my some suggestions or other solutions.
    thanks in advance.
    Johnney.

    Hello,
    If u want to call a FM of the other system then that FM should be a RFC enable on one.
    <b>CALL FUNCTION func DESTINATION dest.</b>
    Effect
    Executes the function module from an external source (as a Remote Function Call or RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed in another R/3 or R/2 System. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    To maintain existing destinations, choose Tools -> Administration, Administration -> Network -> RFC destinations
    Note
    Under certain circumstances, an RFC may trigger a database commit. For this reason, RFCs must not be used between pairs of SQL statements that open and close a database cursor (such as SELECT... ENDSELECT).
    Vasanth

Maybe you are looking for