ankybanky
22nd June 2002, 18:47
Hi friends

I need to call a baan session (customised session) through a shell
(Unix) and pass a parameter (eg Item code as input field ) and get a report based on this item (which i have already prepared.
the basic intention being i need to access baan only for the instance to get data and redirect the output to a temp file .
So that my license usage is restricted .
I need to call the baan session through shell and not the shell through baan.
I know there is one way by using connectkit , but then it fails if i have dumb terminals where in i dont have browser or cant open
visual basic components .
what i want to do is something like this in the shell
-----------------------------------------------------------------------
ba6.1 tddev0401m000 ITEMCODE1 > /tmp/tempfile
exit
-----------------------------------------------------------------------
how do i get a report out of it ?????????????
regards Ankur

NPRao
22nd June 2002, 20:40
Hi Ankur,

Yes you can do it. You have to use a 3-GL program and called that session with a shell program. If you have a session, which needs inputs for the form fields, then you have to make a AFS dll for that session and pass the variable from the 3-GL program to that DLL to start the session.



function main()
{
long no.of.args
string arg1(10)
string arg2(10)

no.of.args = argc()
arg1 = argv$(0)
arg2 = argv$(1)
Â…
|* your functionÂ….
}

ankybanky
23rd June 2002, 13:25
Hi prashanth
Didnt undersand ,
can you make it more clear ?
I want to pass an item code to the session which will explode the
bom for it , this thing i want to do it in shell and get the report in a file format
any help will be of great help
regards Anky

mark_h
24th June 2002, 15:54
What NPR was saying was that you could write a 3gl script that would capture your parameters and do what you want. Here is an example:


function main()
{
long no.of.args
string arg1(10)
string arg2(10)
domaint tcitem some.item

no.of.args = argc()
some.item = argv$(0)

| Now run function server to print BOM report
spool.device = "ASCIF"
| Put you stpapi commands here.
stpapi.put.field(....)
}


Then when the program is done do a exit. I believe you might also be able to do a exit(1) for your script to know that there was an error.

Good Luck!

Mark

NPRao
24th June 2002, 20:16
Thanks for the tip Mark...

Ankur, I am not much into functional stuff... so I couldnt explain you more...

In your 3-GL script you can use the Function Server/API calls to the BOM sessions/reports or build your own logic which also writes an output file, using seq.open, seq.puts etc functions.

I dont think we can pass the return values from the BaaN 3-GL code to the OS shell scripts. Hence you have to write a log file to the OS to check of the process went fine or not, you can write some status like "OK", "Problem", "Item not found" etc... possibilities.

Good Luck!

Richard Chan
26th June 2002, 15:25
Ankur,
I am also interested in doing the same for my barcode project.
If you manage to pass the parameters to a temp file,Let me know
Thanks
Richard