Posted: Sat Jan 31, 2009 2:17 pm Post subject: Re: Propagate Issue.
Grand Master
Joined: 25 Jun 2008 Posts: 1415
wbirookie wrote:
I got some error. BIP2436E, Invalid index assignment to '2'.
Array elements are positional within message trees. You can't reference element[2] unless element[1] currently exists. When you propagate OutputRoot, if you delete its elements, you'll want to reset its index counter(s) too. For example:
Code:
DECLARE x INTEGER; -- Environment.IXSB055PX[x]
DECLARE Count INTEGER CARDINALITY(Environment.IXSB055PX[]);
DECLARE y INTEGER; -- Environment.IXSB066PX[y]
DECLARE Dtl INTEGER CARDINALITY(Environment.IXSB066PX[]);
DECLARE k INTEGER; -- OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k]
SET x = 1;
WHILE (x <= Count) DO
-- OutputRoot is empty
CALL CopyMessageHeaders();
-- populate OutputRoot.XMLNS.Envelope.PO.children
-- from Environment.IXSB055PX[x].children
-- ...
SET y = 1;
SET k = 1;
WHILE (y <= Dtl) DO
IF (Environment.IXSB055PX[x].CUSPO = Environment.IXSB066PX[y].CUSPO) THEN
-- populate OutputRoot.XMLNS.Envelope.PO.PODetail.Item[k].children
-- from Environment.IXSB066PX[y].children
-- ...
SET k = k+1;
END IF;
SET y = y+1;
END WHILE;
PROPAGATE;
SET x = x+1;
END WHILE;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum