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
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 20th June 2017, 14:29
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 568
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face Unable to output a file with Device (re-write file)

Hello All,

This is for Baan IV

I want to call Print Purchase Order session (tdpur4401m000) for a range of supplier. I am selecting a Device with Re-write file type . I am specifically setting spool.fileout variable but the system is not generating the file at given path with given name. It is not generating any file.

The status of purchase order properly set to tdpur045.spur = 3

Can anybody guide what could be wrong in the given code ?

Vishal
Attached Files
File Type: txt code_snippet.txt (622 Bytes, 8 views)
Reply With Quote
  #2  
Old 21st June 2017, 13:15
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
From the looks of the code the supplier from and to are the same so only one PO would go out to the file. Second before I do a set.report I typically set spool.device to something specific and then spool.fileout to a file name. Quick example is something like this:
Code:
                spool.device = "ASCIF"
                spool.fileout = creat.tmp.file$(bse.tmp.dir$())
                print_goods_received(purchase.order,tdpur.kofl.inc.printed,errmsg)
__________________
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
  #3  
Old 21st June 2017, 13:18
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
I forgot to mention - that there have been times where I want to run the same session in 4c4 repeatedly and put the output to a new file. When I do that the spool.fileout does not always change - so for example if I ran the above code in a look even creating a new temp file the output would always end up in the first file I created. To get past his what I ended up doing in a couple of cases was importing spool.device (using code extender qkey) and spool.fileout into the called session - that solved my problems.
__________________
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
  #4  
Old 21st June 2017, 15:56
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 568
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hello Mark,

Thanks for your guidance. I was able to generate file after using spool.close() before stpapi.end.session(). Once, the file is generated in temp folder, i just rename it using file.mv(fileout, CURRDATE_BATCH_SUNO). The problem is that it does not generate file for another supplier (obviously as spooler is closed before calling stpapi.end.session).

Vishal
Reply With Quote
Sponsored Links
  #5  
Old 22nd June 2017, 09:44
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 568
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face Success in generating supplier-wise report

Hi Mark,

I was able to successfully generate a separate file for every vendor.

The mistake I was making is I had kept the stpapi.end.session() inside the loop. I kept the spool.close() inside the loop and moved out stpapi.end.session() and it worked.

I have attached sample script if anybody encounters the similar issue.

Vishal
Attached Files
File Type: cln script.cln (1.5 KB, 4 views)
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
Programming Question mr_suleyman Tools Development 37 11th November 2016 08:14
bshell received SIGTERM manojsharma Tools Development 11 5th June 2008 09:22
Audit file structure baan_user Tools Development 8 4th May 2007 14:32
How to print Postcript in landscape orientation heliopaixao Tools Administration & Installation 8 28th July 2006 13:39
seq.open berthe Miscellaneous 4 12th May 2005 10:20


All times are GMT +2. The time now is 21:22.


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