2011 Nov 07 4:46 AM
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
2011 Nov 07 9:29 AM
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
2011 Nov 07 5:33 AM
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
2011 Nov 07 9:29 AM
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
2011 Nov 09 11:35 AM
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.
2011 Nov 09 2:26 PM
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
2011 Nov 09 3:26 PM
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
2011 Nov 10 7:14 AM
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.