Calling a function mdule from bsp

Hi all is it possible to call function module directly from  BSP ?
or do we need to use a method to calll function module.
In my function module i have  exporting parameters as tables and how to pass tables to method  from there to function module .As there are no tables option in metho creaion.
please give me some explaination
Thanks

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    DOCUMENT_DATA                    = docdata
   PUT_IN_OUTBOX                     = 'X '
   COMMIT_WORK                       = 'X '
IMPORTING
  SENT_TO_ALL                      =
  NEW_OBJECT_ID                    =
  TABLES
    PACKING_LIST                     =  objpack
  OBJECT_HEADER                    =
   CONTENTS_BIN                     =
    CONTENTS_TXT                      =  objtxt
  CONTENTS_HEX                     =
  OBJECT_PARA                      =
  OBJECT_PARB                      =
    RECEIVERS                        =  reclist
EXCEPTIONS
  TOO_MANY_RECEIVERS               = 1
  DOCUMENT_NOT_SENT                = 2
  DOCUMENT_TYPE_NOT_EXIST          = 3
  OPERATION_NO_AUTHORIZATION       = 4
  PARAMETER_ERROR                  = 5
  X_ERROR                          = 6
  ENQUEUE_ERROR                    = 7
  OTHERS                           = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
here the code
Data:   docdata  type   sodocchgi1 ,
                objpack   type ZSOPCKLSTI1,
                objhead    type ZSOLISTI1,
                objtxt     type ZSOLISTI1,
                objbin     type ZSOLISTI1 ,
                reclist   type ZSOMLRECI1,
               itab_objtxt type ZSOLISTI1.
Data: tab_lines  type i,
             P_msub  type  SODOCCHGI1-OBJ_DESCR,
              doc_size   type i, IT_HTML type table of  SOLISTI1 initial size 10,
              att_type   type SOODK-OBJTP.
        DATA : WA_IT_HTML  LIKE  LINE OF  IT_HTML,
      WA_IT_HTML  LIKE  LINE OF  IT_HTML,
        WA_OBJBIN LIKE LINE OF  OBJBIN, wa_objtxt like line of  objtxt,
        wa_objpack  like line of objpack,
    wa_reclist like line of  reclist.
Clear :                  objpack,
                objtxt,
    objhex,
                reclist,
                listobject,
                docdata,
                tab_lines,
                doc_size.
        Refresh :objbin,
                  objpack,
                  objtxt,
          objhex,
                  reclist.
LOOP AT IT_HTML INTO WA_IT_HTML.
          WA_OBJBIN-LINE = WA_IT_HTML-LINE.
          APPEND WA_OBJBIN TO OBJBIN.
          CLEAR WA_OBJBIN.
        ENDLOOP.
        p_msub = 'Diapproval'.
        docdata-obj_name  = 'Hello'.                     "text-003.
        docdata-obj_descr = p_msub.
move  docdata-obj_name to  docdata .
move  docdata-obj_name to  docdata .
*"Dear Manager,"
        wa_objtxt-line = 'Dear employee'.
        APPEND wa_objtxt  TO objtxt.
append wa_objtxt to  objtxt.
        clear wa_objtxt.
Blank line
        wa_objtxt-line = space.
        APPEND wa_objtxt  TO objtxt.
        clear wa_objtxt.
*objtxt = text-011.
   append objtxt.
        wa_objtxt-line ='This is first Line'.
        APPEND wa_objtxt  TO objtxt.
        clear wa_objtxt.
        wa_objtxt-line = 'This is second Line'.
        APPEND wa_objtxt  TO objtxt.
        clear wa_objtxt.
        wa_objtxt-line = space.
        APPEND wa_objtxt  TO objtxt.
        clear wa_objtxt.
Third Line.
*"This is a system generated e-mail. Please do not reply."
        wa_objtxt-line = 'This is third Line'.
        APPEND wa_objtxt  TO objtxt.
        clear wa_objtxt.
        describe table objtxt lines tab_lines.
        read table objtxt into wa_objtxt index tab_lines.
**data : x type char12 .
        docdata-doc_size = ( tab_lines - 1 ) * 255 + strlen( wa_objtxt ).
       move docdata-doc_size to docdata .
        clear wa_objpack-transf_bin.
        wa_objpack-head_start = 1.
        wa_objpack-head_num   = 0.
        wa_objpack-body_start = 1.
        wa_objpack-body_num   = tab_lines.
        wa_objpack-doc_type   = 'RAW'.
        append wa_objpack to objpack.
        wa_reclist-receiver = '[email protected]'.
        wa_reclist-rec_type = 'U'.
        append  wa_reclist   to  reclist.
        wa_reclist-receiver = sy-uname.                "<-- change internal user
        clear   wa_reclist.
        wa_reclist-rec_type = 'B'.
        append wa_reclist to  reclist.

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

  • 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

  • How to call a function module from the Web Template?

    Hi all,
    how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template?
    Many thanks for your hints.
    Regards, Nils

    Hi!
    I am too working on a similar issue.
    Probably this helps:
    Re: Calling a function module from a Web Template
    Regards,
    Sri

  • How to call a Webdynpro view from BSP page (MVC) in a new window?

    Dear Experts,
    kindly advise how to call a webdynpro view from BSP application after performing an event (through button or hyper link).
    Regards,
    Sarat.

    Hi,
    This has been discussed many times in several forums.
    Please check the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL, to create a runtime url for your WD Application and call this URL.
    Refer thread: Call Webdynpro Application from BSP Application
    Hope this will be useful!
    Regards,
    Meganadhan S

  • Can you call a function module from within a smartform?

    I was told that yu can not call a function module from a smartform - that does not make sense to me because you can do tons of ABAP within a smartform.
    Well - can you?
    Thanks.
    Scott

    Yes, you can call function modules.

  • How to call a function module from a workflow ? ?

    hi all,
    i have to call a function module from an workflow, i got a hint from someone that i have to enhance an object and then write and methode, in this methode i can call that function module. I dont know even how to go for it.
    Can anyone suggest that how to go for it ?
    thanks.
    raman khurana.

    Hi Raman Khurana,
    Please  go through the links it might be helpful , notsure
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/content.htm
    http://www.abapcode.info/2007/07/standard-function-module-text.html
    http://it.toolbox.com/wiki/index.php/SAP_Workflow
    Regards,
    Sreekar.Kadiri.

  • How to call a function module from debugger?

    Hi all,
           i just wanted to know whether we can call a function module from a debugger ,
           if yes how ?

    Hi Laxmikanth,
    How ur going to call a function module which is not present in program???
    In debugging mode u can change the values of variables,put break points and watch points,but i thnk its not possible to call a function module(not present in program) while debugging .
    Please share with us if u have any solution...
    Regards,
    lakshman.

  • Calling a function module from a Web Template

    Hi,
    I need to call a function module from a web template. Any pointers on how i can do this ? Is this even possible ?
    Thanks
    Shailesh

    Hi Rael,
    We were finally able to call a FM module from the Web. The trick as Heike suggested was to create an ABAP class which inherits from CL_RSR_WWW_HELP_WINDOW. Then you should modify the process_cmd method of this new class in order to call the FM. Now use this class to create a help service. In case you need to pass any parameters to the FM, you will need to pass them as additional parameters while calling the help service.
    An example is below.
    CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=ZBOOKMARKING&TEXT=mytext&URL=myurl
    Where mytext and myurl were the parameters i pass to my FM and ZBOOKMARKING is my help service.
    Thanks a Lot to Heike for his help on this !!
    Shailesh

  • Calling a function module from APO Macro

    Hi,
    Can I call a function module from a macro directly without going through the user exit? If so, how should I pass the parameters to the function module? I don't have to get the results back to macro.
    Regards

    Hi Asokan - you can call a function module directly from a macro providing it is designed to be called from a macro. For example if you are in the Macrobuilder and use the menu path Edit -> Edit User Function then you will get a list of existing function modules that you can call directly by inserting a Operator/function into your macro. If you want to call a function module not listed in the User Function drop down list then you will either need the user exit or create a custom function module as a wrapper and register the wrapper function module in the Edit User Function menu path. Calling a function module will always return a value - but you can choose to ignore that value depending on how you build your macro.
    Regards
    Andy

  • 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 a function module from CRM 5.0 via ITS to FICA

    Hi
    I want to call a function module in FICA (FICA is using sapgui) from CRM (IC-web) via ITS (Not integrated in FICA)
    Is it possible and how should this be done???
    If someone know how, please help
    BR//JL

    generally RFCs should not have user dialogs.
    any how to handle your case, you need ITS and since FICA is a WAS 6.20 system, you need to have a ITS installed for FICA system, without which you cannot do that.
    alternatively you can mimic the functionality of the RFC by programming the same in a BSP and call this from CRM system
    Regards
    Raja

  • How to call  web ui screen from bsp componants

    Hi Gurus,
                I am trying to call the web ui screen from bsp componants by using the function modules .but exception is coming. but from gui these functionmodules are opening the web ui screen.those function modules are BAPI_BUSPROCESSND_CHANGEDIALOG,CRM_1O_CALL_WEBUI here only we need to pass the GUID. but these are not working from bsp componants .i am not getting why these are not working if there is any solution Please give me suggestion.Its very needful.
    Regards,
    Bixamaiah.

    Hi Caíque Escaler,
             the requirement is workflow is triggered in web client.In the webscreen from the workflow task user selects the work item then one screen will come from there  if the user selects the reject option then immidiately  we need to open that order in web screen.that is the requirement.
    Regards,
    Bixamaiah.

  • Calling of Sapscript program from BSP Application

    Hi,
       I have a requirement to display the sapscript output in PDF throgh BSP.
       In the Application program I am taking the output in PDF format.
       Now While calling the Driver program in BSP it is giving dump.
       I am using Submit 'Prog_name'  and return.
      Pls help.

    Hi Thanuja,
    You cannot call the program using SUBMIT PROGRAM in BSPs.
    You can create PDF from a Smart Form. <i>I have no idea of SAPSCRIPTS calling from BSPs.</i> You can do one thing, you can migrate your SAPSCRIPTS to SMARTFORMS and try the below code.
    You can call the the below three FMs in the following sequence.
    1)
      call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname           = l_form_name
        importing
          fm_name            = l_function_module_name
        exceptions
          no_form            = 1
          no_function_module = 2
          others             = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    2)  call function l_function_module_name
    3)  call function 'CONVERT_OTF'
    Thanks,
    Sreekanth

Maybe you are looking for