Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 6th February 2006, 17:34
jhargett jhargett is offline
Junior Member
 
Join Date: Nov 2002
Posts: 22
jhargett is on a distinguished road
Baan: Baan IVc4 - DB: Oracle - OS: Unix
A Method of Sending Data to Baan

I have had some success with this, so I thought I would pass it along. Especially since I got a lot of ideas from this board. This is a method I have used to integrate with Baan IVc4 without using OpenWorld or other (expensive) packages. You can actually write a Baan AFS script that can be called from the unix command line and pass data to it.

Here is the general flow of the process:
  1. Create a simple ASCII file containing the data to modify Baan. I use a simple format that can be parsed easily by a Baan function. For instance, for sales order data, something like this:
    Code:
    HEAD|017605|5XA|2/01/2006
    LINE|1|1001783|10
    LINE|2|1001821|20
    Each line can be parsed in Baan using the string.scan function.
  2. At the Unix command line, you can now call a Baan AFS script that you have created. I wrote a small shell script to do this. What this code does is, call a Baan script with 2 arguments. The first is the path to the data file that you created in step 1, and the second is a path to a new file that Baan can use to write data to.
    Code:
    #/usr/bin/sh
    # all BAAN and ORACLE env variables are set here
    . /baan/bse/bin/baan.env
    
    PATH=$BSE/bin:$PATH
    export PATH
    BASE_DIR=/apps/integration/so_integration
    DATA_FILES=${BASE_DIR}/data_files
    
    COMM_FILE=/tmp/soint_${$}.txt
    echo ${COMM_FILE}
    APP=$1
    FILE=$2
    CONO=$3
    INPUT_FILE=${DATA_FILES}/${APP}/${FILE}
    
    echo "Input file:${INPUT_FILE}"
    echo "Executing Baan session"
    echo "bshell6.1 -nodebug -server -set BSE_COMPNR=$CONO otdzls0201 $INPUT_FILE $COMM_FILE"
    bshell6.1 -nodebug -server -set BSE_COMPNR=$CONO otdzls0201 $INPUT_FILE $COMM_FILE
    echo "Baan session executed. Reading results..."
    { while read myline;do
       echo $myline
    done } < $COMM_FILE
    rm $COMM_FILE
    mv $INPUT_FILE ${DATA_FILES}/${APP}/processed/
  3. The Baan script that is called is a 3GL program script in Baan with no form. This can be done in session ttaad2130m000 - Maintain Program Scripts. This script can contain normal AFS function calls. Make sure you create a function called main, this is the entry point for the script.
    Here is a big piece of the puzzle, this main function can have arguments! Inside the main function, do this
    Code:
        // Baan 3GL code
        string input_file(128)
        string output_file(128)
    
        | command line arguements
        input_file = argv$(1)
        output_file = argv$(2)
    input_file is the ASCII file that you created in step 1. output_file will be a way for this script to communicate with the calling unix script.
  4. In the this Baan script, parse the input file that you created and use AFS to insert the data in to Baan. Any data that you want to pass back to the calling unix script, you write to the output file using seq.puts()

That's it in a nutshell. More info on creating AFS scripts can be found all over this forum and there is also some info on calling Baan objects from the command line using the bshell. Really the only thing that I discovered (which may also have been published somewhere, so I probably can't even take credit for) is that you can pass arguments to the Baan script from the command line. This is the key to passing data to the function and returning what it did. Granted, it is not the easiest method in the world, but it is cheap!

Hope it helps,
Jon
Reply With Quote
  #2  
Old 22nd January 2011, 17:53
anthony peiris anthony peiris is offline
Junior Member
 
Join Date: Dec 2008
Posts: 27
anthony peiris is on a distinguished road
Baan: v4 - DB: Oracle - OS: Hp-unix
Jon, What you proposed is great, keep on it..
Reply With Quote
  #3  
Old 24th January 2011, 16:41
jhargett jhargett is offline
Junior Member
 
Join Date: Nov 2002
Posts: 22
jhargett is on a distinguished road
Baan: Baan IVc4 - DB: Oracle - OS: Unix
The original post was quite old, but thanks! We have been using this method for the past 4 years with great success. We cut reliance on 3rd party applications. It scaled surprisingly well too. We are able to thousands of transactions a month with this method. It seems that soon we will finally be upgrading to Baan LN so this will no longer be needed, but it worked well when we did.
Reply With Quote
  #4  
Old 24th January 2011, 17:18
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,930
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Quote:
Originally Posted by jhargett View Post
The original post was quite old, but thanks! We have been using this method for the past 4 years with great success. We cut reliance on 3rd party applications. It scaled surprisingly well too. We are able to thousands of transactions a month with this method. It seems that soon we will finally be upgrading to Baan LN so this will no longer be needed, but it worked well when we did.
Why won't you need it for LN? Just curious. Since this method is a good way to interface systems.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 24th January 2011, 17:23
jhargett jhargett is offline
Junior Member
 
Join Date: Nov 2002
Posts: 22
jhargett is on a distinguished road
Baan: Baan IVc4 - DB: Oracle - OS: Unix
That was said out of pure ignorance

Other people in my company are working on the Baan LN upgrade. I am told by them that we have other options for integrations. Perhaps they purchased a piece that allows integration. I have no idea.
Reply With Quote
  #6  
Old 27th January 2011, 10:06
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 573
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Thumbs up

I've been using this method for years, too. Since I normally use "ba6.1 <object>" instead of "bshell6.1 -nodebug -server <object>", I made a simple timing measurement. And: Wow! Your way takes 0.59 seconds, my way takes about 3 seconds (on a very old test system).

Are there any other differences between these to versions to keep in mind?

Günther

Last edited by günther : 27th January 2011 at 10:21.
Reply With Quote
  #7  
Old 6th September 2013, 18:53
dhowells's Avatar
dhowells dhowells is offline
Member
 
Join Date: Oct 2001
Location: Detroit, MI
Posts: 52
dhowells is on a distinguished road
Baan: Baan 4c4 - DB: Oracle - OS: UNIX
Has anyone accomplished this on Windows NT?
Reply With Quote
Sponsored Links
  #8  
Old 6th September 2013, 21:23
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

Yes it can be done in Windows. You can also use VB script to update , insert, delete data in tables.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent help needed in Baan srivatsrs Miscellaneous 0 7th January 2005 16:04
Data Migration from Baan IV c4 SP4/WinNt4.0 to Baan IV c4 SP9/Windows2000 Server Gigaman Operating Systems & Databases 0 22nd July 2004 04:57
Not authorized to run as user baan positive Tools Administration & Installation 7 29th June 2004 09:56
baan40c4 - oracle ottogolze Operating Systems & Databases 7 3rd February 2003 13:34


All times are GMT +2. The time now is 03:42.


©2001-2017 - Baanboard.com - Baanforums.com