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?

Similar Messages

  • 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

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

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

  • 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

  • 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

  • Call function module in new task

    I need to call a function module starting new task but the problem is that it has inporting parameters also. Please help me in doing this. Points will be rewarded.

    Look at the ABAP keywords RECEIVE RESULTS FROM FUNCTION.  This is where you can get the results from the CALL FUNCTION MODULE... NEW TASK...
    It's all in the ABAP help for CALL FUNCTION MODULE.
    matt

  • Performance issue for this function-module(HR_TIM_REPORT_ABSENCE_DATA)

    Hi Friends
    I am having performance issue for this function-module(HR_TIM_REPORT_ABSENCE_DATA) and one my client got over 8 thousend employees . This function-module taking forever to read the data. is there any other function-module to read the absences data IT2001 .
    I did use like this .if i take out this F.M 'HR_TIM_REPORT_ABSENCE_DATA_INI' its not working other Function-module.please Suggest me .
    call function 'HR_TIM_REPORT_ABSENCE_DATA_INI'
    exporting "Publishing to global memory
    option_string = option_s "string of sel org fields
    trig_string = trig_s "string of req data
    alemp_flag = sw_alemp "all employee req
    infot_flag = space "split per IT neccessary
    sel_modus = sw_apa
    importing
    org_num = fdpos_lines "number of sel org fields
    tables
    fieldtab = fdtab "all org fields
    field_sel = fieldnametab_m. "sel org fields
    To Read all infotypes from Absences type.
    RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA.
    central function unit to provide internal tables: abse orgs empl
    call function 'HR_TIM_REPORT_ABSENCE_DATA'
    exporting
    pernr = pernr-pernr
    begda = pn-begda
    endda = pn-endda
    IMPORTING
    SUBRC = SUBRC_RTA
    tables
    absences = absences_01
    org_fields = orgs
    emp_fields = empl
    REFTAB =
    APLTAB =
    awart_sel_p = awart_s[]
    awart_sel_a = awart_s[]
    abstp_sel = abstp_s[]
    i0000 = p0000
    i0001 = p0001
    i0002 = p0002
    i0007 = p0007
    i2001 = p2001
    i2002 = p2002
    i2003 = p2003.
    Thanks & Regards
    Reddy

    guessing will not help you much, check with SE30 to get a better insight
    SE30
    The ABAP Runtime Trace (SE30) -  Quick and Easy
    what is the total time, what are the Top 10 in the hitlist.
    Siegfried

  • 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

  • Test web service for a function module

    Hello,
    I have created web service for a functiona module. I can see the same service in SE80 in Enterprise Services.
    How do I test this service?
    I can see the URL in WSDL tab but when I try to execute it give me following error,
    What has happened?
    URL http://emhbssap15.domain.local:8027/sap/bc/srt/wsdl/sdef_service_name/wsdl11/ws_policy/document call was terminated because the corresponding service is not available.
    Note
    The termination occurred in system BDV with error code 403 and for the reason Forbidden.
    The selected virtual host was 0 .
    What can I do?
    Please select a valid URL.
    If you do not yet have a user ID, contact your system administrator.
    ErrorCode:ICF-NF-http-c:000-u:SAPSYS-l:E-i:EMHBSSAP15_BDV_27-v:0-s:403-r:Forbidden
    HTTP 403 - Forbidden
    Your SAP Internet Communication Framework Team
    The URL I am trying is
    http://emhbssap15.domainname:8027/sap/bc/srt/wsdl/sdef_servicename/wsdl11/ws_policy/document?sap-client=400
    Can anyone help me?
    Regards,,,
    Sunil Joyous
    Edited by: Sunil Joyous on Dec 2, 2009 1:52 PM

    Thanks Venu for your input.
    Unfortunetly we do not have Java stack on our development system. You said we can test it by SOAP UI tool. Where do I see the WSDL file for the service?
    I used WSDL from SE80 --> Service --> WSDL tab, but SOAP UI does not accept this format ?
    What are the other ways I can test this web service? I think about SAP PI, importing RFC & creating web service or creating ABAP proxies... Which is the best way to go forward in case you do not have Java stck.
    Regards,,,
    Sunil Joyous

  • Why Service Call and why not call Function module Directly in WD ABAP

    Hi,
    I have created a Webdynpro applications and the logic requires calling avrious Function modules.
    Do I need to create Service Call for each Function module or call them directly.
    It would be great if you can suggest me under what cases I need to opt for Service call
    For example, if I use 'RP_CALC_DATE_IN_INTERVAL', do I need to use Service call or call function module directly.
    Note: I have searched forums but could not get the correct answer which I want
    Thanks!

    The Service Call is really meant to be a wizard/time saver.  It has the advantage that it can generate matching context nodes/attributes for the interface of the Function Module you are calling. However everything that the service call does can also be created by hand.
    Personally I'm not a fan of what the service call wizard generates.  Its good as a time saver or for beginners, but I find I prefer to touch up the code it generates anyway. I much prefer to create a nice reusable model class with its own unit test and then consume this model class (with the service call wizard) from WD.  This model class might contain one or more function module calls depending upon what logic I need to access.

  • Calling Function Modules

    Hi All,
    We are working on a series of Performance testing Scenarios for Unified Key Mapping (UKM).
    We have function modules present in the XI machine which do the UKM translations. we plan to invoke this modules by using RFC call.
    What I would like to know is in what ways can a function module, already present in XI, be invoked from the IR and ID objects? Are RFC calls the only option...?
    Thanks in Advance...
    Sri..

    Hi Sri,
    maybe using an ABAP Mapping could facilitate this
    i.e.,
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm<a href="http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm">SAP Online Help - ABAP Mapping</a>
    Regards
      Kenny

  • How to schedule a background jobs for a function module

    HI all,
    I have created a function module (zrfc_test). Now I need to schedule it daily around 8am . the 2 tcodes used is sm36 & sm37. But I need a detail description for a function module.
    Points will be rewarded
    thanks in advance

    As there is no direct way of scheduling a function module, you may write a online program (program type 1) and call this function module in side it and schedule the program using SM36. Or you may record a CATT procedure for the function module and schedule it using SCAT transaction.Hope this helps
    Krishna

  • Requirement to call Function Module in Workflow

    Hi,
    I have been assigned to task wherein i have a requierement like this . I have created a workflow with step user decision with 2 options. Now the thing is that when user select one of option i need to call function module and based on result from
    workflow i need to done further processing. Since there is no event to trigger workflow i am using function module
    SAP_WAPI_START_WORKFLOW to trigger workflow .
    Kindly suggest me how would i call Function module in workflow. i.e. What are the ways( or by which step type facilitate
    me to call FM ) by which i should call FM and do further processing based on result.
    Thanks
    Parag

    Follow the below steps inorder to call a fucntion module from the workflow
    1. First you have to create either a business class or a Business object.... from SWO1 txn..
    2. Create a method in the BOR and while created the system will prompt a message that would you like to create by using any FM here you need to specify the name of the FM that you want to use in the workflow...
    3. ONce the method is created and the code will be generated automaticlaly by the system.. and then you have to create a standard task from PFTC txn..
    4. Once the task is created then you have to use the same task in the workflow.. by creating a activity step ...
    That's all..

Maybe you are looking for