SlideShare a Scribd company logo
1 of 22
Download to read offline
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page1
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
ABAP DICTIONARY
 Abap Dictionary is a centralrepository wherewedefineand maintain theobjects which are
related to database.
 Define means creation ofobjects
 Maintenancemeans changing anddeleting theobjects.
Theobjects are,
Database table:
It is an object which stores datain theformof rows and columns.
Each rowis called as record, and each column is called as field.
So, to definea tablewe haveto definethefields first.
So, to definea field, we haveto specify the belowthings:
FIELD = DATA ELEMENT + DOMAIN
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page2
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Domain:
It is an object which specifies technicalinformation suchas datatype and length for a field.
It also specifies sign, lower case, conversion routine, fixed values, and value table.
Data element:
It is an object which specifies semantic information suchas field description, field labels (short,
medium, long and heading)forafield.
Advantages of data element anddomain:
• Reusability: Thesamedataelement and domain can bereused by multipletablefields,
instead ofcreating again and again.
• Thesearealso used in creating foreign key relationship,search help,ale-idoc’s.
Key field: A field which is used to identify therecord uniquely is called a key field. In a tablethere
should beat least onekey field. We can create ____number ofkey fields.
Steps to create domain:
1. Go to SE11
2. Select Domain
3. Give a name, ex – ‘zcno’
4. Click on Create
5. Provideshort description
6. Providedatatypeas CHAR and length as 10.
7. Press enter
8. Save, check and activate
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page3
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Steps to create data element:
1. Go to SE11
2. Select datatype
3. Give a name, ex – ‘zcno’
4. Create -> select dataelement
5. Provideshort description
6. Providedomain nameas ‘zcno’
7. Press enter
8. Click on field label tab, specify short, medium, long and headinglabels
9. Save, check and activate
Steps to create a table:
1. Go to SE11
2. Providethetablename ‘zcust_table’
3. Click on create
4. Providedescription
5. Specify delivery class as ‘A’
6. Specify display maintenanceallowed
7. Click on fields tab
8. Providethefield name, dataelement nameas below
9.
10. Click on save
11. Click on technicalsettings button
12. Providethedetails as dataclass -> APPL0, sizecategory ->0
13. Click on saveand click on back
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page4
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
14. Saveand activatethetable
Creating records into the table:
• Go to SE11
• Give thetablename and click on change
• Click on utilities -> table contents ->create
• Providethecno, cname, city
• Repeat thesameprocedureand createtherecords
Displaying the table contents:
• Click on utilities -> table contents ->display
• Click on executebutton
• Therecords will bedisplayed
Note:Sometimes we may get unpredictableerrors in atable, dueto adding ordeleting thefields in a
table. To solvetheerrorfollow thebelowsteps.
• Go to SE14Providethetablename
• Click on edit button
• Click on ‘activateand adjust databasebutton
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page5
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Components of a TABLE :
Delivery class:
It specifies thetypeofthe datathat stored in atable.
Thedatacan bebusiness dataorsystemdata.
Business datameans application data(masterand transaction data).
Thefollowing options areavailable.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page6
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Display maintenance:
It specifies whetherthedatashould only bedisplayed orit can also bemaintained.
Datamaintenancemeans creation, deletion, andchanging.
Thereare 3 options available.
• Display maintenance allowed: Datais displayed and maintained
• Display maintenance not allowed: Data is not displayed and not maintained
• Display maintenance allowed with restrictions: Datais displayed, but maintenanceis given
only for someusers based on restrictions.
Data class:It specifies thephysicalareaof a tableinsidethedatabase
Depending on thetableweare supposedto select therequired option. Theoptionsavailableare,
Masterdata:Thedatawhich neverchanges orwhich changes very rarely is called masterdata.
Ex: cno, cname, city etc.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page7
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Transaction data:Theday to day business dataorthedatawhich changes everyday is called
transaction data.
Ex: customerbank transaction data
Organization data:Thedatawhich is related to organizationorcompanylikehowmany company
codes, plants,sales organizationetc, is called organization data.
Size category:It specifies themax. Number of records that can bestored in atable.
Thepossibleoptionsareavailableas below.
In thereal time we always set sizecategory as ‘0’ OR ‘1’, becausewehaveto usesmall amount of
memory.
Supposeifthememory is not sufficient thesystemwill automatically assign thesamememory area as
perthesize category mentionedabove.
Buffer/cachememory: It is a temporary memory to storethedata. It is mainly used to increase
thesystemperformance.
Thefunctionality ofbufferis defined as below.
• TheTables request forthedata
• Thesystemwill check whetherthedatais available in cache/buffermemory
• If it is available thedatawill be immediately given back to the table, thereby increasingthe
systemperformance
• Supposeifthedatais not available, therequest will be sent to database, andtheresponsewill
begiven back to bufferor cachememory to storea copy forfuturereferences
• After the copy is stored then thedatawill begiven back to the table
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page8
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Buffering options:
• Buffering not allowed: Datais not stored in buffer
• Buffering allowed but not switchedoff: Used by SAP
• Buffering switched on: Data is stored in buffer
By default buffering not allowed will beselected.
Buffering types:
• Single recordbuffer: Only first record orrecords which areread will bestored in thebuffer
• Fully buffered: All therecords will be stored in thebuffer
• Generic Area: Thekey field’s datais called generic area. Only generic areadata i.e. key fields
data will be stored in thebuffer
Log Data Changes:This Checkboxwould definewhetherchanges to thedatarecords ofthetable
are to belogged/recordedornot.
If checkboxis selected, then every change(Update/Delete)to an existing datarecord is recorded in
theStandard DatabaseLog tableDBTABLOG.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page9
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
CLIENT NUMBER
It is a uniquenumberwhich is used to providesecurity to thedataat thedatabaselevel.
In thereal time, Based on theclient no only, usernames will becreated and theaccess will be given.
In thereal time, normally we usetheclient number(100,120), (200,220), (300,320).
Thefield name, dataelement, and domain forclient numberis ‘MANDT’.
Types of tables based on client number
Ex on Client dependent table:
1. Create a tableby namezcust_table_dp with belowfields.
2.
3. Create somerecords in thetableand display them.
4. Now login to anotherclient. Ex810 client
5. Open thetable and display thedata
6. Thedatawill not beavailable, becauseit is aclient dependent table
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page10
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
STRUCTURES IN ABAP
• It is acontainerofreusablefields
• Structures aredefined in datadictionary
• Oncethe structuresaredefined wemust includethemin tables
• Thereare two options forincluding thestructuresin tables
 Includestructure
 Append structure
Difference between include structure and append structure:
Ex on include structure:
Step 1: Createa structureby name‘zaddr’ with fields city, country, postalcode
1. Go to SE11Selectdatatype provideaname‘zaddr’
2. Click on create and providethedescription
3. Specify thefields and dataelements
4.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page11
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
5. Saveand activate
Steps 2: Includethestructurein atable as below
1. Open any table which is already created
2. Providethefield nameas ‘.include’, dataelement as structurename zaddr(whichis created
above)
3. Enter
4. Thefields will beautomatically copied
Ex on appendstructure: Business requirement:
Add a custom field ‘MNAME’ (middle name)to the standard SAP table ‘KNA1’ .
1. Open thetable kna1in display mode
2. Click on ‘append structure’ button
3. A pop-up is displayed, click on createicon
4. Providetheappend name‘zapp1’ and press enter
5. Providethefield nameas ‘mname’ and dataelement as ‘zmname’
6. Save, activateand click on back
7. Check thefield in thetable, it will be availableat thebottom
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page12
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Currency and Quantity fields
• Currency and quantity fields are used to storecurrency amounts dataand quantity data
respectively.
• So, forevery currency and quantity field we haveto specify thecorresponding unitslikeINRor
USD or EUROetc orKGS or EA orPC etc .
• CURR: It is thedatatypewhich is used to storethecurrency amount orpricefields.
• CUKY: It is thedatatypewhich is used to storethecorresponding units(INRorUSD orEURO)
for thecurrency fields.
• QUAN: It is thedatatypewhich is used to specify thequantity foramaterial orstock.
• UNIT: It is thedatatypewhich is used to specify theunits(KGS orEAorPC) for thequantity
fields.
Ex on currency/quantityfields:
1. Open any table which is already created.
2. Add thebelow fields
3. Click on Currency/Quantity fields tab and specify RefTab Name and RefField Name.
a.
4. Saveand activatethetable
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page13
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Foreign key relation
Therelation between two tables for validating thedatais called foreign key relation.
Validation means checking whetherthevalueis correct ornot.
Check table:
A table which stores masterdatais called a check table.
Foreign Key Table :
A table which is linked with check tablefor validating its own datais called foreign key table
Foreign key relation :
A relation between two ormoretables for validating thedatais called foreign key relation.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page14
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Steps forforeign key relation:
Step 1: Createa tableby name ‘zcustomers’ with field’s customernumberand customer
name, also createsomerecords.
Step 2: Createanothertableby namezcustomers_bank with fields cno, bankid and
bankname.
Step 3: Createtheforeign key relation as below
1. Open thetable zcustomer_bank
2. Select cno field
3. Click on foreign keys button orIcon
4. Providethecheck tablenameas zcustomer(masterdatatable)
5. Click on generateproposal button
6. Click on copy button
7. Saveand activate
Step 4: Unit testing
• Click on utilities -> table contents ->create
• Entertheinvalid customernumberand click on save
• Theerrormessagewill be displayed
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page15
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Real time ex on foreign key relation:
Domain with field values:
• It is an option to maintain someFixed values insidethedomain forvalidation
• It is used forvalidation at thedomain level
• Wehaveto maintain somefixed values at the domain, so that allthetable fields will be
referring to this domain will bechecked against with thefixed values
• If, supposeweenter awrong value for a field which refers this domain, then thesystemwill
check yourvaluewith fixed values. If thevalueis not available, then the systemwill raise the
errormessage
• This option is only used wheneverthenumberofvalues areless than 10or15
• If thevalues are morethan 15, we go for foreign key relation
• Themain advantageofdomain with fixed values is reusability
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page16
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Ex on Domain with field values
1. Open thetable zcustomer_bank
2. Add an extra field by name‘gender’ with dataelement and domain as ‘zgender’
3. Now go to thedomain ‘zgender’.
4. Click on valuerangetab
5. Maintain thefixed values as below
a.
6. Saveand activatethedomain and thetable
7. Go to unit testing
8. Entertheinvalid valuefor gender
9. Theerrorwill bedisplayed
VALUE TABLE:
A table namedefined at thedomain level so that all thetable fields will bereferring to
thedomain will be checked orvalidated with asingletable called as valuetable.
Themain advantageofvaluetableis to automatethesystemforforeign key relation
i.e. thesystemwill automatically display check tablename to generateforeign key
proposal.
Weshould just click on YES button,so that valuetableis convertedas check table.
Steps forvaluetable:
STEP1: Create a tablezzcustomerwith field cno and cname, also createsomerecords
STEP2: Define thecheck tablename at domain level as below. Nowcheck table is called as value
table
1. Go to thedomain zcno
2. Click on valuerangetab
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page17
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
3. Providethevaluetableas zzcustomer
4. Saveand activate, domain and table
STEP3: Create anothertableby namezzcustomer_bank with fields cno, bankid, bankname
STEP4: Maintain theforeign key relation as below
• Open zzcustomer_bank table
• Select cno field and click on foreign key button
• A pop-up displayedas belowwith valuetableto beproposedforcheck table
• If we click on ‘yes’, foreign key relation will be automatically displayed
• If we click on ‘no’, it will not bedisplayed
Differences between checktable and value table
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page18
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Domain properties:
• SIGN: It is used to storethesign ofa number, whetherit is positivesign ornegativesign
• LowerCase: This option is used to storeavaluein thecombination ofcapitaland smallletters
• By default SAP will convert all letters into capitalletters
• If we don’t want to convert allletters into capitalletters, pleaseselect lower caseoption
• Conversion Routine: It is asub-programorfunctionmodulewhich is used to convertavalue
from internalformat to externalformat and viceversa
Conversionroutine function modules:
• Go to any domain, ex: MATNR
• Theconversion routinewillbe displayed, ex: MATN1
• Doubleclick on MATN1
• Two function modules willbe displayed as below
• CONVERSION_EXIT_MATN1_INPUT: This functionmoduleis used to convert materialnumber
from externalformat to internalformat.
• CONVERSION_EXIT_MATN1_OUTPUT: This function moduleis used to convert material
numberfrominternalformat tot externalformat.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page19
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Table Maintenance Generator (SM30):
It is astandard SAPprogramcreated in theformof function modules to maintain mass orbulk
amount ofdata instead ofmaintaining each and every record.
Maintenancemeans creation,deletion and modification.
It is also used forvalidating thetabledatausing theconcept ofevents.
Steps forTMG:
1. Create any tableby name‘zcust’ with mandt, cno,cnameand land1
2. Saveand activatethetable
3. Click on utilities -> select tablemaintenancegenerator
4. Providethedetails as below
5. Authorization group=&NC&
6. Function group =zcust(tablename)
7. Maintenancetype as onestep
8. Click on find screen numberbutton
9. A pop-up is displayed, just pressenter
10. Thescreen numberwill be automatically proposed
11. Click on create icon
12. TheTMG will be created in theform of function modules
Activating TMG:
• Go to SE80
• Select function group fromthelist
• Providefunction groupname(tablename)and press enter
• Right click on function groupnameand select activate
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page20
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
Unit testing:
• Go to SM30
• Providethetablename
• Click on ‘maintain’ button
• Entercustomernumber,nameand country forasinglerecord orbulk amount ofrecords.
• Click on save, thedatawill be saved
Validations with TMG:
 Sometimes we want to validatethedataby writing programlogic.
 In such cases weuseevents in TMG and validatethedata
 Thevalidation arepossibleusing theconcept called events
 Thereare around 39events available
 For each event we need to providearoutinename(sub-programname )
 Insidetheroutinewehaveto write theABAP codefor validating thedata
Events in TMG:
• Open thetable
• Click on utilities and select TMG
• Click on environment ->modification -> events
• A new screen will bedisplayed
• Click on ‘new entries’ button
• Click on ‘help’ button on thefirst row, first column
• The39 events will bedisplayed
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page21
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
• Doubleclick on any Event Name. Ex : 05
• Providetheroutinenameforaboveevent in thesecond column and press enter
New sub-programwhich will becreated forwriting thelogic
Ex on validation: BusinessRequirement:
1. Create a tableby name‘zkna1’ with kunnr, land1,name1fields
2. Create a TMG as discussedabove
3. Click on environment ->modifications ->events
4. Click on ‘new entries’ button
5. Select the event ‘05’ (creating anew record)and providesub-routinename(sub-program
name)
6.
7. Click on editor icon
Raise an errormessage whenevera newrecord orcustomeris created without
providing the countryorland1.
A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page22
A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT
8. Press enter2 times (sub-programwillbe created automatically)
9. Write thebelowABAP code
Form znew_rec.
If zkna1_land1=‘ ’.
Message‘pleaseentercountry’ type‘E’.
Endif.
Endform.
10. Saveand activate
11. Click on back, save
12. Click on back, save
13. Click on save
14. An information messagewill be displayed as ‘functiongroup can’t beprocessed’
15. Click on back -> back -> back
16. Go to SE80and activatefunction group
17. Got SM30 and test it
Assignment
Create a tableby name‘zlfa1’ with vendornumber, name, dateand username. Create
TMG and validatetheTMGso that dateand usernameautomatically saved.

More Related Content

What's hot

Don't Repeat Yourself, and Automated Code Reviews
Don't Repeat Yourself, and Automated Code ReviewsDon't Repeat Yourself, and Automated Code Reviews
Don't Repeat Yourself, and Automated Code ReviewsGramener
 
Oracle10g External Tables
Oracle10g External TablesOracle10g External Tables
Oracle10g External TablesKai Liu
 
005 foxpro
005 foxpro005 foxpro
005 foxproSMS2007
 
SAP BW - Creation of hierarchies (time dependant hierachy structures)
SAP BW - Creation of hierarchies (time dependant hierachy structures)SAP BW - Creation of hierarchies (time dependant hierachy structures)
SAP BW - Creation of hierarchies (time dependant hierachy structures)Yasmin Ashraf
 
Open sql2010 recovery-of-lost-or-corrupted-innodb-tables
Open sql2010 recovery-of-lost-or-corrupted-innodb-tablesOpen sql2010 recovery-of-lost-or-corrupted-innodb-tables
Open sql2010 recovery-of-lost-or-corrupted-innodb-tablesArvids Godjuks
 
OER UNIT 4 PARTITION
OER UNIT 4 PARTITIONOER UNIT 4 PARTITION
OER UNIT 4 PARTITIONGirija Muscut
 
BIS 155 Success Begins /newtonhelp.com 
BIS 155 Success Begins /newtonhelp.com BIS 155 Success Begins /newtonhelp.com 
BIS 155 Success Begins /newtonhelp.com myblue107
 
Sap abap-data structures and internal tables
Sap abap-data structures and internal tablesSap abap-data structures and internal tables
Sap abap-data structures and internal tablesMustafa Nadim
 
Case Problem: Currency.xlsx
Case Problem: Currency.xlsxCase Problem: Currency.xlsx
Case Problem: Currency.xlsxViscKand
 
BIS 155 Expect Success/newtonhelp.com
BIS 155 Expect Success/newtonhelp.comBIS 155 Expect Success/newtonhelp.com
BIS 155 Expect Success/newtonhelp.commyblue26
 

What's hot (13)

Don't Repeat Yourself, and Automated Code Reviews
Don't Repeat Yourself, and Automated Code ReviewsDon't Repeat Yourself, and Automated Code Reviews
Don't Repeat Yourself, and Automated Code Reviews
 
Oracle10g External Tables
Oracle10g External TablesOracle10g External Tables
Oracle10g External Tables
 
005 foxpro
005 foxpro005 foxpro
005 foxpro
 
Sql
SqlSql
Sql
 
SAP BW - Creation of hierarchies (time dependant hierachy structures)
SAP BW - Creation of hierarchies (time dependant hierachy structures)SAP BW - Creation of hierarchies (time dependant hierachy structures)
SAP BW - Creation of hierarchies (time dependant hierachy structures)
 
Open sql2010 recovery-of-lost-or-corrupted-innodb-tables
Open sql2010 recovery-of-lost-or-corrupted-innodb-tablesOpen sql2010 recovery-of-lost-or-corrupted-innodb-tables
Open sql2010 recovery-of-lost-or-corrupted-innodb-tables
 
OER UNIT 4 PARTITION
OER UNIT 4 PARTITIONOER UNIT 4 PARTITION
OER UNIT 4 PARTITION
 
SQL
SQLSQL
SQL
 
BIS 155 Success Begins /newtonhelp.com 
BIS 155 Success Begins /newtonhelp.com BIS 155 Success Begins /newtonhelp.com 
BIS 155 Success Begins /newtonhelp.com 
 
Sap abap-data structures and internal tables
Sap abap-data structures and internal tablesSap abap-data structures and internal tables
Sap abap-data structures and internal tables
 
Case Problem: Currency.xlsx
Case Problem: Currency.xlsxCase Problem: Currency.xlsx
Case Problem: Currency.xlsx
 
BIS 155 Expect Success/newtonhelp.com
BIS 155 Expect Success/newtonhelp.comBIS 155 Expect Success/newtonhelp.com
BIS 155 Expect Success/newtonhelp.com
 
CSD
CSDCSD
CSD
 

Similar to Tables in dd

Lsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishnaLsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishnaHari Krishna
 
How to generate a 100+ page website using parameterisation in R
How to generate a 100+ page website using parameterisation in RHow to generate a 100+ page website using parameterisation in R
How to generate a 100+ page website using parameterisation in RPaul Bradshaw
 
OPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATIONOPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATIONYoomiLaataBekele
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overviewsapdocs. info
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02wingsrai
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01tabish
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01tabish
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewAshish Kumar
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02tabish
 
Lab 3 Set Working Directory, Scatterplots and Introduction to.docx
Lab 3 Set Working Directory, Scatterplots and Introduction to.docxLab 3 Set Working Directory, Scatterplots and Introduction to.docx
Lab 3 Set Working Directory, Scatterplots and Introduction to.docxDIPESH30
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Cathie101
 
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base DesignMS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base Designsqlserver content
 
MS SQL SERVER: Customizing Your D Base Design
MS SQL SERVER: Customizing Your D Base DesignMS SQL SERVER: Customizing Your D Base Design
MS SQL SERVER: Customizing Your D Base Designsqlserver content
 
Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview k kartheek
 

Similar to Tables in dd (20)

Lsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishnaLsmw by guntupalliharikrishna
Lsmw by guntupalliharikrishna
 
How to generate a 100+ page website using parameterisation in R
How to generate a 100+ page website using parameterisation in RHow to generate a 100+ page website using parameterisation in R
How to generate a 100+ page website using parameterisation in R
 
OPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATIONOPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATION
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming Overview
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
 
Lession 7 records maintenance
Lession 7 records maintenanceLession 7 records maintenance
Lession 7 records maintenance
 
Access ppt
Access ppt Access ppt
Access ppt
 
Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
 
Lab 3 Set Working Directory, Scatterplots and Introduction to.docx
Lab 3 Set Working Directory, Scatterplots and Introduction to.docxLab 3 Set Working Directory, Scatterplots and Introduction to.docx
Lab 3 Set Working Directory, Scatterplots and Introduction to.docx
 
Sap abap
Sap abapSap abap
Sap abap
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base DesignMS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Customizing Your D Base Design
 
MS SQL SERVER: Customizing Your D Base Design
MS SQL SERVER: Customizing Your D Base DesignMS SQL SERVER: Customizing Your D Base Design
MS SQL SERVER: Customizing Your D Base Design
 
Database concepts using libre office base
Database concepts using libre office baseDatabase concepts using libre office base
Database concepts using libre office base
 
Database concepts using libre office base
Database concepts using libre office baseDatabase concepts using libre office base
Database concepts using libre office base
 
Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview
 

Recently uploaded

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 

Recently uploaded (20)

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 

Tables in dd

  • 1. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page1 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT ABAP DICTIONARY  Abap Dictionary is a centralrepository wherewedefineand maintain theobjects which are related to database.  Define means creation ofobjects  Maintenancemeans changing anddeleting theobjects. Theobjects are, Database table: It is an object which stores datain theformof rows and columns. Each rowis called as record, and each column is called as field. So, to definea tablewe haveto definethefields first. So, to definea field, we haveto specify the belowthings: FIELD = DATA ELEMENT + DOMAIN
  • 2. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page2 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Domain: It is an object which specifies technicalinformation suchas datatype and length for a field. It also specifies sign, lower case, conversion routine, fixed values, and value table. Data element: It is an object which specifies semantic information suchas field description, field labels (short, medium, long and heading)forafield. Advantages of data element anddomain: • Reusability: Thesamedataelement and domain can bereused by multipletablefields, instead ofcreating again and again. • Thesearealso used in creating foreign key relationship,search help,ale-idoc’s. Key field: A field which is used to identify therecord uniquely is called a key field. In a tablethere should beat least onekey field. We can create ____number ofkey fields. Steps to create domain: 1. Go to SE11 2. Select Domain 3. Give a name, ex – ‘zcno’ 4. Click on Create 5. Provideshort description 6. Providedatatypeas CHAR and length as 10. 7. Press enter 8. Save, check and activate
  • 3. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page3 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Steps to create data element: 1. Go to SE11 2. Select datatype 3. Give a name, ex – ‘zcno’ 4. Create -> select dataelement 5. Provideshort description 6. Providedomain nameas ‘zcno’ 7. Press enter 8. Click on field label tab, specify short, medium, long and headinglabels 9. Save, check and activate Steps to create a table: 1. Go to SE11 2. Providethetablename ‘zcust_table’ 3. Click on create 4. Providedescription 5. Specify delivery class as ‘A’ 6. Specify display maintenanceallowed 7. Click on fields tab 8. Providethefield name, dataelement nameas below 9. 10. Click on save 11. Click on technicalsettings button 12. Providethedetails as dataclass -> APPL0, sizecategory ->0 13. Click on saveand click on back
  • 4. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page4 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT 14. Saveand activatethetable Creating records into the table: • Go to SE11 • Give thetablename and click on change • Click on utilities -> table contents ->create • Providethecno, cname, city • Repeat thesameprocedureand createtherecords Displaying the table contents: • Click on utilities -> table contents ->display • Click on executebutton • Therecords will bedisplayed Note:Sometimes we may get unpredictableerrors in atable, dueto adding ordeleting thefields in a table. To solvetheerrorfollow thebelowsteps. • Go to SE14Providethetablename • Click on edit button • Click on ‘activateand adjust databasebutton
  • 5. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page5 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Components of a TABLE : Delivery class: It specifies thetypeofthe datathat stored in atable. Thedatacan bebusiness dataorsystemdata. Business datameans application data(masterand transaction data). Thefollowing options areavailable.
  • 6. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page6 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Display maintenance: It specifies whetherthedatashould only bedisplayed orit can also bemaintained. Datamaintenancemeans creation, deletion, andchanging. Thereare 3 options available. • Display maintenance allowed: Datais displayed and maintained • Display maintenance not allowed: Data is not displayed and not maintained • Display maintenance allowed with restrictions: Datais displayed, but maintenanceis given only for someusers based on restrictions. Data class:It specifies thephysicalareaof a tableinsidethedatabase Depending on thetableweare supposedto select therequired option. Theoptionsavailableare, Masterdata:Thedatawhich neverchanges orwhich changes very rarely is called masterdata. Ex: cno, cname, city etc.
  • 7. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page7 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Transaction data:Theday to day business dataorthedatawhich changes everyday is called transaction data. Ex: customerbank transaction data Organization data:Thedatawhich is related to organizationorcompanylikehowmany company codes, plants,sales organizationetc, is called organization data. Size category:It specifies themax. Number of records that can bestored in atable. Thepossibleoptionsareavailableas below. In thereal time we always set sizecategory as ‘0’ OR ‘1’, becausewehaveto usesmall amount of memory. Supposeifthememory is not sufficient thesystemwill automatically assign thesamememory area as perthesize category mentionedabove. Buffer/cachememory: It is a temporary memory to storethedata. It is mainly used to increase thesystemperformance. Thefunctionality ofbufferis defined as below. • TheTables request forthedata • Thesystemwill check whetherthedatais available in cache/buffermemory • If it is available thedatawill be immediately given back to the table, thereby increasingthe systemperformance • Supposeifthedatais not available, therequest will be sent to database, andtheresponsewill begiven back to bufferor cachememory to storea copy forfuturereferences • After the copy is stored then thedatawill begiven back to the table
  • 8. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page8 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Buffering options: • Buffering not allowed: Datais not stored in buffer • Buffering allowed but not switchedoff: Used by SAP • Buffering switched on: Data is stored in buffer By default buffering not allowed will beselected. Buffering types: • Single recordbuffer: Only first record orrecords which areread will bestored in thebuffer • Fully buffered: All therecords will be stored in thebuffer • Generic Area: Thekey field’s datais called generic area. Only generic areadata i.e. key fields data will be stored in thebuffer Log Data Changes:This Checkboxwould definewhetherchanges to thedatarecords ofthetable are to belogged/recordedornot. If checkboxis selected, then every change(Update/Delete)to an existing datarecord is recorded in theStandard DatabaseLog tableDBTABLOG.
  • 9. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page9 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT CLIENT NUMBER It is a uniquenumberwhich is used to providesecurity to thedataat thedatabaselevel. In thereal time, Based on theclient no only, usernames will becreated and theaccess will be given. In thereal time, normally we usetheclient number(100,120), (200,220), (300,320). Thefield name, dataelement, and domain forclient numberis ‘MANDT’. Types of tables based on client number Ex on Client dependent table: 1. Create a tableby namezcust_table_dp with belowfields. 2. 3. Create somerecords in thetableand display them. 4. Now login to anotherclient. Ex810 client 5. Open thetable and display thedata 6. Thedatawill not beavailable, becauseit is aclient dependent table
  • 10. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page10 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT STRUCTURES IN ABAP • It is acontainerofreusablefields • Structures aredefined in datadictionary • Oncethe structuresaredefined wemust includethemin tables • Thereare two options forincluding thestructuresin tables  Includestructure  Append structure Difference between include structure and append structure: Ex on include structure: Step 1: Createa structureby name‘zaddr’ with fields city, country, postalcode 1. Go to SE11Selectdatatype provideaname‘zaddr’ 2. Click on create and providethedescription 3. Specify thefields and dataelements 4.
  • 11. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page11 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT 5. Saveand activate Steps 2: Includethestructurein atable as below 1. Open any table which is already created 2. Providethefield nameas ‘.include’, dataelement as structurename zaddr(whichis created above) 3. Enter 4. Thefields will beautomatically copied Ex on appendstructure: Business requirement: Add a custom field ‘MNAME’ (middle name)to the standard SAP table ‘KNA1’ . 1. Open thetable kna1in display mode 2. Click on ‘append structure’ button 3. A pop-up is displayed, click on createicon 4. Providetheappend name‘zapp1’ and press enter 5. Providethefield nameas ‘mname’ and dataelement as ‘zmname’ 6. Save, activateand click on back 7. Check thefield in thetable, it will be availableat thebottom
  • 12. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page12 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Currency and Quantity fields • Currency and quantity fields are used to storecurrency amounts dataand quantity data respectively. • So, forevery currency and quantity field we haveto specify thecorresponding unitslikeINRor USD or EUROetc orKGS or EA orPC etc . • CURR: It is thedatatypewhich is used to storethecurrency amount orpricefields. • CUKY: It is thedatatypewhich is used to storethecorresponding units(INRorUSD orEURO) for thecurrency fields. • QUAN: It is thedatatypewhich is used to specify thequantity foramaterial orstock. • UNIT: It is thedatatypewhich is used to specify theunits(KGS orEAorPC) for thequantity fields. Ex on currency/quantityfields: 1. Open any table which is already created. 2. Add thebelow fields 3. Click on Currency/Quantity fields tab and specify RefTab Name and RefField Name. a. 4. Saveand activatethetable
  • 13. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page13 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Foreign key relation Therelation between two tables for validating thedatais called foreign key relation. Validation means checking whetherthevalueis correct ornot. Check table: A table which stores masterdatais called a check table. Foreign Key Table : A table which is linked with check tablefor validating its own datais called foreign key table Foreign key relation : A relation between two ormoretables for validating thedatais called foreign key relation.
  • 14. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page14 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Steps forforeign key relation: Step 1: Createa tableby name ‘zcustomers’ with field’s customernumberand customer name, also createsomerecords. Step 2: Createanothertableby namezcustomers_bank with fields cno, bankid and bankname. Step 3: Createtheforeign key relation as below 1. Open thetable zcustomer_bank 2. Select cno field 3. Click on foreign keys button orIcon 4. Providethecheck tablenameas zcustomer(masterdatatable) 5. Click on generateproposal button 6. Click on copy button 7. Saveand activate Step 4: Unit testing • Click on utilities -> table contents ->create • Entertheinvalid customernumberand click on save • Theerrormessagewill be displayed
  • 15. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page15 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Real time ex on foreign key relation: Domain with field values: • It is an option to maintain someFixed values insidethedomain forvalidation • It is used forvalidation at thedomain level • Wehaveto maintain somefixed values at the domain, so that allthetable fields will be referring to this domain will bechecked against with thefixed values • If, supposeweenter awrong value for a field which refers this domain, then thesystemwill check yourvaluewith fixed values. If thevalueis not available, then the systemwill raise the errormessage • This option is only used wheneverthenumberofvalues areless than 10or15 • If thevalues are morethan 15, we go for foreign key relation • Themain advantageofdomain with fixed values is reusability
  • 16. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page16 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Ex on Domain with field values 1. Open thetable zcustomer_bank 2. Add an extra field by name‘gender’ with dataelement and domain as ‘zgender’ 3. Now go to thedomain ‘zgender’. 4. Click on valuerangetab 5. Maintain thefixed values as below a. 6. Saveand activatethedomain and thetable 7. Go to unit testing 8. Entertheinvalid valuefor gender 9. Theerrorwill bedisplayed VALUE TABLE: A table namedefined at thedomain level so that all thetable fields will bereferring to thedomain will be checked orvalidated with asingletable called as valuetable. Themain advantageofvaluetableis to automatethesystemforforeign key relation i.e. thesystemwill automatically display check tablename to generateforeign key proposal. Weshould just click on YES button,so that valuetableis convertedas check table. Steps forvaluetable: STEP1: Create a tablezzcustomerwith field cno and cname, also createsomerecords STEP2: Define thecheck tablename at domain level as below. Nowcheck table is called as value table 1. Go to thedomain zcno 2. Click on valuerangetab
  • 17. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page17 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT 3. Providethevaluetableas zzcustomer 4. Saveand activate, domain and table STEP3: Create anothertableby namezzcustomer_bank with fields cno, bankid, bankname STEP4: Maintain theforeign key relation as below • Open zzcustomer_bank table • Select cno field and click on foreign key button • A pop-up displayedas belowwith valuetableto beproposedforcheck table • If we click on ‘yes’, foreign key relation will be automatically displayed • If we click on ‘no’, it will not bedisplayed Differences between checktable and value table
  • 18. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page18 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Domain properties: • SIGN: It is used to storethesign ofa number, whetherit is positivesign ornegativesign • LowerCase: This option is used to storeavaluein thecombination ofcapitaland smallletters • By default SAP will convert all letters into capitalletters • If we don’t want to convert allletters into capitalletters, pleaseselect lower caseoption • Conversion Routine: It is asub-programorfunctionmodulewhich is used to convertavalue from internalformat to externalformat and viceversa Conversionroutine function modules: • Go to any domain, ex: MATNR • Theconversion routinewillbe displayed, ex: MATN1 • Doubleclick on MATN1 • Two function modules willbe displayed as below • CONVERSION_EXIT_MATN1_INPUT: This functionmoduleis used to convert materialnumber from externalformat to internalformat. • CONVERSION_EXIT_MATN1_OUTPUT: This function moduleis used to convert material numberfrominternalformat tot externalformat.
  • 19. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page19 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Table Maintenance Generator (SM30): It is astandard SAPprogramcreated in theformof function modules to maintain mass orbulk amount ofdata instead ofmaintaining each and every record. Maintenancemeans creation,deletion and modification. It is also used forvalidating thetabledatausing theconcept ofevents. Steps forTMG: 1. Create any tableby name‘zcust’ with mandt, cno,cnameand land1 2. Saveand activatethetable 3. Click on utilities -> select tablemaintenancegenerator 4. Providethedetails as below 5. Authorization group=&NC& 6. Function group =zcust(tablename) 7. Maintenancetype as onestep 8. Click on find screen numberbutton 9. A pop-up is displayed, just pressenter 10. Thescreen numberwill be automatically proposed 11. Click on create icon 12. TheTMG will be created in theform of function modules Activating TMG: • Go to SE80 • Select function group fromthelist • Providefunction groupname(tablename)and press enter • Right click on function groupnameand select activate
  • 20. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page20 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT Unit testing: • Go to SM30 • Providethetablename • Click on ‘maintain’ button • Entercustomernumber,nameand country forasinglerecord orbulk amount ofrecords. • Click on save, thedatawill be saved Validations with TMG:  Sometimes we want to validatethedataby writing programlogic.  In such cases weuseevents in TMG and validatethedata  Thevalidation arepossibleusing theconcept called events  Thereare around 39events available  For each event we need to providearoutinename(sub-programname )  Insidetheroutinewehaveto write theABAP codefor validating thedata Events in TMG: • Open thetable • Click on utilities and select TMG • Click on environment ->modification -> events • A new screen will bedisplayed • Click on ‘new entries’ button • Click on ‘help’ button on thefirst row, first column • The39 events will bedisplayed
  • 21. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page21 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT • Doubleclick on any Event Name. Ex : 05 • Providetheroutinenameforaboveevent in thesecond column and press enter New sub-programwhich will becreated forwriting thelogic Ex on validation: BusinessRequirement: 1. Create a tableby name‘zkna1’ with kunnr, land1,name1fields 2. Create a TMG as discussedabove 3. Click on environment ->modifications ->events 4. Click on ‘new entries’ button 5. Select the event ‘05’ (creating anew record)and providesub-routinename(sub-program name) 6. 7. Click on editor icon Raise an errormessage whenevera newrecord orcustomeris created without providing the countryorland1.
  • 22. A R J U N … … . L E A R N R E A L T I M E S C E N A R I O S D O N E B Y M E Page22 A B A P & W E B D Y N P R O A B A P @ A R J U N IGROWSOFT 8. Press enter2 times (sub-programwillbe created automatically) 9. Write thebelowABAP code Form znew_rec. If zkna1_land1=‘ ’. Message‘pleaseentercountry’ type‘E’. Endif. Endform. 10. Saveand activate 11. Click on back, save 12. Click on back, save 13. Click on save 14. An information messagewill be displayed as ‘functiongroup can’t beprocessed’ 15. Click on back -> back -> back 16. Go to SE80and activatefunction group 17. Got SM30 and test it Assignment Create a tableby name‘zlfa1’ with vendornumber, name, dateand username. Create TMG and validatetheTMGso that dateand usernameautomatically saved.