2005 Sep 09 3:43 PM
Hi Friends,
while checking my program through extended program check it is giving warning message as "No read access to field string MKPF" in the TABLES statement. How to correct this?
2005 Sep 09 5:19 PM
2005 Sep 09 5:19 PM
Hello Thalayan,
As far as I know if you are getting warning messages in SLIN it doesnt matter. Make sure you dont get errors while doing extended syntax check.
For your post, to be honest...I dont know.
2005 Sep 09 5:19 PM
2005 Sep 09 5:28 PM
Rich,
If we put "#EC NEEDED at the end of the line..what does it exactly do. I dont know what is its main functionality. Can you please explain a bit.
2005 Sep 09 6:56 PM
The syntax 'TABLES' was a carry-over from the older versions of SAP R/3 where, you have to declare all your database tables, in order to 'SELECT' from them. It is no longer required. Max has beautifully explained it.
You have to remember that when you do a select, you need a work area to place the values that you read. Now if you declare a work area and use it then you dont need the 'TABLES' statement. This is because, TABLES statement provides you with the work area. What this warning told you is that you declared a work area and you are not using it.
Now you can suppress this warning(you are only suppressing the warning message, not eliminating the reason for that warning which is wastage of memory area!!!) like Rich suggested. What it does is to just suppress the message. This will be particularly useful, where if you have a QA team who look into extended check and raise objections to warning messages!!!
2005 Sep 09 7:39 PM
2005 Sep 09 5:42 PM
Hi
The system is just only giving warning as if said to you:
- Hey Abaper! You have declared to use the headerline of MKPF, but perhaps you aren't using it. Check your code and if you don't use you delete that declaretion.
So if you don't use MKPF in your program, you can delete the declaretion, if you use it you can do nothing or you put the string "#EC NEEDED at the end of declaretion. If you do it, while checking program through extend program check, the system skips that message and doesn't show you.
We often use header line of dictionary table only to do an existence query, in this case the system can give that warning message.
For example:
TABLES: BKPF.
SELECT SINGLE * FROM BKPF WHERE BUKRS = P_BUKRS
AND BELNR = P_BELNR
AND GJAHR = P_GJAHR.
IF SY-SUBRC = 0.
WRITE: 'Hello'.
ENDIF.
So I made a query on bkpf, but after I haven't read or used its headerline, so the system give me that message.
If I write:
SELECT SINGLE BUKRS FROM BKPF INTO P_BUKRS
WHERE BUKRS = P_BUKRS
AND BELNR = P_BELNR
AND GJAHR = P_GJAHR.
IF SY-SUBRC = 0.
WRITE: 'Hello'.
ENDIF.
I've done the same thing but now I haven't declared to use the headerline BKPF and so the system won't give me that warning message.
Max
Message was edited by: max bianchi
Message was edited by: max bianchi