arunalv
28th January 2003, 22:10
Not a Baan expert so need some help here!

Trying to change an existing Session to read a particular file when the session is run for that company in question:

Now the session has hadrcoded file name (InfoA) I want to include another file (InfoB) so that when the Session is run for company B it will upload the file for the same.

In the code presently it is:

file = filename & "data/import_dat/InfoA.txt"

I also want to include another file InfoB.txt which may or maynot be there. I will take care of the file existing condition outside of the Session. I just want the Session to be able to read both files.
How do I change it? Is it better to create another new Session for this Company 'B' or can I do it in the existing Session itself?


Thanks!

gfasbender
28th January 2003, 23:49
Why don't you use a company designator in the file name, instead of A or B? For example: "Info600.txt"

file = filename & sprintf$("data/import_dat/Info%03d.txt" , get.compnr() )

That way, the session will read and process the data file for the company you're in.

Just a suggestion.

OmeLuuk
29th January 2003, 13:28
Do talk to your customizing partner (or your current one) :-)

arunalv
29th January 2003, 13:29
Your suggestion seems the right thing to do but since there is already hardcoding of the .txt in the Session I wanted to know if I could do the same for another company? Someone has already hardcoded the file name so I just wanted to keep the same pattern.

OmeLuuk
29th January 2003, 13:34
Another option maybe ... file = filename & "data/import_dat/InfoA.txt"how is filename filled, maybe you can use the same name from another path... The other option is to add a shell script somewhere to do a rename or move action on session start ...

But without source code changes it will be hard to do. That is why I would opt for the customizing partner.