OdiRef.getTable("ID") error in JKM

Looking at ML Doc ID 1285904.1 , regarding work arounds for long table names with ODI CDC.
Suggestion to use flexfields sounds a good idea, but the code provided on that ML note does not seem to work as a generic substitution method.
I've changed the 'Prepare Oracle Streams' JKM step to use :
     DBMS_CAPTURE_ADM.PREPARE_TABLE_INSTANTIATION(TABLE_NAME => '<%=odiRef.getFlexFieldValue(odiRef.getTable("ID"),"2400","TABLE_REAL_NAME")%>');
as per the ML doc, hoping to return the flexfield value for flex field 'TABLE_REAL_NAME', for whatever table is being CDC'd (Start Journal), however I get the following error :
Default Command (Destination):
The application script threw an exception: java.lang.NumberFormatException: For input string: "Exception getTable("L", "ID", "A") : " BSF info: Copy of Prepare Oracle streams at line: 0 column: columnNo
out.print(odiRef.getFlexFieldValue(odiRef.getTable("ID"),"2400","TABLE_REAL_NAME")) ;
out.print("');\nEND;") ;I can return the flex field through the JKM step using :
but clearly that will only return the flexfield for Datastore ID 14167110 and is no good for CDC sets with more than one table
Can anybody help me?
Using ODI 11.1.1.
Many thanks


Just a heads up, the ML Note I was following in 1st post does NOT work with The odiRef.getTable("ID") does not return the table ID when used in a JKM.
Works fine in
Big thanks to Uli Bethke of http://www.business-intelligence-quotient.com fame for helping me with some workarounds but we feel its a good time to move to in our project.