Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 5th October 2017, 12:41
pralash pralash is offline
Member
 
Join Date: Feb 2017
Posts: 62
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Read a record from baan table and write it into the text file
Baan: Other/Unknown
C/S: None/Unknown

Hi,
I'm new to LN Programming.... I want to know how to read a record one by one from baan table and also how to store these records into the text files. Can anybody please give the sample script for this task...
Thanks in Advance,
Regards,
Pralash
Reply With Quote
  #2  
Old 5th October 2017, 14:07
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Look at the other post to see how to find a set of all the records I posted. Basically all you do is open a file select records, write them to the file. This is what I do in 4c4

Code:
|This opnes a temp file and I write a header record to it.
	temp.itm = creat.tmp.file$(bse.tmp.dir$())
        temp.itm = strip$(temp.itm)
        output.itm = seq.open(temp.itm,"w")
	buff = "SOURCE|DESCRIPTION|STATUS CODE|ITEM|ITEM TYPE|LONG DESC|INV. ORG|UOM|FIXED DAYS SUPPLY|FIXE LOT MULTIPLIER|"
	     & "FIXED ORDER QTY|MAX ORDER QTY|MIN. ORD QTY|PLANNER CODE|SHELF LIFE|POSTPROCESSING LEAD TIME|"
	     & "PREPROCESSING LEAD TIME|PROCESSING LEAD TIME|HEIGHT|LENGTH|WEIGHT|WIDTH|BUYER|INSPECTION|TEMPLATE|"
	rc = seq.puts(buff, output.itm)

Inside the selectdo create a buffer - I use sprint but you could just concatenate string fields. So you can search sprint.
Code:
	buff = 	sprintf$("WS|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s", 
		strip$(desc.item), org.csig, trim$(itemmaster.item), itemtype, "", pegorg, converted.uom, conv.ordi, conv.oqmf , conv.fioq, "", "",
		make.planner, conv.shld, conv.post, conv.prep, conv.proc, conv.heig, conv.leng,	conv.weig, conv.widt, strip$(tcudi005.psno), org.insp, itemtemplate)
	rc = seq.puts(buff, output.itm)
and last I close the file and move it down to a client machine. Output dir is another form field - so user can tell me where the files go. You can search on each of the commands below.
Code:
	rc = seq.flush(output.itm)
	rc = seq.close(output.itm)
| Create temporary file to copy the PC file to
	temp.file = output.dir & "WS_ITEMS_DATA_V10.txt"
	rc = server2client(temp.itm, temp.file, 1)
	rc = seq.unlink(temp.itm)

The best advice I can give is to try it yourself and debug what you write. Step thru command by command just to see what the coding does.
__________________
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
Sponsored Links
  #3  
Old 6th October 2017, 08:09
pralash pralash is offline
Member
 
Join Date: Feb 2017
Posts: 62
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Thank a lot.... I try to implement the script by using your example...
Regards,
Pralash
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
Use of DAL Question metropoj Tools Development 4 10th May 2012 16:32
Audit file structure baan_user Tools Development 8 4th May 2007 14:32
ERPJewels Hitesh Shah Third Party Products 10 6th November 2006 05:38
general functions for table field manipulations Hitesh Shah Code & Utilities 8 5th May 2006 06:00
can't write file from server to baan table ltannous Tools Development 6 4th July 2003 16:32


All times are GMT +2. The time now is 01:35.


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