One Star

tLoop iterate to multiple tSAPInput

I have an issue with the tLoop component. Let me explain the context :
I have to extract data from 3 tables in SAP, each one after another using RFC_READ_TABLE. But since the tables are huge, I first extract which Ids are modified since a given date. I recover the list of Ids which I transform using a tJavaFlex to a Vector ressembling like this :
0 : "MATNR in ('xxxxxxx', 'yyyyyy' "
2 : ",'zzzzzz, 'aaaaaa', 'bbbbbb' "
9 : ", 'cccccc', 'dddddd')"
10 : "MATNR in (............ "
Rinse and repeat.
I transfer the Vector's content to tSAPInput parameters by using the tLoop to consume the 10 first strings in the vector, and then the counter passes to the next ten strings. The parameters are correct, as when deactivating everything besides the first tSAPInput (RFC_READ_MARA) and the tExtractDelimitedFields_1, I have my results from SAP.
But strangely enough, the RFC_READ_MAKT fires first when everything is activated, thus not recognizing the current value initialized by tLoop (NullPointerException). Moreover, it's impossible for me to reallocate the Iterate link to RFC_READ_MAKT, or any other OnComponentOk and so on... Same thing for RFC_READ_MARC...
Is there a solution to perform the 3 extractions side by side, and ensuring that every tSAPInput correctly receives the correct iteration value from tLoop ?
Thanks a lot.
One Star

Re: tLoop iterate to multiple tSAPInput

I think you'll have to create a child job and link the tRunJob to the Iteration.
You want to iterate over a subjob, but have linked your loop to a single component. That's why I think you can't redraw your iteration link.

One Star

Re: tLoop iterate to multiple tSAPInput

Thank you Lie, as you said the best way for this is to make a child job called by the loop.
I have another problem (which is the cause of the usage of the loop), but i'll ask it in a separate thread.
Best regards !
One Star

Re: tLoop iterate to multiple tSAPInput

The post is old but I found a better solution than tRunJob to this problem: simply insert a 'NOP' component (tFixFlowInput for example) between tLoop and the 'subjob', in this manner:
tLoop ------iterate-------> tFixFlowInput ------on component Ok-------> other components that call (Integer)globalMap.get("tLoop_1_CURRENT_VALUE")
at every cycle tFixFlowInput let start, onComponentOk, a new execution of pseudo-subjob with updated tLoop iteration values.