SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
FOREIGN KEY
A PRIMARY KEY IS A FIELD OR COMBINATION OF FIELD THAT UNIQUELY IDENTIFY A
RECORD IN A TABLE.
• FOREIGN KEYS ARE USED TO ESTABLISH THE RELATIONSHIP BETWEEN THE DIFFERENT
TABLES PRESENT IN THE ABAP DICTIONARY.
• WE CAN CREATE VALUE CHECKS FOR INPUT FIELDS USING THE FOREIGN KEYS. VALUE
CHECKS ARE REQUIRED TO VALIDATE THE VALUES OF SOME FIELDS IN A TABLE WITH
THE VALUES OF OTHER FIELDS OF DIFFERENT TABLES.
• THE TABLE THAT CONTAINS THE FOREIGN KEY IS CALLED A FOREIGN KEY TABLE AND
ANOTHER TABLE THAT CONTAINS VALID FIELDS, KNOWN AS THE VALUE TABLE.
WHY DO WE NEED TO ESTABLISH
RELATIONSHIP BETWEEN TABLES ?
1.DATA REDUNDANCIES WILL BE REMOVED.
2.CRASHING DATABASE VERY OFTEN WILL BE PREVENTED IN OTHER WORDS,
EFFICIENCY CAN BE IMPROVED BY SPLITTING AND ESTABLISHING
RELATIONSHIP AMONG TABLES.
3.SEARCHING AND FILTERING DATA WILL BE IMPROVED USING QUERY OF
RELATED TABLE INSTEAD OF USING A VERY LARGE TABLE.
4.DATA MANAGEMENT UPDATE, DELETE ETC. WILL BE IMPROVED. RELATIONSHIP
PROVIDES FLEXIBILITY ABOUT SUCH MANAGEMENT.
COMPONENT OF FOREIGN KEY
• BELOW ARE SOME OTHER CONCEPTS RELATED TO THE FOREIGN KEY:
• COMPOUND FOREIGN KEYS
• GENERIC AND CONSTANT FOREIGN KEYS
• THE CARDINALITY OF FOREIGN KEY
COMPOUND FOREIGN KEYS:
• A FOREIGN KEY CONSISTING OF TWO OR MORE FIELDS IS CALLED
A COMPOUND FOREIGN KEY.
• TO APPLY CHECKS FOR COMPOUND FOREIGN KEYS, THE SYSTEM COMPARES
TWO FIELDS IN THE FOREIGN KEY TABLE AGAINST THE TWO FIELDS IN THE
CHECK TABLE.
GENERIC AND CONSTANT
FOREIGN KEYS
• AS WE KNOW, TO CREATE A FOREIGN KEY, ALL THE PRIMARY KEYS OF THE
CHECK TABLE MUST BE INCLUDED IN A FOREIGN KEY RELATIONSHIP.
• BUT IN SOME CASES, WE JUST WANT TO PERFORM VALIDATION AGAINST
SELECTED FIELDS ONLY, AND OTHER FIELDS CAN BE EXCLUDED, SO FOR SUCH
CASES, WE CAN USE THE GENERIC FOREIGN KEYS.
• WE CAN ALSO ASSIGN A CONSTANT VALUE TO THE KEY FIELD OF THE CHECK
TABLE, WHICH WILL ALLOW US TO CHECK THE VALUES AGAINST A CONSTANT
VALUE OF THE CHECK TABLE.
THE CARDINALITY OF FOREIGN
KEY
• THE CARDINALITY OF THE FOREIGN KEY IS USED TO SPECIFY THE ALLOWED
ROWS IN THE FOREIGN KEY TABLE FOR THE CORRESPONDING VALUE IN THE
CHECK TABLE.
• IT IS DEFINED WHILE CREATING THE FOREIGN KEY RELATIONSHIP.
• IT CAN BE EXPRESSED AS X: Y RELATIONSHIP, WHERE X IS USED FOR THE
CHECK TABLE, AND Y IS FOR THE FOREIGN KEY TABLE.
• EXAMPLE: IF THE CARDINALITY IS GIVEN AS 1:N, IT MEANS THERE IS EXACTLY
ONE RECORD THAT EXISTS FOR EACH RECORD OF THE FOREIGN KEY TABLE.
ABAP TEXT TABLES
• A TEXT TABLE IN SAP ABAP IS A DATABASE TABLE USED TO STORE THE
DESCRIPTIONS OF A FIELD IN DIFFERENT LANGUAGES.
• FOR EXAMPLE, IN ENGLISH WE STORE A DESCRIPTION AS “COMPUTER” AND IF
YOU WANT TO STORE THIS IN GERMAN LANGUAGE ALSO WE CAN ALSO DO THE
SAME.
CURRENCY AND QUANTITY FIELD
• A CURRENCY FIELD IS A COMPONENT OF A STRUCTURE, DATABASE TABLE, OR VIEW
DEFINED IN ABAP DICTIONARY OF TYPE CURR AND USED TO RECORD AN AMOUNT
IN A SPECIFIC CURRENCY. THE AMOUNT IS SPECIFIED AS A WHOLE NUMBER IN THE
SMALLEST UNIT OF THE CURRENCY.
• A CURRENCY FIELD MUST BE ASSOCIATED WITH A CURRENCY KEY OF A
STRUCTURE, DATABASE TABLE, OR VIEW THAT SPECIFIES THE CURRENCY AND THE
NUMBER OF DECIMAL PLACES. A CURRENCY KEY IS A COMPONENT OF A
STRUCTURE, DATABASE TABLE, OR VIEW DEFINED IN ABAP DICTIONARY, HAS THE
TYPE CUKY, AND CAN CONTAIN A CURRENCY ID FROM THE DATABASE
TABLE TCURC.
FOREIGN KEY AND TEXT TABLE.pptx
FOREIGN KEY AND TEXT TABLE.pptx
FOREIGN KEY AND TEXT TABLE.pptx
FOREIGN KEY AND TEXT TABLE.pptx

Weitere ähnliche Inhalte

Kürzlich hochgeladen

[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
Key Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapKey Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapIshara Amarasekera
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flinkconfluent
 
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBU
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBUETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBU
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBUsamruddhijedgule2004
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dbaRemote DBA Services
 
OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata
 
full course of software engineering mid term.pdf
full course of software engineering mid term.pdffull course of software engineering mid term.pdf
full course of software engineering mid term.pdfAbdul salam
 
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...Bert Jan Schrijver
 
The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024Artur Skowroński
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Business Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisBusiness Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisDEEPRAJ PATHAK
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 

Kürzlich hochgeladen (20)

[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
Key Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapKey Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery Roadmap
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBU
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBUETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBU
ETE PPT.pdf LMMKLMKLMLKMLLMJKBHJBHBNUIHBU
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dba
 
OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024
 
full course of software engineering mid term.pdf
full course of software engineering mid term.pdffull course of software engineering mid term.pdf
full course of software engineering mid term.pdf
 
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
 
The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Business Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisBusiness Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business Analysis
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 

FOREIGN KEY AND TEXT TABLE.pptx

  • 1.
  • 2. FOREIGN KEY A PRIMARY KEY IS A FIELD OR COMBINATION OF FIELD THAT UNIQUELY IDENTIFY A RECORD IN A TABLE. • FOREIGN KEYS ARE USED TO ESTABLISH THE RELATIONSHIP BETWEEN THE DIFFERENT TABLES PRESENT IN THE ABAP DICTIONARY. • WE CAN CREATE VALUE CHECKS FOR INPUT FIELDS USING THE FOREIGN KEYS. VALUE CHECKS ARE REQUIRED TO VALIDATE THE VALUES OF SOME FIELDS IN A TABLE WITH THE VALUES OF OTHER FIELDS OF DIFFERENT TABLES. • THE TABLE THAT CONTAINS THE FOREIGN KEY IS CALLED A FOREIGN KEY TABLE AND ANOTHER TABLE THAT CONTAINS VALID FIELDS, KNOWN AS THE VALUE TABLE.
  • 3.
  • 4. WHY DO WE NEED TO ESTABLISH RELATIONSHIP BETWEEN TABLES ? 1.DATA REDUNDANCIES WILL BE REMOVED. 2.CRASHING DATABASE VERY OFTEN WILL BE PREVENTED IN OTHER WORDS, EFFICIENCY CAN BE IMPROVED BY SPLITTING AND ESTABLISHING RELATIONSHIP AMONG TABLES. 3.SEARCHING AND FILTERING DATA WILL BE IMPROVED USING QUERY OF RELATED TABLE INSTEAD OF USING A VERY LARGE TABLE. 4.DATA MANAGEMENT UPDATE, DELETE ETC. WILL BE IMPROVED. RELATIONSHIP PROVIDES FLEXIBILITY ABOUT SUCH MANAGEMENT.
  • 5. COMPONENT OF FOREIGN KEY • BELOW ARE SOME OTHER CONCEPTS RELATED TO THE FOREIGN KEY: • COMPOUND FOREIGN KEYS • GENERIC AND CONSTANT FOREIGN KEYS • THE CARDINALITY OF FOREIGN KEY
  • 6. COMPOUND FOREIGN KEYS: • A FOREIGN KEY CONSISTING OF TWO OR MORE FIELDS IS CALLED A COMPOUND FOREIGN KEY. • TO APPLY CHECKS FOR COMPOUND FOREIGN KEYS, THE SYSTEM COMPARES TWO FIELDS IN THE FOREIGN KEY TABLE AGAINST THE TWO FIELDS IN THE CHECK TABLE.
  • 7. GENERIC AND CONSTANT FOREIGN KEYS • AS WE KNOW, TO CREATE A FOREIGN KEY, ALL THE PRIMARY KEYS OF THE CHECK TABLE MUST BE INCLUDED IN A FOREIGN KEY RELATIONSHIP. • BUT IN SOME CASES, WE JUST WANT TO PERFORM VALIDATION AGAINST SELECTED FIELDS ONLY, AND OTHER FIELDS CAN BE EXCLUDED, SO FOR SUCH CASES, WE CAN USE THE GENERIC FOREIGN KEYS. • WE CAN ALSO ASSIGN A CONSTANT VALUE TO THE KEY FIELD OF THE CHECK TABLE, WHICH WILL ALLOW US TO CHECK THE VALUES AGAINST A CONSTANT VALUE OF THE CHECK TABLE.
  • 8. THE CARDINALITY OF FOREIGN KEY • THE CARDINALITY OF THE FOREIGN KEY IS USED TO SPECIFY THE ALLOWED ROWS IN THE FOREIGN KEY TABLE FOR THE CORRESPONDING VALUE IN THE CHECK TABLE. • IT IS DEFINED WHILE CREATING THE FOREIGN KEY RELATIONSHIP. • IT CAN BE EXPRESSED AS X: Y RELATIONSHIP, WHERE X IS USED FOR THE CHECK TABLE, AND Y IS FOR THE FOREIGN KEY TABLE. • EXAMPLE: IF THE CARDINALITY IS GIVEN AS 1:N, IT MEANS THERE IS EXACTLY ONE RECORD THAT EXISTS FOR EACH RECORD OF THE FOREIGN KEY TABLE.
  • 9.
  • 10. ABAP TEXT TABLES • A TEXT TABLE IN SAP ABAP IS A DATABASE TABLE USED TO STORE THE DESCRIPTIONS OF A FIELD IN DIFFERENT LANGUAGES. • FOR EXAMPLE, IN ENGLISH WE STORE A DESCRIPTION AS “COMPUTER” AND IF YOU WANT TO STORE THIS IN GERMAN LANGUAGE ALSO WE CAN ALSO DO THE SAME.
  • 11.
  • 12.
  • 13. CURRENCY AND QUANTITY FIELD • A CURRENCY FIELD IS A COMPONENT OF A STRUCTURE, DATABASE TABLE, OR VIEW DEFINED IN ABAP DICTIONARY OF TYPE CURR AND USED TO RECORD AN AMOUNT IN A SPECIFIC CURRENCY. THE AMOUNT IS SPECIFIED AS A WHOLE NUMBER IN THE SMALLEST UNIT OF THE CURRENCY. • A CURRENCY FIELD MUST BE ASSOCIATED WITH A CURRENCY KEY OF A STRUCTURE, DATABASE TABLE, OR VIEW THAT SPECIFIES THE CURRENCY AND THE NUMBER OF DECIMAL PLACES. A CURRENCY KEY IS A COMPONENT OF A STRUCTURE, DATABASE TABLE, OR VIEW DEFINED IN ABAP DICTIONARY, HAS THE TYPE CUKY, AND CAN CONTAIN A CURRENCY ID FROM THE DATABASE TABLE TCURC.