‎2007 Feb 20 1:41 PM
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.
‎2007 Feb 20 1:43 PM
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.
‎2007 Feb 20 1:44 PM
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
‎2007 Feb 20 1:51 PM
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.
‎2007 Feb 20 1:53 PM
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
‎2007 Feb 20 1:45 PM
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 .
‎2007 Feb 20 1:46 PM
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
‎2007 Feb 20 1:48 PM
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
‎2007 Feb 20 1:50 PM
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