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 16th July 2007, 15:10
justknowledge's Avatar
justknowledge justknowledge is offline
Junior Member
 
Join Date: Jul 2006
Posts: 24
justknowledge is on a distinguished road
Baan: Baan IV - DB: Oracle - OS: Unix HP
Question Problem in AFS for Print Sales Invoice

Hi ,

I am writing AFS for print sales invoice however i am facing problem to print sales invoice report and change the status as well as generating invoice number in table tdsls045.

I am not able to trace out where the actual problem is in my code.

Can sombody please help me.

Regards
Nitesh


Quote:
domain tcncmp cmpnr
cmpnr = get.compnr()

rprt_log = creat.tmp.file$(bse.tmp.dir$())
stpapi.put.field( "tdsls4404m000", "Printed", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "inv.date", str$(date.num()))
stpapi.put.field( "tdsls4404m000", "selection", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "comp.f", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "comp.t", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "cuno.f", "")
stpapi.put.field( "tdsls4404m000", "cuno.t", "ZZZZZZ")
stpapi.put.field( "tdsls4404m000", "orno.f", str$(orno1))
stpapi.put.field( "tdsls4404m000", "orno.t", str$(orno1))
stpapi.put.field( "tdsls4404m000", "copt.f", "")
stpapi.put.field( "tdsls4404m000", "copt.t", "ZZZ")
stpapi.put.field( "tdsls4404m000", "amount.f", str$(-9999999999.00))
stpapi.put.field( "tdsls4404m000", "amount.t", str$(9999999999.00))
stpapi.put.field( "tdsls4404m000", "definite", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "direct.process", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "exci.inv", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "totals", str$(etol(tcyesno.no)))

|if prnt.options tcyesno.yes then make prnt.sellpr = tcyesno.no
|if prnt.options tcyesno.no then make prnt.sellpr = tcyesno.yes
|because only one rpt can be set be set thru AFS.

|so selection as to be make
stpapi.put.field( "tdsls4404m000", "prnt.options", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "prnt.sellpr", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "reportgrp","1")
stpapi.put.field( "tdsls4404m000", "spool.fileout",rprt_log)
stpapi.set.report("tdsls4404m000", "rtdsls440401000","D",error.mess)
if isspace(error.mess) then
stpapi.print.report("tdsls4404m000", error.mess)
stpapi.continue.process("tdsls4404m000",error.mess)
else
stpapi.recover("tdsls4404m000", error.mess)
endif

stpapi.end.session("tdsls4404m000")

Reply With Quote
  #2  
Old 16th July 2007, 15:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Search for tdsls4404m000 and you will find some other posts to look at - like this thread. I believe one post mentions a patch needed.

I do not think these two lines are needed:
Code:
stpapi.put.field( "tdsls4404m000", "reportgrp","1")
stpapi.put.field( "tdsls4404m000", "spool.fileout",rprt_log)
Then again we do not use the session, but from the one example I looked at they did not set these fields.

Good Luck!
__________________
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 17th July 2007, 13:30
justknowledge's Avatar
justknowledge justknowledge is offline
Junior Member
 
Join Date: Jul 2006
Posts: 24
justknowledge is on a distinguished road
Baan: Baan IV - DB: Oracle - OS: Unix HP
I think its a bug

Hi Mark,

I think there is a bug in tdsls4404m000 AFS when you run session with specific order basis. when i run afs with specific orders and put final invoice to tcyesno.yes or tcyesno.no same proforma prints.

Where as per logic if i put tcyesno.yes in final invoice field it should print sales invoice and if i put tcyesno.no in final invoice it should print performa

However if i choose only order range and not specific order AFS works perfactly (Print sales invoice,Update sales order status,generate invoice no)

I went through all the thread available and applied every possible option but couldn't successed.

please provide suggestion for same.

Regards
Nitesh
Reply With Quote
Sponsored Links
  #4  
Old 17th July 2007, 15:53
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Yes - sounds like a bug. You can always contact support and see if they have a solution.

This may not work for you, but what I did for print specific purchase orders, was to ask the user to enter up to 10 orders. Then in the background I ran the session 10 times for each of the orders using the print by order range. So I just ran the session for each individual order 1 at a time. The difference was that my users were always printing - I know at one point I did not let them pick a display device. Just a thought.
__________________
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.

Last edited by mark_h : 18th July 2007 at 16:08.
Reply With Quote
  #5  
Old 18th July 2007, 06:19
justknowledge's Avatar
justknowledge justknowledge is offline
Junior Member
 
Join Date: Jul 2006
Posts: 24
justknowledge is on a distinguished road
Baan: Baan IV - DB: Oracle - OS: Unix HP
good idea

your idea is good however i will have to speak to my functional consultant regarding this option.

Thanks for your suggestions

Regards
Nitesh
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
Unable to print a specific sales invoice through api calls Punitha AFS/DDC/OLE: Function servers 12 16th July 2007 07:07
problem in AFS - Sales Order Splitting veyant AFS/DDC/OLE: Function servers 7 10th May 2006 06:40
open purchase order with wrong price nopadon Distribution, Transportation & Warehousing 2 4th March 2006 15:11
Problem in Session Print Sales Invoice manusatsangi Finance, Invoicing and Integration 1 5th July 2004 08:56
sales return integration not reversing invoice totals and revenue anshum Finance, Invoicing and Integration 1 27th June 2003 09:43


All times are GMT +2. The time now is 00:32.


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