The syntax for an inner join of more than two tables is the same as for two tables. You simply chain multiple inner join clauses together in the FROM clause.
For example:
SELECT A~a, B~c, C~y
FROM A
INNER JOIN B ON A~b = B~b
INNER JOIN C ON B~x = C~x
This performs an inner join of tables A, B and C.
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
The focus of this blog is to present an overview of the new programming techniques in ABAP after the introduction of HANA database. The focus will be towards providing a guideline on why and how an ABAP developer should start transitioning its code to use the new coding technique’s.
As an ABAP Developer, we often have to develop ABAP reports that displays some data from the database. SAP provides a set of ALV (ABAP List Viewer) function modules which can be put into use to embellish the output of a report. Object oriented ALV is more robust and is more advanced when compared to Traditional ALV.
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERSIICT Chromepet
Most Important SAP ABAP Interview Questions along with answers are Shared. These questions are useful to clear any kinds of interview. Especially for freshers its mostly useful. Dont forget to read these question and answers in SAP ABAP Module.
For training requirement please visit:
https://iicttechnologies.com/
(Or)
http://www.traininginchennai.co.in/
(Or)
https://traininginchrompet.com/
Free Download - http://sapdocs.info/sap/abap/abap-training-course-for-beginners/
A must document for those don't have any experience about ABAP, never seen code..
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
The focus of this blog is to present an overview of the new programming techniques in ABAP after the introduction of HANA database. The focus will be towards providing a guideline on why and how an ABAP developer should start transitioning its code to use the new coding technique’s.
As an ABAP Developer, we often have to develop ABAP reports that displays some data from the database. SAP provides a set of ALV (ABAP List Viewer) function modules which can be put into use to embellish the output of a report. Object oriented ALV is more robust and is more advanced when compared to Traditional ALV.
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERSIICT Chromepet
Most Important SAP ABAP Interview Questions along with answers are Shared. These questions are useful to clear any kinds of interview. Especially for freshers its mostly useful. Dont forget to read these question and answers in SAP ABAP Module.
For training requirement please visit:
https://iicttechnologies.com/
(Or)
http://www.traininginchennai.co.in/
(Or)
https://traininginchrompet.com/
Free Download - http://sapdocs.info/sap/abap/abap-training-course-for-beginners/
A must document for those don't have any experience about ABAP, never seen code..
HR ABAP Technical Overview | http://sapdocs.info/sapdocs. info
You can get this HR ABAP Material from http://sapdocs.info/sap/hr-abap/download-hr-abap-ppt-tutorial-material-technical-overview/
get more SAP Materials from http://sapdocs.info
SAP Accounts Reveivable Functions | http://sapdocs.infosapdocs. info
Get this and other SAP Account Reveivable Materials from http://sapdocs.info/sap/fico/sap-accounts-receivable-ppt-training-materials-documents-for-beginners/
for more SAP Documents please visit http://sapdocs.info
Processing massive amount of data with Map Reduce using Apache Hadoop - Indi...IndicThreads
Session presented at the 2nd IndicThreads.com Conference on Cloud Computing held in Pune, India on 3-4 June 2011.
http://CloudComputing.IndicThreads.com
Abstract: The processing of massive amount of data gives great insights into analysis for business. Many primary algorithms run over the data and gives information which can be used for business benefits and scientific research. Extraction and processing of large amount of data has become a primary concern in terms of time, processing power and cost. Map Reduce algorithm promises to address the above mentioned concerns. It makes computing of large sets of data considerably easy and flexible. The algorithm offers high scalability across many computing nodes. This session will introduce Map Reduce algorithm, followed by few variations of the same and also hands on example in Map Reduce using Apache Hadoop.
Speaker: Allahbaksh Asadullah is a Product Technology Lead from Infosys Labs, Bangalore. He has over 5 years of experience in software industry in various technologies. He has extensively worked on GWT, Eclipse Plugin development, Lucene, Solr, No SQL databases etc. He speaks at the developer events like ACM Compute, Indic Threads and Dev Camps.
Most developers get started building applications without giving a lot of thought to their database. Either they get told that the company does everything with Database X, or they Google around and end up using MySQL or MS Access. Neither of these is the wrong choice, but it's often not the best choice. I was one of those guys, first with Access and then MySQL. As I've moved through my career, I've used a lot of database systems, both relational and non-relational ("NoSQL"), and my go-to choice has become PostgreSQL.
I'm not going to spend much time on the "SQL vs NoSQL" debate. It's sort of a straw man argument, because they're solving a variety of fundamentally different problems. It's also much better in discussion format, for that same reason: so much variety.
Like everything else in technology, there is no one-size-fits-all solution, but I want to show why I think it's a great first choice for most things, and the reasons why a lot of other options fall short. Your choice of database can shape a lot of how you build your application, how well it performs, and how it can grow over time. It can be a productivity boon, or force you to constantly working around it's limitations. As application developers, we should be spending our time solving business problems, not on low-level technology plumbing.
This session is intended for people who have built a few database-backed applications, and are curious about what options are out there and how to go about choosing between them.
Intermediate languages are used in compiler construction to simplify retargeting compilers to multiple machine architectures. In the implementation of \emph{domain-specific languages} (DSLs), compilers typically generate high-level source code, rather than low-level machine instructions. DSL compilers target a software platform, i.e. a programming language with a set of libraries, deployable on one or more operating systems. DSLs enable targeting \emph{multiple} software platforms if its abstractions are platform independent. While transformations from DSL to each targeted platform are often conceptually very similar, there is little reuse between transformations due to syntactic and API differences of the target platforms, making supporting multiple platforms expensive. In this paper, we discuss the design and implementation of PIL, a Platform Independent Language, an intermediate language providing a layer of abstraction between DSL and target platform code, abstracting from syntactic and API differences between platforms, thereby removing the need for platform-specific transformations. We discuss the use of PIL in an implemementation of WebDSL, a DSL for building web applications.
These slides were presented by Hossein Falaki of Databricks to the Atlanta Apache Spark User Group on Thursday, March 9, 2017: https://www.meetup.com/Atlanta-Apache-Spark-User-Group/events/238120227/
From time to time, there is a need to modify information systems due to changes in legislation (like SOX), standards, currency change (like the euro), and more. These types of changes have a substantial impact on many components of an information system and therefore contain a high risk factor.
In this guide (screenshots + descriptions), MRP Steps with exemplary data is covered in SAP.
Visit http://sapdocs.info/sap/production-planning/sap-pp-mrp-user-training-document-pdf/ for free download
SAP ECC 6.0 PM Configuration Manual - www.sapdocs.infosapdocs. info
Visit http://sapdocs.info/sap/plant-maintenance/sap-ecc-6-0-pm-configuration-manual-step-by-step/ to download for free.
Step by step SAP PM guide with screenshots & IMG menu paths..
SAP PM Training Manual - www.sapdocs.infosapdocs. info
SAP PM - Step by step training manual for beginners
Please visit http://sapdocs.info/sap/plant-maintenance/sap-pm-training-manual/ to download file for free
ABAP Basico para Consultores Funcionalessapdocs. info
http://docserve.blogspot.com
Introducción a ABAP Workbench
Introducción al Diccionario ABAP
Introducción a los Eventos ABAP
Elementos Básicos del Lenguaje ABAP
Acceso a Base de Datos
Subrutinas en ABAP
Procesamiento de Lista Clásica
Sentencias Útiles ABAP
Creación y llamadas a Grupo de Funciones y a Módulos de Funciones
Ampliaciones sobre SAP Standard
SAP Configuration Guide for Functional Modules (Based on IDES)sapdocs. info
Based on IDES, this configuration guide provides steps for functional modules of SAP like FI, MM and SD.
http://sapdocs.info/sap/sd-related-topics/sap-configuration-guide-for-functional-modules-based-on-ides/
SAP MM Configuration - Real Project Documentationsapdocs. info
Step by step configuration procedures for SAP MM module.. Screenshots, menu paths and descriptions provided
http://sapdocs.info/sap/materials-management-2/sap-mm-configuration-a-real-life-project-documentation/
SAP Plant Maintenance Training Material | www.sapdocs.infosapdocs. info
Download free SAP Plant Maintenance end-user training material from http://sapdocs.info/sap/plant-maintenance/download-free-sap-ecc-6-pm-training-material-pdf/
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
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
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.
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.
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.
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.
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
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’;
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
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.
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.
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.
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.
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.
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.