benito
2nd May 2012, 13:44
i have a baan script that prints labels in the shop floor. it's interactive and it brings an input form if the quantity printed (qty x number of boxes) is still less than the received quantity. this is in the dll called by main program and all works well as expected. the problem is i will also be calling this dll through the BDE. the purpose is to have a front end written in java on the intermec scanner. (this interactive feature is a new requirement and didnt plan for this before writing the dll). short of re-writing the whole thing and bring this logic into the java front-end, is there a way i can call a non-baan form (pls see my note: open external program) like html, dos screen, etc that can pass a value to baan? i can probably call an asp page, take the user input and place the value in a temp baan table but i thought that would give me a lag as i need the value fast so i can print the labels.


select whinh312.*
from whinh312
where whinh312.rcno = {:i_rcno}
order by whinh312.rcno,whinh312.rcln
selectdo
prnt.qty = whinh312.qrec
if (print.box.yn = tcyesno.yes or printbox = 1 ) then

for num.of.boxes = 1 to i_nbox

quan1 = i_bqty
print_one_label("1 ")
endfor

rem.qty = whinh312.qrec - (i_bqty * i_nbox)
if rem.qty > 0 then
if baan_prog = true then
REPEAT
ret.str = start.session(MODAL,
"bbinh3412m001",
"bbinh3412m000",
"")
print.box.yn = tcyesno.no
import("box.qty", box.qty)
quan1 = box.qty
print_one_label("1 ")
rem.qty = rem.qty - quan1
UNTIL rem.qty <= 0
else
|* open external program; coming from BDE
|
|start.application.local ???

endif
endif

else
quan1 = whinh312.qrec
print_one_label("1 ")
endif
endselect

benito
3rd May 2012, 17:43
any takers yet?

mark_h
3rd May 2012, 21:01
You might have to wait a while for others to find this thread. About the only thing I have done is call DLL's from excel - which did something in baan. This is only something I played with and not something we ever did in production environment - I also had issues all the time with upgrades. I am by no means an expert on any of this.

norwim
10th May 2012, 13:46
Hi benito,

don't know whether this will be of help for you, but I had to do something similar, just the other way round: call a Baan Session from external and pass variables to it.
Start of session xxyyy1234m000 with "I" "can" "pass" "something"
ba6.1 xxyyy1234m000 I can pass something
This is how to retrieve the variables:
for i=1 to argc()-1
value(i)=argv$(i)
endfor
IIRC, argv$(0) contains the sessionsname itself
Perhaps you can use this to control printing with external programs and keep track of the status in Baan in background?

regards
Norbert

benito
10th May 2012, 14:59
hi norwim,

just to be clear, my intermec scanner is running on windows mobile. i will need a screen that comes up, takes a user input (quantity), hit enter. this data will be accepted by LN dll and processed per my script.

i have tested by running this dll through bde (eclipse) but the computer has baan installed on it. it called the unix shell and executed the script. but i cannot open the same in the scanner.

if baan_prog = true then
REPEAT
ret.str = start.session(MODAL,
"bbinh3412m001",
"bbinh3412m000",
"")
print.box.yn = tcyesno.no
if box.qty <= 0 then
import("box.qty", box.qty)
endif
quan1 = box.qty
if quan1 <= 0 then |* for runaway printing
quan1 = rem.qty
endif
print_one_label("1 ")
rem.qty = rem.qty - quan1
UNTIL rem.qty <= 0
else
|* open external program

ret = shell( "/erpln_shared/loch/2/test.sh", SHELL_MWINDOW )
|file2 = "/erpln_shared/loch/2/result1"
|fp = seq.open(file2, "r")

endif

benito
10th May 2012, 15:07
this is the content of test.sh:

echo "Please enter a quantity..."
read var1
echo $var1 > /erpln_shared/loch/2/result1

baanconsultant
11th May 2012, 12:15
Hi benito,

I normally create a webservice to connect windows mobile devices to Baan. The webservice is installed on a server with the Baan client installed. It receives the call from the mobile device, forwards it to baan, receives the response and forwards the response to the scanner. You might do some extra processing on the webservice-part to get some load of the scanner.

Kind regards,

Djaloeka Griep

benito
14th May 2012, 13:56
hi Djaloeka ,

yes i do have a webservice that accesses my custom bde. you are right that i might do some extra steps on the webservice part to get the functionality i want. i might probably do that in phase 2 of the project. i plan to go live without this functionality in a couple of weeks. thanks for the input.

benito