Keep alive a session between 2 BAPI calls

Hi -
I am calling several BAPIs to maintain data. I am calling from an outside system as I published the BAPIs as Web Services.
I would like that the session between 2 BAPI calls is kept, so I don't miss some session info between call #1 and call #2.
Anyone knows a way of keeping alive a session between 2 BAPI calls?
Thanks !

Try this..
<b>ARFC with Resource Management (Parallel Remote Function Call)</b>
CALL FUNCTION 'MYFUNC'
STARTING NEW TASK 'T1'
DESTINATION IN GROUP 'PRFC'
EXPORTING ...
TABLES ...
EXCEPTIONS ...
communication_failure = 100
system_failure = 101
resource_failure = 200.
IF sy-subrc= 102.
wait and retry...
ENDIF.
<b>Define ‘PRFC’via RZ12</b>
Amandeep

Similar Messages

  • Keep alive a session in CRM

    Dear CRM folks -
    I am calling CRM using BAPIs. The BAPIs are published as Web Services.
    I would like that the session between 2 BAPI calls is maintained in an optimized way so I don't make specific calls to the DB to store my session info.
    Anyone knows a way of keeping alive a session in the CRM between 2 BAPI calls?
    Thanks !

    BAPIs are just basically function modules.  Two function modules which are in the same function group are able to share information while the session is open.
    If your two BAPIs are not in the same function group(you didn't mention the names or I could have checked) then you can create a wrapper function module which has it's own variables to store the information.  Unfortunately once the RFC session/ICM Web Session is closed then you'll lose that in-memory information.
    I assume that you're making the two BAPI calls at different times which is why you're having this problem.  Like one to get user information and then one more to get some other detailed info once the user inputs something.
    Without knowing much about what you are really trying to do, my quick idea is to create a Stateful BSP in CRM which accepts all your requests.  The BSP can simply call the BAPIs(eliminate the need for the web service - unless you have some reason you need it) and then between the first and second BAPI call, the BSP will keep the state of the BAPI results in-memory.
    If you give more info, might be easier to answer your question.

  • How to keep alive a session in Web Services?

    I have to do my project, that will be including some following features:
    1. Login to Application through Web Services method. For example:
    http://mydomain.com/web-services/Login?WSDL
    2. After logging in, use mySms method to send message to Cellphone through Web Services! For example:
    http://mydomain.com/web-services/mySms?WSDL
    My questions are:
    1. How can I keep alive the session after logging in the application in Web Services? In Web, I can use "Session".
    2. If someone has not logged in the Application, he/she could not use mySms method for sending Sms. How can I do that?
    3. I know, when I invoke a Web Services, one JavaBean has been called, and this bean is persistence with his own states. It means, if I set value to parameters of this bean, these values are persistence for invoked methods by other persons.
    For example:
    mySms bean has a private field "jid" inited with NULL value.
    Person A invoked mySms.
    Then, A set jid of mySms to value "A".
    Person B invoked mySms. B got jid value. He receive the result value is "A".
    The question is, how can I set mySms bean so that mySms bean is not persistence?
    Thanks many!

    Hi,
    I can right away answer your FIRST Question.
    Since WebServices are PURELY Based on SOAP which is in tern based on HTTP, they rely on a Stateless protocol.
    I am sure you know that the HTTP is the STATELESS Protocol and so you can not maintain Session and so EACH Http REQUEST is considered as a SEPERATE REQUEST.
    Now, still you want to maintain the Session in WebServices,
    The simple answer is PASSING PARAMETERS.
    Just Maintain your Session on Client (If you are using JSPs or Servlets to CAll WEBSERVICES then maintain Session through your HTTPSession) and each time you Invoke WebService PASS ON REQUIRED Parameters.
    This Approach is Exactly like your URL REWriting OR your Parameters Passing through QUERY STRINGS.
    I hope you got what I am saying!
    Take care,
    Himanshu/

  • Session between multiple Webservice calls from PI7.0

    Hello XI SDNers,
    I am unable to overcome my Webservice session problem using SOAP (Axis) adapter. My scenario is as follows:
    I am calling a external Webservice deployed in Axis webservice engine from PI7.0, during my first call:  I call synchronous "Login" webservice and I became the response "User is Logged in"
    during my second synchronous call "GetItem", the webservice returns "The user doesn't have valid session". The two synchronous calls are executed from same scenario one after another!
    I lost my session after the "Login". Is there any way in PI 7.0 to maintain the session?
    Note: I tried the same scenario using XML SPY SOAP client, it is working!!!  it is maintaining the session between multiple webservice calls.
    Is there any suggestions to overcome this problem?
    Thanks and regards,
    Satish.

    Hi Satish,
       We are working on the same sort of scenarios, where we have to call more than one webservice in a sequential fashion using the same session id details.
        What we did was we built new xsds adding session details node using the webserive request and response xsds. And we are maintaining a sessions table which contains session id and  status fields in PI. So we send webservice request with the session id details. We wrote an UDF to get the session details from PI and set the status field as busy so that no other request uses the same session details.
       Webserive response again contains the sessions details which can be used for the next webservice request.
      Finally after all the calls set back the status to Active in PI table.
    Webservice Calls From a User Defined Function
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Hope this helps.
    Thanks,
    Vijaya.

  • HFM Web Sever Configuration--Keep Alive and Session Time Out Optimal Config

    We recently implemented an HFM 9.3.1 environment. We are using Windows 2003 Enterprise SP2 servers with IIS6. We have two HFM Web servers connecting to an application cluster with two application servers in the cluster. We were getting some errors when trying to unlock HFM cells in Workspace, but we were able to perform the functions fine on the application using the WIN32 client.
    I opened a ticket with support and they recommended modifying the subcontext.properties file located in %HYPERION_HOME%\deployments\WebLogic9\servers\Workspace\webapps\workspace\conf. They recommended changing the following settings:
    #KeepAliveInterval=30
    #SessionTimeout=60
    From what I understand, these settings are for the communication between the HFM Web Servers and the application cluster servers. I'm wondering how changing these settings may affect our environment. Are there negative effects and/or trade-offs for changing these settings? Is there a recommended threshold or maximum value?

    Hi Dinesh,
    This cannot be achieved without development enhancements to some standard SAP framework component, to introduce a "keep-alive" concept. If you are using a CMS for CTI or email integration, you need to ensure it supports keeping the communications session alive also.
    Sincerely,
    Glenn
    Glenn Abel
    Covington Creative
    www.covingtoncreative.com

  • How to keep alive a session with a timeout

    my session have a timeout of 20 minutes (it's a system setting i cannot change)
    i run a program that generates a file excel that need 60 minutes to  end.
    i cannot run the program in background because OLE and creating excel is not supported
    is there a way to avoid my session time out?
    is there a way to make the sistem don't close my session while it's creating my file excel?
    thanks,
    Giacomo

    Giacomo,
    Try it.
    REPORT  zz_keep_alive.
    CLASS lcl_trigger DEFINITION.
      PUBLIC SECTION.
        METHODS: fim_timer FOR EVENT finished OF cl_gui_timer.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    CLASS lcl_trigger IMPLEMENTATION.
      METHOD fim_timer.
        cl_gui_cfw=>set_new_ok_code( new_code = 'ONLI' ). "ONLI = Executar
      ENDMETHOD.                    "fim_timer
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    DATA: r_timer   TYPE REF TO cl_gui_timer.
    DATA: r_trigger TYPE REF TO lcl_trigger.
    PARAMETERS: p_uzeit TYPE sy-uzeit.
    AT SELECTION-SCREEN OUTPUT.
      p_uzeit = sy-uzeit.
      CREATE OBJECT: r_timer, r_trigger.
      SET HANDLER r_trigger->fim_timer FOR r_timer.
      r_timer->interval = 60.
      r_timer->run( ).
    Hope it helps.
    Rgs
    Paulo Afonso Cordeiro

  • Is possible to keep alive 2 sessions at the same time?

    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    Francesco

    fmarchioniscreen wrote:
    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    FrancescoSaving critical user information in cookies is not a good practice.Please divert your approach to scoping it in session to fix your problem.
    usage of session.set/getAttribute() accordingly.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Session Keep Alive

    I have seen that my user sessions for a room will expire if there is no activity for some period of time. After that time it looks as if the authentication token for that user cannot be used again.
    Is this expected behavior? If so, after what period of inactivity does the session become invalid?
    Ideally I would like to keep the user session alive for a controlled period as long as they stay in the room(browser is not closed). Is there a recommended "keep alive" call I can make from clients to keep sessions alive?
    Thanks,
    Barry

    I ran another test and it does seem like an auth token becomes invalid in some circumstances after a period of inactivity. I still can't pin down exactly why, but the main reason for the problem I was seeing was because I had another process that deleted the room in the background.
    If I see a pattern for how auth tokens become invalid I'll post back, but it works well enough now for my purposes.
    Jamie,
    Yes, the tokens are created using the server api.
    Thanks,
    Barry

  • Is it best practice to use a dedicated link between NX7K pair for keep-alive?

    I have been using dedicated physical 10G link between pair of NX7k for keep-alive. Is it a best practice? It seems a waste of 10G ports because keep-alives does not need that much bandwidth.
    I'm thinking just configure a dedicated VLAN interface in the default VRF, and have it routed through other devices (fir example 6509 core switches) for keep-alive. Has anyone done that before? The goal is not to use dedicated 10G ports for keep-alive.
    Thanks a lot.

    gwhuang5398 wrote:I have been using dedicated physical 10G link between pair of NX7k for keep-alive. Is it a best practice? It seems a waste of 10G ports because keep-alives does not need that much bandwidth.I'm thinking just configure a dedicated VLAN interface in the default VRF, and have it routed through other devices (fir example 6509 core switches) for keep-alive. Has anyone done that before? The goal is not to use dedicated 10G ports for keep-alive.Thanks a lot.
    I agree that using a Tengig port for this purpose is not efficient. The whole idea of peer-keepalive is to have a way to avoid split brain scenarios in case of peer-link failure. For this reason the peer-keepalives should never cross the peer-link as it defeats the original purpose I just cited. Following are some viable options:
    You can use the N7K management ports for peer-keepalive functionality. If you have redundant supervisors then make sure you use an external switch (OOB switch for example) to patch the management ports.
    You can use dedicated interfaces just like you are doing right now but that would make more sense if you had Gig ports in my opinion.
    You can run peer-keepalives inband but you need to make sure this traffic is never routed over the peer-link. It is considered a good practice to use a dedicated VRF for this purpose.
    Atif

  • Two bapi calls in the same session using PI

    Hi,
    I have a file to RFC scenario wherein I need to call a BAPI (L_TO_CANCEL) and then again, I need to call another bapi called
    "BAPI_TRANSACTION_COMMIT" in the same session. My question is, if I use RFC adapter, do I have to call the commit bapi again?
    If yes, is there anyway I can do that ?
    I believe that will be the case only if I use a proxy. Is that correct ?
    The requirement is to call these two BAPIs and finally include a success or error message in the response.
    Thanks.

    Inside the BPM you do not have a specific exception message. You can do an exception handling based on the exception, but the excpetion itself is not a real message.
    If you want a real message, you could create an ABAP proxy, which has a message like this:
    root
      - part1
           - rfc response
       - part2
            - error text
    then you can split this inside BPM and send a the response or the error.
    Of course there are other possible solutions.

  • Weblogic proxy plugin closes keep-alive connections to clients randomly

    In short we have following arhitecture:
    clients ---> wl proxy plugin 1 ----> weblogic 1
    clients ---> wl proxy plugin 2 ----> weblogic 2
    Beacuse of the application/installation specific requirements, we are not using failover, one wl proxy always forwards requests to one weblogic (simple configuration).
    Application is TR-069 protocol based (SOAP over HTTP) so it very much relays on persistence TCP connections (Connection: keep-alive). This TCP persistence has to work correctly in order that TR-069 messages are exchanged in required order, otherwise we have a error on application layer.
    Here and there we've noticed applications errors which suggest that we have some problems in TCP connection between the client and the weblogic server. After sniffing, we've noticed that weblogic proxy plugin (Apache) randomly, or because of some other reason we do not know, decides to close TCP connection to client, even app on weblogic did not request so ???
    As a result, client opens new connection to the server with new TR-069 session and it gets bounced beacuse it allready has one open on weblogic server.
    We've sniffed, traced everything we could, we were searching for patterns in time, etc... but we can not find the reason why proxy plugin decides to close the connection to the client (not to the weblogic server).
    Trace (replaced sensitive information):
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: CompleteStatusLine set to [HTTP/1.1 200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: StatusLine set to [200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> parsed all headers OK
    Thu Apr 29 15:05:50 2010 <958012725463463784> sendResponse() : r->status = '200'
    Thu Apr 29 15:05:50 2010 <958012725463463784> canRecycle: conn=1 status=200 isKA=1 clen=545 isCTE=0
    Thu Apr 29 15:05:50 2010 <958012725463463784> closeConn: pooling for '$IP$/$PORT$'
    Thu Apr 29 15:05:50 2010 <958012725463463784> request [$URL$] processed successfully..................
    !!!! Now it closes the TCP connection and inserts "Connection: close" HTTP header !!!
    WL proxy plugin conf params are:
    WebLogicCluster $IP$:$PORT$
    DynamicServerList OFF
    KeepAliveTimeout 90
    MaxKeepAliveRequests 0
    KeepAliveSecs 55
    Apache worker configuration is:
    <IfModule mpm_worker_module>
    PidFile var/run/httpd-worker.pid
    LockFile var/run/accept-worker.lock
    StartServers 2
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadLimit 200
    ThreadsPerChild 200
    MaxClients 2000
    MaxRequestsPerChild 0
    AcceptMutex pthread
    </IfModule>
    Why weblogic proxy plugin ignores Keep-alive directive and decides to close connection to the client by itself?
    Any help?

    If a WebLogic Server instance listed in either the WebLogicCluster parameter or a dynamic cluster list returned from WebLogic Server fails, the failed server is marked as "bad" and the plug-in attempts to connect to the next server in the list.
    MaxSkipTime sets the amount of time after which the plug-in will retry the server marked as "bad." The plug-in attempts to connect to a new server in the list each time a unique request is received (that is, a request without a cookie).
    Note: The MaxSkips parameter has been deprecated as the MaxSkipTime parameter.
    See also here: http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/plugins/plugin_params.html
    You said the problem arises under significant load. Maybe, it is wise to tune the number file descriptor's on your operating system. HTTP connections are nothing more than TCP sockets on the operating system. All modern operating systems treat sockets as a specialized form of file access and use data structures called file descriptors to track open sockets and files for an operating system process. To control resource usage for processes on the machine, the operating system restricts the number of open file descriptors per process. You should be aware that all TCP connections that have been gracefully closed by an application will go into what is known as the TIME_WAIT state before being discarded by the operating system.
    On most unix systems you can use netstat -a | grep TIME_WAIT | wc -l to detemine the number of socket in time_wait state. You have to check with your system adminstrator how to tune the tcp_time_wait_interval. On solaris you can use: /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000

  • Keep alive script for HTTPS service with GET method

    Hello,
    I tried to implement a keep alive to services that support HTPS connections. I’ve created a script that opens a tcp connection on port 443 and tries to do a GET of a test web page. This web page only displays “OK”.
    In a resumed form I used the following script commands:
    Socket connect host 192.168.136.134 port 443 tcp
    Socket send ${SOCKET} “GET /teste.template\n\n”
    Socket waitfor ${SOCKET}” 200 “ 2000
    Socket disconnect ${SOCKET} graceful
    I was unable to receive the expected “ 200 “response and received a message saying string not found, I used the socket inspect command to inspect the socket’s internal data buffer and the result was nothing, it seemed empty.
    I tried the same operation using a linux machine that has IP connectivity with the Webservers and I was successful.
    In the same CSS I have services configured to respond to HTTP sessions. I tried the following script and everything went well
    Socket connect host 192.168.136.151 port 80 tcp
    Socket send ${SOCKET} “HEAD /index.html\n\n”
    Socket waitfor ${SOCKET}” 200 “ 2000
    Socket disconnect ${SOCKET} graceful
    When I issued the socket inspect command I could in fact see the socket’s internal data buffer content.
    The CSS is running WebNS 5.0 build 66
    Can someone give me a help?
    Thanks,
    Ricardo Lourenço

    Hello,
    There is no direct no direct link between TCP and SSL.
    So, in spite of having success with the TCP port 443 connection the CSS will not be able to negotiate de security parameters necessary to establish the SSL session.
    This was the reason for not having success through the use of the socket commands, as i refered in my original message.
    Thanks for your collaboration,
    Ricardo Lourenço

  • Minimal Authentication for BAPI calls

    Hi,
    We use SAP Jco Library to connect SAP systems in our applications. Within the aplication we make BAPI calls to the SAP system for various operations. A typical BAPI calls we make are BAPI_DOCUMENT_CREATE, BAPI_DOCUMENT_GETLIST, BAPI_EQUI_GETLIST etc.
    For these BAPI calls it is must that the user needs SAP_ALL and SAP_NEW profile added to his profile. I would be interested to know what is the minimal profile the user needs to make these BAPI calls?
    Is there a document/link which talks about the minimum roles\profile needed for different BAPI calls byt the user.
    Regards,
    Naveen

    there's a couple of notes on that:
    [452508|https://service.sap.com/sap/support/notes/452508] describes RFC-connects coming from a portal.
    [129795|https://service.sap.com/sap/support/notes/129795] does the same for connect via Session Manager
    ... there are a couple of others - a quick search in SMP will reveal the others.
    as for your BAPIs: obviously you will need the authorizations for whatever the BAPI wants - some BAPI's require transaction code, several organisational values - e. g. creating CS-orders uses most of the I_* objects as well as the t-code for IW31.
    But that is about all - you do not need SAP_ALL and/or SAP_NEW - in fact: try to avoid it - reduce the RFC-users to what they need and no more. Keep to using BAPIs for your development, as they are much more trustworthy (securitywise) than other RFC-FM's/methods.
    In the SDN security forum are some sticky threads where you might find additional information in that direction. Its worth a look, Julius goes to great length of pain to make them interesting.

  • LB configuration - Keep Alive.

    I need to help configure proper load balancing between 2 building modules of Portal server.
    SetUp:
    Server A - Portal 1,Access Manager 1 , Directory 1
    Server B - Portal 2, Access Manager 2, Directory 2
    Logical Architecture.
    -------- Server A
    User Request -------------------->LB ------------>
    ------ Server B
    I need to configure LB in a way that It has keep Alive info for Server A and B.I think there is a configuration required in some xml/property file so that If lets say server A goes down...the LB will automatically direct the next request to server B.
    Can somebody point me in the right direction?
    Thanks.

    Do you need the SSO session created on Server A to failover to Server B or is it ok that the user has to reauthenticate if Server A goes down?
    In any case you can either configure the LB for s.c. active cookie based persistence (LB is inserting it's own cookie) or s.c. passive cookie based persistence (LB is using a predefined cookie). I guess this is what you mean by 'keep-alive info' - correct?
    Of course this does only work if no SSL is used or if SSL is terminated at the LB.
    If SSL is used the only solution is to use client-IP based persistence.
    All the above is only needed to prevent cross-talk between AM instances.
    -Bernhard

  • Keep-alive message bridge connection

    Hi,
    I have setup messaging bridge between WLS 10.3.0.0 and a JBoss Messaging queque, after about 4 hours of inactivity in a queue bridge was disconneted, is there any way to configure keep-alive connection in WLS bridge ?
    Thanks,
    Lukasz

    You can try to set the IdleTimeMaximum setting on your bridge configuration to a very large number. It specifies the maximum amount of time, in seconds, that a messaging bridge instance remains idle.
    In “asynchronous” mode, this is the longest amount of time a messaging bridge instance stays idle before it checks the sanity of its connection to the source. In “synchronous” mode, this is the amount of time the messaging bridge can block on a receive call if no transaction is involved.
    -Dongbo

Maybe you are looking for

  • Time quota issue

    hi  sap experts, when running program RPTQTAoo the systen is diaplaying the following message.. generation rules not maintained , please guide me with steps to proceed further and we are using negative Time management , regads, prasad

  • Why can't I use different programs on different computers?

    Yesterday we bought two CC subscriptions for me and my colleague. We both also work from home sometimes so I replaced my CS6 software at home with the updated software for the programs we use (Photoshop, Bridge, Illustrator and InDesign). For Acrobat

  • How do I send a message with more than 140 characters?

    Hi, I am having some problems with Firefox that just cropped up. I have been using it quite a while without incident. Now when I try to access my bank account, after I log in with the user name and password [I am at the page where I select my account

  • Windows Server 2012 Storage Spaces Simple RAID 0 VERY SLOW reads, but fast writes with LSI 9207-8e SAS JBOD HBA Controller

    Has anyone else seen Windows Server 2012 Storage Spaces with a Simple RAID 0 (also happens with Mirrored RAID 1 and Parity RAID 5) virtual disk exhibiting extremely slow read speed of 5Mb/sec, yet write performance is normal at 650Mb/sec in RAID 0? W

  • Classic Environment documents and Leopard

    I am running Tiger on a non-dual-core iMac G5. I have about 300 documents that I created in Classic Environment. I am told that Leopard does not support Classic. I would like to upgrade to Leopard. (Also, some day I will replace this Mac with a dual