rohan_rege
18th October 2002, 18:42
hi ,

I have written a interface program using AFS for the whole Maintain Transaction ..process in baan....

After I am read the ASCII file and try inputting the fields into session in API mode......if i get a error inserting a record ...

i write the current record to a ascii file and append the error message to it .

but the problem is the record comprises of field values delimited by tilde's ~ , so it looks something like following :

D~128~~~~~~~11112090~~~~~~75~L
Above record(13) generated the following error:
tfacp1120s000 Insert: Input is mandatory tfglds0192 LedgerAccount or Dimensions have to be entered

This ofcourse is not a good readable error message , for the enduser who will be using the error log file to find which invoice no. had a error .....

also the ascii file that i am reading from has records in two formats ;

first is the Invoice Header fields
and then it is followed by Invoice detail fields...

the error might occur in either of the two types of record types


I have been asked to get this ascii error file that i gets created by my prog ..into a more readable format...with columns names...

i dont know , how to go abt it ......any suggestions

basically can this ascii file convrted into a Excel sheet or something on similar lines so that it becomes beter to read...

If anyone has done something simillar..pls post me the sample code or email it to me ...so that i can start working on the same lines

rgds
Rohan

mark_h
18th October 2002, 19:38
Instead of opening one file maybe two error files would be better - one for details and one for headers. What I do to make error files more readable is to open the file write 1 header line, then close them. Each time I run into an error I re-open the error file, append the record, close the file. In my case I use |'s(pipes) or ,'s(commas) to delimit the input files, then when I write and error record I just append a delimiter and the message. So ~'s could be used. When you open the error file in excel the text import wizard will ask for the file type, pick delimited. Next pick other for the delimiter and give in the ~. Try that.

Mark

gfasbender
18th October 2002, 19:59
Rohan,

I was wondering when you were going to get to the interface that is wrapped around your API processes.

You should be designing some "standard" routines that provide processing like:

transaction input/output controls
transaction data visibility (end-user)
transaction process status visibility (success, failure)
transaction error message visibility
error correction
error transaction re-processing


You might want to take a look at the strategic architecture that I've developed to manage API transactions, called the API Queue (http://gwconsulting.netfirms.com/apiqueue.html). It might give you some good ideas.