<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SCAN KEYWORD USAGE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915410#M57998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sidhartha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This keyword is actually for internal use by SAP.&lt;/P&gt;&lt;P&gt;However, we use it in a check program to enforce the standardization of ABAP coding (so all global variables start with gv_, all constants start with co_) and to check if ABAP code is build correctly (Is ALWAYS a check on SY-SUBRC available after certain commands).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to use it:&lt;/P&gt;&lt;P&gt;Take a look at the next partial source code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF int_abap OCCURS 0,    " Internal table for storing ABAP code
        line(73) TYPE c,
      END OF int_abap.
DATA : BEGIN OF int_sttmts OCCURS 0. " All statements
        INCLUDE STRUCTURE sstmnt.
DATA:  END OF int_sttmts.
DATA : BEGIN OF int_tokens OCCURS 0. " All keywords
        INCLUDE STRUCTURE stokex.
DATA:  END OF int_tokens.
DATA : BEGIN OF int_levels OCCURS 0. " Levels of includes
        INCLUDE STRUCTURE slevel.
DATA:  END OF int_levels.
DATA : BEGIN OF int_lines OCCURS 0,  " Internal table for storing ABAP
         line(200),
       END OF int_lines.
* Cleaning
  CLEAR: int_sttmts,
         int_tokens,
         int_levels,
         int_lines.
  REFRESH: int_sttmts,
           int_tokens,
           int_levels,
           int_lines.
* Using the SCAN command
*"
  SCAN ABAP-SOURCE int_abap TOKENS INTO int_tokens
                            STATEMENTS INTO int_sttmts
                            WITH ANALYSIS
                            WITH INCLUDES
                            LEVELS INTO int_levels.
*"
* Do something with the result
  LOOP AT int_sttmts.
    LOOP AT int_tokens FROM int_sttmts-from TO int_sttmts-to.
      CONCATENATE int_lines-line int_tokens-str INTO int_lines-line
        SEPARATED BY space.
    ENDLOOP.
    APPEND int_lines.
    CLEAR int_lines.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this answers your question,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Apr 2005 06:29:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-04-29T06:29:22Z</dc:date>
    <item>
      <title>SCAN KEYWORD USAGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915408#M57996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone used the "scan" keyword? I will be reading a report program into an internal table, after which i need to read the tables contents and find the list of datatypes used in it. Also i need to map these datatypes then to its corresponding database fields. Can someone please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2005 05:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915408#M57996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-29T05:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN KEYWORD USAGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915409#M57997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_UPLOAD can split files automatically, when using open dataset you can use SPLIT string AT val INTO fields... explicitly - why do you want to search in a structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see more flexibility, search this forum e.g. for split or dataset - you will find some nice examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2005 06:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915409#M57997</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-04-29T06:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN KEYWORD USAGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915410#M57998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sidhartha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This keyword is actually for internal use by SAP.&lt;/P&gt;&lt;P&gt;However, we use it in a check program to enforce the standardization of ABAP coding (so all global variables start with gv_, all constants start with co_) and to check if ABAP code is build correctly (Is ALWAYS a check on SY-SUBRC available after certain commands).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to use it:&lt;/P&gt;&lt;P&gt;Take a look at the next partial source code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF int_abap OCCURS 0,    " Internal table for storing ABAP code
        line(73) TYPE c,
      END OF int_abap.
DATA : BEGIN OF int_sttmts OCCURS 0. " All statements
        INCLUDE STRUCTURE sstmnt.
DATA:  END OF int_sttmts.
DATA : BEGIN OF int_tokens OCCURS 0. " All keywords
        INCLUDE STRUCTURE stokex.
DATA:  END OF int_tokens.
DATA : BEGIN OF int_levels OCCURS 0. " Levels of includes
        INCLUDE STRUCTURE slevel.
DATA:  END OF int_levels.
DATA : BEGIN OF int_lines OCCURS 0,  " Internal table for storing ABAP
         line(200),
       END OF int_lines.
* Cleaning
  CLEAR: int_sttmts,
         int_tokens,
         int_levels,
         int_lines.
  REFRESH: int_sttmts,
           int_tokens,
           int_levels,
           int_lines.
* Using the SCAN command
*"
  SCAN ABAP-SOURCE int_abap TOKENS INTO int_tokens
                            STATEMENTS INTO int_sttmts
                            WITH ANALYSIS
                            WITH INCLUDES
                            LEVELS INTO int_levels.
*"
* Do something with the result
  LOOP AT int_sttmts.
    LOOP AT int_tokens FROM int_sttmts-from TO int_sttmts-to.
      CONCATENATE int_lines-line int_tokens-str INTO int_lines-line
        SEPARATED BY space.
    ENDLOOP.
    APPEND int_lines.
    CLEAR int_lines.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this answers your question,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2005 06:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915410#M57998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-29T06:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN KEYWORD USAGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915411#M57999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;Thanx for such a fast response. Actually the problem i have is how to use the information i get out of the SCAN keyword. Using scan i get the statements type internal table which contains all the statements in my source code as well it also identifies whether its a keyword or not. The problem now is to figure out how to find out whether  each line of statements internal table is for a datatype definition or not. I want to have an internal table that will contain the list of all datatypes used in my code. Then i need to resolve if any of these fields are mapped to any database fields or not. Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2005 07:04:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scan-keyword-usage/m-p/915411#M57999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-04-29T07:04:22Z</dc:date>
    </item>
  </channel>
</rss>

