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 22nd March 2014, 05:05
jojovalenton jojovalenton is offline
Senior Member
 
Join Date: Aug 2007
Posts: 182
jojovalenton is on a distinguished road
Baan: InforLN FP7 - DB: SQL Server 2008 R2 - OS: Window Server 2008 R2
how to call session specific commands in afs

Hello,

Need help on how call session specific commands from AFS script for example I want to run Release Orders... (Ctrl+Shift+R) from tisfc0501m000 specific?

Thanks,

Jojo
Reply With Quote
  #2  
Old 22nd March 2014, 06:37
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
hi,

You can use

stpapi.form.command("tisfc0501m000 ", 5 ,"Release Orders", error.message)

where
1st argument : Session name
2nd Argument : 2 or 5 : 2 for session and 5 for function
3rd argument : function or sessioon name
4th argument : error message
Reply With Quote
  #3  
Old 22nd March 2014, 15:42
jojovalenton jojovalenton is offline
Senior Member
 
Join Date: Aug 2007
Posts: 182
jojovalenton is on a distinguished road
Baan: InforLN FP7 - DB: SQL Server 2008 R2 - OS: Window Server 2008 R2
hello,

Thanks for the reply and now its calling the release order session but the report can't be recognized bec I dont know how to select report from LN report dialog box in afs script.

regards,

jojo
Attached Images
File Type: jpg report dialog box.JPG (7.7 KB, 36 views)
Reply With Quote
  #4  
Old 23rd March 2014, 18:01
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
Use stpapi.set.report command. You just need the report defined before the AFS command that starts the report generating.
__________________
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 March 2014, 06:13
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
use stpapi.set.report("tppin4200m000", "rtppin420001000", "D", error.msg)

where
1st Args: Session name
2nd Args: Report Code
3rd arg : Device
4th arg: Error message
Reply With Quote
  #6  
Old 24th March 2014, 06:16
sachinbaan's Avatar
sachinbaan sachinbaan is offline
Senior Member
 
Join Date: Oct 2013
Posts: 166
sachinbaan is on a distinguished road
Baan: ERP LN - DB: MS SQL - OS: Microsoft Server
To Print The Report For Which You Set the report:
use this command
stpapi.continue.process("ttstpsplopen",err)
Reply With Quote
  #7  
Old 24th March 2014, 07:32
jojovalenton jojovalenton is offline
Senior Member
 
Join Date: Aug 2007
Posts: 182
jojovalenton is on a distinguished road
Baan: InforLN FP7 - DB: SQL Server 2008 R2 - OS: Window Server 2008 R2
report name not filled

hello,

thanks for all the replies, really appreciated but one error message still appearing "report name not filled" but it's filled up in the afs script:
Code:
function afs.run.tisfc002.1(
   domain tcpdno sfc.pdno.afs)
{  |release production order
   domain  tcmcs.str100 error.msg
   long ret1
   error.msg = ""
   domain tcyesno print.process, print.error, check.shortages, shortage.report, interactive
      |* AFS Script
   stpapi.put.field("tisfc0501m000","tisfc001.pdno",sfc.pdno.afs)
   ret1 = stpapi.find("tisfc0501m000",error.msg)
   if ret1 = 1 then
      stpapi.form.command("tisfc0501m000", 2, "tisfc0204m000", error.msg)  |session

     	stpapi.put.field("tisfc0204m000","pdno.f.segment.1",sfc.pdno.afs)
		stpapi.put.field("tisfc0204m000","pdno.t.segment.2",sfc.pdno.afs)
      stpapi.put.field("tisfc0204m000","cwar.f.segment.1","")
		stpapi.put.field("tisfc0204m000","cwar.t.segment.2","~~~~~~")
      stpapi.put.field("tisfc0204m000","cwoc.f.segment.1","")
		stpapi.put.field("tisfc0204m000","cwoc.t.segment.2","~~~~~~")
		stpapi.put.field("tisfc0204m000","prdt.f.segment.1",str$(0))
		stpapi.put.field("tisfc0204m000","prdt.t.segment.2",str$(utc.num()))
      stpapi.put.field("tisfc0204m000","pldt.f.segment.1",str$(0))
		stpapi.put.field("tisfc0204m000","pldt.t.segment.2",str$(utc.num()))
      stpapi.put.field("tisfc0204m000","item.f.segment.1","")
		stpapi.put.field("tisfc0204m000","item.t.segment.2","~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
      stpapi.put.field("tisfc0204m000","check.shortages",str$(etol(tcyesno.yes)))
      stpapi.put.field("tisfc0204m000","interactive",str$(etol(tcyesno.yes)))
      stpapi.put.field("tisfc0204m000","shortage.report",str$(etol(tcyesno.yes)))
      stpapi.put.field("tisfc0204m000","print.process",str$(etol(tcyesno.yes)))
      stpapi.set.report("tisfc0204m000","rtisfc020401000","N", error.msg)
      stpapi.continue.process("ttstpsplopen",error.msg)
      stpapi.put.field("tisfc0204m000","print.error",str$(etol(tcyesno.yes)))
      stpapi.set.report("tisfc0204m000","rtisfc020402000","N",error.msg)
      stpapi.continue.process("ttstpsplopen",error.msg)
      stpapi.form.command("tisfc0204m000", 5, "exec.cont.process",error.msg)  |function

      if not isspace(error.msg) then
         message(error.msg)
      endif
   endif
}

regards,

jojo

Last edited by mark_h : 24th March 2014 at 13:37. Reason: add code tags
Reply With Quote
  #8  
Old 24th March 2014, 14:00
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
What version of baan is this?

My first guess is this not 4c4 so I would expect to see:
Code:
	stpapi.set.report("tisfc0204m000","rtisfc020401000","N", error.msg)
	stpapi.form.command("tisfc0204m000", 5, "exec.cont.process",error.msg)  |function
That is assuming you have a spool.device named "N".


My second comment is that from looking at the code is that if it is like release outbound then you can only run 1 report at a time. What we do in release outbound - is print only the shortage report. Then we run the print outbound session and print all the other reports. I would say set everything to NO and see if the order releases. Then set only one report to yes (make sure the correct report number is in the stpapi.set.report) and see if it still works.

Another thing to try - don't zoom to tisfc0204m000 from tisfc0501m000. It looks like tisfc0204m000 is a main session. Just put the production order number in and run it. Not reason to use it as a subsession if it can be run as the main session.
__________________
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
  #9  
Old 26th March 2014, 06:56
jojovalenton jojovalenton is offline
Senior Member
 
Join Date: Aug 2007
Posts: 182
jojovalenton is on a distinguished road
Baan: InforLN FP7 - DB: SQL Server 2008 R2 - OS: Window Server 2008 R2
report name not filled

Thanks Mark for the reply, I'm using FP7 - integ 6.2. I used all the advised scripts send in to this issue but I still don't know why the message 'report name not filled' appear. Any additional help advise is welcome. Thanks.

jojo
Reply With Quote
  #10  
Old 26th March 2014, 13:54
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
I won't be much help with LN. If it was 4c4 this is exactly how I would test it. I would call the session directly and make sure I had the correct report number for the error report. I would not zoom from another session.

Code:
     	stpapi.put.field("tisfc0204m000","pdno.f.segment.1",sfc.pdno.afs)
	stpapi.put.field("tisfc0204m000","pdno.t.segment.2",sfc.pdno.afs)
	stpapi.put.field("tisfc0204m000","prdt.f.segment.1",str$(0))
	stpapi.put.field("tisfc0204m000","prdt.t.segment.2",str$(utc.num()))
	stpapi.put.field("tisfc0204m000","pldt.f.segment.1",str$(0))
	stpapi.put.field("tisfc0204m000","pldt.t.segment.2",str$(utc.num()))
	stpapi.put.field("tisfc0204m000","check.shortages",str$(etol(tcyesno.no)))
	stpapi.put.field("tisfc0204m000","interactive",str$(etol(tcyesno.no)))
	stpapi.put.field("tisfc0204m000","shortage.report",str$(etol(tcyesno.no)))
	stpapi.put.field("tisfc0204m000","print.process",str$(etol(tcyesno.no)))
	stpapi.put.field("tisfc0204m000","print.error",str$(etol(tcyesno.yes)))
	stpapi.set.report("tisfc0204m000","rtisfc020402000","D",error.msg)
	stpapi.form.command("tisfc0204m000", 5, "exec.cont.process",error.msg)

I might even make the error report no - and then just check to make sure the order released.
__________________
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
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
Sub session activating another sub session in AFS ameya_gidwani Distribution, Transportation & Warehousing 0 9th April 2013 13:33
AFS session not terminating in batch job rduncan10 AFS/DDC/OLE: Function servers 3 13th December 2012 14:45
Zoom Menu Return Multi Value layswan Tools Development 3 24th July 2012 09:42
How to call AFS in sp24? PV Ramone AFS/DDC/OLE: Function servers 4 2nd September 2008 11:06
AFS and session tfgld1107s000 jhargett AFS/DDC/OLE: Function servers 1 26th January 2006 18:36


All times are GMT +2. The time now is 07:56.


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