Skip to Content
avatar image
Former Member

Scheduling and Archiving

For an Interface , i am defining a Job that will be scheuled by an external Scheduler .

The interface will be posting data into SAP .

SAP will recieve two files from two different systems into a single directory . The filenames will be different and the format of the data will be ORDERS01 .

the Job will have three steps:

1) Run the unix script to fetch the files.

2) call RSEINB00 from a program , fetch the filenames from directory and submit the program .

3) Archive only the file that was succesfuly posted .

The problem that i m facing is :

As these are job steps : The Zprogram will fetch the files, call the RSEINB00 for each file .

Suppose if File 1 fails , it will still go and fetch the secon file and post . Suppose after the step 2 the situation is :

File 1 fails.

File 2 successful .

Then , if i want to archive only the file 2 , how to do that , how to tell the Unix Script that only file 2 will be archived ?? or shall I create two spereate jobs ( but this doesnt looks a good way . suppose if num of files increses in future ?)

If some one has any idea , Pls guide me thru .

Thanks Much

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 15, 2006 at 05:19 PM

    Hi Raymond,

    I don't think it is good idea to have separate jobs for each file. You may want to keep the process as generic as possible.

    Perhaps you can create a signal file in UNIX if process file is successful (2nd step). Then 3rd step will read the file, perform the archive activity and at the end delete the signal file. If there no file then do not perform archive activity.

    Again, hope this will help and give you an idea.

    Regards,

    Ferry Lianto

    Please reward points if helpful.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ferry,

      Thanks a Lot . I think this should be a good way to do it . 😊

      I will mark the query solved and assign the points .

      Thanks much again .

      Ray .

  • avatar image
    Former Member
    May 15, 2006 at 03:32 PM

    Hi Raymond,

    I think the simplest way is to have another unix script running in parallel which will archive the files as they are successfull.

    Cheers

    VJ

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      But how will the suceess status be communicated to the Unix Script ? The Unix Script is a generic script to archive the files ...

  • May 15, 2006 at 03:56 PM

    Hi Raymond,

    Perhaps you can do the following steps.

    1. Create a custom program and use this FM <b>EPS_GET_DIRECTORY_LISTING</b> to get all incoming IDoc files.

    2. Loop at internal table <b>DIR_LIST</b> (from above FM) and submit program RSEINB00 by fetching the complete file name and file port.

    3. If the submit program is successfull, then system will archive the current incoming file. Otherwise, system will raise an error message.

    4. Once the error has been identified and fixed, you can rerun the program from top again.

    Hope this will give you an idea.

    Regards,

    Ferry Lianto

    Please reward points if helpful.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ferry ,

      Thanks much for the response.

      The problem that I am facing is : how to communicate the Sucees Status of the File to the UNIX script . The call to Unix Script is a seperate step of the Job .

      Shall i make two seperate jobs for each file ?

      Step 1: fetch the file

      step2 : process the file .

      step 3 . if step 2 sucess , then archive .