NCo 3 RfcServer: TransactionID in called function always NULL

Hello,
using NCo 3 (v3.0.1, x64) I wrote a RfcServer which receives IDocs via the function "IDOC_INBOUND_ASYNCHRONOUS". When the function is called by SAP the  TransactionIDHandler seems to work fine as these functions are called together with a TransactionID (CheckTransactionID, Rollback, ConfirmTransactionID). But if my implemented function itself is called it never belongs to the Transaction (RfcServerContext.TransactionID == NULL and RfcServerContext.InTransaction == false).
Execution sequence:
- Check transaction (with ID)
- IDOC_INBOUND_ASYNCHRONOUS (without TransactionID)
- Rollback transaction (with ID)
- Confirm transaction (with ID)
As I'm new to the NCo I wonder if this is the correct behaviour. I expect to get the transaction ID passed into the function call. Otherwise I don't know which transaction the function call belongs to. Any help appreciated.
Thanks,
Mathias
    Type[] handlers = new Type[1] { typeof(RFC_Server_Handler) };
    RfcServer server = RfcServerManager.GetServer("DEV", handlers);
    server.RfcServerError += OnRfcServerError;
    server.RfcServerApplicationError += OnRfcServerError;
    server.RfcServerStateChanged += OnRfcServerStateChanged;
    server.TransactionIDHandler = new RFC_Transaction_Handler();
    server.Start();
[RfcServerFunction(Name = "IDOC_INBOUND_ASYNCHRONOUS", Default = false)]
public void IDOC_INBOUND_ASYNCHRONOUS(RfcServerContext context, IRfcFunction function) {
    //context.TransactionID is null
    //context.InTransaction is false

Hello Mathias;
I wonder how the implementation of server.TransactionIDHandler RFC_Transaction_Handler = new ();
Thank you!

Similar Messages

  • Hey my iphone 4 has a problem regarding carrier. Its always showing searching mode and wifi-address N/A and Bluetooth address 00:00:00:00:00 and call function is disable

    hey my iphone 4 has a problem regarding carrier. Its always showing searching mode and wifi-address N/A and Bluetooth address 00:00:00:00:00 and call function is disable. Please help me. I have tried every thing ..like restore from DFU mode with out sucess.

    Refer to  Note 98458 - SAPMSSY1, CALL_FUNCTION_NOT_FOUND

  • CALL FUNCTIONS

    HI ALL
    WHERE CAN I FIND ALL THE FUNCTION MODULES USED IN ABAP AND I ALSO NEED EXPLANATIONS ....CAN ANYONE HELP
    WITH REGARDS
    VIJAY

    Hi,
    You can use the table TFDIR  to see all the fun modules in ABAP.
    see the doc  and links for further details
    Function Modules;
    Check this matter.
    Function Modules are Glopbal 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.
    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
    reward if useful
    regards,
    Anji

  • HANA Server site JavaScript how to call functions in another .js file? thanks

    In HANA Studio, I have created a .js file and a server site javaScript .xsjs file. The .js file and .xsjs file are in the same path .I create function F1() in js file. Then I want to call function F1 in xsjs file. But it always through an error “f1 was used before it was defined”. Any suggestion? Thanks very much
    .js file:
    .xsjs file:

    Hi Jim,
    Now I have found the method how to use external library. If we want to outsource some of xsjs functions to an external library, XSEngine provides a special format for this, called “.xsjslib”. Then in xsjslib file, we define functions need to be outsourced.
    In .xsjs file, we can import a library using the following code:
    $.import("<Package_Library_was_deployed>","xsjslib File Name");
    The Package_Library_was_deployed please refer to:
    Access functions inside library by this path:
    $.Package_Library_was_deployed.xsjsFileName.FunctionName();

  • How can I call functions in packages using flash builder?

    a new guy in flash developnet, I need to find out a way to import multiple packages into frames and call functions. I know how to import packages, but an error occurs error 1120 : access of undefined property. How can ı solve them?
    Is there any easy way to add Mediapomise object to the stage form the package? "addChild(loader);" does not work? or ı do not know whether it works or not, ı could not see the photo that ı took from camerauı object in android.
    thank you 

    I need to find out a way to import multiple packages into frames
    Usually, no matter where you use any classes of any package, the imports happen always in the beginning.
    If you have a specific problem with flashbuilder you should post in this forum:
    http://forums.adobe.com/community/flash_builder

  • Calling functions / setting variables in loaded SWF

    You know how you can create a Movieclip object, add a
    function or variable to it, then call that function or change that
    variable from within the SWF that includes it? I wanna be able to
    do that, only with SWFs that are loaded at run time.
    My "main" SWF is simply a menu-type thing. The user clicks a
    button in my MAIN.SWF, and the MAIN.SWF then loads the SWF that's
    associated with that button, using the AS 3.0 prescribed
    Loader()-URLRequest()-addChild() method that everyone always asks
    about.
    This works great. But now I've got some custom objects and
    such (ie., not just strings) within my MAIN.SWF that I'd like to be
    able to share with the loaded SWFs. Preferably, I'd like to use an
    accessor-type function (ie.,
    LoadedSWF.GiveMeTheCoolObject(MyCoolObject);), though at this point
    I'm willing to hack into the object itself (ie.,
    LoadedSWF.CoolObject.CoolField = MyCoolObject.CoolField;) if that's
    what it takes.
    I've tried just calling the functions and setting the fields,
    but the AS 3.0 compiler doesn't care for that sort of nonsense on
    it's generically-defined objects. Notice also that, at run time, a
    call to LoadedSWF.hasOwnObject("GiveMeTheCoolObject") returns true.
    So my big-brained colleagues, what's the magic?
    In advance, thanks for the help!
    Scott

    Kglad,
    quote:
    Originally posted by:
    kglad
    from that error message it appears your function is expecting
    a member of the MyCoolObject class, correct?
    and MyCoolObject is not an instance of that class. so, you
    need to fix that. ie, create a member of that class and use that
    class member as the function parameter.
    Heh, that's what the error message says all right. But the
    object actually IS a MyCoolObject class object. I stared at this
    thing for hours, and MyCoolObject IS an instance of that class. I
    tried various casting combinations (including casting it to an
    Object and passing that) but had no luck whatsoever.
    So I googled this particular runtime error message ("Error
    #1034: Type Coercion failed: cannot convert ") and found a ton of
    links to other people having a similar issue. Typically, the
    problem was just as you said, someone passing a button as a string,
    that kinda thing. But one guy had a problem with an object he
    derived from the Event class. After hours spent trying to get it to
    work, he tried overriding the base class' clone() method and got it
    to work:
    http://www.asserttrue.com/articles/2006/10/14/custom-events-in-actionscript-3-0
    As for my project, I took a long hard look at the overall
    architecture of my project and decided that it was best if all the
    "real work" took place in the MAIN.SWF file. This approach would
    solve a couple of other problems, and it just makes sense in a
    "separate the display from the data" mentality.
    So (and this is the interesting part) I changed the API for
    the LOADED.SWF to accept String pairs (ie.,
    LoadedSWF.AddToDisplay(Name:String, Data:String) ) instead of
    accepting MyCoolObj. Ran it, and Viola, now we're working without
    any run time exceptions. After that glorious moment, I created a
    couple of other APIs that just accepted base classes (one an int
    type, the other a function type) and was happily on my way.
    From this, I gather that passing non-base class (ie, derived
    class) objects to loaded MovieClips via custom function APIs is...
    maybe not as straightforward as we'd expect. In the grand scheme of
    things though, not a big deal: As far as I'm concerned AS3 rocks.
    Again Kglad, thanks for all the help: Your input on how to do
    this was the big push that I needed to get over the last technical
    hurdle of this project.
    To those who are reading this topic for the "how do I call
    functions and/or set variables in a loaded SWF?"
    The short answer is to cast the loaded SWF's content object
    as a MovieClip and then call the function or alter the variable:
    //Load the SWF (you've seen this code a million times)
    var LoadedSWFObj:Loader = new Loader();
    var MyURL:URLRequest = new URLRequest("LoadThisSWF.SWF");
    LoadedSWFObj.load(MyURL);
    //This is within your Event.COMPLETE handler:
    //Cast it as a MovieClip object and work with that.
    var LoadedSWF:MovieClip = LoadedSWFObj.content as MovieClip;
    // or another way to cast it is:
    var LoadedSWF:MovieClip = MovieClip(LoadedSWFObj.content);
    //Call yer function:
    LoadedSWF.CallMe();

  • 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

  • First call is always true

    I want to set the value of a numeric slider every time a sertain mode is set. I would suspect the "first call' would be the obvius solution. But for some reson it is always
    'true"
    Is there a nother good way of solving this problem, or am I doing somthing wrong?
    /REO
    Attachments:
    Rhino interface.vi ‏290 KB

    Hai,
    The first call function will always return TRUE in your case the reason is as follows:  When a VI runs for the first time this fuction returns TRUE and this VI should remain in memory (in execution mode) so that when it is called the next time it will give FALSE.  But the vi does not stay in memory i.e. when you press run button it executes and unloads from memory when execution completes.
    One Workaround is keep the VI in memory or put a while loop with unintialized shift register and should run only once! Look at the VI that i have attached.
    Hope this helps.
    With regards,
    JK
    (Certified LabVIEW Developer)
    Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
    Attachments:
    Rhino interface1.vi ‏129 KB

  • Call function problem

    Hello
    I'm calling a remote function:
    CALL FUNCTION 'Z_RFC_TEST' DESTINATION i_rfc-host
    At first it worked. But now I always get the error: "FUNCTION MODULE Z_RFC_TEST not found.
    Any idea what this could be?
    Greets.

    Hi,
      You have to check out two main things as follows:
      1. Check whether the function module exists in the remote system or not. If it exists just go the properties and check whether the remote enabled option have selected or not.If the function module is not exist just create it as a remote enabled function module. Also there might be some problem with the function group where the function module is resided. So just activate the function group.
      2. Just check out the RFC destination name. I think you are passing the RFC destination name to the variable as i_rfc-host.
    Just make sure the destination name.
    Regards,
    Sankar.

  • Calling function within function as parameter

    We're planning to switch from MS-OLEDB to Oracle OLEDB and are expecting several troubles.
    One of these is that MS supports calling functions with another function within whilst Oralce does not?
    Example (works fine with MS):
    {? = call *<FUNCTION_1>* ( ?, ?, *<FUNCTION_2>* ( ?, ?, ? ) + 1, ?, 1 )}
    This raises ORA-01036: Variablenname/-nummer ungültig with Oracle's OLEDB.
    Any ideas?
    Thanks in advance!
    Edited by: user617919 on 04.11.2011 01:28

    Hi,
    Whenever you have a problem, please post a complete test script that people can run to re-create the problem and test their ideas. In this case, include complete CREATE PACKAGE and CREATE PAGKAGE BODY statements, CREATE TABLE and INSERT statements for any tables needed, some test calls to the the package, and the results you want from those test calls gibven that data.
    Always say which versin of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    LostNoob wrote:
    --Calculate salary minus before tax deductions
    FUNCTION sal_mns_btd (emp_no IN NUMBER)
    RETURN NUMBER
    IS
    tot_mns_btd Number;
    BEGIN
    SELECT e.sal - bef_tax_ded(bef_ded_tot)
    INTO  tot_mns_btd
    FROM  emp
    WHERE empno = emp_no;
    RETURN tot_mns_btd;
    END sal_mns_btd;
    If bef_tax_ded is a function in the same package, then what you posted is a correct way to call it.
    What is bef_ded_tot? If it's a NUMBER column in emp, then what you posted makes sense. If bef_ded_tot is a local variable inside some other function, then it doesn't make sense.. How to do what you want depends on what you want, and I can't tell you how to do it unless I understand what you want.
    Also, the table alias e isn't defined. It doesn't look like you need a table alias.

  • Call function POPUP_TO_CONFIRM after Excel close

    Good morning
    I have written code like this
    DATA: EXCEL TYPE OLE2_OBJECT.
      DATA: BOOKS TYPE OLE2_OBJECT.
      DATA: BOOK  TYPE OLE2_OBJECT.
      DATA: CELL  TYPE OLE2_OBJECT.
      DATA: FONT  TYPE OLE2_OBJECT.
      DATA: FILE  TYPE OLE2_OBJECT.
      CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
      CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
      CALL METHOD OF FILE 'OPEN'
        EXPORTING
          #1 = 'C:temp8D.xls'
          #2 = 1.
    CALL METHOD OF EXCEL 'CELLS' = CELL
        EXPORTING
          #1 = 6
          #2 = 'C'.
      SET PROPERTY OF CELL 'VALUE' = zak_pomoc.
    CALL METHOD OF EXCEL 'QUIT'.
      FREE OBJECT EXCEL.
    If user has modified the 8D file I want display this file on the screen, but first function POPUP_TO_CONFIRM  should ask him if he really wants to show file.
    I make it like this.
      call function 'POPUP_TO_CONFIRM'
        EXPORTING
          TITLEBAR              = 'Display report'
          TEXT_QUESTION         = 'Display report 8D?'
          DEFAULT_BUTTON        = '1'
          DISPLAY_CANCEL_BUTTON = 'X'
          START_COLUMN          = 25
          START_ROW             = 6
        IMPORTING
          answer                = ans.
             if ans eq '1'.
    DATA gs_excel TYPE ole2_object .
      DATA gs_wbooks TYPE ole2_object .
      DATA gs_wbook TYPE ole2_object .
      DATA gs_application TYPE ole2_object .
      CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
      SET PROPERTY OF gs_excel 'Visible' = 1 .
      GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
      GET PROPERTY OF gs_wbooks 'Application' = gs_application .
    *--Opening the existing document
      CALL METHOD OF gs_wbooks 'Open' = gs_wbook
        EXPORTING
          #1 = 'c:temp8D.xls'.
    endif.
    But there is my problem because two windows: first- asking about saving the file and the second- asking about showing the file, pop up in this same time.
    What condition should I write to call second window after this first one?
    Please, any suggestions?
    Thank you.

    Hello
    I'm just beginner and there is one thing I don't understand. Between lines
    CALL METHOD OF EXCEL 'QUIT'
    and
    FREE OBJECT EXCEL
    the window 'Do you want save changes' appears. And in that moment what is the value that says if the user chooses OK or QUIT?
    If I would know that value, I could call function POPUP_TO_CONFIRM in the right moment.

  • 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.

  • Uncatchable exception: BSP calling Function Module

    Hi all,
    currently i'm facing a very weird problem. My application class calls function module
    HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
    If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
    What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
    Regards
    Mark-André

    Hi MA,
    try using ERROR_MESSAGE in the exceptions list, like this.
    CALL FUNCTION 'func_name'
         EXPORTING
              string            = text
              pos               = position
         IMPORTING
              string1           = text1
              string2           = text2
         EXCEPTIONS
              string1_too_small = 1
              string2_too_small = 2
              ERROR_MESSAGE     = 3
              OTHERS            = 4.
    Cheers
    Graham Robbo

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • How to fill data when call function of sap standard script form?

    Hi every experts,
    <Priority Normalized>
    In our system, when we log in 'FR', we can print purchase order in language Franch,in t_code:ME22N.  And when logging in 'EN', we can print it in language English, in ME22N. The English form is just only translated from Franch, with all same structure and frame.  The form is done by script form.
    And when logging in 'ZH', we create a new program, calling function smartform, instead of translating from EN language. Because of different structure and frame, I don't know the way to write script, so  I print puchase order by smartform, when logging in 'ZH'.
    But I have a new issue. Our MM module consultant needs me to print Chinese form if one condition, print English form in other condition.
    So I have no idea to solve it. Because in my program, I get data to fill smartform and call function of smartform. And I don't know how to get data to fill script form. I only know the function name, 'OPEN_FORM' 'WRITE_FORM' 'CLOSE_FORM'.....
    If I only call the several functions, I will get only frame without no data. So who can tell me how to do????
    <Urgency downgraded>
    Edited by: Suhas Saha on Jul 26, 2011 3:34 PM
    Edited by: Vinod Kumar on Jul 26, 2011 4:09 PM

    Hi,
    Normally if we look in NACE transaction, you can see that upto five different FORMS can be assigned to a single output type . i.e. for each form there will be a seperate routine through which it gets called. But it all start from the first form only.
    so you need to write your code in the ENTRY of the first form and if it does not satisfy do not go for processing of it but just exit of that form ENTRY. so that it will take you to next form.
    hope this helps.
    Thanks,
    Venkatesh

Maybe you are looking for

  • How can I publish a project so that the link to embedded flv is not lost?

    When publishing an Adobe Captivate 3 project, the embedded flv file does not play. How can I publish a project so that the link to embedded flv is not lost?

  • Cannot get Microsoft Express to work

    I have an e-mail account through the school that I go to. It is through Microsoft Express, but for some reason I cannot get that account to sync with my phone. It is claiming that the phone will not sync with the exchange. I have tried to up load whi

  • Problems with special characters when exporting to LDAP

    Hi, Im using standard report RPLDAP_EXTRACT to export data to LDAP. The problem is that the special characters (in this case polish letters) do not save correctly (we get for instance '?' instead of normal letter) I tried switching the configuration

  • How to hide the title caption of the column

    Hi friends, Can i hide the title caption of a column in a matrix. In my matrix there is only one column. i need to display its like a list box. Any one know how to hide the title caption of the column Thanks

  • Partitioning a Wide Table on RAID5--Need Advice

    We will soon have to add a new table to our database that is 2 Gig in size and growing, so we are considering partitioning it for speed. I've a lot of Oracle experience, but haven't used partitioning before. NOTE: -- The database is on RAID5 disks --