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
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 17th May 2017, 00:22
dromeo dromeo is offline
Junior Member
 
Join Date: Feb 2016
Posts: 11
dromeo is on a distinguished road
Baan: BAAN IV - DB: ORACLE - OS: WINDOWS 7
Create Sequence Number in Report
Baan: ERP LN 6.1 FP10 (Infor ERP 10.4)
C/S: None/Unknown

Hello all,

I'm working on the ACH file report (Direct Payments) in Infor 10.4 and I would need to add on the header of the report / file a sequence number that increases for every file that is printed out. Now, I already have the format of the code, the only problem is that I don't really know where I could save the last sequence number in order to retrieve it and then add a + 1 for that variable in the script. Do you have any advice (or better way) to do it in Infor?

Thank you very much,

Daniel Romeo
Reply With Quote
  #2  
Old 17th May 2017, 07:06
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,936
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
At one point we had a table with 1 row in it - like first free numbers in baan 4. We would lock the table with with an application lock, so users had to access it 1 at a time. So lock it, get the number, update it with +1, save the table, release the application lock. Then use the number to go create files or something along that lines.
__________________
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 May 2017, 18:54
dromeo dromeo is offline
Junior Member
 
Join Date: Feb 2016
Posts: 11
dromeo is on a distinguished road
Baan: BAAN IV - DB: ORACLE - OS: WINDOWS 7
Quote:
Originally Posted by mark_h View Post
At one point we had a table with 1 row in it - like first free numbers in baan 4. We would lock the table with with an application lock, so users had to access it 1 at a time. So lock it, get the number, update it with +1, save the table, release the application lock. Then use the number to go create files or something along that lines.
Hello Mark,

Thank you very much for the reply! That was a perfect idea!!!

I did what you suggested so:

1- I'm using the table tcmcs050 (First Free Numbers) --> I created a number group and then I'm using the field First Free Numbers that is long type so perfect in this case
2- I'm reading the value from the table, adding +1, and then updating the table with the lock procedure that you told me and is working good!!!

Only problem that may seem trivial: The procedure requested by the bank says that the first number on production needs to be 1, but the value of 0 is not allowed on the field table First Free Numbers, meaning that I can't put 0 on that field to then make the sum +1 and have as a result 1. Any advice??

Thank you very much.

Daniel Romeo
Reply With Quote
  #4  
Old 18th May 2017, 14:38
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,936
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well you could just start it at 1. So basically lock table, read table, get the number to be used for transaction, update the table only with number+1, release table. Then when you look at the table the number you see should be the number you use in the next transaction. It other words the "first free number" for next transaction. One thing to keep in mind is to make sure the number is big enough you never run out.
__________________
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
  #5  
Old 18th May 2017, 18:03
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,322
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Or, use a combination of Series and Sequence to make it infinitely available in future. Check if you can get it approved by the bank.

Rest whatever Mark suggested, sounds good enough.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #6  
Old 19th May 2017, 15:46
dromeo dromeo is offline
Junior Member
 
Join Date: Feb 2016
Posts: 11
dromeo is on a distinguished road
Baan: BAAN IV - DB: ORACLE - OS: WINDOWS 7
Hello,

Thank you very much for your advices @bhushanchanda & @Mark!!! What Mark says is very good! Essentially my logic was the problem, because I was increasing the number before on the selectdo while reading the table, so when displayed on the report would be 2 the first time, and then when saved on the table the number will be 2. I wanted to use that logic because I wanted to put 0 as a first free number but then I realized that the value of 0 was not allowed on the field "First Free Numbers"...

Instead is far more easy and logic what Mark says: to read directly the first number, display it on the report and then increase the number while saving into the table, so the first number read and displayed will be 1 and then once saved 2.

Regarding the limit of the number, there is a limit established by the Bank: after 9999 the counter has to go back to 0001 (the first free number to be used in production). That I think I will manage it with a condition!
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
Increment a Sequence Number on new insert ben.kansas Tools Development 8 28th September 2015 07:42
create my own Sales Number sally2112 Distribution, Transportation & Warehousing 1 13th September 2013 08:40
Create Report with getting data from multiple companies ailisee Tools Development 2 2nd May 2012 20:38
Handling Unit functionality baazigar Distribution, Transportation & Warehousing 4 19th February 2012 16:54
solving recursion problems rmarles Tools Development 2 25th January 2005 22:23


All times are GMT +2. The time now is 18:57.


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