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 13th December 2016, 10:20
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 135
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
I'm searching a function for getting order pegging relation to sales order
Baan: Other/Unknown
C/S: None/Unknown

Hello to All,

I'm searching a function or dll where I can select the original sales order out of the production orders. As I found the item is the combining element in table cprrp041. But somehow it will not be enough for uniqueness.

In the session Production Orders (tisfc0501m000) I can call the session cprrp0740m100 (Order Pegging Browser). I found also some libraries for that calling. But all is only programmed for this browser display.
I'd like to get the raw data for sales order is related with production order.

Thanks a lot in advance.

Best Regards
Bernd
Reply With Quote
  #2  
Old 13th December 2016, 15:06
pillai.ganesh's Avatar
pillai.ganesh pillai.ganesh is offline
Senior Member
 
Join Date: Apr 2011
Location: United Arab Emirates
Posts: 105
pillai.ganesh is on a distinguished road
Baan: ERP LN 6.1 - DB: Oracle, SQL, Informix - OS: Windows
cprrpdll0041 + cprrpdll0045

void cprrp.dll0045.print.pegging.relations( domain tcyesno i.print.signals, domain tcyesno i.print.specification, domain cpcom.plnc i.scenario, domain cpstream i.streaming, domain cprao.prio i.critical.priority, domain tcyesno i.where.used, domain tcsrnb i.print.levels, domain tcmcs.str215m i.sel.criteria.desc mb, domain tcmcs.str215m i.options.desc mb, long i.peg.arrays.depth, const domain tccom.long i.parent.array(), const domain tcncmp i.parent.site.array(), const long i.parent.subset.array(), const domain tccom.long i.child.array(), const domain tcncmp i.child.site.array(), const long i.child.subset.array(), const domain tcqiv1 i.child.qty.array(), const domain tcqiv1 i.partial.qty.array() )

Expl. : This function will print the pegging relations based on the
array's loaded by cprrp.dll0041.load.pegging.relations.
Pre : -
Post : -
Input : i.print.signals - Print signals
i.print.specification - Print specifications
i.scenario - Scenario
i.streaming - Streaming
i.critical.priority - Critical priority
i.where.used - Analyse where-used quantity
i.print.levels - Levels to be printed
i.sel.criteria.desc - Description of selection criteria
i.peg.arrays.depth - Depth of pegging arrays
i.parent.array - Array with parent transactions
i.parent.site.array - Array with site of parent transaction
i.parent.subset.array - Array with subset of parent
i.child.array - Array with child transactions
i.child.site.array - Array with site of child transaction
i.child.subset.array - Array with subset of child
i.child.qty.array - Array with where-used quantity
Output : -
Return : -
Reply With Quote
  #3  
Old 13th December 2016, 15:21
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 135
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hello Pillai Ganesh,

thanks for fast help. For further clarification, will that function "print" the data into a browser window? Cause as written in the explanation comments the Output: is nothing. And as I found the functions in cprrp.dll0041 will only deliver data into the browser.
But I need the data explicitly within an Infor LN Report.

Best Regards
Bernd
Reply With Quote
  #4  
Old 13th December 2016, 15:34
pillai.ganesh's Avatar
pillai.ganesh pillai.ganesh is offline
Senior Member
 
Join Date: Apr 2011
Location: United Arab Emirates
Posts: 105
pillai.ganesh is on a distinguished road
Baan: ERP LN 6.1 - DB: Oracle, SQL, Informix - OS: Windows
Bernd,

Honestly, I have not tried using the dlls. After reading your post I was curious if such a dll exist. That's the reason I searched the DLL with the help of "Generate Library Documentation". Found this!

On further exploration, I found these two tables-
cprrp040 (Pegging Relations)
cprrp041 (Pegging Transactions)

I think you will have to run dll - cprrp.dll0041.load.pegging.relations to load these tables.

Let know if this works.
Reply With Quote
  #5  
Old 13th December 2016, 16:41
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 135
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hi Pillai,
fast reply :-) and a good hint: "Generate Library Documentation" => I've missed to do that.
I've additionally found a helpful session cprrp0520m000 "Item Order Plan" called out of the Pegging - Downstream Browser Session (cprrp0740m100).
Here the sales order will listed again together with the production orders.

Thanks a lot for help.

Best Regards
Bernd
Reply With Quote
  #6  
Old 15th December 2016, 12:31
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 135
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hello Pillai,

for additional clarification. I've found the table cprpd100 - Items-Planning.
In that table the cprpd100.plni = cprrp041.plni and cprpd100.item = tisfc001.mitm are equivalent. For that I can join the tables for selecting the correct sales order number out of cprrp041.orno (with cprrp041.koor = 3 => tckoor.act.sls => sales order) with the item-field.

Best Regards
Bernd
Reply With Quote
  #7  
Old 15th December 2016, 13:52
pillai.ganesh's Avatar
pillai.ganesh pillai.ganesh is offline
Senior Member
 
Join Date: Apr 2011
Location: United Arab Emirates
Posts: 105
pillai.ganesh is on a distinguished road
Baan: ERP LN 6.1 - DB: Oracle, SQL, Informix - OS: Windows
cprpd100 (Items-Planning) => Contains the Planning settings for the items with Order System Planned. So I'm not sure how it will help for getting the Sales Order for the Production Order.

Table cprrp040 (Pegging Relations) => Contains scenario wise demand and supply transaction number. Which is the pegging relationship between Sales Order (Demand) and Production Order (Supply).

Thus, you can query the cprrp041 table for the getting the supply transaction number of your production Order and then use that transaction number and scenario number to query cprrp040 table to get the demand transaction against the supply transaction number and scenario we queried from the cprrp041 table previously.
Then take the demand transaction number and query the cprrp041 table again to get the SO number.
Hope I didnt confuse you
Reply With Quote
  #8  
Old 16th December 2016, 11:44
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 135
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hi Pillai,

yes you confused me ;-).

But you're right. Your query seems to be the better/correct way. I've checked it and got the correct values.

Best Regards
Bernd
Reply With Quote
  #9  
Old 17th December 2016, 14:32
pillai.ganesh's Avatar
pillai.ganesh pillai.ganesh is offline
Senior Member
 
Join Date: Apr 2011
Location: United Arab Emirates
Posts: 105
pillai.ganesh is on a distinguished road
Baan: ERP LN 6.1 - DB: Oracle, SQL, Informix - OS: Windows
Ahh ha!! Sounds good...
Reply With Quote
  #10  
Old 20th December 2016, 18:01
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Pillai,

here is a DLL-Code Fragment that I did a couple of years ago to do the same thing you are trying to achieve. Hope it helps.
Note: A production order can be pegged to more than one sales order line. Therefore the tolerance Input variable.

Code:
#include "itcmcs2000"		|RETIFNOK,...
#include "itcmcs0012"		|Compare Doubles
#pragma used dll otcmcsdll0095	|read parmeters

function extern long tixsfdllxxxx.find.pegged.sales.order.for.prod.order(
						domain	tcpdno		i.pdno,
							double		i.tolr,
					ref	domain	tcorno		o.orno,
					ref	domain	tcpono		o.pono)
{
dllusage
	This function searches for the sales order which was the requirement
	for a certain production order. This is done by searching Pegging
	relations in enterprise planning for the actual scenario. The found
	sales order line must have generated a demand to supply ratio more than
	or equal to the input field i.tolr (say 0.9).
	
	Pre: Pegging relationships are generated in Enterprise Planning  
	
	Return	0: 		Pegged sales order is found
				o.orno is filled with sales order
				o.pono is filled with sales line
		DALHOOKERROR:	No pegged sales order is found. 
				o.orno is empty
				o.pono is zero
enddllusage
	table	tcprpd000	|Enterprise planning parameters
	table	tcprrp040	|Pegging relations
	table	tcprrp041	|Pegging transactions

	domain	tcorno	l.sales.orno
	domain	tcpono	l.sales.pono
	domain	tcqiv1	l.demand.quan
	domain	tcqiv1	l.supply.quan
		boolean	l.found

	o.orno = ""
	o.pono = 0

	RETIFNOK(tcmcs.dll0095.read.parm("cprpd000"))
	
	l.found = false

	select	demand.orno:l.sales.orno,
		demand.pono:l.sales.pono,
		supply.quan:l.supply.quan,
		cprrp040.quan:l.demand.quan
	from	cprrp041 supply,
		cprrp040,
		cprrp041 demand
	where	supply.plnc = :cprpd000.aplc
	and	supply.koor = tckoor.act.sfc
	and	supply.orno = :i.pdno
	and	supply.pono = 0
	and	supply.kotr = tckotr.receipt
	and	cprrp040.plnc = supply.plnc
	and	cprrp040.strn = supply.trns
	and	demand.plnc = cprrp040.plnc
	and	demand.trns = cprrp040.dtrn
	and	demand.koor = tckoor.act.sls
	and	demand.kotr = tckotr.requirement
	selectdo
		if  GREATER.OR.EQUAL(l.demand.quan, l.supply.quan * i.tolr) then
			o.orno = l.sales.orno
			o.pono = l.sales.pono
			l.found = true
			break
		endif
	endselect

	if not l.found then
		dal.set.error.message("xxxxxxx", i.pdno)
		|Your Error Message....
		return(DALHOOKERROR)
	endif
		
	return(0)
}
__________________
May the force be with you!
Reply With Quote
Sponsored Links
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
AFS Sales Order Insert eric.dizon AFS/DDC/OLE: Function servers 3 11th June 2014 23:46
Wokflow 7.4 ERP LN Extention yadav1981 DEM & Workflow 3 21st April 2009 08:08
Sales order invoicing with invoice alifikhwan Distribution, Transportation & Warehousing 6 6th April 2009 13:37
Sales Order Unblocking in error NicoleR Distribution, Transportation & Warehousing 4 18th September 2007 18:35
Archiving of Sales Order Data kclewley Archiving & Multisite 6 21st January 2003 13:00


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


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