2012 Mar 14 11:55 AM
Hello,
I am trying to use SCAN AND CHECK ABAP-SOURCE statement.
{code}
*DATA : BEGIN OF itab5 OCCURS 0,
* text TYPE char200,
* END OF itab5.
data itab5 TYPE TABLE OF char200.
DATA itab4 TYPE sysch_result OCCURS 0.
READ REPORT 'ZAASHTEST_TOKENS' INTO itab5.
*data is there in itab5, verified in debugger
SCAN AND CHECK ABAP-SOURCE itab5 RESULT INTO itab4.
{/code}
I am getting the syntax error - ''SCAN AND" must be followed by a source code table.
I have tried defining itab5 in both the ways as shown above.
What can I do to resolve this error?
2012 Mar 14 12:14 PM
Not sure, but if you want to just do a syntax check for the code in itab5 I suggest you rather use statement SYNTAX-CHECK, which is easier to use and not flagged as "internal use only".
Thomas
2012 Mar 14 12:31 PM
Thanks for taking the time to reply Thomas.
My requirement is to identify data objects and do further processing on it and syntax-check will not serve my purpose.
Help on this statement(scan and check abap-source) says that this statment does exactly what I want.
2012 Mar 14 12:41 PM
Hi,
Use class CL_RECA_RS_SERVICES & method CHECK_SYNTAX as mentioned by our friend Vinod in this wiki
2012 Mar 15 3:55 AM
Hi,
Your codes seems correct as per my checking in ABAP Keyword Documentation. Try to define your itab5 as:
DATA: itab5 TYPE STANDARD TABLE OF string.or try to apply these extras.Parts marked with " ..." are interchangeable
Extras:
1. ... PROGRAM FROM c1 2. ... INCLUDE INTO c2
3. ... MESSAGE INTO c3
4. ... WORD INTO c4
5. ... LINE INTO n1
6. ... OFFSET INTO n2
Regards,
Jake
2012 Mar 15 4:28 AM
Hi Jake,
Thanks for taking the time to reply.
I tried both your suggestions. Unfortunately neither works .
I am still getting the same error.
-Aashrith.
2012 Mar 15 5:54 AM
Hi,
Why not try SCAN ABAP-SOURCE ? Try to view this link from Prakash Bhatia.
Regards,
jake
2012 Mar 15 7:02 AM
Did you check the class / method I mentioned ? If its not working the please specify the exact reason .
2012 Mar 15 7:34 AM
Thanks for following up, Kesavadas.
The method you have mentioned tells me whether my source code has errors or not.
My requirement is to identify data objects in the source code.
Eg : 1. data c type mara-matnr.
2. tables kna1.
3. select * from mard.
4. " marc is another table name.
Here mara-matnr, kan1 & mard should be identified and marc should be ignored.
2012 Mar 15 7:40 AM
"Here mara-matnr, kan1 & mard should be identified and marc should be ignored"
On what basis you are ignoring MARC. This question doesn't match with your actual question. How is "SCAN AND CHECK ABAP-SOURCE" going to help you with this ?
"My requirement is to identify data objects in the source code"
Check if this blog helps you http://help-abap.zevolving.com/2012/02/list-the-environment-variables-used-in-a-program/ , mark 'X' to environment_selection-tabl and check it
2012 Mar 15 9:19 AM
Scan and check abap-source identifies all the data objects .
Marc should be igonored because it's used inside a comment and does not act as a data object in the example above.
That's the reason I am trying to use it.
2012 Mar 15 7:49 AM
Hi,
Try using 'SCAN ABAP-SOURCE' instead of 'SCAN AND CHECK ABAP-SOURCE'.
Regards,
Sharin
2012 Mar 15 9:28 AM
In that case the blog which I mentioned will provide you the solution.
2012 Mar 15 9:28 AM
In that case the blog which I mentioned will provide you the solution.