cancel
Showing results for 
Search instead for 
Did you mean: 

Update Rule routine

Former Member
0 Kudos
56

I have an object in an Update Rule and would like to write a routine so that it is populated from a field say /BIC/Z_Field from a table say /BIC/PZ_TABLE. Could someone help. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Niten,

is that field z_field from which u r going to populate present in the communication structure. refer the sdn link:

/message/703972#703972 [original link is broken]

Message was edited by: ravi raj

Former Member
0 Kudos

correct link: (ignore previous posting)

Former Member
0 Kudos

Thanks for that, but it is not part of the Communication Structure. The scenario is as follows:

I have an ODS which has an Update Rule. In the ODS in the Data Fields I have included an InfoObject which is also a Data Provider (contains attributes and is compounded). In the Update Rule of the ODS I need to write a routine to populate the InfoObject that I have put in the ODS with a field from its p table

former_member188975
Active Contributor
0 Kudos

Hi Niten,

What will be the basis for populating the InfoObject value with 'X' value from the P Table? Can you provide the scenario with names (even if they all are Z objects...it will help to understand the relationships)

Former Member
0 Kudos

In the transfer rule for the ODS the attribute is

Z_ObjtId (Object key).

I need to write a routine which gets the value from the Z_Object_Id P table since it is not part of the InfoSource which is populating the ODS. The name of the P table is

/BIC/PZ_ObjtId

What the name of the field is in the P table, I am not sure but lets say Z_ObjtId

Thanks

former_member188975
Active Contributor
0 Kudos

Thanks for the info Niten. Is the Z_OBJECT_ID data coming from your source? If yes, then you can populate the value of its attribute (Z_OBJTID) without even writing any code, through a simple update rule. Please confirm if this is what you want and also if you need info on how to do this.

Former Member
0 Kudos

No it is not coming from the InfoSource which is populating the Update Rule. It is for a field which has been added to the ODS and I am looking to populate it with itself from its P table. Thanks

Former Member
0 Kudos

In the routine for the characteristic put the following code.


select <i><your required attribute></i>
       from <b>/BIC/PZ_ObjtId</b>
       into <b>RESULT</b>
       where <i><your comp. char.></i> = COMM_STRUCTURE-<i><your comp. char.></i>
       and   /BIC/Z_ObjtId = COMM_STRUCTURE-/BIC/Z_ObjtId.

Hope that helps!

Rishi

former_member188975
Active Contributor
0 Kudos

Hi Niten,

What Rishi has provided will work if you have the value of the Char and are looking to populate an attribute value, but if you want to pick up the value of the char itself from the P table...it is not enough to select from P table. I mean you need to have some condition attached...in simple words: Select OBJID from P table. But then the question is: Which OBJID ? So you need to provide a condition for selection like Where X = Y. I hope I am coming through...

Former Member
0 Kudos

Thanks Rishi,

I would near to declare table or not necessary?

Former Member
0 Kudos

Thanks guys made the necessary amendments as suggested and works fine

Answers (0)