cancel
Showing results for 
Search instead for 
Did you mean: 

Change Cell color dinamically on a table created upon a RFC execution.

Former Member
0 Kudos

Hi,

I´m facing the issue that I have a UI Table created upon a Service Call to an RFC which I created using the Service Call option in WDA, this creates automatically the context and is not allowing me to modify it or create new attributes, so I´m kind of confused on how can I achieve to change the color of a cell when an event ocurs, and the requirement is to change just a cell color and not the whole column or all cells in the column, has somebody achieved this or know how to do it?

Thanx in advanced,

Kind Regards,

Gerardo J

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

> Hi,

>

> I´m facing the issue that I have a UI Table created upon a Service Call to an RFC which I created using the Service Call option in WDA, this creates automatically the context and is not allowing me to modify it or create new attributes, so I´m kind of confused on how can I achieve to change the color of a cell when an event ocurs, and the requirement is to change just a cell color and not the whole column or all cells in the column, has somebody achieved this or know how to do it?

>

> Thanx in advanced,

>

> Kind Regards,

>

> Gerardo J

when the node is generated based on the DDIC structure then it is not possible to add attribute in the node. What you can do is

1) Change the DDIC structure or create a new one and include the existing structure.

2) You can create a singleton node inside this node say (color with cardinality 1:1), add attribute(s) of type WDUI_TABLE_CELL_DESIGN.

Write a supply method to fill the color attribute for every column.

Bind this color->attribute(s) to the cellEditor .

You can follow this forum

Former Member
0 Kudos

Hi Baskaran,

Thanx alot for the answer, I have a question, The atribute has to be in the same node that the table is binded am I right? then I´ve been doing some testing and in the context node if I delete the data type of the node then it alows me to add more attributes since it wont be attached to a ddic structure and it seems to be working but I still need to do more testing, my question is that if I remove the data type and add a new attribute to the structure will this affect in some way the information that travels back to the RFC? this structure is of type CHANGING so the structure travels back to the RFC and the information I have in the structure is received by the RFCand it seems to be geting the information right and cause the RFC takes the data and in the response it returns the same data that I sent him and it seems to be working till now(still has to do more testing) but I don´t know if you see this as a good aproach or this is not a good idea and with a new patch level this could stop working or something like that?

Thanx Again!

Kind Regards,

Gerardo J

Former Member
0 Kudos

Hi Gerardo J,

The approach is fine. But it is recomended to keep seperate node for UI related stuff. So that you always get a data Backup in the node created using RFC.

Otherwise sometime you need to make RFC call again to get the data and it is costly at the customer network from performance point of view.

-Pradip

Former Member
0 Kudos

Hi Pradip,

Thanx for the help!

Actually I did not modified the structure on the RFC, but deleted the ddic type of the context node and then it allowed me to add a new attribute, so I don´t need to recall the RFC to bring the values, I maintain the values on WDA side without going to the RFC again, in deed when I call the RFC again the values that I had get initialized but it can be handled, I think that the over head comes when I call the RFC again then it sends the extra atribute and it is not beed used by the RFC, my consern is about if this is a good aproach cause this issue of having different structure on this side than the RFC and that I deleted the DDIC type of the node.

I also tried with a separate node as you recommend and filled the structure and the problem was that even I changed the node leading position to the one that I wanted to change in the table, there were no changes in the table and I noticed this.

If I fill the structure with different values from the begining then it gots reflected in the table cell color but if I change the value of the atribute it makes no modification unless I change the first position then it changes but the whole colum changes of color instead of just the first cell, it seems that all the cells are pointint to the first position of the structure or something like that.

You think I´m missing something?

Thanx again!

Kind Regards,

Gerardo J

Edited by: Gerardo Jiménez on Jan 19, 2011 1:39 PM

Former Member
0 Kudos

Hi,

my question is that if I remove the data type and add a new attribute to the structure will this affect in some way the information that travels back to the RFC

It is not any problem as because when you use the RFC the importing parameters are typed. So before you call the FM, you need to use the move-corresponding from your local node element structure to the FM importing structure.

If you had not remove the type then you do not have to use move-corresponding.

but I don´t know if you see this as a good aproach or this is not a good idea and with a new patch level this could stop working or something like that?

We have been using this approach. I personally prefer to keep close to the DDIC as because if you want to use one of the attribute you can use the get_static_attributes and if you want them to use as parameter to the method ..etc it is very easy.

Otherwise as you do, you need to type them like

lv_carrid type wd_this->element_my_data_node-carrid.

But it is all small differences and comfort of the developer i guess.

Former Member
0 Kudos

Hi Baskaran,

thanx Again for the help!

In your other post you commented to use a node inside the structure, I´m not using a node, instead I added an attribute directly into the Structure, is this allright too?

thanx in advanced!

Kind Regards,

Gerardo J

Former Member
0 Kudos

> Hi Baskaran,

>

> thanx Again for the help!

> In your other post you commented to use a node inside the structure, I´m not using a node, instead I added an attribute directly into the Structure, is this allright too?

>

> thanx in advanced!

>

> Kind Regards,

>

> Gerardo J

I recommended that as a second choice as because if you do not want to alter the model node, then you have only one choice of adding a local node inside the model node , first choice is to add a attribute to the DDIC structure. So your choice is good .

Former Member
0 Kudos

Thanx Again for the follow up, actually I´m not adding an attribute to the DDIC structure, what I did is that I removed the DDIC type from the context node and then it allowed me to add in the context node a new attribute.

I´m trying with a node instead an attribute and I´m geting some errors and can not make it work till now, that´s why I asked if the aproach I took of removing the type from the structure and then adding a new attribute to manage the color was a good idea :O)

Kind Regards,

really apreciate the Help!!

Gerardo J

Former Member
0 Kudos

> Thanx Again for the follow up, actually I´m not adding an attribute to the DDIC structure, what I did is that I removed the DDIC type from the context node and then it allowed me to add in the context node a new attribute.

> I´m trying with a node instead an attribute and I´m geting some errors and can not make it work till now, that´s why I asked if the aproach I took of removing the type from the structure and then adding a new attribute to manage the color was a good idea :O)

>

> Kind Regards,

>

> really apreciate the Help!!

>

> Gerardo J

Hi Gerardo,

It is okay.. i understood that correctly . As i already stated in my previous reply it is developers choice. Your approach is one of the option , your own solution. Be proud of it. I do

Former Member
0 Kudos

Hi Experts,

I am facing similar issue. I have to read data from the context of RFC. After this I have to populate a table. The table cells should have different color based on the data returned by RFC.

I am not sure how to do it.

I thought of reading the data from a context and then storing it in a internal table and then making changes in data for color requirement and then displaying it.

How to do it?

Please help.

Regards,

Gary

Answers (0)