cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with row of Result view after Color

former_member267851
Participant
0 Kudos

Hi Experts,

I do changes in color of Result view of Oppt.

But after color the row doesn't seems like normal row and gaps also increase .

Plz suggest me some solution to make it normal row.

Here is the Code .

CASE P_ROW_INDEX.

WHEN P_ROW_INDEX.

READTABLE me->iv_data INTO ls_data INDEX p_row_index.
IF sy-subrc NE0.
EXIT.
ENDIF.


ASSIGNCOMPONENT p_column_key OFSTRUCTURE ls_data TO <col>.
IF sy-subrc = 0.
wf_text = <col>.
ENDIF.

IF ls_data-STATUS eq'E0002'.

iv_flag = ABAP_TRUE.

Endif.
if iv_flag = ABAP_TRUE.
*      CONCATENATE '<span style="background-color:YELLOW">'  wf_text '</span>'
*                 INTO html_str.
CONCATENATE'<font color="RED">' wf_text '</font>'into  html_str.

ELSE. EXIT.
*     CONCATENATE '<font color="GREEN">' wf_text '</font>' into  html_str.

ENDIF.

CREATE OBJECT html_bee.

                    html_bee->add( html = html_str ).

                    p_replacement_bee = html_bee.

Regards

Alok

Accepted Solutions (0)

Answers (3)

Answers (3)

devashish_bhattacharya
Active Participant
0 Kudos

Hello Alok,

You can try moving the focus to the initial line.

To do so, first create an instance attribute ihe class in which you are writing this code :

LR_BO    Instance Attribute    Type Ref To    IF_BOL_BO_PROPERTY_ACCESS

Secondly, paste the below code at the last after your code ( i.e. after this line

p_replacement_bee = html_bee.  )

* set focus to Initial line

  lr_bo = me->gr_context_node->get_bo_by_index( iv_index = 1 ).


Let me know the result.

Regards,

Devashish

former_member211707
Active Participant
0 Kudos

Hello Alok,

Please check below link:--

http://scn.sap.com/message/14295856#14295856

Thanks,

Amit Singh

former_member267851
Participant
0 Kudos

Thanks Amit,

By following this thread only i writing code .

Its not work out........????

Regards

Alok

CarstenKasper
Active Contributor
0 Kudos

Hi Alok,

I suppose you are in the iterator of a cellerator tag. It is kind of hard to get what you are doing from the post you made.

If I remember correctly, I did it with a DIV tag and adding styles. You seem to already have build an HTML bee around the original content.

<div style="background-color: green">

Of course you need to close the tag again </div>


You might have to add the DIV for every cell. As the BSP Tags add styles very often they get overwritten a lot.

cheers Carsten

former_member267851
Participant
0 Kudos

Thanks Carsten,

My requirement is to change color of text not background as per the status value.

But the problem is with the row is after color change it expands , but as per requirement

it should seems like normal row.

I am writing code in render_cell .

Am i clear with my requirement or u need some more input??

Regards

Alok

CarstenKasper
Active Contributor
0 Kudos

The background color was just an example. For chaning the text color the corresponding attribute is:

<div style="color:green">

What I meant in my above post is that you should be working with styles instead of adding new attributes. They are likely to destroy any formatting SAP has done by CSS classes.

Currently I do not have access to a CRM system. Thus I could not try the code above, but I am positive it works.

cheers Carsten

former_member267851
Participant
0 Kudos

Hi Carsten,

It behaves the same after using div style.

Plz share with me if u have any other idea.