SlideShare a Scribd company logo
ABAP Chapter 3
   Open SQL
   Internal Table
SAP System : 3 Tier Client/Server
SAP GUI           SAP GUI         SAP GUI   Presentation
                                            Server




                             SAP
                             Application
                             Server



                             DB Server
SAP SYSTEM (3 Tier Architecture)
                                       SAP GUI            SAP GUI

Presentation Layer
(Windows based)



                        SAP Instance
Application Layer
                                              Dispatcher                         M
(Windows Server/UNIX)
                         Request                                           SAP Buffer
                          Queue
                                                                         (Shared Mem)

                                   D      D      B    V      S      E
                                                                                 G



                                                                        Oracle
Database Layer
                                                                        Informix
(Windows Server/UNIX)
                                                                        DB2
                                   Database Server
                                                                        MS SQL Server
                                                                        SAP DB/MaxDB
SAP System : Dialog Processing
                                    SAP GUI

                                                                            Report zpsm1.

                                 Request                                    Tables customers.
                                              List                          Select single * from
                                   Generate
                                1   10
                                                                             customers where id = 1.
                                   Screen(List)
Application Server       Send Request                                       Write: / customers-name.


Store request
to queue3                    Dispatcher
                Send         2     Search for                  SAP Buffer
                List
                  9                free WP
   Request                         Check Program in                                7
                                                                 Program
    Queue Send request             Program Buffer
                                       5                                        Execute
           to WP
              4                                                                 ABAP
                                                                Table
                  D          D        D …            D                          stateme
                                                                                nt
                                                                        …

                         8                                 6

                         SQL                             Load&Gen
Database Server          Request                         Program
Dialog Work Process Architecture
   Dialog Work Process             Local Memory

                                      Memory Space
         TaskHandler


        ABAP Processor
                                      List buffer

      DYNPRO Processor


          DB Interface
               Result Set Memory




                    Database Server
Open SQL
   SELECT ...
   INSERT ...
   UPDATE ...
   DELETE ...
DB Interface
SAP Application Server

        Dialog WP                 Local Memory
                  TaskHandler      Memory Space

           ABAP Processor
                   DYNPRO
                                   List Buffer
             DB Interface

                    Result Set

          ~ 32 KB in length
Database Server


                                                  Data   Data
                           Data      Data
           Data
Example Tables in DB

                                                 customers
spfli                                             id   name       city

carrid   connid   cityfrom   cityto   distance
                                                  1    John    New York
 LH      0400        LA        NY       100       2    Peter   Singapore
 LH      0402       BK         NY       540       3    David    London
 SQ      0110       SQ         BK       250
Example Tables in DB
sflight
carrid   connid     fldate   price


 LH      0400     20010101     150

 LH      0400     20010110     145

 LH      0400     20010228     130

 SQ      0110     20010226      75
Select Overview
Select <result>         Which Columns?
 From <table>           Which Table?
   Into <destination>   Where to place?
    Where <condition>   Which Lines?
Select Statement
   Select multiple records from database
           SELECT * FROM customers.
            …
           ENDSELECT.



   Select single record from database
           SELECT SINGLE * FROM customers WHERE id = 1.
            …
Select Multiple Records
Tables spfli.
Seclect * from spfli.
       write: / spfli-carrid, spfli-connid,
                 spfli-cityto.
endselect.
if sy-subrc <> 0.
   write: / ‘No Data’.
endif.
Dialog WP
Dialog WP                Local Memory
                         Memory Space
   TaskHandler

   ABAP Processor

                         List buffer
   DYNPRO Processor


     DB Interface
            Result Set




    Database
SELECT Statement Working Steps
1. Transform open SQL to DB SQL and return result set
 into result set work area

   SELECT * FROM spfli.           SELECT * FROM spfli;
    …
   ENDSELECT.


2. Loop with data in result set and transfer each record to
work area in memory space
                                  Table Structure in Memory
   SELECT * FROM spfli.           Space
    …
   ENDSELECT.
Select … Into Table Structure
Tables spfli.
Seclect * from spfli into spfli.
       write: / spfli-carrid, spfli-connid,
                 spfli-cityfrom, spfli-cityto.
endselect.
if sy-subrc <> 0.
   write: / ‘No Data’.
endif.
Select … Into Work Area
Data wa like spfli.
Seclect * from spfli into wa.
       write: / wa-carrid, wa-connid,
                 wa-cityfrom, wa-cityto.
endselect.
if sy-subrc <> 0.
   write: / ‘No Data’.
endif.
Exercise I




                customers-name   customers-city
customers-id
SELECT with WHERE Clause
Loop Processing with Restriction
Tables spfli.
Select * from spfli
           where cityfrom = ‘FRANKFURT’.
   write: / spfli-carrid, spfli-cityto.
endselect.
If sy-subrc <> 0.
   write / ‘no data’.
endif.
Select With Range
Tables     sflight.
Select * From sflight
           Where price between 100 and
           1000.
 Write:    /    sflight-carrid, sflight-connid,
           sflight-price.
Endselect.
SELECT … With IN List
Tables     sflight.
Select * From sflight
     Where price in ( 100, 1000 ).
 Write: /       sflight-carrid, sflight-connid,
           sflight-price.
Endselect.
Select Single Record
Select Single Record
Tables spfli.
Select single * from spfli
     where carrid = ‘LH’ and
             connid = ‘0400’.
if sy-subrc = 0.
     write: / spfli-carrid, spfli-connid,
               spfli-cityfrom, spfli-cityto.
else.
     write: / ‘Data not found’.
endif.
Select Column List
Select * : Example




SELECT *
Reading Selected Column
Data: id like customers-id,
        name like customers-name,
        city like customers-city.
Select id name city
  into (id, name, city)
      from customers.
   write: / id, name, city.
endselect.
if sy-subrc <> 0.
    write / ‘No Data found’.
endif.
Reading Selected Column
Data: begin of wa,
       id    like customers-id,
       name like customers-name,
       city like customers-city,
       end of wa.
Select id name city
  into wa
      from customers.
   write: / wa-id, wa-name , wa-city.
endselect.
if sy-subrc <> 0.
    write / ‘No Data found’.
endif.
Select Column : Example I
Reading Selected Column
Tables customers.
Select id name city
  into (customers-id, customers-name, customers-city)
      from customers.
   write: / customers-id, customers-name, customers-city.
endselect.
if sy-subrc <> 0.
    write / ‘No Data found’.
endif.
Select Column : Example II
Corresponding Fields of...
Tables: customers.
Select id name city
 into corresponding fields of customers
   from customers.
 Write: / customers-id, customers-name,
          customers-city.
Endselect.
Select Statement : Special Topics
DB Count : SY-DBCNT
Tables customers.
Select * from customers.
   write: / sy-dbcnt, customers-id, customers-name.
endselect.
if sy-subrc <> 0.
    write: / ‘No Data found’.
else.
    write: / sy-dbcnt, ‘Record found’.
endif.
SELECT … ORDER BY ...
Tables: spfli.
Select * from spfli
          Order by cityfrom.
 Write: / spfli-carrid, spfli-connid,
          spfli-cityfrom.
Endselect.
SELECT … With Template
Tables     customers.
Select * From customers
            Where name Like ‘_r%’.
  Write: /     customers-id,customers-name.
Endselect.
Aggregate Functions
      Data: maxdat like sflight-distance,
            mindat like sflight-distance,
            counter type I.
      Select COUNT( * ) MIN( distance ) MAX( distance )
          into (counter ,mindat, maxdat)
              from spfli.
      Write: / ‘Count :’ , counter,
            / ‘Min :’    , mindat,
            / ‘Max :’ , maxdat.


Aggregate Functions : COUNT,MIN,MAX,AVG and SUM
SELECT … GROUP BY ...
    Data: carrid like sflight-carrid,
                              sflight
         mindat Type P Decimals 2,
         maxdat Type P Decimals 2.
                              carrid connid  fldate     Price

    Select carrid Min( price )LHMax( price )
                                      0400 20010101       150
     Into (carrid, mindat, maxdat)
                                LH    0400 20010110       145
      From sflight
       Group by carrid.         LH    0400 20010228       130
     Write: / carrid, mindat,SQ 0110 20010226
                                 maxdat.                   75
    Endselect.
ยากทราบว่า ในแต่ละสายการบิน มีราคาตั๋วตำำาสุดและสูงสุดเท่าไร
Sub Query
tables customers.               ลูกค้าคนใดทีอยู่เมือง
                                              ่
                                เดียวกับลูกค้ารหัส ID 1
select *
  from customers
    where id <> 1 and
       city =
        ( select city
           from customers
            where id = 1 ).
  write: / customers-id, customers-name.
endselect.
Exercise I

               ห้ามใช้ SELECT *




                  customers-name   customers-city
customers-id
Exercise II

              ห้ามใช้ SELECT *




usr02-bname       usr02-trdat    usr02-ltime
ABAP : Inner Join
Tables Join

                                                 sflight
spfli
                                                 carrid   connid     fldate   price
carrid   connid   cityfrom   cityto   distance
                                                  LH      0400     20010101    150
 LH      0400       NY         BK       100
                                                  LH      0400     20010110    145
 LH      0402       BK         NY       540
                                                  LH      0400     20010228    130
 SQ      0110       SQ         BK       250
                                                  SQ      0110     20010226     75
Tables Join
Question: Select carrid, connid and cityto from spfli
         and fldate,price from sflight where carrid = ‘LH’

spfli-carrid   spfli-connid sflight-fldate spfli-cityto sflight-price


เงืำอนไข : ให้แสดงข้อมูลเฉพาะสายการบิน ‘LH’ เท่านัน
                                                  ้
Standard SQL

Select spfli.carrid, spfli.connid, sflight.fldate,
        sflight.price
   From spfli, sflight
    Where spfli.carrid = sflight.carrid and
              spfli.connid = sflight.connid and
                spfli.carrid = ‘LH’;
Tables Join Methods
   Nested select statement
   Internal table
   View
   Inner join of Select statement
Nested Select Statement
Tables: spfli,sflight.
Select * from spfli where carrid = ‘LH’.
 Select * from sflight
     where carrid = spfli-carrid and
               connid = spfli-connid.
   Write: / spfli-carrid, spfli-connid, sflight-fldate,
            sflight-price.
 Endselect.
Endselect.
Open SQL – Inner Join
Tables: spfli,sflight.
Select spfli~carrid spfli~connid sflight~fldate spfli~cityto sflight~price
  into (spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price)
          from spfli inner join sflight
             on    spfli~carrid = sflight~carrid and
                   spfli~connid = sflight~connid
               where spfli~carrid = ‘LH’.
    Write: / spfli-carrid, spfli-connid, sflight-fldate,
                spfli-cityto, sflight-price.
Endselect.
Open SQL – Inner Join
Tables: A,B.
                            A-a B-b B-c
Select A~a B~b B~c
   into (A-a,B-b,B-c)
      from A inner join B
          on A~b = B~b.             Table : B
 Write: / A-a,B-b,B-c.
                                          b     c
Endselect.
              Table : A                   b1    c1
               a            b             b2    c2
               a1           b1            b3    c3
               a2           b2
Open SQL – Inner Join
                 Table : A                    Table : B
Database
                     a             b              b             c
 Server
                     a1            b1             b1            c1
                     a2            b2             b2            c2
                                                  b3            c3

Application Server        Single Result Table(Result set)   1

             2
  Select …                   A~a        B~b       B~c
     inner join..             a1         b1        c1
  Endselect.                  a2         b2        c2
Open SQL – Alias Table Name
Tables: spfli,sflight.
Select a~carrid a~connid b~fldate a~cityto b~price
 into (spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price)
   from spfli as a inner join sflight as b
      on    a~carrid = b~carrid and
             a~connid = b~connid
          where a~carrid = ‘LH’.
 Write: / spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price
Endselect.
Inner Join/Outer Join Example
  ZCUSTOMERS                                             ZSALEREPS
 id     name            city             tel              sale_id       name
  1      John         New York        111111                01        Somchai
  2      Peter         London         222222                02          Pipop
  3     David         Singapore       432555
  4     Micheal       Bangkok         234111
                                                 ZSALES
                                               cust_id   prod_id    sale_date   qty   sale_id
ZPRODUCTS
                                                 1         A1       20020318    10      01
 p_id     prod_name            on_hand
                                                 1         A2       20020318    50      01
 A1             Pen             100
                                                 3         X1       20020321    90      02
 A2         Pencil              125
 B1          Ruler               80
 X1          Tape               120
 Y1              CD              99
Open SQL – Inner Join
REPORT ZINNERJOIN01 .
TABLES: ZCUSTOMERS,ZSALES.
SELECT A~NAME B~PROD_ID
 INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID)
  FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A
   ON B~CUST_ID = A~ID.
   WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID.
ENDSELECT.
Open SQL – Inner Join > 2 Tables
                                       Table : C
Tables: A,B,C.           A-a B-c C-y
Select A~a B~c C~y                          x       y
   into (A-a,B-c,C-y)                       …       ...
      from A inner join B
           on A~b = B~b                Table : B
        inner join C
                                           b       c
          on C~x = B~c.
 Write: / A-a,B-c,C-y.
                                           …       ...
Endselect.                                 …       ...
               Table : A                   …       …
                 a            b
                 …           …
Open SQL – Inner Join > 2 Tables
REPORT ZINNERJOIN02 .
TABLES: ZCUSTOMERS,ZPRODUCTS,ZSALES.
SELECT A~NAME C~PROD_NAME B~QTY
 INTO (ZCUSTOMERS-NAME, ZPRODUCTS-PROD_NAME, ZSALES-QT
  FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A
   ON B~CUST_ID = A~ID
     INNER JOIN ZPRODUCTS AS C
       ON C~P_ID = B~PROD_ID.
   WRITE: / ZCUSTOMERS-NAME,ZPRODUCTS-PROD_NAME,ZSALES-
              QTY.
ENDSELECT.
Exercise
   List customers who buy product from
    company as following fields:

      zcustomers-id
     zcustomers-name
     zsales-sale_date
     zproducts-prod_name
     zsales-qty
     zsalereps-name
Exercise : User Master
USR02-BNAME    USR02-TRDAT   ADCP-TEL_NUMBER   Tables Relationship


                                                     USR02


                                                             BNAME


                                                     USR21

                                                             PERSNUMBER
                                                             ADDRNUMBER


                                                     ADCP
ABAP : Outer Join
Open SQL – Outer Join
REPORT ZOUTERJOIN .
TABLES: ZCUSTOMERS,ZSALES.
SELECT A~NAME B~PROD_ID
 INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID)
  FROM ZCUSTOMERS AS A LEFT OUTER JOIN ZSALES AS B
   ON A~ID = B~CUST_ID.
   WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID.
ENDSELECT.
                 Single Result Table
                  A~NAME          B~PROD_ID
                  John            A1
                  John            A2
                  Peter
                  David           X1
                  Micheal
Exercise
   List customers name who do not buy any
    product from company
Sub Query
REPORT ZSUBQUERY .
tables: zcustomers.               ลูกค้าชื่ออะไรที่ไม่ได้ซื้อ
                                  สินค้าจากเรา มีใครบ้าง
select * from zcustomers as a
 where not exists
            ( select *
                from zsales as b
                  where b~cust_id = a~id ).
    write: / zcustomers-name.
endselect.
Internal Table
Data Objects in ABAP
Memory Space
   Variable                 Structure



  Table Structure                       Internal Table



 Constants          <Field-symbols>
INTERNAL TABLE
    Flight (Structure)
      Carrid     Connid   Date   Price



Internal Table
    Flight (Internal Table)         Header Line
      Carrid     Connid   Date   Price
Structure
Data:     Begin of   flight,
          carrid       like sflight-carrid,
          connid       like sflight-connid,
          date         like sflight-fldate,
          price        like sflight-price.
Data:     End of flight.
flight-carrid = ‘LH’.
Write:    / flight-carrid.
INTERNAL TABLE
Data:   begin of tab occurs 10,
        carrid like sflight-carrid,
        connid like sflight-connid,
        fldate like sflight-fldate,
        price    like sflight-price.
Data    end of tab.
USING ABAP DICTIONARY STRUCTURE

Data:   begin of tab occurs 0.
        Include structure sflight.
Data    end of tab.
INTERNAL TABLE USING LIKE

Data tab LIKE sflight OCCURS 0 WITH HEADER LINE.
FILLING INTERNAL TABLE (APPEND)

Tables sflight.
Data flight like sflight occurs 0 with header line.
Select * from sflight.
 Move sflight to flight.
 Append flight.
Endselect.
Standard Key of Internal Table
                               tab

Data: begin of tab occurs 0,   f1    f2   f3   f4
     f1 type C,
     f2 type I,
     f3 type N,
     f4 type P,
     end of tab.
Reading Data From Internal Table
Data tab like sflight occurs 0 with header line.
Select * from sflight into table tab.
If sy-subrc = 0.
 Loop at tab.
  Write: / tab-carrid, tab-price.
 Endloop.
Else.
  Write: / ‘No Data’.
Endif.
Access Database Without Internal Table
Access Database Using Internal Table
Reading Data From Internal Table
Data: begin of tab occurs 0,
       id like customers-id,
       name like customers-name,
       end of tab.
Select id name from customers into table tab.
If sy-subrc = 0.
  Loop at tab.
    Write: / tab-id, tab-name.
  Endloop.
else.
   Write: / ‘No Data’.
Endif.
Exercise I : Change

   Using Internal Table
SORTING INTERNAL TABLE (SORT)

Sort   flight.
Sort   flight by   price fldate.
Sort   flight by   price ascending
                   fldate descending.
SORTING INTERNAL TABLE
Data tab like spfli occurs 0 with header line.
Select * from spfli into table tab.
Sort tab by cityfrom.
…
Loop at tab.
 write: / tab-carrid, tab-connid,tab-cityfrom.
Endloop.
PROCESSING INTERNAL TABLE
    ...
Loop at flight.
 Write: / flight-carrid, flight-connid.
Endloop.

Loop at flight where carrid = ‘LH’.
 Write: / flight-carrid, flight-connid.
Endloop.
Loop at flight from 1 to 10.
 Write: / sy-tabix ,flight-carrid, flight-connid.
Endloop.
Internal Table Template Condition
...
loop at tab where name cp ‘+r*’.
...
Reading Single Record
...
Sort flight by carrid connid fldate.
Read table flight
      with key carrid = ‘LH’
                connid = ‘0400’
                fldate = ‘19990201’
                Binary Search.
if sy-subrc = 0.
      write : / flight-carrid,flight-connid,
                 flight-fldate, flight-price.
endif.
Reading Single Record using Index
         ...
Read table flight index 3.
If sy-subrc = 0.
   write: / flight-carrid, flight-connid.
Endif.
CHANGING INTERNAL TABLE

       ...
 Delete      flight index 5.
 Delete      flight where carrid = ‘LH’.

 flight-carrid = ‘XX’.
 flight-price = 100.
 …
 Insert flight index 1.
DELETING INTERNAL TABLE
DATA flight LIKE sflight occurs 0 with header line.

        Clear flight.
        Refresh flight.
        Free flight.
Total Record of Internal Table

Data: line_count type i.
Data tab like sflight occurs 0 with header line.
Select * from sflight into table tab.
Describe table tab lines line_count.
Write: / line_count.
Exercise I
Internal Table Processing
Data tab like spfli occurs 0 with Header line.
…
Select * from spfli
        appending table tab
            where carrid = ‘LH’.
SELECT … INNER JOIN
REPORT ZINNERJOIN01 .
TABLES: ZCUSTOMERS,ZSALES.
SELECT A~NAME B~PROD_ID
 INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID)
  FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A
   ON B~CUST_ID = A~ID.
   WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID.
ENDSELECT.
Inner Join into Internal Table
REPORT ZJOIN01 .
DATA: begin of tab occurs 0,
     name like zcustomers-name,
     prod_id like zsales-prod_id,
     end of tab.
SELECT A~NAME B~PROD_ID
 INTO TABLE tab
  FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A
   ON B~CUST_ID = A~ID.
…
LOOP AT tab.
   WRITE: / TAB-NAME,TAB-PROD_ID.
ENDLOOP.
Internal Table Without Header Line
DATA tab LIKE customers OCCURS 0.
DATA wa LIKE customers.
…
LOOP AT tab INTO wa.
 WRITE: / wa-id, wa-name.
ENDLOOP.
Internal Table Declaration
DATA tab TYPE TABLE OF customers.
DATA wa LIKE LINE OF customers.
…
ABAP Practice
Database Table Processing

   INSERT
   UPDATE
               Database
   MODIFY
   DELETE
Insert (Table)
Tables customers.
customers-id = ‘999’.
customers-name = ‘Test’.
Insert customers.
if sy-subrc <> 0.
   write: / ‘Data Already Exists’.
endif.
Update Statement

Tables customers.
Select single * from customers where id
    = 1.
If sy-subrc = 0.
   customers-name = ‘John’.
   update customers.
Endif.            Update customers
                set name = ‘John’
                 where id = 1.
Update Statement
Data wa like customers.
wa-id = ‘1’.
wa-name = ‘Test No 1’.
wa-city = ‘Bangkok’.
update customers from wa.
If sy-subrc <> 0.
 write: / ‘Data not found’.
Endif.
Modify Statement
Tables customers.
customers-id = ‘1’.
customers-name = ‘Test No 1’.
Modify customers.
Deleting Database Table Entries
Tables customers.
customers-id = ‘1’.
Delete customers.

Delete customers From Table
   delcustomers.

Delete From customers Where city =
Exercise II
Exercise II
1. ห้ามใช้ SELECT * 2. ใช้ Internal Table




    usr02-bname    usr02-trdat   usr02-ltime
Exercise III
Tables Relationship for User Master
USR02-BNAME   USR02-TRDAT   ADCP-TEL_NUMBER   Tables Relationship


                                                    USR02


                                                            BNAME


                                                    USR21

                                                            PERSNUMBER
                                                            ADDRNUMBER


                                                    ADCP
Exercise III : User Master

                          usr02-trdat

usr02-bname

                                        adcp-tel_number




              ใช้ Internal Table

More Related Content

What's hot

Reports
ReportsReports
Reports
Jugul Crasta
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questionsKranthi Kumar
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANA
Ashish Saxena
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONKranthi Kumar
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
Hitesh Gulani
 
Badis
Badis Badis
Badis
Rajesh Kumar
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
Harshul Phadke
 
Dialog programming ABAP
Dialog programming ABAPDialog programming ABAP
Dialog programming ABAP
Jefferson Mutuva
 
ABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type GroupABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type Group
sapdocs. info
 
07.Advanced Abap
07.Advanced Abap07.Advanced Abap
07.Advanced Abap
sapdocs. info
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview
sapdocs. info
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
Noman Mohamed Hanif
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
IICT Chromepet
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)Kranthi Kumar
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
Abap performance tunning tips
Abap performance tunning tipsAbap performance tunning tips
Abap performance tunning tips
Jay Dalwadi
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.info
sapdocs. info
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
Pradipta Mohanty
 

What's hot (20)

Reports
ReportsReports
Reports
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questions
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANA
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Badis
Badis Badis
Badis
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
 
Dialog programming ABAP
Dialog programming ABAPDialog programming ABAP
Dialog programming ABAP
 
ABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type GroupABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type Group
 
07.Advanced Abap
07.Advanced Abap07.Advanced Abap
07.Advanced Abap
 
08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview08.Abap Dialog Programming Overview
08.Abap Dialog Programming Overview
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Abap performance tunning tips
Abap performance tunning tipsAbap performance tunning tips
Abap performance tunning tips
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.info
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
 

Viewers also liked

Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
sapdocs. info
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
sapdocs. info
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
sapdocs. info
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1
Panduka Bandara
 
HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/
sapdocs. info
 
HR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.infoHR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.info
sapdocs. info
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
sapdocs. info
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
sapdocs. info
 
SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!
sapdocs. info
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
Revanth Nagaraju
 
Abap course chapter 3 basic concepts
Abap course   chapter 3 basic conceptsAbap course   chapter 3 basic concepts
Abap course chapter 3 basic conceptsMilind Patil
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
sapdocs. info
 
SAP Accounts Reveivable Functions | http://sapdocs.info
SAP Accounts Reveivable Functions | http://sapdocs.infoSAP Accounts Reveivable Functions | http://sapdocs.info
SAP Accounts Reveivable Functions | http://sapdocs.info
sapdocs. info
 
Sap abap ale idoc
Sap abap ale idocSap abap ale idoc
Sap abap ale idocBunty Jain
 

Viewers also liked (16)

Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1
 
HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/HR ABAP Technical Overview | http://sapdocs.info/
HR ABAP Technical Overview | http://sapdocs.info/
 
HR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.infoHR ABAP Programming Training Material | http://sapdocs.info
HR ABAP Programming Training Material | http://sapdocs.info
 
SAP ABAP Material
SAP ABAP MaterialSAP ABAP Material
SAP ABAP Material
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!SAP FICO BBP Sample Document PDF NEW!
SAP FICO BBP Sample Document PDF NEW!
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 
Abap course chapter 3 basic concepts
Abap course   chapter 3 basic conceptsAbap course   chapter 3 basic concepts
Abap course chapter 3 basic concepts
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
Message, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type GroupMessage, Debugging, File Transfer and Type Group
Message, Debugging, File Transfer and Type Group
 
SAP Accounts Reveivable Functions | http://sapdocs.info
SAP Accounts Reveivable Functions | http://sapdocs.infoSAP Accounts Reveivable Functions | http://sapdocs.info
SAP Accounts Reveivable Functions | http://sapdocs.info
 
Sap abap ale idoc
Sap abap ale idocSap abap ale idoc
Sap abap ale idoc
 

Similar to ABAP Open SQL & Internal Table

Hadoop World Oct 2009 Production Deep Dive With High Availability
Hadoop World Oct 2009 Production Deep Dive With High AvailabilityHadoop World Oct 2009 Production Deep Dive With High Availability
Hadoop World Oct 2009 Production Deep Dive With High AvailabilityAlex Dorman
 
Admin High Availability
Admin High AvailabilityAdmin High Availability
Admin High Availabilityrsnarayanan
 
Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview k kartheek
 
Processing massive amount of data with Map Reduce using Apache Hadoop - Indi...
Processing massive amount of data with Map Reduce using Apache Hadoop  - Indi...Processing massive amount of data with Map Reduce using Apache Hadoop  - Indi...
Processing massive amount of data with Map Reduce using Apache Hadoop - Indi...
IndicThreads
 
Gse 2009 Cmolaro Final02 1
Gse 2009 Cmolaro Final02 1Gse 2009 Cmolaro Final02 1
Gse 2009 Cmolaro Final02 1Cristian Molaro
 
The RDBMS You Should Be Using
The RDBMS You Should Be UsingThe RDBMS You Should Be Using
The RDBMS You Should Be Using
ColdFusionConference
 
R3arch
R3archR3arch
Boston Spark Meetup event Slides Update
Boston Spark Meetup event Slides UpdateBoston Spark Meetup event Slides Update
Boston Spark Meetup event Slides Updatevithakur
 
Sap abap online corse content
Sap abap online corse contentSap abap online corse content
Sap abap online corse contentkrajesh0011
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
zefhemel
 
Parallelizing Existing R Packages
Parallelizing Existing R PackagesParallelizing Existing R Packages
Parallelizing Existing R Packages
Craig Warman
 
Cowboy dating with big data, Борис Трофімов
Cowboy dating with big data, Борис ТрофімовCowboy dating with big data, Борис Трофімов
Cowboy dating with big data, Борис Трофімов
Sigma Software
 
Apache Flink Training: System Overview
Apache Flink Training: System OverviewApache Flink Training: System Overview
Apache Flink Training: System Overview
Flink Forward
 
Introduction to Apache Spark
Introduction to Apache SparkIntroduction to Apache Spark
Introduction to Apache Spark
Vincent Poncet
 
Oracle10g new features
Oracle10g  new featuresOracle10g  new features
Oracle10g new featuresTanvi_Agrawal
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology Overview
Haim Ben Zagmi
 
Apache spark - Architecture , Overview & libraries
Apache spark - Architecture , Overview & librariesApache spark - Architecture , Overview & libraries
Apache spark - Architecture , Overview & libraries
Walaa Hamdy Assy
 
Cowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
Cowboy Dating with Big Data or DWH Evolution in Action, Борис ТрофимовCowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
Cowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
Sigma Software
 

Similar to ABAP Open SQL & Internal Table (20)

Hadoop World Oct 2009 Production Deep Dive With High Availability
Hadoop World Oct 2009 Production Deep Dive With High AvailabilityHadoop World Oct 2009 Production Deep Dive With High Availability
Hadoop World Oct 2009 Production Deep Dive With High Availability
 
Ta3
Ta3Ta3
Ta3
 
Admin High Availability
Admin High AvailabilityAdmin High Availability
Admin High Availability
 
Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview
 
Processing massive amount of data with Map Reduce using Apache Hadoop - Indi...
Processing massive amount of data with Map Reduce using Apache Hadoop  - Indi...Processing massive amount of data with Map Reduce using Apache Hadoop  - Indi...
Processing massive amount of data with Map Reduce using Apache Hadoop - Indi...
 
Gse 2009 Cmolaro Final02 1
Gse 2009 Cmolaro Final02 1Gse 2009 Cmolaro Final02 1
Gse 2009 Cmolaro Final02 1
 
The RDBMS You Should Be Using
The RDBMS You Should Be UsingThe RDBMS You Should Be Using
The RDBMS You Should Be Using
 
R3arch
R3archR3arch
R3arch
 
Help desk
Help deskHelp desk
Help desk
 
Boston Spark Meetup event Slides Update
Boston Spark Meetup event Slides UpdateBoston Spark Meetup event Slides Update
Boston Spark Meetup event Slides Update
 
Sap abap online corse content
Sap abap online corse contentSap abap online corse content
Sap abap online corse content
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Parallelizing Existing R Packages
Parallelizing Existing R PackagesParallelizing Existing R Packages
Parallelizing Existing R Packages
 
Cowboy dating with big data, Борис Трофімов
Cowboy dating with big data, Борис ТрофімовCowboy dating with big data, Борис Трофімов
Cowboy dating with big data, Борис Трофімов
 
Apache Flink Training: System Overview
Apache Flink Training: System OverviewApache Flink Training: System Overview
Apache Flink Training: System Overview
 
Introduction to Apache Spark
Introduction to Apache SparkIntroduction to Apache Spark
Introduction to Apache Spark
 
Oracle10g new features
Oracle10g  new featuresOracle10g  new features
Oracle10g new features
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology Overview
 
Apache spark - Architecture , Overview & libraries
Apache spark - Architecture , Overview & librariesApache spark - Architecture , Overview & libraries
Apache spark - Architecture , Overview & libraries
 
Cowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
Cowboy Dating with Big Data or DWH Evolution in Action, Борис ТрофимовCowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
Cowboy Dating with Big Data or DWH Evolution in Action, Борис Трофимов
 

More from sapdocs. info

SAP PM Master Data Training Guide
SAP PM Master Data Training GuideSAP PM Master Data Training Guide
SAP PM Master Data Training Guide
sapdocs. info
 
SAP SD Certification (C_TSCM62_66) Preparation Training Notes
SAP SD Certification (C_TSCM62_66) Preparation Training NotesSAP SD Certification (C_TSCM62_66) Preparation Training Notes
SAP SD Certification (C_TSCM62_66) Preparation Training Notes
sapdocs. info
 
Variant Configuration in SAP PP: Beginner's Guide
Variant Configuration in SAP PP: Beginner's GuideVariant Configuration in SAP PP: Beginner's Guide
Variant Configuration in SAP PP: Beginner's Guide
sapdocs. info
 
SAP PP MRP Guide for Beginners
SAP PP MRP Guide for BeginnersSAP PP MRP Guide for Beginners
SAP PP MRP Guide for Beginners
sapdocs. info
 
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.infoSAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
sapdocs. info
 
SAP PM Training Manual - www.sapdocs.info
SAP PM Training Manual - www.sapdocs.infoSAP PM Training Manual - www.sapdocs.info
SAP PM Training Manual - www.sapdocs.info
sapdocs. info
 
ABAP Basico para Consultores Funcionales
ABAP Basico para Consultores FuncionalesABAP Basico para Consultores Funcionales
ABAP Basico para Consultores Funcionales
sapdocs. info
 
SAP Configuration Guide for Functional Modules (Based on IDES)
SAP Configuration Guide for Functional Modules (Based on IDES)SAP Configuration Guide for Functional Modules (Based on IDES)
SAP Configuration Guide for Functional Modules (Based on IDES)
sapdocs. info
 
SAP FI-AP TCODES & MENU PATHS
SAP FI-AP TCODES & MENU PATHSSAP FI-AP TCODES & MENU PATHS
SAP FI-AP TCODES & MENU PATHS
sapdocs. info
 
SAP FI-AR TCODES & MENU PATHS
SAP FI-AR TCODES & MENU PATHSSAP FI-AR TCODES & MENU PATHS
SAP FI-AR TCODES & MENU PATHS
sapdocs. info
 
SAP CO Configuration Guide - Exclusive Document
SAP CO Configuration Guide - Exclusive DocumentSAP CO Configuration Guide - Exclusive Document
SAP CO Configuration Guide - Exclusive Document
sapdocs. info
 
SAP PP End User Document - www.sapdocs.info
SAP PP End User Document - www.sapdocs.infoSAP PP End User Document - www.sapdocs.info
SAP PP End User Document - www.sapdocs.info
sapdocs. info
 
SAP MM Configuration - Real Project Documentation
SAP MM Configuration - Real Project DocumentationSAP MM Configuration - Real Project Documentation
SAP MM Configuration - Real Project Documentation
sapdocs. info
 
SAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User GuideSAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User Guide
sapdocs. info
 
SAP FI AR: End User Guide for Beginners
SAP FI AR: End User Guide for BeginnersSAP FI AR: End User Guide for Beginners
SAP FI AR: End User Guide for Beginners
sapdocs. info
 
SAP FI AP: End User Guide for Beginners
SAP FI AP: End User Guide for BeginnersSAP FI AP: End User Guide for Beginners
SAP FI AP: End User Guide for Beginners
sapdocs. info
 
SAP FI Asset Accounting: End User Guide for Beginners
SAP FI Asset Accounting: End User Guide for BeginnersSAP FI Asset Accounting: End User Guide for Beginners
SAP FI Asset Accounting: End User Guide for Beginners
sapdocs. info
 
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.infoVariant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
sapdocs. info
 
Exclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.infoExclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.info
sapdocs. info
 
SAP Plant Maintenance Training Material | www.sapdocs.info
SAP Plant Maintenance Training Material | www.sapdocs.infoSAP Plant Maintenance Training Material | www.sapdocs.info
SAP Plant Maintenance Training Material | www.sapdocs.info
sapdocs. info
 

More from sapdocs. info (20)

SAP PM Master Data Training Guide
SAP PM Master Data Training GuideSAP PM Master Data Training Guide
SAP PM Master Data Training Guide
 
SAP SD Certification (C_TSCM62_66) Preparation Training Notes
SAP SD Certification (C_TSCM62_66) Preparation Training NotesSAP SD Certification (C_TSCM62_66) Preparation Training Notes
SAP SD Certification (C_TSCM62_66) Preparation Training Notes
 
Variant Configuration in SAP PP: Beginner's Guide
Variant Configuration in SAP PP: Beginner's GuideVariant Configuration in SAP PP: Beginner's Guide
Variant Configuration in SAP PP: Beginner's Guide
 
SAP PP MRP Guide for Beginners
SAP PP MRP Guide for BeginnersSAP PP MRP Guide for Beginners
SAP PP MRP Guide for Beginners
 
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.infoSAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.info
 
SAP PM Training Manual - www.sapdocs.info
SAP PM Training Manual - www.sapdocs.infoSAP PM Training Manual - www.sapdocs.info
SAP PM Training Manual - www.sapdocs.info
 
ABAP Basico para Consultores Funcionales
ABAP Basico para Consultores FuncionalesABAP Basico para Consultores Funcionales
ABAP Basico para Consultores Funcionales
 
SAP Configuration Guide for Functional Modules (Based on IDES)
SAP Configuration Guide for Functional Modules (Based on IDES)SAP Configuration Guide for Functional Modules (Based on IDES)
SAP Configuration Guide for Functional Modules (Based on IDES)
 
SAP FI-AP TCODES & MENU PATHS
SAP FI-AP TCODES & MENU PATHSSAP FI-AP TCODES & MENU PATHS
SAP FI-AP TCODES & MENU PATHS
 
SAP FI-AR TCODES & MENU PATHS
SAP FI-AR TCODES & MENU PATHSSAP FI-AR TCODES & MENU PATHS
SAP FI-AR TCODES & MENU PATHS
 
SAP CO Configuration Guide - Exclusive Document
SAP CO Configuration Guide - Exclusive DocumentSAP CO Configuration Guide - Exclusive Document
SAP CO Configuration Guide - Exclusive Document
 
SAP PP End User Document - www.sapdocs.info
SAP PP End User Document - www.sapdocs.infoSAP PP End User Document - www.sapdocs.info
SAP PP End User Document - www.sapdocs.info
 
SAP MM Configuration - Real Project Documentation
SAP MM Configuration - Real Project DocumentationSAP MM Configuration - Real Project Documentation
SAP MM Configuration - Real Project Documentation
 
SAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User GuideSAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User Guide
 
SAP FI AR: End User Guide for Beginners
SAP FI AR: End User Guide for BeginnersSAP FI AR: End User Guide for Beginners
SAP FI AR: End User Guide for Beginners
 
SAP FI AP: End User Guide for Beginners
SAP FI AP: End User Guide for BeginnersSAP FI AP: End User Guide for Beginners
SAP FI AP: End User Guide for Beginners
 
SAP FI Asset Accounting: End User Guide for Beginners
SAP FI Asset Accounting: End User Guide for BeginnersSAP FI Asset Accounting: End User Guide for Beginners
SAP FI Asset Accounting: End User Guide for Beginners
 
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.infoVariant Configurition in SAP: Beginners Guide | www.sapdocs.info
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
 
Exclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.infoExclusive SAP Basis Training Book | www.sapdocs.info
Exclusive SAP Basis Training Book | www.sapdocs.info
 
SAP Plant Maintenance Training Material | www.sapdocs.info
SAP Plant Maintenance Training Material | www.sapdocs.infoSAP Plant Maintenance Training Material | www.sapdocs.info
SAP Plant Maintenance Training Material | www.sapdocs.info
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 

ABAP Open SQL & Internal Table

  • 1. ABAP Chapter 3  Open SQL  Internal Table
  • 2. SAP System : 3 Tier Client/Server SAP GUI SAP GUI SAP GUI Presentation Server SAP Application Server DB Server
  • 3. SAP SYSTEM (3 Tier Architecture) SAP GUI SAP GUI Presentation Layer (Windows based) SAP Instance Application Layer Dispatcher M (Windows Server/UNIX) Request SAP Buffer Queue (Shared Mem) D D B V S E G Oracle Database Layer Informix (Windows Server/UNIX) DB2 Database Server MS SQL Server SAP DB/MaxDB
  • 4. SAP System : Dialog Processing SAP GUI Report zpsm1. Request Tables customers. List Select single * from Generate 1 10 customers where id = 1. Screen(List) Application Server Send Request Write: / customers-name. Store request to queue3 Dispatcher Send 2 Search for SAP Buffer List 9 free WP Request Check Program in 7 Program Queue Send request Program Buffer 5 Execute to WP 4 ABAP Table D D D … D stateme nt … 8 6 SQL Load&Gen Database Server Request Program
  • 5. Dialog Work Process Architecture Dialog Work Process Local Memory Memory Space TaskHandler ABAP Processor List buffer DYNPRO Processor DB Interface Result Set Memory Database Server
  • 6. Open SQL  SELECT ...  INSERT ...  UPDATE ...  DELETE ...
  • 7. DB Interface SAP Application Server Dialog WP Local Memory TaskHandler Memory Space ABAP Processor DYNPRO List Buffer DB Interface Result Set ~ 32 KB in length Database Server Data Data Data Data Data
  • 8. Example Tables in DB customers spfli id name city carrid connid cityfrom cityto distance 1 John New York LH 0400 LA NY 100 2 Peter Singapore LH 0402 BK NY 540 3 David London SQ 0110 SQ BK 250
  • 9. Example Tables in DB sflight carrid connid fldate price LH 0400 20010101 150 LH 0400 20010110 145 LH 0400 20010228 130 SQ 0110 20010226 75
  • 10. Select Overview Select <result> Which Columns? From <table> Which Table? Into <destination> Where to place? Where <condition> Which Lines?
  • 11. Select Statement  Select multiple records from database SELECT * FROM customers. … ENDSELECT.  Select single record from database SELECT SINGLE * FROM customers WHERE id = 1. …
  • 12. Select Multiple Records Tables spfli. Seclect * from spfli. write: / spfli-carrid, spfli-connid, spfli-cityto. endselect. if sy-subrc <> 0. write: / ‘No Data’. endif.
  • 13. Dialog WP Dialog WP Local Memory Memory Space TaskHandler ABAP Processor List buffer DYNPRO Processor DB Interface Result Set Database
  • 14. SELECT Statement Working Steps 1. Transform open SQL to DB SQL and return result set into result set work area SELECT * FROM spfli. SELECT * FROM spfli; … ENDSELECT. 2. Loop with data in result set and transfer each record to work area in memory space Table Structure in Memory SELECT * FROM spfli. Space … ENDSELECT.
  • 15. Select … Into Table Structure Tables spfli. Seclect * from spfli into spfli. write: / spfli-carrid, spfli-connid, spfli-cityfrom, spfli-cityto. endselect. if sy-subrc <> 0. write: / ‘No Data’. endif.
  • 16. Select … Into Work Area Data wa like spfli. Seclect * from spfli into wa. write: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto. endselect. if sy-subrc <> 0. write: / ‘No Data’. endif.
  • 17. Exercise I customers-name customers-city customers-id
  • 19. Loop Processing with Restriction Tables spfli. Select * from spfli where cityfrom = ‘FRANKFURT’. write: / spfli-carrid, spfli-cityto. endselect. If sy-subrc <> 0. write / ‘no data’. endif.
  • 20. Select With Range Tables sflight. Select * From sflight Where price between 100 and 1000. Write: / sflight-carrid, sflight-connid, sflight-price. Endselect.
  • 21. SELECT … With IN List Tables sflight. Select * From sflight Where price in ( 100, 1000 ). Write: / sflight-carrid, sflight-connid, sflight-price. Endselect.
  • 23. Select Single Record Tables spfli. Select single * from spfli where carrid = ‘LH’ and connid = ‘0400’. if sy-subrc = 0. write: / spfli-carrid, spfli-connid, spfli-cityfrom, spfli-cityto. else. write: / ‘Data not found’. endif.
  • 25. Select * : Example SELECT *
  • 26. Reading Selected Column Data: id like customers-id, name like customers-name, city like customers-city. Select id name city into (id, name, city) from customers. write: / id, name, city. endselect. if sy-subrc <> 0. write / ‘No Data found’. endif.
  • 27. Reading Selected Column Data: begin of wa, id like customers-id, name like customers-name, city like customers-city, end of wa. Select id name city into wa from customers. write: / wa-id, wa-name , wa-city. endselect. if sy-subrc <> 0. write / ‘No Data found’. endif.
  • 28. Select Column : Example I
  • 29. Reading Selected Column Tables customers. Select id name city into (customers-id, customers-name, customers-city) from customers. write: / customers-id, customers-name, customers-city. endselect. if sy-subrc <> 0. write / ‘No Data found’. endif.
  • 30. Select Column : Example II
  • 31. Corresponding Fields of... Tables: customers. Select id name city into corresponding fields of customers from customers. Write: / customers-id, customers-name, customers-city. Endselect.
  • 32. Select Statement : Special Topics
  • 33. DB Count : SY-DBCNT Tables customers. Select * from customers. write: / sy-dbcnt, customers-id, customers-name. endselect. if sy-subrc <> 0. write: / ‘No Data found’. else. write: / sy-dbcnt, ‘Record found’. endif.
  • 34. SELECT … ORDER BY ... Tables: spfli. Select * from spfli Order by cityfrom. Write: / spfli-carrid, spfli-connid, spfli-cityfrom. Endselect.
  • 35. SELECT … With Template Tables customers. Select * From customers Where name Like ‘_r%’. Write: / customers-id,customers-name. Endselect.
  • 36. Aggregate Functions Data: maxdat like sflight-distance, mindat like sflight-distance, counter type I. Select COUNT( * ) MIN( distance ) MAX( distance ) into (counter ,mindat, maxdat) from spfli. Write: / ‘Count :’ , counter, / ‘Min :’ , mindat, / ‘Max :’ , maxdat. Aggregate Functions : COUNT,MIN,MAX,AVG and SUM
  • 37. SELECT … GROUP BY ... Data: carrid like sflight-carrid, sflight mindat Type P Decimals 2, maxdat Type P Decimals 2. carrid connid fldate Price Select carrid Min( price )LHMax( price ) 0400 20010101 150 Into (carrid, mindat, maxdat) LH 0400 20010110 145 From sflight Group by carrid. LH 0400 20010228 130 Write: / carrid, mindat,SQ 0110 20010226 maxdat. 75 Endselect. ยากทราบว่า ในแต่ละสายการบิน มีราคาตั๋วตำำาสุดและสูงสุดเท่าไร
  • 38. Sub Query tables customers. ลูกค้าคนใดทีอยู่เมือง ่ เดียวกับลูกค้ารหัส ID 1 select * from customers where id <> 1 and city = ( select city from customers where id = 1 ). write: / customers-id, customers-name. endselect.
  • 39. Exercise I ห้ามใช้ SELECT * customers-name customers-city customers-id
  • 40. Exercise II ห้ามใช้ SELECT * usr02-bname usr02-trdat usr02-ltime
  • 41. ABAP : Inner Join
  • 42. Tables Join sflight spfli carrid connid fldate price carrid connid cityfrom cityto distance LH 0400 20010101 150 LH 0400 NY BK 100 LH 0400 20010110 145 LH 0402 BK NY 540 LH 0400 20010228 130 SQ 0110 SQ BK 250 SQ 0110 20010226 75
  • 43. Tables Join Question: Select carrid, connid and cityto from spfli and fldate,price from sflight where carrid = ‘LH’ spfli-carrid spfli-connid sflight-fldate spfli-cityto sflight-price เงืำอนไข : ให้แสดงข้อมูลเฉพาะสายการบิน ‘LH’ เท่านัน ้
  • 44. Standard SQL Select spfli.carrid, spfli.connid, sflight.fldate, sflight.price From spfli, sflight Where spfli.carrid = sflight.carrid and spfli.connid = sflight.connid and spfli.carrid = ‘LH’;
  • 45. Tables Join Methods  Nested select statement  Internal table  View  Inner join of Select statement
  • 46. Nested Select Statement Tables: spfli,sflight. Select * from spfli where carrid = ‘LH’. Select * from sflight where carrid = spfli-carrid and connid = spfli-connid. Write: / spfli-carrid, spfli-connid, sflight-fldate, sflight-price. Endselect. Endselect.
  • 47. Open SQL – Inner Join Tables: spfli,sflight. Select spfli~carrid spfli~connid sflight~fldate spfli~cityto sflight~price into (spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price) from spfli inner join sflight on spfli~carrid = sflight~carrid and spfli~connid = sflight~connid where spfli~carrid = ‘LH’. Write: / spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price. Endselect.
  • 48. Open SQL – Inner Join Tables: A,B. A-a B-b B-c Select A~a B~b B~c into (A-a,B-b,B-c) from A inner join B on A~b = B~b. Table : B Write: / A-a,B-b,B-c. b c Endselect. Table : A b1 c1 a b b2 c2 a1 b1 b3 c3 a2 b2
  • 49. Open SQL – Inner Join Table : A Table : B Database a b b c Server a1 b1 b1 c1 a2 b2 b2 c2 b3 c3 Application Server Single Result Table(Result set) 1 2 Select … A~a B~b B~c inner join.. a1 b1 c1 Endselect. a2 b2 c2
  • 50. Open SQL – Alias Table Name Tables: spfli,sflight. Select a~carrid a~connid b~fldate a~cityto b~price into (spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price) from spfli as a inner join sflight as b on a~carrid = b~carrid and a~connid = b~connid where a~carrid = ‘LH’. Write: / spfli-carrid, spfli-connid, sflight-fldate, spfli-cityto, sflight-price Endselect.
  • 51. Inner Join/Outer Join Example ZCUSTOMERS ZSALEREPS id name city tel sale_id name 1 John New York 111111 01 Somchai 2 Peter London 222222 02 Pipop 3 David Singapore 432555 4 Micheal Bangkok 234111 ZSALES cust_id prod_id sale_date qty sale_id ZPRODUCTS 1 A1 20020318 10 01 p_id prod_name on_hand 1 A2 20020318 50 01 A1 Pen 100 3 X1 20020321 90 02 A2 Pencil 125 B1 Ruler 80 X1 Tape 120 Y1 CD 99
  • 52. Open SQL – Inner Join REPORT ZINNERJOIN01 . TABLES: ZCUSTOMERS,ZSALES. SELECT A~NAME B~PROD_ID INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID) FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A ON B~CUST_ID = A~ID. WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID. ENDSELECT.
  • 53. Open SQL – Inner Join > 2 Tables Table : C Tables: A,B,C. A-a B-c C-y Select A~a B~c C~y x y into (A-a,B-c,C-y) … ... from A inner join B on A~b = B~b Table : B inner join C b c on C~x = B~c. Write: / A-a,B-c,C-y. … ... Endselect. … ... Table : A … … a b … …
  • 54. Open SQL – Inner Join > 2 Tables REPORT ZINNERJOIN02 . TABLES: ZCUSTOMERS,ZPRODUCTS,ZSALES. SELECT A~NAME C~PROD_NAME B~QTY INTO (ZCUSTOMERS-NAME, ZPRODUCTS-PROD_NAME, ZSALES-QT FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A ON B~CUST_ID = A~ID INNER JOIN ZPRODUCTS AS C ON C~P_ID = B~PROD_ID. WRITE: / ZCUSTOMERS-NAME,ZPRODUCTS-PROD_NAME,ZSALES- QTY. ENDSELECT.
  • 55. Exercise  List customers who buy product from company as following fields:  zcustomers-id  zcustomers-name  zsales-sale_date  zproducts-prod_name  zsales-qty  zsalereps-name
  • 56. Exercise : User Master USR02-BNAME USR02-TRDAT ADCP-TEL_NUMBER Tables Relationship USR02 BNAME USR21 PERSNUMBER ADDRNUMBER ADCP
  • 57. ABAP : Outer Join
  • 58. Open SQL – Outer Join REPORT ZOUTERJOIN . TABLES: ZCUSTOMERS,ZSALES. SELECT A~NAME B~PROD_ID INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID) FROM ZCUSTOMERS AS A LEFT OUTER JOIN ZSALES AS B ON A~ID = B~CUST_ID. WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID. ENDSELECT. Single Result Table A~NAME B~PROD_ID John A1 John A2 Peter David X1 Micheal
  • 59. Exercise  List customers name who do not buy any product from company
  • 60. Sub Query REPORT ZSUBQUERY . tables: zcustomers. ลูกค้าชื่ออะไรที่ไม่ได้ซื้อ สินค้าจากเรา มีใครบ้าง select * from zcustomers as a where not exists ( select * from zsales as b where b~cust_id = a~id ). write: / zcustomers-name. endselect.
  • 62. Data Objects in ABAP Memory Space Variable Structure Table Structure Internal Table Constants <Field-symbols>
  • 63. INTERNAL TABLE Flight (Structure) Carrid Connid Date Price Internal Table Flight (Internal Table) Header Line Carrid Connid Date Price
  • 64. Structure Data: Begin of flight, carrid like sflight-carrid, connid like sflight-connid, date like sflight-fldate, price like sflight-price. Data: End of flight. flight-carrid = ‘LH’. Write: / flight-carrid.
  • 65. INTERNAL TABLE Data: begin of tab occurs 10, carrid like sflight-carrid, connid like sflight-connid, fldate like sflight-fldate, price like sflight-price. Data end of tab.
  • 66. USING ABAP DICTIONARY STRUCTURE Data: begin of tab occurs 0. Include structure sflight. Data end of tab.
  • 67. INTERNAL TABLE USING LIKE Data tab LIKE sflight OCCURS 0 WITH HEADER LINE.
  • 68. FILLING INTERNAL TABLE (APPEND) Tables sflight. Data flight like sflight occurs 0 with header line. Select * from sflight. Move sflight to flight. Append flight. Endselect.
  • 69. Standard Key of Internal Table tab Data: begin of tab occurs 0, f1 f2 f3 f4 f1 type C, f2 type I, f3 type N, f4 type P, end of tab.
  • 70. Reading Data From Internal Table Data tab like sflight occurs 0 with header line. Select * from sflight into table tab. If sy-subrc = 0. Loop at tab. Write: / tab-carrid, tab-price. Endloop. Else. Write: / ‘No Data’. Endif.
  • 71. Access Database Without Internal Table
  • 72. Access Database Using Internal Table
  • 73. Reading Data From Internal Table Data: begin of tab occurs 0, id like customers-id, name like customers-name, end of tab. Select id name from customers into table tab. If sy-subrc = 0. Loop at tab. Write: / tab-id, tab-name. Endloop. else. Write: / ‘No Data’. Endif.
  • 74. Exercise I : Change Using Internal Table
  • 75. SORTING INTERNAL TABLE (SORT) Sort flight. Sort flight by price fldate. Sort flight by price ascending fldate descending.
  • 76. SORTING INTERNAL TABLE Data tab like spfli occurs 0 with header line. Select * from spfli into table tab. Sort tab by cityfrom. … Loop at tab. write: / tab-carrid, tab-connid,tab-cityfrom. Endloop.
  • 77. PROCESSING INTERNAL TABLE ... Loop at flight. Write: / flight-carrid, flight-connid. Endloop. Loop at flight where carrid = ‘LH’. Write: / flight-carrid, flight-connid. Endloop. Loop at flight from 1 to 10. Write: / sy-tabix ,flight-carrid, flight-connid. Endloop.
  • 78. Internal Table Template Condition ... loop at tab where name cp ‘+r*’. ...
  • 79. Reading Single Record ... Sort flight by carrid connid fldate. Read table flight with key carrid = ‘LH’ connid = ‘0400’ fldate = ‘19990201’ Binary Search. if sy-subrc = 0. write : / flight-carrid,flight-connid, flight-fldate, flight-price. endif.
  • 80. Reading Single Record using Index ... Read table flight index 3. If sy-subrc = 0. write: / flight-carrid, flight-connid. Endif.
  • 81. CHANGING INTERNAL TABLE ... Delete flight index 5. Delete flight where carrid = ‘LH’. flight-carrid = ‘XX’. flight-price = 100. … Insert flight index 1.
  • 82. DELETING INTERNAL TABLE DATA flight LIKE sflight occurs 0 with header line. Clear flight. Refresh flight. Free flight.
  • 83. Total Record of Internal Table Data: line_count type i. Data tab like sflight occurs 0 with header line. Select * from sflight into table tab. Describe table tab lines line_count. Write: / line_count.
  • 85. Internal Table Processing Data tab like spfli occurs 0 with Header line. … Select * from spfli appending table tab where carrid = ‘LH’.
  • 86. SELECT … INNER JOIN REPORT ZINNERJOIN01 . TABLES: ZCUSTOMERS,ZSALES. SELECT A~NAME B~PROD_ID INTO (ZCUSTOMERS-NAME,ZSALES-PROD_ID) FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A ON B~CUST_ID = A~ID. WRITE: / ZCUSTOMERS-NAME,ZSALES-PROD_ID. ENDSELECT.
  • 87. Inner Join into Internal Table REPORT ZJOIN01 . DATA: begin of tab occurs 0, name like zcustomers-name, prod_id like zsales-prod_id, end of tab. SELECT A~NAME B~PROD_ID INTO TABLE tab FROM ZSALES AS B INNER JOIN ZCUSTOMERS AS A ON B~CUST_ID = A~ID. … LOOP AT tab. WRITE: / TAB-NAME,TAB-PROD_ID. ENDLOOP.
  • 88. Internal Table Without Header Line DATA tab LIKE customers OCCURS 0. DATA wa LIKE customers. … LOOP AT tab INTO wa. WRITE: / wa-id, wa-name. ENDLOOP.
  • 89. Internal Table Declaration DATA tab TYPE TABLE OF customers. DATA wa LIKE LINE OF customers. …
  • 91. Database Table Processing  INSERT  UPDATE Database  MODIFY  DELETE
  • 92. Insert (Table) Tables customers. customers-id = ‘999’. customers-name = ‘Test’. Insert customers. if sy-subrc <> 0. write: / ‘Data Already Exists’. endif.
  • 93. Update Statement Tables customers. Select single * from customers where id = 1. If sy-subrc = 0. customers-name = ‘John’. update customers. Endif. Update customers set name = ‘John’ where id = 1.
  • 94. Update Statement Data wa like customers. wa-id = ‘1’. wa-name = ‘Test No 1’. wa-city = ‘Bangkok’. update customers from wa. If sy-subrc <> 0. write: / ‘Data not found’. Endif.
  • 95. Modify Statement Tables customers. customers-id = ‘1’. customers-name = ‘Test No 1’. Modify customers.
  • 96. Deleting Database Table Entries Tables customers. customers-id = ‘1’. Delete customers. Delete customers From Table delcustomers. Delete From customers Where city =
  • 98. Exercise II 1. ห้ามใช้ SELECT * 2. ใช้ Internal Table usr02-bname usr02-trdat usr02-ltime
  • 100. Tables Relationship for User Master USR02-BNAME USR02-TRDAT ADCP-TEL_NUMBER Tables Relationship USR02 BNAME USR21 PERSNUMBER ADDRNUMBER ADCP
  • 101. Exercise III : User Master usr02-trdat usr02-bname adcp-tel_number ใช้ Internal Table