Sie sind auf Seite 1von 14

A

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

VIEWS IN DATA DICTONARY


Many a times it is required to extract data from several tables this can be a time consuming process. To simplify the process and to increase the efficiency of the code, you can define a VIEW. Data is not stored in a VIEW physically. Here data is combined from several tables, but the data is stored in their respective tables. As the name goes a VIEW is just a VIEW of the selected/desired fields from a number of tables. Fields that are not required are hidden. For example if data needs to be extracted from 5 tables with desired fields, then you can create a VIEW of the required fields.

There are 4 types of views Database view Projection view Help view Maintenance view

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 1

B A P&W E B D Y N P R O A B A P @ A R J U N Database view:

IGROWSOFT

A view created on two or more tables using inner join concept is called database view In this view we can only read the data We can provide selections to read the data We cannot maintain the data Ex on database view: Develop a database view on MARA and MAKT tables to display material number, material type, material units, language and description. 1. Go to SE11 2. Provide the view name zdb_view and click on create 3. Select database view 4. Click on copy 5. Provide description 6. Provide the table names and joining condition as below

a.

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 2

B A P&W E B D Y N P R O A B A P @ A R J U N 7. Click on view fields tab 8. Click on table fields button

IGROWSOFT

9. Double click on MARA and select MATNR, MTART and MEINS 10. 11. 12. 13. 14. Click on copy Again click on table fields button Double click on MAKT and select SPRAS, MAKTX Click on copy The screen should look as below

a. 15. 16. Click on condition tab Provide the condition as below

17. 18. Save and activate

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 3

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

19.

Click on

Icon and check the records

Projection view: A view created on single table is called projection view. Projection views are mainly used to minimize the database interface (number of fields) and improve the system performance. In simple words, we can hide the unnecessary fields from a single table We can maintain the data in the projection views. We cannot provide any selections in the projection views. Ex on projection view: Go to SE11 Provide the view name zproj_view Click on create, provide description Provide the basis table as mara Click on table fields button Select matnr, mtart, mbrsh and meins
ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME
Page 4

B A P&W E B D Y N P R O A B A P @ A R J U N Click on copy button Save and activate Click on contents and display the view Maintaining the data:

IGROWSOFT

To maintain the data, we have to provide the key fields i.e. mandt, matnr Go to the view and add the first field as mandt

Click on maintenance status tab Select read and change radio button Select display maintenance allowed

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 5

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

Save, activate and display the data Help view: A view created on two or more tables using outer join concept is called help view. Help view are specially designed for search helps. We cannot execute help views directly, instead we have to include help views inside the search helps. We cannot maintain the data in help views.

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 6

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

Ex on help views: 1. Go to SE11 2. Provide the view name zhelp_view 3. Click on create 4. Provide description a. Provide the table name as makt OR mara b. and click on relationships button

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 7

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

c. 5. Click on copy, the join condition will be automatically displayed 6. Click on view fields tab 7. Provide the field names matnr, mtart, meins and maktx by clicking on table fields button 8. Provide the selection condition if required 9. Save and activate 10. 11. We cannot test this help view If we want to test we should create a search help

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 8

B A P&W E B D Y N P R O A B A P @ A R J U N Maintenance view:

IGROWSOFT

A view created on two or more tables using inner join concept is called maintenance views We can maintain the data in maintenance views Maintenance view are used by SAP for internal purpose In the real time we dont create any maintenance views because the data should be saved or modified in multiple tables which leads inconsistency If we want save or modify the data, we have to use standard SAP transactions or BAPIs Ex on Maintenance views: 1. Go to SE11 2. Provide the view name zmaint_view 3. Click on create 4. Provide description a. Provide the table name as makt OR mara b. and click on relationships button

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 9

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

c. 5. Click on copy, the join condition will be automatically displayed 6. Click on view fields tab 7. Provide the field names as below

a.

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 10

B A P&W E B D Y N P R O A B A P @ A R J U N 8. Provide the selection condition if required 9. Provide the maintenance status as below

IGROWSOFT

10. 11. 12.

Save activate. Create a TMG for the view and then maintain the data.

13. 14. Finally, Click on Icon and check the records

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 11

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

Search Helps IN DATA DICTONARY


Providing a help functionality or F4 functionality for an input field is called search help. There are two types of search help. Elementary search help Collective search help Elementary search help: Providing a single search help for an input field is called elementary search help. Collective search help: Collection of elementary search helps for an input filed is called collective search help. Assigning search helps: Once search helps are created we have to assign them At program-selection screen level At table-level At sap-screen level Selection-screen: Input screen to a program or search is called selection screen. Parameters: It is a keyword to declare or create an input field on the selection screen.

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 12

B A P&W E B D Y N P R O A B A P @ A R J U N Ex: Parameters : p_kunnr(10) type c. Parameters : p_matnr(20) type c. Match code object:

IGROWSOFT

It is a keyword which is used to assign a search help to the input fields on the selection screen. By default standard SAP search help will be displayed. If we dont want standard search help then we use match code object to assign our own search help. Syntax: Parameters: <Param.Name> (len) type <dtyp> match code object <sh_name> Or Parameters: <parameter name> type <table-fname> match code object <sh_name>

Ex on elementary search help: Go to SE11 Provide the search help name zel_sh Click on create and provide description Provide the selection method as mara
ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME
Page 13

B A P&W E B D Y N P R O A B A P @ A R J U N Provide the search help parameter as below with IMP,EXP,SPOS,LPOS

IGROWSOFT

Save, activate and test it Assigning search help at program-selection screen level: Go to SE38 Create a program by name zsh_prog Write the below code

Save Act and Test

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 14

Das könnte Ihnen auch gefallen