Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
13%
Yes
87%
Total votes: 91

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 1st June 2012, 13:33
ap2203 ap2203 is offline
Member
 
Join Date: Jan 2006
Posts: 42
ap2203 is on a distinguished road
Baan: baan ivC - DB: oracle - OS: unix
AFS tiitm0101 - tiitm01014

I want to upload some data in Item Master...
there are more than 20 000 items that required to be uploaded in Baan IV.
If anyone can help me with AFS script for tiitm0101m000 session....


I make code , but i have a problem with field titim001.citg

stpapi.put.field("tiitm0101m000","tiitm001.citg",zdsim004.citg)|citg
because i dont have data in tiitm0110m000 i put
stpapi.enum.answer("tiitm0101m000","tiitm01014",tcyesno.yes)

stpapi.insert("tiitm0101m000", 0, err.ins) |01.06.2012
after this I have message in err.ins "tiitm01014"

What can I do to insert data
Please help
Reply With Quote
  #2  
Old 1st June 2012, 14:47
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,975
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
First on our system running tiitm0101m000 actually starts session tppdm0110m000. Then on our system tiitm01014 is only a warning. The stpapi.enum.answer does nothing - it is only used for questions. Are you positive the item is not being inserted anyway?

On my system the warning is "Note: No default item date for this item type and item group combination. There are several ways to handle this:
(1) Go add the item type and item group data in default item data session tppdm0109m000(on our system).
(2) Just print an error and skip the record.
(3) Include code to convert it to a known item type and item group combination. You can always print a report when insert the records and have the users go update it later.
(4) Just insert a record into tiitm002(table on our system).

Looks like there is nothing wrong with your code - but the data needs to be cleaned up. If I was loading 20k items I would send the errors to the customer and ask them how they wanted to handle it. My code to insert an item is pretty basic - but to get to that point I do a lot of converting and prechecking before this function even gets called.
Code:
function extern insert_item(	domain	tcitem		baan.item,
				domain	tcdsca		baan.dsca,
				domain	tckitm		baan.kitm,
				domain	tccitg		baan.citg,
				domain	tcctyp		baan.ctyp,
				domain	tccsig		baan.csig,
				domain	tccuni		baan.cuni,
				domain	tccuni		baan.stgu,
				domain	tccwar 		baan.cwar,
				domain	tckltc		baan.kltc,
				domain	tcobpr		baan.obpr,
				domain	tckpsl		baan.kpsl,
				domain	tcqbia		baan.npsl,
				domain	tcemno		baan.buyr,
				domain	tcemno		baan.cplb,
				domain	tcoltm		baan.oltm,
				domain	tiqbm1		baan.unom,
				domain	tiqro1		baan.runi,
				ref     string          msg())
{
	
	msg = ""
	stpapi.put.field( "tppdm0110m000", "tiitm001.item", baan.item )  	| Put item again
	|stpapi.put.field( "tppdm0110m000", "tiitm001.dscb", str$(baan.dsca) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.dsca", baan.dsca )
	stpapi.put.field( "tppdm0110m000", "tiitm001.kitm", str$(baan.kitm) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.citg", baan.citg )
	stpapi.put.field( "tppdm0110m000", "tiitm001.ctyp", baan.ctyp )
	stpapi.put.field( "tppdm0110m000", "tiitm001.csig", str$(baan.csig) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.uset", "   ALL" )		| Must enter unit set
	stpapi.put.field( "tppdm0110m000", "tiitm001.cuni", str$(baan.cuni) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.stgu", str$(baan.stgu) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.cwar", str$(baan.cwar) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.kltc", str$(baan.kltc) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.obpr", str$(baan.obpr) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.kpsl", str$(baan.kpsl) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.npsl", str$(baan.npsl) )	
	stpapi.put.field( "tppdm0110m000", "tiitm001.buyr", str$(baan.buyr) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.cplb", str$(baan.cplb) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.oltm", str$(baan.oltm) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.unom", str$(baan.unom) )
	stpapi.put.field( "tppdm0110m000", "tiitm001.runi", str$(baan.runi) )

| Possible questions
	stpapi.enum.answer("tppdm0110m000", "tiitm0101s", tcyesno.yes)

	rc = stpapi.insert( "tppdm0110m000", 1, msg )
	if not isspace(msg) then
		| Clear out what was done, do not worry about some.msg yet
		rc = stpapi.recover("tppdm0110m000", some.msg)
		| End the session.
		stpapi.end.session("tppdm0110m000")
		return
	endif
}
__________________
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
  #3  
Old 1st June 2012, 15:52
ap2203 ap2203 is offline
Member
 
Join Date: Jan 2006
Posts: 42
ap2203 is on a distinguished road
Baan: baan ivC - DB: oracle - OS: unix
I put it my code I dont see the differences from your, except last instruction

| Possible questions
stpapi.enum.answer("tppdm0110m000", "tiitm0101s", tcyesno.yes)

I know that tiitm01014 is only warning means "Note: No default item date for this item type and item group combination.... " , but why I can not insert my item
I am sure that I dont have wanted item in the data base anyway?
I dont see what is wrong in my code
I ll try with your code

Thanks for help
BR
Reply With Quote
  #4  
Old 1st June 2012, 17:48
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,975
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I do not know for a fact, but I do not think it is the code. I think it is the data. You can do one of two things - add a valid item type and item group combo to the record and see if it then gets added. But I think what I would do is run the session manually and input the data by hand. See what warnings and messages you get. It may not have anything to do with the warning you see in the AFS code.
__________________
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 4th June 2012, 10:53
ap2203 ap2203 is offline
Member
 
Join Date: Jan 2006
Posts: 42
ap2203 is on a distinguished road
Baan: baan ivC - DB: oracle - OS: unix
AFS tiitm0101m000

You are right, problem is not in the code.
Problem is data .
I done what you said , and see it when I put data manually
AFS work correct

Thanks for suggestion
BR
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
AFS waiting timed out (frozen) jp.aalders AFS/DDC/OLE: Function servers 4 20th December 2011 20:48
AFS for tfacr4410m000 and Credit Notes Neal Matthews AFS/DDC/OLE: Function servers 7 12th April 2011 20:48
Steps to create AFS indian_sumesh AFS/DDC/OLE: Function servers 1 6th November 2008 17:32
AFS hangs in stpapi.put.field garias AFS/DDC/OLE: Function servers 1 30th January 2005 22:13
AFS (tfgld1101m000) don´t run fine since a user with a Dynamic menu (DEM) garias AFS/DDC/OLE: Function servers 4 20th January 2004 14:24


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


©2001-2013 - Baanboard.com - Baanforums.com