Adding a function module in BSP

Hi all,
I want to add a call to an exisitng function module to run once a user exits the BSP page.
Any body has idea on how this is done ?
Uche

Hi,
I would suggest to work a bit like the logoff session described in https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/564ba07e-0701-0010-06ab-da25f77004ff
and
/people/eddy.declercq/blog/2005/11/15/enemy-of-the-state
In the start page of your app, you create a frame where your actual app resides in. Then you use the onunload event in Javascript to submit staring page. In the oninputproecessing of the BSP page in that upper frame you put the FM you want to run.
It looks a bit like this.
This is your starting page
<html>
<head>
<script language="JavaScript">
function exitBSPApplication(newTargetUrl) {
document.aform.submit();
</script>
</head>
<body scroll="no" bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onUnLoad="exitBSPApplication();" >
<iframe id="fr0" frameborder=no height=100% width=100%  src="pageb.htm">
</iframe>
<form name="aform">
    <input type="submit" name="OnInputProcessing(callFM)" value="callFM">
</form>
</body>
Then in oninputprocessing:
case event_id.
when 'callFM'.
call .... your fm
endcase.
pageb.htm is the first page of your app.
Eddy

Similar Messages

  • Calling Z function module from BSP page

    hi,
      i am calling a z function module from BSP application ROS_SELF_REG ,The z function module is inside a z function group,It does not give any sytnax error..but while running BSP application ,it is going into dump saying that Z function module is not found..Any idea why this is happening???

    Hi,
    Check whether the Z function module is spelled correctly. Also try activating the whole function group and function module in se80 transaction.
    Check whether the BSP application is calling the Z FM from the correct server/client where it is available.
    Regards,
    Harish

  • Adding a function module into a SQ01 Query

    Hi ABAP Gurus,
    I was trying to extract few dates from TSEGE Table, by linking the VTTK - HANDLE. We are trying to look at maintaining dates of shipment that were not previously used in our company.
    When I tried extracting the dates from TSEGE, they come as timestamped UTC. I was told to use the function module IB_CONVERT_FROM_TIMESTAMP with CET in a query by an external consultant we use for our services. I am familiar with creating simple queries in SQVI and convert them to SQ01, also I know to create queries in SQ01 itself. But do not know how to add a function module into an SQ01 Query.
    After checking a few threads, I realise that I should be creating a field and entering the code of the function module.
    Is there any way, anybody could instruct me in simple terms how do I go about adding a function module.
    Your help will be greatly appreciated.
    Thanks in advance!

    Dear Jogeswara,
    I have after reading a few threads, understood this small code and changed to my specification
    To convert UTC Start time from TSEGE
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        I_TIMESTAMP = TSEGE-EVEN_TSTFR
        I_TZONE = CET
      IMPORTING
        e_datlo = date
        e_timlo = time
    To convert UTC Start End from TSEGE
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        i_timestamp = TSEGE-EVEN_TSTTO
        i_tzone = CET
      IMPORTING
        e_datlo = date
        e_timlo = time
    I hope the above codes are correct. If yes, I have a doubt: TSEGE-EVEN_TSTFR & TSEGE-EVEN_TSTTO have different time in the same field, "Actual" & "Forecast", which is determined by TSEGE-EVEN_VERTY wherein 1 is Actual and 0 is Forecast. Is this something I would have to put in the code, or something that would work in the query "Selection Fields"?
    Thanks again!

  • Calling function module in bsp

    hi all,
    please help me out. i am calling function module in bsp(in on initialization). i am calling 2d_matrix fm. but in output, its not showing the graphics. i think i have to do something in layout also, to connact the FM. Plz help me if you have any idea in bsp.
    thanks in advance.

    thanks for ur reply.
    but i am using it in layout and its giving me an error.
    i have selected all the fields in on initialization.
    and in layout i am displaying my data in tabular form. correspondigly i want to display same data in graphical format.
    for that i have used a FM in on initialization(2d_matrix FM).
    but how i link it in layout . so, that i can give me a output.
    i can understand.
    plz reply me.
    thanks in advance.

  • Using Function modules in  BSP - Operations on Service Orders

    Hi,
    We are creating a custom BSP application for scheduling resources and updating appointments for resource personnel.
    The process is as follows:
    From the list of Service Orders with some product added as line item, with status OPEN, the user selects a SO and makes an online payment.
    Returning from the site, the Status of the Service order is changes to Released. Following this, the available resource is assigned to the Service order and the appointment details are populated in the Service Order. Subsequently, another line item of the Service order is set to Released.
    We are using the following function modules in the order as given below:
    To set status of a line item to Released
    1)     CRM_ORDER_INITIALIZE
    2)     CRM_STATUS_SET_INTERN_OW
    3)     CRM_STATUS_SAVE_OW
    4)     COMMIT WORK
    To assign a resource to the Service Order
    1)     WFD_RES_GET_AVAIL
    2)     CRM_ORDER_INITIALIZE
    3)     WFDS_GET_ASSIGNMENT_TO_SO_ITEM
    4)     CRM_ORDER_INITIALIZE
    5)     WFDS_CRM_SRV_ASSIGNMENT_MODIFY
    6)     WFDS_SAVE
    7)     WFD_TRANSACTION_COMMI
    To update the assignment dates in Service Order
    1)     CRM_ORDER_DEQUEUE
    2)     CRM_ORDER_INITIALIZE
    3)     CRM_ORDER_INIT_OW
    4)     CRM_ORDER_MAINTAIN
    5)     CRM_ORDER_SAVE
    6)     BAPI_TRANSACTION_COMMIT
    To set status of a second line item to Released
    1)     CRM_ORDER_INITIALIZE
    2)     CRM_STATUS_SET_INTERN_OW
    3)     CRM_STATUS_SAVE_OW
    4)     COMMIT WORK
    Using these FM’s in a report program or even in Debug mode works fine, except in the BSP’s where the behavior is random.
    The issue that we are facing:
    1)     Calling the Function modules sequentially, it takes time to update the order after execution of a BAPI/RFC and at times the order gets locked although we are using the Function Module CRM_ORDER_DEQUEUE after a logical block, and the Service Order is un-available for subsequent actions
    2)     At times, the Steps get executed correctly
    3)     At times the Steps get executed correctly after adding certain delay after each logical block of steps, but at times the time is not enough for the order to get updated.
    Can someone help us solve this un-predictable behavior?
    If someone has previously worked on such a requirement, please provide inputs on the scenario.
    Also, please let me know if there is a fail-proof procedure to ensure that the steps get executed completely and also if there is a need to use alternative BAPI’s in a specific order.
    Thanks,
    Regards,
    Siddhartha Jain

    I am afraid you would have :
    - to copy the standard FM 'MS_EXCEL_OLE_STANDARD_DATA' (it is wrapped up into EXCEL_OLE_STANDARD_DAT)
    - to comment this line in this newly created FM
      SET PROPERTY OF obj_ex_app 'Visible' = 1.
    - to call your own 'ZMS_EXCEL_OLE_STANDARD_DATA'
    That should do the trick.

  • Suggest me way for calling Function Module in BSP page

    Dear Friends,
    I want to create sales order using BSP. For that there is an bapi called BAPI_SALES_CREATEFROMDAT2. I have two ways to do that.
    1. I will create all the required structure on the BW system and then i can call the bapi.
    2. I will create another function module which calls the BAPI_SALES_CREATEFROMDAT2. and i will pass all the require parameters to my created Function module.
    In the first case i suppose to create structure for header data, order items and partner data. It is quite lenghty work.
    In the second case i need not to create any kind of structure or types-pool.
    If answer is case1 then should i create exact structure or i can create that many fields contained structure which i require?
    Suggest me that whether should i follow first case or i should follow second case and also which one is more powerful?

    Thanks for giving me answer.
    I have tried to find through BAPI Browser for BAPI_SALESORDER_CREATEFROMDAT2 but unfortunately it is not creating the structure. This is very suprising for me because as per your weblog and as per your answer it should be generated. Now i have two choices :
    1. I create same structure on 6.20 system manually for that i have to create around 100 data elements or may be more than that which are not exits on 6.20 system.
    2. I will create another function module on 4.6c system which calls BAPI_SALESORDER_CREATEFROMDAT2 and i need to pass only selected parameters.
    2nd option is suitable for me but i have doubt that is the proper way for working production?

  • Call function module from BSP page

    Hi Experts,
    I am new to ABAP and BSP as well.
    I am creating an BSP page through which I want to call an function module in R/3 which will fetch a file from the application server and place into an internal table.
    I have identified the function module.
    My questions are:
    Since I am going to have an web interface where on a button click the file should be uploaded to the intrernal table.So how do I call the function module.
    Can I use JSP and ABAP together in an BSP page.
    Thanks
    Ankit

    Hello Ankit,
    Please check the following link:
    http://help.sap.com/saphelp_47x200/helpdata/en/bd/ac1e3a0088e042e10000000a11402f/frameset.htm
    I think it will answer all your queries.
    Regards,
    Siddhesh

  • Call an Function Module from BSP page to import an CSV file to internal tab

    Hi Experts,
    I am working on creating a web application in BSP which will call the function module  ALSM_EXCEL_TO_INTERNAL_TABLE.
    This function module imports an excel file into an internal table.
    Since this is the first time I am working on BSP I am not sure how to call this FM from event handler tab in BSP page.
    What I could gather from previous posts is that we need to create an attribute which should take the value of the export parameter of the function module.But I am kind of messed up on this.
    Could u guys please help ,I would be extremely grateful.Points will be assigned for sure
    Thanking in anticipation
    Ankit

    Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
    Thanks,
    Shashi.

  • Calling Function Modules from BSP

    Hi,
    Can we call Remote Function Modules from a BSP page? If yes, can they be called from both Layout and Events and what's the proper way of calling them?
    Any help will be great.

    HI Aurang
    Calling RFC is similar to calling any other Function Module..Only thing is you need to provide the DESTINATION name  of RFC Destination..
    And you can call it from Event like OnInputprocessing...
    inside your BSP Page..
    For Example
          CALL FUNCTION 'ZFI_FUNC_IM_DISPLAY_ASSE_CA_AS' DESTINATION 'Provide the RFC Destination here'
            EXPORTING
              I_PRCAT    = 'CA'
              I_DOCNO    = VAR_DOCNO
            IMPORTING
              E_ASSE_HDR = WA_HDR
              E_TEXT     = VAR_STATUS
            TABLES
              T_ASSE_LIT = T_T900.
    If you are calling from same server..Write destination as NONE
    Cheers:)
    Mithlesh

  • Function Modules in BSP

    Hi All,
    Can anyone confirm, Wether we can call standard function modules in a BSP Application?
    Regards,

    Hi,
    For example you can call an FM from the DO_HANDLE_EVENT method of the BSP calls which is event handling class of BSP.
    Else in view while processing view you can call the SAP FM
    Or from within the controller class assigned to view you can call FM
    Best Regards,
    Pratik patel
    <b>Reward with Points!</b>

  • How to display out put of a function module in BSP?

    hi friends,
    I am using a FM to get details of a pernr in screen. But it's displaying in R/3 screen instead of in BSP page.
    plz help me in this.....
    CALL FUNCTION 'HR_ESS_ADDRESSLIST_01'
      EXPORTING
        PERNR                 = w_pernr
        NAME                  = w_ename
        ACCOUNTEDTO   = ACCOUNTEDTO1
        PAYROLLAREA   = pa
        INFOLINE            = infoline1
    IMPORTING
      RETURNCODE   =
       ADDRESSKEY    = addresskey1
      CHANGING
        MOLGA             = wa_molga
        ANSSA             = anssa1
    Regards,
    Shankar.

    Hi vijay,
    thanks for ur reply. But the thing is here they dont want desing again. By using this FM u will be seeing the result in a screen right.
    That screen as it is i have to display in BSP.
    Plz just check out once output of that FM in SE37.
    help me..if is there any ways...
    Regards,
    Shankar.

  • How to delare function module in BSP page

    hi
    i m using FM in bsp psge
    CALL FUNCTION 'TB_DOMAINVALUES_GET'
                                EXPORTING
                                  DOMAIN        =
    *                             LANGU         = SY-LANGU
                                TABLES
                                  T_DD07V       = gtab
    which is giving error massage
    Fields "Tables" is unknown .It is nither one of the specific tables nor defined by "Data" Statement .
    how to solve it
    thanks

    Hi Prashant,
    FMs are used in BSP as we do in ABAP.
    In your code thers no value for exporting parameter DOMAIN , probably that is the reason of this error.
    Search the forum before posting a question.
    Appreciate all helpful asnwers.
    Regards,
    Anubhav

  • Function module not in Function group after transport

    We have a function group ZPCAD with three function modules in it. I added two  function modules. When they were transported, the function group in the target client did not show the function modules
    I found the program in SE80 Repository info System. when I opened the Module got a message about funtion group being damaged.
    Since then, we have:
    transported the modules again. that did not help
    transported the Function group, that did not help
    Transport all function modules (old and new), that did not help.
    I went to SE37, opened the module and pressed Control, Shift, F5. The function group ZPCAD was opened indicating the module is part of the group. However, the new function modules still were not listed in the group.
    Any advice would be appreciated.
    Scott

    Some time function modules will not be displayed in function group in target systems.
    Goto SE80
    Select the function group from the list box and search for the function group.
    Right click on the functio group and select "Other Functions" and "Rebuild Object List" from the sub menu of "Other Functions".
    After doing all these, function modules will be displayed in function group.
    Regards,
    Siva.

  • 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

  • How to call a Function Module in a BSP Page?

    Hi there,
    i have no deep knowledge about BSP Programming.
    So what i wanna do is to call a Function Module in a BSP Site..
    I go to SE80... create a new empty BSP Application under that a Page with FlowLogic:
    I see the new empty BSP Page with this Test Button and Hello world in it.
    So my Funtion Module is called Z_Subscribe
    What i have to do that the FM is called when i open the BSP?
    Thanks
    Bjoern
    Edited by: bjoern bayerschmidt on Mar 3, 2009 1:01 PM

    Hi Bjoem,
    Search the forum for tutorials and blogs...
    Regards,
    Anubhav

Maybe you are looking for

  • How to clear all component in internalframe?

    I want to clear all components in the frame, but the frame isn't remove, just remove all components, it becouse i want to add anothers component. So i just want a new blank frame. how must i do?

  • Sony Xperia Z3 and PS4 controller connection

    Hey I guess this is a wellknown problem among the Xperia Z3 Dual users. I wanna connect my PS4 controller to the phone but it won't connect at all unless I do it before I connect the xperia z3 to the PS4. I wanna experience how the ps4 controller wor

  • New FAQ Entry on JVM Parameters for Large Cache Sizes

    I've posted a new [FAQ entry|http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#60] on JVM parameters for large cache sizes. The text of it is as follows: What JVM parameters should I consider when tuning an application with a larg

  • How to display the print dialogbox in crystal reports viewer for visualstudio 2013 in wpf?

    Hi, In my wpf application when i click on print button i want to display the print dialog box for current report. Here i have written like as follows. 1.MyCrystalReportsViewer.ViewerCore.ReportSource = reportDocument; 2. MyCrystalReportsViewer.Viewer

  • Mute and unmute button is actionscript 3.0

    Hi, I am wondering how to make a mute and unmute button is actionscript 3.0.  I did it before in actionscript 2.0 but not in 3.0. Here is my actionscript 2.0 code. var sound = 1; var slashMC = _root.attachMovie("slash","slash01",99); slash01._visible