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: 
Read only

warning in Extened program check

Former Member
0 Likes
869

Hi all,

I got a waring in extended program check please give me some solution.

warning in extended program check

<b>Program: ZCSRE_HU_PRODUCTION_REPORT Include: ZCSRM_HU_PRD_PROCESS_FORMS Line : 283

No read access to field L_BWART

(Message can be hidden using: "#EC NEEDED )</b>

when I click on L_BWART it is pointing to the program at bolded line below

  • Validate Movement Type

<b>DATA: l_bwart LIKE mseg-bwart.</b>

IF NOT s_bwart IS INITIAL.

SELECT bwart FROM mseg INTO l_bwart WHERE bwart IN s_bwart.

IF sy-subrc = 0.

EXIT.

ENDIF.

ENDSELECT.

IF sy-subrc <> 0.

  • text-012-Please Enter a Valid Movement Type

MESSAGE e000 WITH text-013.

ENDIF.

CLEAR l_bwart.

ENDIF.

please give solution.

8 REPLIES 8
Read only

Former Member
0 Likes
826

Hi,

U can comment out the warning using

DATA: l_bwart LIKE mseg-bwart.<b> "#EC NEEDED</b>

its just warning it wont affect.

See this code, u have to use this variable in ur program otherwise no use of this selection.

clear v_bwart.
SELECT bwart FROM mseg INTO v_bwart .
IF sy-subrc = 0.
 WRITE:/ v_bwart.
ENDIF.
ENDSELECT.

Read only

Former Member
0 Likes
826

Hi ranjith,

The problem is that you are selecting that field into a local varaible, but using it nowhere else. You can just hide that warning in SLIS, by adding the code

"#EC NEEDED just beside the statement in line 283.

Regards,

Ravi

Read only

0 Likes
826

Hi Ravi,

Thanks for your quick answer, as you said that the variable is used no were else but is used in the following code (see bolded text)

  • Validate Movement Type

DATA: l_bwart LIKE mseg-bwart.

IF NOT s_bwart IS INITIAL.

SELECT bwart FROM mseg INTO <b>l_bwart</b> WHERE bwart IN s_bwart.

IF sy-subrc = 0.

EXIT.

ENDIF.

ENDSELECT.

IF sy-subrc <> 0.

  • text-012-Please Enter a Valid Movement Type

MESSAGE e000 WITH text-013.

ENDIF.

CLEAR <b>l_bwart</b>.

ENDIF.

can you further explain it.

Thanking you.

Read only

0 Likes
826

Hi,

Only clearing teh variable is of no use, u have to use the variable for processing.

clear v_bwart.
SELECT bwart FROM mseg INTO v_bwart .
IF sy-subrc = 0.
 WRITE:/ v_bwart.
ENDIF.
ENDSELECT.

In ur code
DATA: l_bwart LIKE mseg-bwart.
IF NOT s_bwart IS INITIAL.
SELECT bwart FROM mseg INTO l_bwart WHERE bwart IN s_bwart.
IF sy-subrc = 0.
EXIT.
ELSE.
WRITE:/ i_bwart.
ENDIF.
ENDSELECT.
IF sy-subrc <> 0.
* text-012-Please Enter a Valid Movement Type
MESSAGE e000 WITH text-013.
ENDIF.
CLEAR l_bwart.
ENDIF.

try this and check

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
826

Hi Ranjith,

Use this code:-

  • Validate Movement Type

IF NOT s_bwart IS INITIAL.

SELECT bwart FROM mseg WHERE bwart IN s_bwart.

IF sy-subrc = 0.

EXIT.

ENDIF.

ENDSELECT.

IF sy-subrc <> 0.

  • text-012-Please Enter a Valid Movement Type

MESSAGE e000 WITH text-013.

ENDIF.

ENDIF.

<b>* Since there was no read access to l_bwart so remove it from everywhere, even

  • from select statement.</b>

NOTE: Please reward ponits if you are satisfied with the solution :).

Thanks and regards,

Ravi .

Read only

Former Member
0 Likes
826

Hello Ranjith,

Since the L_BWART is not assigned to any varaiable thsi warning exist.

WHat U can do this

  • Validate Movement Type

DATA: l_bwart LIKE mseg-bwart.
IF NOT s_bwart IS INITIAL.
SELECT bwart FROM mseg INTO l_bwart WHERE bwart IN s_bwart.
IF sy-subrc = 0 and <b>NOT l_bwart IS INITIAL.</b>
EXIT.
ENDIF.
ENDSELECT.
IF sy-subrc <> 0.
* text-012-Please Enter a Valid Movement Type
MESSAGE e000 WITH text-013.
ENDIF.
CLEAR l_bwart.
ENDIF.

Vasanth

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
826

You may want to change this around a little.......



data: l_bwart like mseg-bwart.

if not s_bwart is initial.
  clear l_bwart.
  select single bwart from mseg into l_bwart
              where bwart in s_bwart.
  if sy-subrc <> 0.
* text-012-Please Enter a Valid Movement Type
    MESSAGE e000 WITH text-013.
  endif.
endif.


Regards,

Rich HEilman

Read only

Former Member
0 Likes
826

Hi,

You need to write some text for that field, i mean the short description for that one

DATA: l_bwart LIKE mseg-bwart. " Short text

and you need to use this variable in your program also, if not coment this, if you declare a variable and did not use it then it will give the warning message

Regards

Sudheer

Message was edited by:

Sudheer Junnuthula