Archive_schedule_job

I am calling FM archive_schedule_job and these are my parameters:
    CALL FUNCTION 'ARCHIVE_SCHEDULE_JOB'
      EXPORTING
        object              = 'IDOC'
        jobtype             = 'DEL'
        cleanup_job_table   = ' '
        start_immediate     = 'I'
        inherit_spool_parms = 'X'
        user                = sy-uname
        file_key            = archkey
        dont_release        = ' '
        indicate_progress   = ' '
        delete_failed_job   = 'X'
      IMPORTING
        jobname             = jobname
        jobcount            = jobcount
      EXCEPTIONS
        object_not_found    = 1
        job_not_created     = 2
        no_such_variant     = 3.
This FM creates a background job to delete archived idocs.
When executed in foreground, it is doing what it's supposed to do (delete archived IDocs). But something strange happens when it (program where FM is called) is executed in background -- though it still does what it's supposed to do.
After executing in background and checking in SM37, the program (which called the FM) is Canceled while the job that the FM created is completed successfully.
The job log for the program is: " Runtime errors         MESSAGE_TYPE_X"
and the code (LARCJF01) where the runtime error occurred is:      
ELSE.                                                             
no archiv_key in case of xml archiving object                         
        IF gv_admi_jobs-document IS INITIAL                             
        OR ( gv_xml IS INITIAL AND gv_admi_jobs-archiv_key IS INITIAL ).
>          MESSAGE x008  WITH                    
          'job_init' 'WRONG ADMI_JOBS ENTRY FOR DEL'        "#EC NOTEXT 
          gv_admi_jobs-document gv_admi_jobs-archiv_key.                
        ENDIF.                                                          
        gv_session = gv_admi_jobs-document.                             
        gv_file = gv_admi_jobs-archiv_key.                              
      ENDIF.                                                            
Please help me how to use the FM correctly. What's wrong with the parameters I passed? I need to be able to run it in background and not receive a canceled status in SM37.
Thank you.

Hi,
You need to define jobs both in BW (Job1) and the third party system (Job2).
Trigger Job1 which will trigger BW job (Job2). You need to set the dependencies on Third Party tool for the third party jobs. No need to define any dependencies for the BW jobs. Individual BOX needs to be identified on third party tool.
Thx,
Soumya

Similar Messages

  • FM ARCHIVE_SCHEDULE_JOB giving dump as background job?

    Hello Everyone,
                       I am scheduling a report in SM37 which consists of FM ARCHIVE_SCHEDULE_JOB.
                       And based on the output of FM, some Ztables are updated and some jobs are created in sm37.
    Now, when i debugged the background job, i found out that Fm is giving Dump 'NO_RUNTIME_INFO' since sy-batch is not initial.
    Due to which Ztables are not updated but the jobs are created....
    Can anyone please help me what should i do on this case?
    Edited by: Suruchi Razdan on Jun 2, 2011 9:45 AM

    Hi Akshay,
    II have copied the Std workflow WS20000075 into a custom one and in the latest end tab, i have selected "Workitem creaton" for Refer Date/Time field and given 5 mins. I have deactivated the workflow in which i have created the containers for date and time and used "Expresion" for latest end and also commented the zmethod in delegated object. Even now also the job is getting cancelled with the same error.
    Any idea why is it happening ?
    regards,
    Trimurty

Maybe you are looking for