lakoon
29th July 2003, 20:47
I'm setting up a test example to read item data from baan into an access DB.
For this reasons I have created the necessary elements in the OW Designer. (ROWTyps, CONNECTORS, ITERATORS).
In the Connector Login script I have entered the following lines:
Login Script:
==========================================
{
OleObject ItemBOI;
try
{
System.debug ("COMPONENT_Item Login");
//DLL = Items, Klasse = ItemsManager
ItemBOI = OleObject("Items.ItemsManager");
ItemBOI.initialize("cn=BaanTest, o=ced");
this.BOI = ItemBOI;
}
catch (Exception e)
{
String mess;
mess.sprintf("%d %s %s", e.code, e.reason, e.description);
System.debug(mess);
}
}
==========================================
In the ITERATOR I have entered two scripts. One in the Initialization section and the other one in the Iteration Section
Initialization script:
==========================================
{
String errormessage;
try
{
System.debug("ITERATOR_Item - Initphase");
this.BOIPointer = Session.BOI.Show("LEI1080");
System.debug(String(Session.BOI.getCurrentBackend()));
}
catch(Exception e)
{
errormessage.sprintf("%d|%s|%s", e.code, e.reason, e.description);
}
}
==========================================
Iteration script:
==========================================
Script Iteration
{
OleObject ItemObj;
String errormessage;
try
{
System.debug("ITERATOR - Loop");
ItemObj = OleObject("Items.Items");
System.debug("1");
ItemObj = this.BOIPointer.nextElement; <<==???
System.debug("2");
System.debug(String(ItemObj.getItem()));
System.debug("3");
return 0;
}
catch (Exception e)
{
errormessage.sprintf("%d|%s|%s",e.code,e.reason,e.description);
}
}
==========================================
The Iteration script does not work from the marked point on (<<==??).
How can I transfer the pointer to the ItemObj?
How do I have to ask for the next Elements (number of).
Actually I woul like to do something like that:
=========================
if(Number(this.BOIPointer.hasMoreElements()))
{
ItemObj = this.BOIPointer.nextElement;
Result.Item = String(ItemObj.getItem());
Result.Description = String(ItemObj.getDescription());
return 1;
}
else
{
return 0;
}
====================
Any help would really make me happy....
thanks...
For this reasons I have created the necessary elements in the OW Designer. (ROWTyps, CONNECTORS, ITERATORS).
In the Connector Login script I have entered the following lines:
Login Script:
==========================================
{
OleObject ItemBOI;
try
{
System.debug ("COMPONENT_Item Login");
//DLL = Items, Klasse = ItemsManager
ItemBOI = OleObject("Items.ItemsManager");
ItemBOI.initialize("cn=BaanTest, o=ced");
this.BOI = ItemBOI;
}
catch (Exception e)
{
String mess;
mess.sprintf("%d %s %s", e.code, e.reason, e.description);
System.debug(mess);
}
}
==========================================
In the ITERATOR I have entered two scripts. One in the Initialization section and the other one in the Iteration Section
Initialization script:
==========================================
{
String errormessage;
try
{
System.debug("ITERATOR_Item - Initphase");
this.BOIPointer = Session.BOI.Show("LEI1080");
System.debug(String(Session.BOI.getCurrentBackend()));
}
catch(Exception e)
{
errormessage.sprintf("%d|%s|%s", e.code, e.reason, e.description);
}
}
==========================================
Iteration script:
==========================================
Script Iteration
{
OleObject ItemObj;
String errormessage;
try
{
System.debug("ITERATOR - Loop");
ItemObj = OleObject("Items.Items");
System.debug("1");
ItemObj = this.BOIPointer.nextElement; <<==???
System.debug("2");
System.debug(String(ItemObj.getItem()));
System.debug("3");
return 0;
}
catch (Exception e)
{
errormessage.sprintf("%d|%s|%s",e.code,e.reason,e.description);
}
}
==========================================
The Iteration script does not work from the marked point on (<<==??).
How can I transfer the pointer to the ItemObj?
How do I have to ask for the next Elements (number of).
Actually I woul like to do something like that:
=========================
if(Number(this.BOIPointer.hasMoreElements()))
{
ItemObj = this.BOIPointer.nextElement;
Result.Item = String(ItemObj.getItem());
Result.Description = String(ItemObj.getDescription());
return 1;
}
else
{
return 0;
}
====================
Any help would really make me happy....
thanks...