RFC Call from BSP Page

Hello All,
I have a standard SAP BSP application(which is statefull, but does not have a script for handling WINDOW closing EVENT , for removing the orphaned sessions, also I cannot add that code now as it's standard).
In one of the bas page I'm calling an RFC function module to a second R/3 system.
When I call the RFC and after doing some processing if I close the application( Please note that underlying session is still active), I still can see the RFC Login in 2nd system.
Is there any way to remove the RFC connection immediately after the RFC call? so that there is no persistent RFC connection, and a connection will be established only on demand.
Regards
Geogy

Hi Geogy,
Please use the FM "RFC_CONNECTION_CLOSE" after the corresponding RFC call with the same destination.
This will close the connection opened by the previous call.
Thanks
Madhan

Similar Messages

  • Rfc call from html page

    i wrote html code for entering username and password.
    then i got output in html page as
    SAP LOGON SCREEN
    USER NAME
    PASSWORD
               ENTER
    when the user press enter button both username and password has to check with data in ztable in sap.
    validation has to done.
    if input not match with sap ztable it should produce error message when user press enter buuton in html
    please give me some steps to do rfc

    Hi,
    It is not possible to intract backend system from html alone, even we are not able to write java scripts too. So try to SAPNW to develope your application.
    If you decide to create application via SAPNW then you can go with following steps,
    1. Create application (Application, component, window and view)
    2. Import model (it needs JCo details)
    3. In controller create an object for function module which one you imported, bind it to model node, assign user name and password and use "exec" function to execute and get return values from backend system through another model node and display result as you wish.
    4. Build, Deploy and Run your application
    Good Luck!

  • Excel sheet generation through RFC call from a BSP application

    Hi,
      I am calling a RFC FM ( in R3)  in Event handler 'OnInputProcessing' of a BSP application in a SRM server.
    That function submits a report program which geneates a excel sheet using download FM . Excel sheet is not getting generated.
    But when i am calling this RFC FM  (in R3) from a report program ( in srm server)
    this is generating an ecel sheet.
    I want to have call RFC from BSP application.
    I tried the way of submit a program ( which contains RFC call) from BSP application ,but it is also not generating excel sheet.
    My ultimate AIM is to generate excel sheet by trigerring CALL or submit from BSP
    application.
    can any one propose solution for it.
    Useful answers will be rewarded.

    Hi,
    Which FM is it. I guess that the download generated is a SAP gui oriented solution, which will never work in a web environment
    Eddy
    PS. Reward useful answers and earn points yourself

  • Download to excel in different tabs from bsp page

    Hi all,
    I have a requirement in which I have to download to xl-sheet in different tabs based on some conditions from a bsp page.
    I am successful in downloading data into different tabs.
    Now I had written the piece of code required to download to xl in a function module
    and I am calling that function module when pressing a button in bsp page.
    When I run the fm seperately its working but when I run it from bsp page its not working.But while debugging I found that the fm is being called and executed perfectly without any errors.
    But the xl is not being created on our side.
    Can anyone suggest me how to proceed on this.
    Helpful answers will be rewarded.
    Thanks,
    Uga

    Hi Raja,
    Yes I am using ole objects.
    For more clarity I am alos pasting my code.
    If this is not possible then please guide how to achieve this in BSP.
    *******************CODE*****************************************
    include ole2incl.
    data: w_cell1 type ole2_object,
    w_cell2 type ole2_object.
    *--- Ole data Declarations
    data: h_excel type ole2_object, " Excel object
    h_mapl type ole2_object, " list of workbooks
    h_map type ole2_object, " workbook
    h_zl type ole2_object, " cell
    h_f type ole2_object, " font
    gs_interior type ole2_object, " Pattern
    worksheet type ole2_object,
    h_cell type ole2_object,
    h_cell1 type ole2_object,
    range type ole2_object,
    h_sheet2 type ole2_object,
    h_sheet3 type ole2_object,
    gs_font type ole2_object,
    flg_stop(1) type c.
    Internal table Declaration
    data:gt_kna1 type standard table of kna1,
         gt_knvv type standard table of knvv,
         wa_kna1 type kna1,
         wa_knvv type knvv.
    types: data1(1500) type c,
    ty type table of data1.
    data: it type ty with header line,
    it_2 type ty with header line,
    it_3 type ty with header line,
    rec type sy-tfill,
    deli(1) type c,
    l_amt(18) type c.
    data: begin of hex,
    tab type x,
    end of hex.
    field-symbols: <fs> .
         constants cns_09(2) type n value 09.
    assign deli to <fs> type 'X'.
    hex-tab = cns_09.
    <fs> = hex-tab.
    data gv_sheet_name(20) type c .
    SELECT kunnr name1
      INTO corresponding fields of table gt_kna1
      FROM kna1
    UP TO 1000 ROWS.
    SELECT kunnr vkorg
      INTO corresponding fields of table gt_knvv
      FROM knvv
    UP TO 3 ROWS.
    loop at gt_kna1 into wa_kna1.
    concatenate  wa_kna1-kunnr  wa_kna1-name1 into it separated by deli.
    append it.
    clear it.
    endloop.
    loop at gt_knvv into wa_knvv.
    concatenate wa_knvv-kunnr wa_knvv-vkorg into it_2 separated by deli.
    append it_2.
    clear it_2.
    endloop.
    if h_excel-header = space or h_excel-handle = -1.
    *start Excel
    create object h_excel 'EXCEL.APPLICATION'.
    endif.
    call method of h_excel 'Workbooks' = h_mapl.
    set property of h_excel 'Visible' = 1.
    *add a new workbook
    call method of h_mapl 'Add' = h_map.
    gv_sheet_name = 'KNA1'.
    get property of h_excel 'ACTIVESHEET' = worksheet.
    set property of worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
    data l_rc type i.
    call method cl_gui_frontend_services=>clipboard_export
    importing
    data = it[]
    changing
    rc = l_rc
    exceptions
    cntl_error = 1
    error_no_gui = 2
    not_supported_by_gui = 3
    others = 4.
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 1.
    PERFORM err_hdl.
    call method of h_excel 'Range' = range
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    call method of range 'Select'.
    *PERFORM err_hdl.
    call method of worksheet 'Paste'.
    ****for second sheet**********
    GV_SHEET_NAME = '2ND SHEET'.
    gv_sheet_name = 'Knvv'.
    get property of h_excel 'Sheets' = h_sheet2 .
    call method of h_sheet2 'Add' = h_map.
    set property of h_map 'Name' = gv_sheet_name .
    get property of h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
    call method cl_gui_frontend_services=>clipboard_export
    importing
    data = it_2[]
    changing
    rc = l_rc
    exceptions
    cntl_error = 1
    error_no_gui = 2
    not_supported_by_gui = 3
    others = 4.
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 1.
    PERFORM err_hdl.
    call method of h_excel 'Range' = range
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    call method of range 'Select'.
    PERFORM err_hdl.
    call method of worksheet 'Paste'.
    Can you people give me inputs so that I can proceed further.
    Thanks,
    Uga

  • How to send/set parameter from BSP page to iview

    Dear Expert,
    Can advise me how to send or set parameter from BSP page to iview ?
    http://xxx.xxx.com/irj/portal?navigationtarget=roles://pcd:portal_content/FLD.ObjetLibrary/FLD.Iviews/FLD.CRM/ET/bsppage.htm?lv_param=xxx
    I want to view my bsp page in portal but with parameter value.
    I can open my bsp page without parameter value like link below :
    http://xxx.xxx.com/irj/portal?navigationtarget=roles://pcd:portal_content/FLD.ObjetLibrary/FLD.Iviews/FLD.CRM/ET/
    Thnx & Regards,
    Pieter

    Hi,
    your BSP page get's integrated via an iFrame. So, simply speaking, it's not possible to pass an parameter back.
    But what you can try is to use the Portal DataBag component. In the BSP page, store the information you want to pass in the browser. The iView/Portal than has to check if there is a new parameter / value stored.
    SAP Help: http://help.sap.com/saphelp_nw70/helpdata/en/68/322a9261c54e51b7965f86aac3dae2/frameset.htm
    br,
    Tobias

  • RFC call from Excel using VBA

    I am trying to do an RFC call from Excel to SAP using VBA. RFC is working fine for most the RFC enabled Function Modules except DDIF_FIELDINFO_GET and DDIF_FIELDLABEL_GET.
    What can be the reason for this?
    Can someonme please help me with a macro code where these FMs are working.
    Also can someone please help me with some tutorial on SAP connection with Excel.
    <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
    Edited by: Alvaro Tejada Galindo on Nov 12, 2008 9:14 AM

    Hello Jon.
    DDIF_FIELDINFO_GET is not working for me either. But I have used another FM (/ZOPTION/LIVE_DDIF_FIELDINFO):
    Public Sub RFC_FIELDINFO()
    Dim Func As Object
    Dim sapConn As Object
    Dim tblFIELDTAB
    Dim tblFIXED_VALUES
    Dim intRow%
    Dim intCol%
    '* Sub     : Call FM /ZOPTION/LIVE_DDIF_FIELDINFO                         *
    '* Author  : Holger Köhn                                                  *
    '* Created : 23.08.2014                                                   *
    '* Changed :                                                              *
    ThisWorkbook.Sheets("TEST").Activate
    Cells.Select
    Selection.ClearContents
    ThisWorkbook.Sheets("TEST").Range("A1").Select
    '* create RFC-Connection                                                  *
    Set sapConn = CreateObject("SAP.Functions")
    sapConn.Connection.RfcWithDialog = True
    If sapConn.Connection.LogOn(1, False) <> True Then
        MsgBox "Cannot Logon to SAP"
        Exit Sub
    End If
    DoEvents
    '* run FM /ZOPTION/LIVE_DDIF_FIELDINFO                                    *
    Set Func = sapConn.Add("/ZOPTION/LIVE_DDIF_FIELDINFO")
    Func.Exports("TABNAME") = "AUFK"
    Set tblFIELDTAB = Func.Tables("FIELDTAB")
    If Func.Call = False Then
         MsgBox Func.Exception
         Exit Sub
    Else
        Application.ScreenUpdating = False
            For intCol = 1 To tblFIELDTAB.ColumnCount
                ThisWorkbook.Sheets("TEST").Cells(1, intCol).Value = tblFIELDTAB.ColumnName(intCol)
            Next
            If tblFIELDTAB.RowCount > 0 Then
                For intRow = 1 To tblFIELDTAB.RowCount
                    For intCol = 1 To tblFIELDTAB.ColumnCount
                        ThisWorkbook.Sheets("TEST").Cells((intRow + 1), intCol).Value = tblFIELDTAB(intRow, intCol)
                    Next
                Next
                ThisWorkbook.Sheets("TEST").Activate
            End If
            Columns.AutoFit
        Application.ScreenUpdating = True
    End If
    '* clear tblFIELDTAB                                                      *
    Do Until tblFIELDTAB.RowCount = 0
         Call tblFIELDTAB.Rows.Remove(1)
    Loop
    Set sapConn = Nothing
    Set Func = Nothing
    Set tblFIELDTAB = Nothing
    End Sub

  • RFC Call from ABAP (R3) to Webdynpro EP

    Hi experts,
    I have a requirement to initiate a call from an ABAP program on R3 to a standard Portal (Webdynpro) API. Does anyone have any experience with this?
    I understand that normally Portal (Webdynpro) applications will make the RFC call to ABAP via the established JCO connection. However there's very limited literature elaborating how the call can be made in the other direction i.e. from ABAP R3 to Portal
    Anyone, please kindly advise how, if this can be done. Many thanks!
    Best regards,
    Lionel

    Hi,
    I'm trying to make a RFC call from the ABAP program to a built in Java method residing on EP. It is part of a suite of methods provided by the UME engine.
    Typically a call is made from a webdynpro program to a SAP ABAP function module. In this case, I'd like to make a call from the SAP ABAP report to the EP method.
    Best regards,
    Lionel

  • Making an RFC call from within the VM container

    Hi all,
    since a long time I am searching for information on how to implement an RFC call from within the VMC. The problem is that we have implemented several (p)functions in ABAP and we need to implement them in JAVA.
    Now I am searching for a way how to just call the already existing pfunctions???
    Is it possible to read CRM DB tables too?
    Thank you in advance
    Boris

    Hi Freeto,
    This may be due to the Network Failures.
    If you have triggered a job then because of the Network fluctuations the system may not respond properly and cannot execute the job.
    So, this is the cause for the failure.
    Hope you understood.
    With Regards,
    Ravi Kanth

  • Asynchronous RFC call from R/3

    I need to make an asynchronous RFC call from R/3. I receive an error message in R/3 stating that my RFC destination can only be of type I (Internal) or type 3 (R/3 system). In order for it to reach XI I need it to be of type T (TCP/IP). Any help would be appreciated.
    Here is the function call.
    CALL FUNCTION 'Z_B2B_R3_FUNCTIONAL_ACK' starting new task 'SESSION1'
       destination 'RFC2XMBSERVICE'
          EXPORTING
               MSG_TYPE            = msg_type
               ORDER_HEADER_RETURN = order_header_return
          TABLES
               RETURNCODE          = i_return.
    the RFC desitnation RFC2XMBSERVICE is of type TCP/IP which by default makes it synchronous.
    Thanks,
    Jim

    hi,
    have you tried:
    CALL FUNCTION 'Z_B2B_R3_FUNCTIONAL_ACK'
    in background task
    destination 'RFC2XMBSERVICE'
    EXPORTING
    MSG_TYPE = msg_type
    ORDER_HEADER_RETURN = order_header_return
    TABLES
    RETURNCODE = i_return.
    commit work.
    Regards,
    michal

  • RFC call from a Windows Service

    Hi All,
    I have created a simple windows service which is making an RFC call to R/3 system. This is not working. Whereas the same piece of code written in a windows application projects(exe) works properly. Does anyone had similer issues working with Windows services ? Is it a known issue of RFC calls from windows service ???
    Thanks & Regards
    Ganesh Datta

    Hi Juergen,
    After I put the debug statements I figured out that connection to R/3 system is unsuccessful.
    I am using the SAP .Net Connector 2.0. I wrote a windows service which is manually started. Withing my service I am using Single sign on to connect .This is what was causing the problem. If I disable Single sign on and supply userID and password then connection is successful and also subsequent RFC calls.
    I guess within windows service Single sign on does not work.
    Thanks for your reply
    Best Regards
    Ganesh Datta

  • Best approach for RFC call from Adapter module

    What is the best approach for making a RFC call from a <b>reciever</b> file adapter module?
    1. JCo
    2. Is it possible to make use of MappingLookupAPI classes to achieve this or those run in the mapping runtime environment only?
    3. Any other way?
    Has anybody ever tried this? Any pointers????
    Regards,
    Amol

    Hi ,
    The JCo lookup is internally the same as the Jco call. the only difference being you are not hardcoding the system related data in the code. So its easier to maintain during transportation.
    Also the JCO lookup code is more readable.
    Regards
    Vijaya

  • RFC Call through BSP

    Hi ,
               Can we do a RFC call from a  system having WAS to another R/3 system not having WAS installed.
    Regards,
    Divyanshu

    Hi Divyanshu
    here is the code for RFC. Its the same as calling a  function module. You have to just specify the RFC destination name here it is 'ABC'. RFC destination you can create thru SM59
    CALL FUNCTION 'ZTM_TI_CREATE' destination 'ABC'
    EXPORTING
    STARTDATE = strtripbegin
    STARTTIME = strstarttime
    ENDDATE = strtripend
    ENDTIME = strendtime
    FIRSTDEST = watidisp-arrival
    COUNTRY = strcountry1
    REASON = strreason
    CASHADVANCE = strcashadvance
    CASHCURR = 'INR'
    BANKADVANCE = strbankadvance
    BANKCURR = 'INR'
    EMPLNO = employeeno
    IMPORTING
    REINR = watripno
    TABLES
    MESSTAB =
    ADDDEST = adddest
    Regards
    Naresh

  • Invoke MII Transaction thru RFC Call from SAP

    Hi,
    We want to get the data from Oracle DB table thru MII (12.0.2).
    We need to use RFC call from SAP to MII.
    Is it possible to invoke the MII transaction thru RFC by setting in Message Listener?
    We have used iDoc messages but not tried with RFC.
    How to do that?
    Regards,
    Senthil

    I feel MII doesn't have anything equivalent to RFC in ECC. You may try web services in an ABAP program
    Hope the article below helps you
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9f101377-0c01-0010-269f-c3ee905d583b&overridelayout=true
    Regards,
    Musarrat

  • How to call a BSP page or webdynpro from a WAD Template button

    Hi All,
    I want to implement a button on a web template which when called involes a BSP page or a web dynpro and displays the BSP page or webdynpro in a popup window.
    Thanks
    Karen

    Hi Karen,
    What you could do is create a bsp application which receives workbook id as url parameter.
    From WAD create a link to this BSP page and pass the wbook id in the url.
    Within the BSP you can then read the excel as binary string like below
    Select * from rsrwbstore into table wb_tab where workbookid = wbid.
    You can then set wb_tab-clustd as the response of the page with mime type to 'application/vnd.ms-excel'. which will open as excel
    Take a look on this weblog,
    /people/durairaj.athavanraja/blog/2006/02/06/read-sap-table-data-from-bw-webtemplate-ajax-in-bw-webtemplate
    Hope it Helps,
    Regards,
    Amit

  • Calling a BSP page from ABAP programme

    Dear Friends...
            I am cslling a BSP... from an ABAP program... for that I have used this class and also a function module to ckeck.. actually from the abap program it invoks the BSP page very nicely and as my logic for invoking the BSP is a part of the Business Object and it is associated with the Enterprise portal so... when i reach the ep and trigger that business object to instantiate the BSP page from my calling logic of abap... it goes to the ITS and port 80 or something and didnt produce the BSP.. and only the blank screen was there...kindly help me how i am supposed to instantiate the BSP from properly from ABAP by interfacing the EP... my code is given below...
    data :
        lv_url type string.
      concatenate
        'http://sapdevbp.sbic.co.za:8041/sap(bD1lbiZjPTIwMA==)'
        '/bc/bsp/sap/z_updatemng/bp.htm?bpid=' object-key-businesspartnerid
        into lv_url.
    call method cl_gui_frontend_services=>execute
      exporting
        document = lv_url
      exceptions
        others   = 1.
    please help....
    me...
    regards
    Naim

    Instead of hard coding the URL try to get the URL of the BSP application with the below code
    CALL METHOD cl_http_ext_webapp=>create_url_for_bsp_application
    EXPORTING
    bsp_application = '<BSP application name'
    bsp_start_page = <start page e.g default.htm>
    bsp_start_parameters = params " any parameter you want to pass along with url
    IMPORTING
    local_url = url.
    Then try out passing the URL to the execute function

Maybe you are looking for