Function Module (Execution)

Hi All,
Kindly help me out with the below scenario
Scenario:
1) I have to "CHEKIN" a file into DMS system using XI from file system, here DOC info is already present in the DMS system.Now only CHECKIN of file has to happen in correspond to particular DOCnum,DOCtype,DOCversion.
2) To make it to work we use FM "BAPI_DOCUMENT_CHECKIN2"
3) Now When i use this FM IN se38 and run it executes sucessfully by putting in the file ito DMS system,there is a paramter asking for file path : (We have given it the XI Server path)
For instance : "
xx.x.x.xxx\mdmtest\srinivas"
3) Now i have imported this FM into XI and done mapping for these paramters , for some elements i have put conatnt mapping , for docpath etc.
4) This is on Target (Receiver RFC Adapter) , but when i run the scenario, the Sender RFC is not picking up the same XI file path and putting it into DMS.
Doubt:
Target has : Element (Docpath) which is XI server path, will this work or donot work, suggest p.lz,When i run there is no error but file is not seen,
Kindly revert back if there is no clarity.
With regards
Srinivas

Hi,
When i run the FM on the ERP backend system using se38 (ABAP Editor) , the function module has a parameter called "BAPI_DOCUMENT_CHECKIN2"
  lt_files-docfile  = for this parameter i have given
local path of system             ( Ex: c:\temp\doc.txt )
XI path folder                       ( Ex: '
10.x.x.15x\mdmtest\srinivas\srinipaddu.txt' )
ERP Backend system folder (Ex : '
10.x.x.1x1\sapsdn\srinipaddu.txt'
For Above three all are working fine when am executing from the SE38 of the system.
But here in XI box i have used Receiver RFC Adapter and used 'BAPI_DOCUMENT_CHECKIN2" as target interface.Some fields are given constant value using mapping , for ex: "lt_files-docfile " but when i execute in XI there is no file checked in , it shows no error when i see in "Communication channel moniotring" in RWB , but in when i see in sxmb_moni of my target system there are no messages.
i see no error , but my file in the specifed folder is not getting checked in .
kindly put u r views seeing above steps done.
thx in advnc
srinivas

Similar Messages

  • Scheduling function module execution in background jobs

    Hi,
    I have requirement where in after obtaining all the required inputs from the user we will call an function module to execute it.
    The requirement is that the execution of fm shld happen in background and a log must be created showing the user whther it was successful or if it failed with the list of errors.
    Can you kindly give some input on how to schedule the execution of function module in background job and if scheduled how to create the logs to display the success or error message.
    Warm Regards,
    Naveen M

    Hi,
    Just create a simple program where you have to call this FM.
    Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
    For Message Log, you can use structurre BDCMSGCOLL
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    After Call to FM, read from this internal table as follows
    READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
                                            MSGNR  = <Message Number>.
    regds,
    Anil

  • How to give only one function module execution Auth for a User ?

    Dear Experts
    I have reviewed S_DEVELOP auth object. It is not ful filling my requirement
    Any Ideas !!
    Rgds

    Rakesh...Firstly thanks for reply.
    As i said i reviewed these and found it is not meeting my requirement.
    As we aware We can control auth to Function modules thru object type
    Filed OBJTYPE----
    FUGR --> 1st control
    and with Function Group Name
    Field OBJNAME----
    <Function Group Name>  --> 2nd control
    In my scenario - I have given the authroizations as below
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    ACTVT            Activity                                                 Display, Execute
    DEVCLAS       Package                                               *
    OBJNAME      Object name                                         ZECC_FG
    OBJTYPE       Object type                                           FUGR
    P_GROUP       Authorization group ABAP/4 pro              *
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    The above authroization is giving all Function modules authrozation under ZECC_FG Function Group.
    My Requirement
    I shoudl be able to give only one Function Module of a Function group where multiple function modules exist under the same Function Group.
    How can i acheiveit. Any Custom Control can be place to acheive this.
    I am sure S_DEVELOP will not solve my requirement (I Beleive)
    Regards

  • Function Module Execution (ERP / SRM)

    Hi All,
    I have a RFC FM called "BAPI_DOCUMENT_CHECKIN2" on ERP back end System.
    I execute with below parameters :
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
    EXPORTING: documenttype = lf_doctype
    documentnumber = lf_docnumber
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = ls_return
    TABLES: documentfiles = lt_files.
    I give parameters:
    lt_files-storagecategory = 'Z_xxxL_xxx'. "
    lt_files-docfile = '
    10.x.x.xxx\mdmtest\srinivas\srinipaddu.txt'.
    Now "srinipaddu.txt" gets attached in the DMS system (IP:10.x.x.xxx: Belongs to the XI box and not either backend erp or SRM box below)
    Second Scenario:
    Now this same FM which is not present in the SRM BOX is called up using below syntax (Destination)
    call function 'BAPI_DOCUMENT_CHECKIN2' DESTINATION 'abapdest' EXPORTING: documentnumber = lf_docnumber
    documenttype = lf_doctype
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = pr_ls_return
    TABLES: documentfiles = pr_lt_files.
    Now the FM gets executed but the file in the specified folder is not getting attached in DMS system.
    Is this right or should i do any changes here
    help me out

    Hi,
           Try the function module GUI_RUN.
    Check this link.
    [http://abaplovers.blogspot.com/2008/05/sap-abap-function-module-to-run.html]
    Regards,
    Haritha.

  • Regarding Function Module Execution

    Hi Friends
    I am using the FM: ARCHIVFILE_SERVER_TO_CLIEN.
    With the parameters:
    Path = /tmp/TEST EMP COMP COE ECM_MB_07.txt
    And target Path = c:\Bonusbudget\TEST EMP COMP COE ECM_MB_07.txt
    While executing this FM , if I checked the uppercase/lower case checkbox, I am getting the proper results otherwise I am getting the error that:
    Error in opening file /TMP/TEST EMP COMP COE ECM_MB_07.TXT for reading (No such file or directory).
    As I am calling this in my program and getting the above error.
    Can anyone please suggest me the solution for this.
    Points are assured for useful answers.
    Regards,
    Sreeram

    Hi Nick
    Thanks.
    See my code to correct:
    VARIABLE DECLARATION
      DATA: lv_single_line TYPE string, "To split the file contents
            lv_objid TYPE hrobjid,      "Holds the Org Unit ID
            p_file TYPE rlgrap-filename,"File from Application Server
            lv_file_budget TYPE string. "Source File Name
      DATA: it_orgunit     TYPE hap_t_hrsobid    ,     " Id of Org. unit
            it_suborgunits TYPE hap_t_hrsobid    ,     " Ids of Sub Org Units
            wa_orgunit     TYPE LINE OF hap_t_hrsobid ," Work Area of orgunit
            lv_sobid       TYPE hrp1001-sobid      ,   " Org. Unit
            lv_stext TYPE stext,                       "Org.Unit Description
            lv_user TYPE sy-uname ,                    "User
            lv_afile TYPE epsf-epsfilnam,              "Application Server file name
            lv_objid1 TYPE hrobjid,     "Holds the Org Unit ID
            lv_uzeit TYPE syuzeit,      "Application Server's time
            lv_tpath TYPE sapb-sappfad, "Target Path on the Desktop
            lv_spath type SAPB-SAPPFAD. "Source File
    CONSTANTS DECLARATION     
      CONSTANTS: c_split(5) TYPE c VALUE ' ', " File spliting indicator
                 c_rsign TYPE rsign VALUE 'A', "Relationship Indicator
                 c_relat TYPE relat VALUE '300',"Relation ship
                c_file(255) TYPE c VALUE '/tmp/Bonusfile3.txt',
                  c_file(255) TYPE c VALUE '/tmp/Sample Budget Upload File.txt',
                 c_currency(5) TYPE c VALUE 'USD'.
      CONSTANTS: c_plvar(4) TYPE c VALUE '01', "Plan Version
                 c_o(3) TYPE c VALUE 'O',      "Object
                 c_otype(4) TYPE c VALUE 'BU', "Object type
                 c_rsign1 TYPE rsign VALUE 'B'."Relationship
      CONSTANTS : c_x(3) TYPE c VALUE 'X',
                  c_0(3) TYPE c VALUE '0',
                  c_usd(5) TYPE c VALUE 'USD'.
      CONSTANTS: c_otype1 TYPE otype VALUE 'US', "Object Type for User
                 c_otype2 TYPE otype VALUE 'O', "Org.Unit
                 c_evalpath TYPE gdstr-wegid VALUE 'SAP_MANG', "Evaluation path
                 c_depth TYPE hrrhas-tdepth VALUE '0',"Depth
                 c_underscore TYPE c VALUE '_', "Underscore
                 c_mb(4) TYPE c VALUE 'MB',     "Merit Bonus
                 c_pb(4) TYPE c VALUE 'PB',     "Performance Bonus
                 c_spot(6) TYPE c VALUE 'SPOT', "Spot Bonus
                 c_star TYPE c VALUE '*',       "To fecth all files
                 c_dirname TYPE epsf-epsdirnam VALUE '/tmp', "Directory name
                 c_tpath TYPE sapb-sappfad VALUE 'c:\Bonusbudget\'. "Target Path on the Desktop
    INTERNAL TABLE DECLARATION.
      TYPES: BEGIN OF ty_budget,
               orgunit TYPE orgeh,             "Org.Unit
               kcurr TYPE cmp_bu_kcurr,        "Monetery Falg
               butyp TYPE ecm_butyp,           "Budget Type
               budgetperiod TYPE cmp_bu_finyr, "Budget Period
               oldam(20) TYPE c,               "Amount
               oldcu TYPE waers,               "Currency
             END OF ty_budget.
      DATA: it_budget TYPE STANDARD TABLE OF ty_budget,
            wa_budget TYPE ty_budget.
    *INTERNAL TABLE & WORK AREA HOLDS THE MANAGER ORG.UNIT
      DATA: it_obj_tab_tmp TYPE STANDARD TABLE OF hrrootob.
      DATA: wa_obj_tab_tmp TYPE hrrootob.
      DATA: it_dir_list TYPE STANDARD TABLE OF epsfili,
            wa_dir_list TYPE epsfili.
      lv_user = sy-uname.
      lv_uzeit = sy-uzeit.
      lv_user = 'DALKW1'.
      p_file = c_file.
      lv_file_budget = p_file.
      CALL FUNCTION 'RH_STRUC_GET'                              "#EC *
        EXPORTING
          act_otype      = c_otype1
          act_objid      = lv_user
          act_wegid      = c_evalpath
          act_begda      = sy-datum
          act_endda      = sy-datum
          act_tdepth     = c_depth
        TABLES
          result_tab     = it_obj_tab_tmp
        EXCEPTIONS
          no_plvar_found = 1
          no_entry_found = 2
          OTHERS         = 3.
      LOOP AT it_obj_tab_tmp INTO wa_obj_tab_tmp.
        lv_objid1 = wa_obj_tab_tmp-objid.
      ENDLOOP.
      SELECT SINGLE stext
      FROM hrp1000
      INTO lv_stext
      WHERE otype = c_otype2
      AND objid = lv_objid1.
      IF sy-subrc EQ 0.
        CONCATENATE lv_stext+0(18) c_star INTO lv_afile.
      ENDIF.
    GET THE FILE NAMES BY PASSING THE DIRECTORY NAME AND FILE NAME.
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
        EXPORTING
          dir_name               = c_dirname
          file_mask              = lv_afile
        TABLES
          dir_list               = it_dir_list
        EXCEPTIONS
          invalid_eps_subdir     = 1
          sapgparam_failed       = 2
          build_directory_failed = 3
          no_authorization       = 4
          read_directory_failed  = 5
          too_many_read_errors   = 6
          empty_directory_list   = 7
          OTHERS                 = 8.
      IF sy-subrc EQ 0.
        LOOP AT it_dir_list INTO wa_dir_list.
          CONCATENATE c_tpath wa_dir_list-name INTO lv_tpath.
          lv_spath = wa_dir_list-name.
         concatenate c_dirname '/' lv_spath  into lv_spath.
    DOWNLOAD THE FILE TO THE PRESENATATION SERVER PATH.
          CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
            EXPORTING
              path       = lv_spath
              targetpath = lv_tpath
            EXCEPTIONS
              error_file = 1
              OTHERS     = 2.
          IF sy-subrc EQ 0.
            CALL FUNCTION 'GUI_DOWNLOAD'
              EXPORTING
                filename = lv_tpath
                filetype = 'ASC'
              TABLES
                data_tab = it_budget.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
          ENDIF.
          CLEAR lv_tpath.
        ENDLOOP.
      ENDIF.
    Regards,
    Sree

  • Receiver Type Function Module in SWE2 use of export parameter.

    i am trying to understand the underlying concept in following things:(neednot to say i have searched alot and read sap documentation already).
    In event type linkage table say i have an entry for BOR -> AFVC_PM.
    As per sap Documentation says all these FM will trigger in following way.
    1 Check Function Module (to place any validations/checks)
    2 Receiver Type Function Module ()
    3 Receiver Function Module.
    Thats fine.
    This is what documentation says about Receiver Type FM(2nd FM) not Receiver FM(3rd FM).
    This FM has 1 export paramter
    Export parameters
    RECTYPE type SWETYPECOU-RECTYPE Receiver type( Result of the evaluation by the receiver type function module.)
    if i am understanding this right, in this FM receiver type will be decided .
    i have placed BREAK-POINT in this FM  and passing value WS90000024 (Workflow with simple mail step) in export parameter RECTYPE.
    after everything executed successfully why i can't see that mail in my inbox.
    Please correct me if i had misunderstood the concept .

    ok,indeed i was missing this thing.
    i got the mails in inbox.
    but why i can't see this value WS90000024 of this workflow ()which is going to be triggered ) in parameter RECTYPE.(its empty).
    it is empty after the receiver type function module execution is complete.
    below is workflow template,

  • How to execute Se30(performance check) for a function module

    can anyone please let me know hot to execute perofrmance check for a function module.

    In SE30 below the program option you have Function Module option.
    Give the FM name there >execute, It will lead to the SE37 for Function Module execution screen, enter the values>Execute.
    The ctrl will return back to SE30.
    Press Evaluate to know the analysis.
    Hope this answers.
    Regards
    Vinayak

  • Performance problem with OLE_FLUSH_CALL function module

    Hello Everyone,
    I am facing problem with OLE_FLUSH_CALL function module (execution is taking long time which is going to be dump error).
    Could you please help me in knowing solution for this problem?
    Thanking you in advance.
    Srinivas

    Hi Srinivas,
    the OLE_FLUSH_CALL does an RFC from ABAP backend to frontend UI. So high execution time could result from high network time, for example latency between UI and backend server.
    How many UI interaction steps did you measure for the trace above? Ideally, there should only be one OLE_FLUSH_CALL per user interaction step. If its more, the application is not written in an optimized way.
    Best Regards, Randolf

  • Need to know how to find the last execution time for a function module

    HI all
    I need to know
    1) How to find out the last execution time of the function module ?
      say for eg. I have executed a func. module at 1:39pm. How to retrieve this time  (1:39pm)
    2) I have created 3 billing document in tcode VF01 i.e 3 billing doucment no. would be created in SAP TABLE "VBRP" b/w 12am to 12:30 am.
    How to capture the latest SAP database update b/w time intervals?
    3) Suppose I am downloading TXT file using "GUI_DOWNLOAD" and say in 20th record some error has happened. I can capture the error using the exception.
    Is it possible to run the program once again from 21st records ? All this will be running in background...
    Kindly clarify....
    Points will be rewarded
    Thanks in advance

    1.Use tcode STAT input as Tcode of Fm and execute .
    2. See the billing documents are created in table VBRk header and there will always be Creation date and time.
    VBRk-Erdat "date ., u can check the time field also
    So now if u talk the date and time we can filter then display the records in intervals.
    3. with an error exeption how is my txt download finished .
    once exception is raised there will not be a download .
    regards,
    vijay

  • Function Module to find the Last Execution date of Back ground Job

    Hi,
    Is there any function module to find the <b>last execution date of back ground job</b>.
    So that I can transfer the data from SAP to Legacy system based on the document creation date should be in between last execution date and current date.
    thanks in advance.
    Eswar.

    Don't know of a function module, but you should be able to use the information in table TBTCO to get the last start date and time of the job you are interested in.

  • Tcode for the execution of function module

    Hi!
    A very simple question:
    What is the Tcode for the execution of function module? (Se38,???)
    I have to execute  the function module RRSI_INITIAL_LINE_INSERT with import parameter I_CHABASNM = 0REQUID.
    Thank you very much!
    regards
    Thom

    hi,
    You create new or edit Fm in SE37. You also put the code for that FM in SE37.
    You can call it through pattern button in SE38, where u pass the importing and exporting parameters of that Fm
    Hope this helps, Do rewad.

  • Tracking the execution of Function Modules

    Hi there,
    for ABAP reports there is an enhancement S38MREP1 'Exit at Start report' in transaction CMOD available which could be used e. g. to track the execution at least of executable programs (TRDIR-SUBC = 1); limitation: it is executed before the selection screen, so no guarantee that a certain program is really submitted afterwards.
    Is there something similar available in release 4.5B (or in any higher release?) or how can I track the execution of function modules in the customer name space in a smart way?
    Thanks in advance for any support,
    Peter

    Expanding a bit on Seigfried's post,  you could write a little function module with with a parameter which would be function module name and it would update a custom table everytime it is executed.
    Put this function call at the end of the function module that you want to log.
    call function 'Z_LOG_FUNCTION_EXECUTION'
          exporting
             fcname = 'Z_THE_NAME_OF_THE FUNCTION'.
    The code inside this function module could be something like this.
    ztable-fcname = fcname.
    ztable-uname  = sy-uname.
    ztable-datum  = sy-datum.
    ztable-uzeit  = sy-uzeit.
    insert ztable.
    Regards,
    Rich Heilman

  • Runtime Error in execution of 'SO_OBJECT_SEND' function module

    Hi friends,
    We are going for upgradation from 4.6c to ECC6.0. There is one program which is used to send external mails thru 'SO_OBJECT_SEND', but the function module is giving runtime error(line no:515) in ECC6.
    what could be the reason?
    rewarded,
    Steve

    Hi,
    Plz check if any latest release notes of SAP for the function module 'SO_OBJECT_SEND' are available. If so you may apply those.
    If you have valid SAP service username and password you can get the notes from service.sap.com. Else your BASIS people can help you.
    Which is the highest patch level you have applied?
    Regards,
    Renjith Michael.

  • Execution of a Function module ?

    Hi,
    Could you please tell me how to execute a custom function module in which the import parameters are a couple of tables which has lot of fields. Do i need to give entries in all of the fields to execute or to debug the Function Module..??
    Thanks in Advance.. !!

    Hi,
      To call function module from program
    slect the pattern button on APPlication toolbar of ABAP editor enter your FM name.
    Regarding parameters...
      You have to pass all mandatory field values of FM.
    To check whether mandatory or not
    GOTO tcode SE37  enter Fm name  press display
    import parametres--->check call OPTION if check means Mandatory else. not.
    Don't forget to reward if useful....

  • How to exit the execution in middle of a function module

    Hi Fox,
    I have a function which sometime needs more than 10 minutes to deliver a result.
    This is not acceptable thus this function will be given a time-out value in a second format after which the function should be stopped or killed. Do you have an idea how to do it. The function has to process a lot  of records within a table, so maybe a solution with a counter
    Cheers!
    Kami

    CALL FUNCTION func DESTINATION 'NONE' ...
    The destination NONE refers to the calling system. Function
    modules called with are executed in the system of the calling program, but in their own program context.
    As you know RFC uses dialog work process and the timeout for dialog work process will be in the range of 10 -15 mins not beyond that , so once the time the function module gets killed !!!
    I m sure about this process because i did a similary requirement like yours.
    Thanks.

Maybe you are looking for