• ABAP Online Training @ $50

    Now you can learn ABAP by watching and listening video classes by experienced consultant.

  • ABAP Tutorials N Materials

    Read, Surf and Download useful ABAP tips, tutorials, code and download many eBooks and documents free

  • Latest ABAP Job in India

    Get all latest opening for SAP ABAP and related jobs, vaccancies across India and apply for the same.

    Thursday, October 25, 2012

    SELECT statement is used to get the data from database table. The simple and basic format of writing a select query is below

     

    SELECT * FROM <table name>.

    **statement**

    ENDSELECT.

     

    This statement retrieves all columns and all rows from the specified table.  In ABAP, the data is placed into an internal table after retrieving from table, which will hold the data in run time.

     

    This select statement will work like a loop statement. This will fetch 1 by 1 record and execute the statement. Check out a very simple example below:

     

    Data : lwa_kna1 type kna1.

     

    SELECT *

    FROM KNA1 into lwa_kna1.

    WRITE: / lwa_KNA1-KUNNR, lwa_KNA1-NAME1.

    ENDSELECT.

     

    So, here first the work area is declared with the same type of KNA1 table. Next in the SELECT statement, after retrieving every record, it is writing the output values from that work area and then proceeds further for the next data.

     

    This way a SELECT....ENDSELECT works, similar to a LOOP ... ENDLOOP statement only.


    0 comments:

    Post a Comment

    Easy2learnabap.co.in @ 2012 All product names on this web site are trademarks of the companies that own them .

    Easy2learnabap.co.in is not affiliated with SAP AG in any way. SAP AG is the registered trademark holder of SAP, SAP R/3, mySAP, ABAP, xApps, NetWeaver, and other proprietary terms.

    The technical information on this site is verified to the greatest extent possible, however, any information found on this site is used at the site visitor's own risk. All the tutorials are collected from various sources, if anyone is having problem with the content, report this to us. We will take action accordingly.

    Easy2learnabap.co.in reserves the right to correct any errors or omissions in any portion of this site at any time without obligation.

    This website is created to teach people about ABAP technology. The Video contents provided in Premium service are completely owned by us and copyrighted.