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

Similar Messages

  • Scheduled function module in background job

    HI all,
    I have created a function module(RFC) & Now I need to schedule it in background job, i have used fm job_open ,job_close  But through there i can only scheduled Reports  so pls gide me how to scheduled fm .
    regards,
    Anuj

    Hi Anuj,
    Check this one:
    Re: can i scheddule a function module(rfc)  in background
    Regards,
    Chandra Sekhar

  • Scheduling of process chain with background job

    Hello All,
                  I have scheduled the process chains through background jobs. I have copied the meta chain and created seven background jobs that is from Monday till sunday. The problem is most frequently the job gets cancelled with the message
    Process CHAIN, variant PAA1_GS001 is not scheduled waiting for event RSPROCESS 44NRPDWZ7CQUJ92ATDTY6368H.
    This is the variant for the next process after the start process. I tried by giving merge active versions, but one day the background job runs fine , but the next day it gets cancelled.
    If anyone has faced this issue before kindly let me know.
    Regards,
    Karthik.

    Hi,
    It seems to be there may be in probelm in Varients, so create a separate Varient for each PC and then activate the PC and execute.
    Thanks
    Reddy

  • Schedule Abap Server proxy in background job in SAP r/3

    Hi all,
    My scenario is File XI Proxy Interface inbound to SAP...
    My requirement is to schedule the proxy in the background job every night.
    How can I acheive this?
    <removed_by_moderator>
    Read the "Rules of Engagement"
    Thank you,
    Mili.
    Edited by: Juan Reyes on Oct 21, 2008 3:04 PM

    Hi ,
    U don't need to schedule a server proxy ...as the proxy will kick in automatically as soon as the message is processed by file adapter .
    Since yours is File to proxy scenario...
    and you want to execute it overnight ..
    You will have to control when the file is processed by XI file adapter.
    Here what you can do ..
    Let's just say your file gets placed in a Folder 'A' ...and your file communication channel is configured to pick files from folder B.
    Write an abap code on xi box ..(or you can use a V.B. script)
    which will move the file from folder A to Folder B.This code can easily be scheduled..so that it you can get files in folder B from where XI processig will kick in .
    (job scheduling can be done sm36 ..use the wizard)

  • Problem when calling function module CV120_DOC_CHECKOUT_VIEW in background

    Hi ,
    I'm currently developping an abap program which extract document from KPRO for printing into a windows Folder.
    For this I use standard function module CV120_DOC_CHECKOUT_VIEW.
    When i run my program in foreground task there's no problem, but when i run it in background task the extract doesn't work. It seems that the system cannot connect to the Windows Network.
    Whe the program is running in foreground task, the function module user SAPHHTP RFC destination, when it runs in background task it use SAPFTP destination .
    Does somebody can help me ?
    thanks in advance

    Hi Ajay,
    The program extract document into a folder on Windows Network that means on a server not on a PC .
    I know that in background task ther's no connection with sapgui.
    For example when i want to create a file on network n background task i use OPEN_DATASET instruction and that works fine.
    My problem is the use of the standard function module CV120_DOC_CHECKOUT_VIEW in background task because when this function module is running in background task it use the SAPFTP rfc destination instead of SAPHHTP rfc destination in foreground task . I check the RFC destination , thoses works both . SO i think the problem comes from parameters given to the function module.
    Regards.

  • How to DEBUG a function module running in background mode? Please help!

    Hi Experts,
       I am calling a function module in my ABAP code in background module using the following syntax:
      CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
              TABLES
                itab_std_format_inv = itab_std_format_inv
                itab_snapshot_inv = itab_snapshot_inv.
            COMMIT WORK.
    If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
    I cannot comment this  "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
    So how to DEBUG a function module running in background mode? Please help!
    Thanks
    Gopal

    Hi,
    You could try to use the following trick:
    (1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
      DATA:
        lx_exit_loop(1)     TYPE c.
      lx_exit_loop = ' '.
      DO.
        IF ( lx_exit_loop = 'X' ).
          EXIT.
        ENDIF.
      ENDDO.
    (2) Call your function module in background task
    (3) Call transaction SM50 and search for the background process.
    (3) Choose from menu Program/Mode -> Program -> Debugging
    Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
    <b>Reward points</b>
    Regards

  • Error BT616 when calling function module SXPG_COMMAND_EXECUTE in background

    Hi All,
    We use function module SXPG_COMMAND_EXECUTE with a custom command we defined in SM69 to move files in unix (mv command).
    The function module call has worked fine for almost a year and recently we have been seeing an error (BT616) in our job lob (SM37) when the program is run in background. We have not been able to reproduce the error in foreground mode and it seems to be occuring only periodically in the background. (The appropriate SAP authorization objects where assigned to the batch job ID and the steps on the batch job.) We are in the process of setting up the trace flag and performing analysis on the trace log via ST11 to help identify the issue.
    After perform analysis on SXPG_COMMAND_EXECUTE, the error is occurring when calling function module SAPXPG_END_XPG for exception 2, system failure, yet function module SAPXPG_END_XPG does not exist. I assume this is a program at the operating system level and is just a signature of the parameters to be passed to the operating system program.
    Below is part of the SAP function module SXPG_COMMAND_EXECUTE that is failing.
    * Now we have to wait for the termination of the external
    * command if the caller wants us to.
        IF TERMINATIONWAIT = 'X'.
          CALL FUNCTION 'SAPXPG_END_XPG'
            DESTINATION DESTINATION
            IMPORTING   EXITSTAT = STATUS
                        EXITCODE = EXITCODE
            TABLES      LOG      = LOG
            EXCEPTIONS  COMMUNICATION_FAILURE = 1 MESSAGE MSG
                        SYSTEM_FAILURE        = 2 MESSAGE MSG.
    I performed a where used on function module SXPG_COMMAND_EXECUTE, and most of SAP programs call the function module with the parameter TERMINATIONWAIT = 'X', so I assume we should pass ‘X’ as well.
    Any ideas on what could be causing this issue?
    Mike Vondran

    I also remember I have this kind of issue, as I have some UNIX script at OS( UNIX) level . The problem was with the ID , as it don’t have proper authorization at OS level ( UNIX ) . Please check this ID authorization. This could be the one of reasons if you’re sure from SAP standpoint.
    Hope this’ll give you some guide line..
    Thanks
    Bye

  • Can i scheddule a function module(rfc)  in background

    hi,
    i want to know how can schedule a function module in background.
    bye
    sreenu.

    Transactional RFC before release 7.0
    1. CALL FUNCTION func IN BACKGROUND TASK
                         [DESTINATION dest]
                         parameter_list
                         [AS SEPARATE UNIT].
    Transactional RFC as of release 7.0
    2. CALL FUNCTION func IN BACKGROUND UNIT
                         parameter_list.

  • Function Module to Dealy the JOB

    Hi,
    I have a program and inside it submiting one JOB. So i have wait for execution of further program till the previous job finises. So how can i do this? Is there any function module to wait for the JOB.
    Thanks
    Ku

    Hi Sunil,
    You can do this
    Go to Table tbtco and give the job name and select all the details of the job.
    Pass the Job count to the function module as
    call function 'BP_JOB_CHECKSTATE'
                   exporting
                        dialog                       = 'N'
                        jobcount                     = t_tbtco-jobcount
                        jobname                      = t_tbtco-jobname
                   importing
                        actual_status                = l_status
                   exceptions
                        checking_of_job_has_failed   = 1
                        correcting_job_status_failed = 2
                        invalid_dialog_type          = 3
                        job_does_not_exist           = 4
                        no_check_privilege_given     = 5
                        ready_switch_too_dangerous   = 6
                        others                       = 7.
    check the ststus for F or A. Do it in a whil eloop and when it finishes continue your program.
    Thanks
    Lincon

  • Calling function module in the background task

    Hello everybody,
    I have a function module which wil create conditon records,the problem is it has performance problems because of which i am planning to make this as background job.
    Can any one of please tell me how the call function ' fun name ' in background task behaves.
    Regards,
    Aruna

    hi,
    try to refer to the link below:
    http://help.sap.com/saphelp_nw04/helpdata/EN/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm
    i hope it helps
    regards
    arjun

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Function Module to show all jobs in that Org Unit.

    Does any one know is there any Function Module which gives all the jobs that comes under that Org Unit. for example if org unit 10 has 2 Sub Org Units(11 and 12) and 3 jobs(20, 21 and 22) under it. and the Sub Org Unit 11 and 12 has 1 job each( 30 and 40). When you run for org unit 10 it should give all 5 jobs (20, 21, 22, 30 and 40).

    Hi Fayyaz
    Well you use a FM RH_READ_INFTY_1001 to discover the relationships between an ORG Unit and Jobs.
    Alternative, you can write a simple query to extract data from HRP1001 to find the jobs under an Org Unit. Because Jobs are related to an Org Unit and this relationship is stored in Infotype 1001/HRP1001.
    Reward Points, If helpful.
    Regards
    Waz

  • Send mail using CL_BCS through function module, run in background task.

    Hi,
    I am running a function module in Background task. in this function module I am sending mail using CL_BCS class.
    but mail is not generated. if I run the same function Module in foreground mail generated successfully....
    can anyone please tell me the reason behind this.

    Hi i realise that The LIST_TO_ASCII thing is not working correctly in background because the the list-processing in beckground is working not the same as in dialog i think.
    I can only get the last page of the list out when running in background. Any solution to this?
    my code:
        CALL FUNCTION 'LIST_TO_ASCI'
             EXPORTING
                  list_index         = sy-lsind
             TABLES
                 list_dyn_ascii = downtab
             EXCEPTIONS
                  empty_list         = 1
                  list_index_invalid = 2
                  OTHERS             = 3.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
    Thanks ,
    LH

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

    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

Maybe you are looking for

  • Audio ahead of video in iTunes using Windows 8

    I recently bought a new HP ENVY m4 laptop with Windows 8 at Best Buy. I do not like Windows 8, I prefer Windows 7, but there was nothing I could do about it. After I bought my new laptop, I downloaded iTunes along with everything I have ever bought o

  • PDF printing got error : 500 Internal Server Error

    Hi, I have configured PDF printing as per doc "PDF Printing in Application Express 3.0" and configured " Apache FOP " as per instruction and test the JSP page by http://hostname:8888/apex_fop_render.jsp and got following error: java.lang.NullPointerE

  • Question about "synchronized" and "wait"

    Hello, everyone! I have seen a piece of code like this, synchronized (lock) //do operation 1 lock.wait(); //do operation 2 I think in the above piece of code, when a thead finished operation 1, it will release the lock and let other threads waiting f

  • Is there a JAVA API to generate out reports yet?

    I've read all the forum information regarding a java api not being available yet. They are dated back in 2004. Is there still not one available? I need to be able to generate reports that were created with Oracle reports, but do it from a Java Applic

  • Missing Pixel Font in Flash Player 9

    I have developed a site in Flash 7.2 and since the Flash Player update to version 9, my pixel font has disappeared from my site - even though I can still see it in the fla file! Any help gratefully received.