Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interface for loading bank BAI format document into SAP

JanjanamRamesh
Participant
0 Likes
769

HI Experts,

I have to write a script program that retrieves and uploads the EBS file into SAP will ensure that all files are received and uploaded into SAP.  The program will inform the responsible parties if some files are not received or are uploaded with errors.

here the file is in appl server. So, i decided to schedule a job for FF_5 Transaction, then it will archived. while job is scheduled, if some documents got fail. so here how can i identify which one got failed/error and send a mail to xxxxxxx@domain.com.

hope it is brief.  could you help me out.

1 REPLY 1
Read only

Former Member
0 Likes
458

We utilize a similar process.  The steps within a single scheduled job, for me, are:

Execute our custom program that will:

1.  Get the bank/account information from T012, T012k and make the set unique, as needed.

2.  Open the BAI2 file dataset and read to find the file header (for the run date, etc.)  If no file, abend the scheduled job with an E message.

3.  Submit our custom program to upload the BAI2 file and convert it to the needed format, storing a file for each combination of company code and payment ID (HKTID) or acct (BANKN).  This produces a set of files with the unique file header, the account / company code header, etc. needed for next steps.

loop at our derived unique rows from T012/T012k.

4.  Construct a unique runid code for the company and HKTID or BANKN.

5.  try to open the corresponding (to runid) dataset created from 3 above.  If successful, close and continue, if not successful, continue to next row in t012/t012k table.

6.  Submit rfkkcr00 with the needed parameters to create a run id and to prevent accidental reruns.

7.  Create the parameters for rfkkcrcash_check into a parameters table.

8.  Submit rfkkcrcash_check with the parameters table.

endloop.

Of course, we're checking for success at each step of the way.  Our process is probably much more complex than you need, since we have multiple company codes and multiple bank accounts.

Afterward, a little later in the morning, we have a scheduled job that reads the RUNIDs from DFKKCRST to see if any runids were generated (or which runids were generated), since in my case, I store runids by YYMMDD, Company code and last two of HKTID.  If nothing is found, and it is Tuesday - Saturday, and yesterday was not one of the known, predicable holidays (Dec 25, Jan1, July4), we issue an E-error message to the log to cause an abend.  The job log then shows the cancellation, and we read the log to see what happened (since I output a message for each step).