Mick Andrus
20th July 2004, 15:32
I have on two occasions, used the Inp/Ref function on a form to draw data from another table and display in on the screen. For instance, in the standard Baan production bill session, the component's description is not displayed. I've created references from the tibom010 table to the tcibd001 table to retrieve the component's item description from tcibd001 by declaring the reference in the Inp/Ref Expres setting.
I'd like to do the same thing with General Item Data where I can remove the Item Type column and replace it with the Supply Source column from the Item Plan Data - cprpd100. (Our users are either unable or unwilling to distinguish between the two and so get confused.)
As I've said, I've used this successfully to retrieve item descriptions for bills of material but it doesn't seem to want to work in the situation I've described.
If anyone has any insights into how to best use the Inp/Ref feature, I'd appreciate some hints.
lbencic
20th July 2004, 16:53
Hi Mick -
What did you put in the inp/ref expression? I would think cprpd100.item would work - that has the direct reference to the tcibd001 table.
Make sure the field type is 'display' and not 'display only'.
Mick Andrus
20th July 2004, 18:55
Lisa,
I tried cprdp100.item as a reference field. It picks up only the Distribution supply source in that situation. In other words, in the now Supply Source column, the only value that shows is Distribution.
Perhaps I need more than one field in the reference? Index 8 on cprpd100 is Cluster,Item and Index 9 is Item,Cluster.
Mick
lbencic
20th July 2004, 20:15
O I see, that would work if you wanted something from the Item Master onto the Planned screens. I don't think this can be done, I tried a few combos. You have to have a reference from tcibd001 to the primary key cprpd100. This would tranlsate to the SQL call:
where tcibd001.xxx refers to cprpd100
It has to refer to the primary index, the refers to only works with the primary. Since the primary index in cprpd100 has a different domain and multiple values that can not be directly related to tcibd001 - I don't think you can do it.
You were able to define a link to the item description on your BOM because you had the Item in hand, and wanted the item description. You were able to pass the primary key of the Item Master to get that.
You don't have the primary key of cprpd100.
You need a little code in the before.display section of your cprpd100.sour field that goes and looks it up. The wrapper tools are good for that if you don't want to directly modify the source.
Mick Andrus
20th July 2004, 20:17
Lisa,
If by wrapper tools you mean RMCis then give me a call and we can discuss.
Mick
jaycee99
4th November 2008, 02:13
Why i tried to get field from other table using this method is not working? Anything need to be write at the script?
ARijke
4th November 2008, 08:42
No nothing has to be coded. Do you have a single field in your main table which has a reference to the other table? Some details on your specific situation would help as well.
jaycee99
4th November 2008, 10:19
The current session is using table tfcmg201, and the field that i want to retrieve is from table cisli245. So at the Field Name in the Edit Form, i put cisli245.slso and the Input/Ref.Expression - tfcmg207.ninv
This document number (tfcmg207.ninv - SIN2800019) also can be found in (cisli245.idoc - SIN2800019)
ARijke
4th November 2008, 11:33
The reference will only work when you are able to refer to primary key of cisli245.
The first index of cisli245 consist of slcp, ortp, koor, slso, oset, pono, sqnb, shpm. So this will probably not all be available in tfcmg201. So you can not use the reference expression.
You have to create a form field and program your query yourself in the before.display.