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

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 22nd October 2004, 21:46
BurghMan's Avatar
BurghMan BurghMan is offline
Junior Member
 
Join Date: Jun 2002
Location: Pittsburgh, PA, USA
Posts: 16
BurghMan is on a distinguished road
Baan: Baan IVc4 - DB: SQL Server 2008 - OS: Windows 2008 R2 Standard
AFS - Print Order Documents

I am making my first attempt at AFS. I am attempting to automate the print order documents session (tisfc0408m000). The reason for this is that our company started printing all documents duplex to save money. When printing a range of production orders and when the route sheet is an odd number of pages, the start a new route sheet prints on the back of the paper. They want all new route sheets to start on a new sheet of paper.

I thought with AFS I could print each document individually to solve this problem.

I am posting my code. I copied the original forms to my session and added afs. to all form fields. I am getting a “No data within selection” message.

Also, I have AFS logging turned on, but I am not sure what to look for. I can post the afs log if that would help.

Thanks in advance,
Code:
|********************************************************
declaration:
     #pragma used dll ottstpapihand
|*********************************************************
choice.cont.process:
on.choice:
            execute(print.data)
            choice.print.data:
on.choice:
            if          rprt_open() then
                        read.main.table()
                        rprt_close()
            else
                        choice.again()
            endif                             
 functions:
|******************************************************
function read.main.table()
{
            afs.pdno = afs.pdno.f
            while afs.pdno <= afs.pdno.t 
                        afs.tisfc0408m000()
                        afs.pdno = afs.pdno + 1
            endwhile
}
|*********************************************************
function afs.tisfc0408m000()
{
|*********************************************************

            cprj.f    =  afs.cprj.f       | ( I added afs. to all the fields on my form
            cprj.t    =  afs.cprj.t 
            pdno.f   =  afs.pdno.f 
            pdno.t   =  afs.pdno.t 
            opno.f   =  afs.opno.f 
            opno.t   = afs.opno.t 
            prdt.t    = afs.prdt.t 

|********************************************************
 stpapi.enum.answer("tisfc0408m000", "order.sorted", tisfc.osrt.order)
 stpapi.put.field("tisfc0408m000","cprj.f", afs.cprj.f)
 stpapi.put.field("tisfc0408m000","cprj.t", afs.cprj.t)
stpapi.put.field("tisfc0408m000","pdno.f", str$(afs.pdno.f))                                
stpapi.put.field("tisfc0408m000","pdno.t", str$(afs.pdno.t))        
stpapi.put.field("tisfc0408m000","opno.f", str$(afs.opno.f))                                            
stpapi.put.field("tisfc0408m000","opno.t", str$(afs.opno.t))                                         
stpapi.put.field("tisfc0408m000","prdt.t", str$(afs.prdt.t))           
stpapi.enum.answer("tisfc0408m000", "document.sorted", tisfc.dsrt.doc.by.order)
stpapi.enum.answer("tisfc0408m000", "print.org", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "print.dupl", tcyesno.yes)
stpapi.enum.answer("tisfc0408m000", "print.modi", tcyesno.yes)
stpapi.enum.answer("tisfc0408m000", "covn.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "roul.b", tcyesno.yes)
stpapi.enum.answer("tisfc0408m000", "oprn.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "matl.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "matn.b", tcyesno.no)
stppapi.enum.answer("tisfc0408m000", "subn.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "chel.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "sawl.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "collect.sawl", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "cutl.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "collect.cutl", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "recn.b", tcyesno.no)
stpapi.enum.answer("tisfc0408m000", "insn.b", tcyesno.no)
|*********************************************************
           error.msg.1 = ("Error Setting Report")
           error.msg.2 = ("Error Printing Report")
**********************************************************

stpapi.set.report("tisfc0408m000", "rtisfc040802001","ASCII",error.msg.1)
stpapi.print.report("tisfc0408m000", error.msg.2)
stpapi.end.session("tisfc0408m000")

|*********************************************************

}

Last edited by patvdv : 22nd October 2004 at 22:32. Reason: Added CODE tags
  #2  
Old 23rd October 2004, 16:31
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.

A quick search turned up this thread . Check out his code and some of the comments. I think the first thing you need to do is use str$ on the enumerated fields. You may have to play with which report to set. Not sure about this, but I just did outbound advice and in order to get the shortage listing I actually have to set the report to the advice report. Just something to think about, but first check the other post.

Mark
  #3  
Old 26th October 2004, 15:42
BurghMan's Avatar
BurghMan BurghMan is offline
Junior Member
 
Join Date: Jun 2002
Location: Pittsburgh, PA, USA
Posts: 16
BurghMan is on a distinguished road
Baan: Baan IVc4 - DB: SQL Server 2008 - OS: Windows 2008 R2 Standard
mark_h,

I tried setting using the str$ on all ennumerated fields and I have the report set to the route sheet in this statement.
stpapi.set.report("tisfc0408m000", "rtisfc040802001","ASCII",error.msg.1)
Is that what you mean?

The thread also mentioned setting the report group to 14. I tried that and setting the report group to 2 (reportgrp = 2) since there is no report group 14 attached to print order documents that I can see.

I am still getting the " No Data within selection error"

Is there any documentation that you know of on the afs log?

Thanks in advance, BurghMan
  #4  
Old 27th October 2004, 04:50
Paul P's Avatar
Paul P Paul P is offline
Guru
 
Join Date: Jul 2002
Location: Jakarta, Indonesia
Posts: 797
Paul P is on a distinguished road
Baan: BaanIV, BaanERP - DB: SQL Server, Informix, Oracle - OS: Windows, HP-UX
Dear BurghMan,

Simply use stpapi.put.field() for all those fields you use in the codes since they are screen fields to be filled up. Please use stpapi.enum.answer() only to answer pop-up questions that normally appear if you execute the session manually.

Rgds,
Paul
__________________
Pambudi

Visit my technology consulting blog
Sponsored Links
  #5  
Old 27th October 2004, 15:04
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
Paul is correct - I just noticed all of your stpapi.enums. Here is what worked for me to get only the routing list.

Code:
	string	msg(100)
	domain	tcdate	today
	today = date.num()
	stpapi.put.field("tisfc0408m000", "order.sorted", str$(tisfc.osrt.order))
	stpapi.put.field("tisfc0408m000","ccot.f", " ")
	stpapi.put.field("tisfc0408m000","ccot.t", "ZZZ")
	stpapi.put.field("tisfc0408m000","cprj.f", "")
	stpapi.put.field("tisfc0408m000","cprj.t", "ZZZZZZ")
	stpapi.put.field("tisfc0408m000","pdno.f", "323419")                                
	stpapi.put.field("tisfc0408m000","pdno.t", "323419")        
	stpapi.put.field("tisfc0408m000","opno.f", "")                                            
	stpapi.put.field("tisfc0408m000","opno.t", "999")                                         
	stpapi.put.field("tisfc0408m000","prdt.t", str$(today+1000))           
	stpapi.put.field("tisfc0408m000", "document.sorted", str$(tisfc.dsrt.doc.by.order))
	stpapi.put.field("tisfc0408m000", "print.org", str$(tcyesno.yes))
	stpapi.put.field("tisfc0408m000", "print.dupl", str$(tcyesno.yes))
	stpapi.put.field("tisfc0408m000", "print.modi", str$(tcyesno.yes))
	stpapi.put.field("tisfc0408m000", "covn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "roul.b", str$(tcyesno.yes))
	stpapi.put.field("tisfc0408m000", "oprn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "matl.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "matn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "subn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "chel.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "sawl.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "collect.sawl", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "cutl.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "collect.cutl", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "recn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "insn.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "pcdl.b", str$(tcyesno.no))
	stpapi.put.field("tisfc0408m000", "print.config", str$(tcyesno.no))
	stpapi.set.report("tisfc0408m000", "rtisfc040801000","D66",msg)
	stpapi.continue.process("tisfc0408m000", msg)
	stpapi.end.session("tisfc0408m000")

Please note that I am on 4c4 A&D 1. So I might have some fields on my form that you do not have.

Mark
  #6  
Old 29th October 2004, 21:07
BurghMan's Avatar
BurghMan BurghMan is offline
Junior Member
 
Join Date: Jun 2002
Location: Pittsburgh, PA, USA
Posts: 16
BurghMan is on a distinguished road
Baan: Baan IVc4 - DB: SQL Server 2008 - OS: Windows 2008 R2 Standard
Success!

You and Paul are both correct. It is working great, thanks so much for your help!!
Closed Thread


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
India Localization problem while making afs of Purchase Order crdeshpande AFS/DDC/OLE: Function servers 6 26th November 2003 10:25
Print Order Documents benito Manufacturing & Supply Chain 1 2nd November 2002 02:27
AFS - Automating Print Order Document and Release Problem!!! gous99 AFS/DDC/OLE: Function servers 6 6th September 2002 20:50
Not able to print customer text on Sales Order documents rmbarr Tools Development 7 12th March 2002 10:07


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


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