Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Extended Program Check Warning - No Read Access to Field

rahul2000
Contributor
0 Kudos
3,480

Hi All,

I am getting a warning saying that

1-No read access to field OREF_LABEL

2-No read access to field OREF_TEXT

I have declared them as below

oref_label TYPE REF TO cl_salv_form_label ,

oref_text TYPE REF TO cl_salv_form_text .

I am using them as below

*************************************************************************

*Program Name

*************************************************************************

oref_flow = oref_grid_1->create_flow(

row = 3

column = 1 ).

oref_label = oref_flow->create_label(

text = 'Program Name :'(041)

tooltip = 'Program Name :'(041) ).

oref_text = oref_flow->create_text(

text = sy-repid

tooltip = sy-repid ).

How can I remove these warnings from Extended Program Check

Rahul

1 ACCEPTED SOLUTION

marcin_cholewczuk
Active Contributor
0 Kudos
1,128

Hi Rahul,

You can hide them as was mentioned above, but question is do you need those variables? Maybe you can simply delete them without harm to your report.

Best regards

Marcin Cholewczuk

6 REPLIES 6

Former Member
1,128

Hi Rahul,

This warning can be hidden using pseudo comment "#EC NEEDED, when there is no read access needed for the variable.

oref_label TYPE REF TO cl_salv_form_label ,  "#EC NEEDED
oref_text TYPE REF TO cl_salv_form_text .    "#EC NEEDED

Thanks,

Varun

marcin_cholewczuk
Active Contributor
0 Kudos
1,129

Hi Rahul,

You can hide them as was mentioned above, but question is do you need those variables? Maybe you can simply delete them without harm to your report.

Best regards

Marcin Cholewczuk

0 Kudos
1,128

Hi,

I don't want to hide them . I can't remove them either .since for e.g i am using it as follows

DATA : lv_text_top TYPE char255 ,

oref_grid TYPE REF TO cl_salv_form_layout_grid,

oref_grid_1 TYPE REF TO cl_salv_form_layout_grid,

oref_flow TYPE REF TO cl_salv_form_layout_flow,

oref_label TYPE REF TO cl_salv_form_label ,

oref_text TYPE REF TO cl_salv_form_text .

*Program Name

oref_flow = oref_grid_1->create_flow(

row = 3

column = 1 ).

oref_label = oref_flow->create_label(

text = 'Program Name :'(041)

tooltip = 'Program Name :'(041) ).

oref_text = oref_flow->create_text(

text = sy-repid

tooltip = sy-repid ).

Is there a way out?

Rahul.

0 Kudos
1,128

Hi,

But you're not using them. You're simple writting a value inside. What for? Are you using oref_label or oref_text? According to SAP no. That's why you're getting a warning.

BR

Marcin Cholewczuk

0 Kudos
1,128

Hi,

I don't want to hide them

If those warnings upset you so much, why don't you want to hide them??

Sometimes SAP shows warnings that are not to be considered as such.... Then if you want to avoid seeing them in extending checks, the only way is by using the pseudo comment...

@Marcin,

He's using them... with


oref_flow = oref_grid_1->create_flow(
 row = 3
 column = 1 ).
 
oref_label = oref_flow->create_label(
 text = 'Program Name :'(041)
 tooltip = 'Program Name :'(041) ).

The fact is that here instead of calling CREATE_LABEL for a specific row/column and then call the SET_TEXT method, he's doing the text assignement already by passing text and tooltip to the constructor of CL_SALV_FORM_LABEL...

Or could have been done like:


oref_label = oref_flow->create_label( row = 1 column = 1 ).
oref_label->set_text( 'Program Name :' ).

This way, no warning should be shown...

Kr,

Manu.

Edited by: Manu D'Haeyer on Nov 9, 2011 4:28 PM

0 Kudos
1,128

Thanks a ton Manu . What you have told worked perfectly .

Now i have changed it to something like this

*Program Name

oref_flow = oref_grid_1->create_flow(

row = 3

column = 1 ).

oref_label = oref_flow->create_label(

text = 1

tooltip = 1 ).

oref_label->set_text( 'Program Name :'(041) ).

oref_text = oref_flow->create_text(

text = 1

tooltip = 1 ).

oref_text->set_text( sy-repid ).

Now , no more warnings :)...and for the first time ever...SLIN is crystal clear 😛

Thanks a ton once again

Rahul.