rohan_rege
17th October 2002, 22:50
i have created a exchange scheme for exporting data from tables tdpur050 and tdpur051.......
but its taking a lot of time bcoz in the exchange scheme
i first pull data from tdpur051 which is PO lines History table
and then the rest of the fields in the same ASCII file relevant to PO header History table are pulled for each PO line using a select query in a condition for each PO header field.
this takes a lot of time ...but this is the requirement where i have to club the tdpur051 and tdpur050 data in one ascii file...
i am thinking of switching from exchange scheme to programming
where i will do a select join on the two tables and then
in the select do write the selected record one by one to a ASCII file....
has anyone done something like this ...?
I wud like someone to share a similar script
Mainly i need the part of code to write the record selected to a ASCII file ,such that the fields are delimited by a tilde ~
bcoz i have not done this before , and i have a time constraint..
where in i cant afford to waste time trying things out..
If anyone has a sample code for writing selected records to
ASCII file by delimiting the fields by either tilde or any other delimiting character...pls do reply
Rgds
Rohan
rgds
Rohan
rdbailey
17th October 2002, 23:02
Hi Rohan,
I have created several ascii files (formatted in any way I want) using the following procedure:
I use "Generate Session" to create a report session.
Let Baan create the report script etc...
In the report detail, layout the data how you want it
If you want a tilde between fields, just put it on the screen.
When you finish, run the report then output to ASCIIF; give it a file name and presto....
In the Script for the session you can massage the SELECT statement to do any table merging, selection criteria, sorting etc....
I hope this helps.
Sincerely,
rohan_rege
17th October 2002, 23:41
thanks for ur help...
i will try it out .....
is it okay if i pm u if i get across some problems while trying to implement the way u do it.
Rgds
Jai Gurudeva
Rohan
rdbailey
17th October 2002, 23:50
Sure, you can PM me and I could walk you through some details. It is a simplistic approach, but I hate doing stuff the hard way if I don't have to. :)
rohan_rege
17th October 2002, 23:56
hi ron,
i have not worked much with reports..but am going to surely try my hand at it ..
one question i had before going ahead...
i will be putting many fields in the report ...the total length will go as much as 277 characters...
does baan report has a max limit of the total size of a detail line...
thanks
Jai Gurudeva*
Rohan Rege
rdbailey
18th October 2002, 00:08
I just modify the size of the report form (second form in maintain reports) to accomodate large files (I currently have a report that generates our EDI). The variable declaration can use tcmcs.str300m to give you the length you are looking for.
rohan_rege
18th October 2002, 00:25
hi ron ,
i tried changin the report size on the second form...butit wudnt let me increase it higher than 132 as the columns
also ,what do the diff types of report signify..type 1 , 2 and 3
I didnt understand ur following statement :
The variable declaration can use tcmcs.str300m to give you the length you are looking for.
rgds
Jai Gurudeva
Rohan
gfasbender
18th October 2002, 00:53
Try something like this:
long fptr
string buf(1000)
fptr = seq.open("${BSE}/data/pohist", "w+")
select tdpur050.*, tdpur051.*
from tdpur050, tdpur051
where tdpur051 refers to tdpur050
and YourOtherCriteria
selectdo
buf = sprintf$("%s~%s~%s~%d~%d~%s",
tdpur050.fld1,
tdpur050.fld2,
tdpur050.fld3,
tdpur051.fld1,
tdpur051.fld2,
tdpur051.fld3)
seq.puts(buf, fptr)
endselect
seq.close(fptr)
rohan_rege
18th October 2002, 01:02
hi gordon,
ya , i will try that....
also wanted to know one thing...
the req is that , once the ascii file is created ...i have to append a
date/time stamp at the end of the ascii file name i create using the code u had posted.
is such a thing possible...if yes ..how ?
rgds
Jai Gurudeva
Rohan
gfasbender
18th October 2002, 01:37
Merge the following into the code I supplied above to create your filename with a date/time stamp.
string dstr(12)
string fname(200)
dstr = dte$()
fname = sprintf$("${BSE}/log/pohist_%s%s%s_%s%s%s"
dstr(1;2), dstr(3;2), dstr(5;2),
dstr(7;2), dstr(9;2), dstr(11;2))
fptr = seq.open(fname, "w+")
dansimmo
18th October 2002, 03:21
We use safari to to simple queries. You can print to csv file and the benefit is that you can fit many fields accross the page. Safari will export the full field even if the feild in the layout is very narrow.
The other option is easy SQL
rohan_rege
18th October 2002, 18:13
hi ,
Whats this Safari .....is it free download...or we have to purchase it...is there any doc. on it available...
can u throw some more light on what this safari is abt ?
also i have heard abt Easy SQL but never used it...any idea ...
if we have any doc.on it also on baan board...
also how does easy sql help me for my purpose....?
thanks a lot
Rohan
dansimmo
20th October 2002, 02:23
Safari is an external report writer that was aligned with baan but i think is no longer. It costs money unfortunately.
Easy SQL is good because you do not need to create sessions and it will write some of the sql for you. You can then edit the sql for more complex queries and edit the report. Reports can also be included on users menus (if you use the DEM menus) vie the execute query session. Also can be made into jobs.
In the baan report it is easy to place delimiters between fields and the baan date and time stamp are available as standard.