Neal Matthews
19th December 2006, 11:10
Hello,

Set up an exchange scheme to handle standard Baan report ie. still includes headers. Trying to filter out the data so that only component items tdinv921.citm that begin with a "1" are processed.

Put a condition in against the Import like below;


table ttdinv921

if tdinv921.citm(1;1) <> "1" then
return (false)
else
return (true)
endif


This imports zero records despite the schemes ASCII file clearly showing several tdinv921.citm records that begin with a "1". Is there anything obvious I am missing here.

Cheers
Neal

mark_h
19th December 2006, 14:40
Have you put the exchange in debug mode to see what the code is actually doing? I have never done an exchange scheme where I try to skip records and I do not know what the returns cause. It could just be that tdinv921.citm is not getting populated correctly.

Neal Matthews
19th December 2006, 15:42
Hello Mark,

Forgot you could debug an exchange. Anyway from what I can work out the condition is only being run only for the first record (a blank line). The return(false) seems to stop the Exchange and the condition isn't run again.

I have defined the condition against the scheme in tuxch0121m000 - Maintain Table Relations Import. Is this correct or should I be filtering the records another way ?

Cheers Neal

Juergen
19th December 2006, 18:05
Hi Neal,

do you have defined a execute condition on table relation level in form 1?
If this condition returns 'false' the batchline is NOT executed.

You should use the "add record", "overwrite" or "update" conditions on the table relation level in form 2.

Regards,
Juergen

mark_h
19th December 2006, 18:19
Wrong spot - that tests if you want to run the batch. If you are inserting the put the condition on for 2 for add record. For updating or overwriting put the condition there. So try that.

Neal Matthews
20th December 2006, 17:10
Thanks chaps working fine now.

Cheers
Neal