Monday, March 22, 2021

Thursday, December 10, 2020

Data Dictionary


SE11:
Data Dictionary
Database table
View
Data type

  • Data element
  • Structure
  • Table Type

Type Group
Domain
Search Help
Lock Objet

Domain: Manage the technical properties of Data element (Can’t be used directly in table or program). Settings format (Char, dats, dec, numc) and output characteristics


Data element: contains both semantic (short description) and technical properties about the data type.
Documentation (F1 Help), Search Help and SET/GET parameter, Default Component Name, Change Document (logs), Input History, Bi Directional.

Structure: Components of Data elements, integrated types, table types, definition of data base table or views, other structure types

Flat: Simple form of structure. List of fields, typed with data elements
Nested: Include another structure into a structure
Deep: A Structure containing one or more fields using a table type


Table Type:
A line type that defines structure and data type attribute of the line in the internal table.
Modes:

Standard Table
Sorted Table
Hashed table
Index table
Not specified

Specific table types
Generic Table type
Range table type

¬
Type Groups: Global complex data types, global constants and macros


Database tables:
Transparent Table
Pooled table (M_MTVMA, M_MTVMB)
Cluster table (CDPOS, KONV, BSEC, BSED, BSEG)

Transparent Table:
Technical settings:
1. Table Buffer
2. Size Category: How many possible records.
3. Data Class: Physical area on DB it stored
4. Logging: log Changes to the data record

Pooled and Cluster table
Several tables logically defined in ABAP dictionary are combined in physical database table (Type pool or cluster)

Cluster Table: Functionality dependent data, which is divided among different tables (VARDATA primary key)

Pooled Table: stores data records from database defined in data dictionary that are not dependent to one another. Database interface stores the non-keys fields of pooled table in an unstructured way

Advantages:
Fewer tables and data fields
Data compression
Encrypted data storage

Disadvantages
Limitations: No native SQL, no views or joins, no secondary index, no Group by Order by and so on
No table appends
For Cluster table, selection is limited to cluster key
For pooled table, longer keys are required than necessary


Index:
Primary Index Key fields of the table, is always unique
Secondary Index
Extension Index: extension of standard index


Table Buffering:
Full Buffering
Generic key buffering  all the records whose left justified part of the key are buffered
Single record buffering

Buffering synchronization: rdisp/buffertime  60 to 240


Input Checks
Fixed values: Only limited set of values are allowed. Defined at domain level, used as F4 help and input validation on screen

Foreign Key
Fields in the foreign key table are checked against the check table (Parent/Master), whose key fields.


Conversion Error:
tablespace overflow
Data loss if reduced in size
Invalid of the change type

Enhancing the table
Append structure: append fields to standard table, without modifying table definition. Can only assigned to only one table. There can be many structure to one table

Custom Include: all the contents in the structure are include to the table. Can be assigned to multiple tables. These are already provided with custom name space

Views
Data from single/multiple tables are joined/projected to display the required fields.

Projection View:
Maintenance view: Can be displayed and maintained using SE54

Cluster view: SE54
Combine multiple maintenance generated dialogs for views


Search Help F4 help POV
Using FM: F4IF_FIELD_VALUE_REQUEST or
F4IF_INT_TABLE_VALUE_REQUEST
Elementary Search Help
Collective Search Help: search help that combines several paths

Enhancement:
Append search helps
Search help exists



TMG:
STANDARD RECORDING ROUTINE radio button to be selected to make entries transportable
No, or use, recording routine

Single screen Vs Overview screen

Check Table is for Field level Validation whereas Value table is for Domain Level Validations.
Value Table proposes table for check table.
If you define foreign key then value table is proposed as check table

Value Table
This is maintained at Domain Level.
Whenever you create a domain, you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only allowed values is H or S.
Whenever you use this Domain, the system will forces you to enter only these values.
This is a sort of master check. To be maintained as a customization object. This mean that if you want to enter values to this table you have to create a development request & transport the same.
Check table
For example you have Employee master table & Employee Transaction table.
Whenever an employee Transacts we need to check whether that employee exists, so we can refer to the employee master table.
This is nothing but a Parent & Child relationship. Here data can be maintained at client level, no development involved.
As per DBMS what we call foreign key table, is called as check table in SAP.
There is 1 more important Difference in Value Table and Check Table is that:
1. The contents of the check will be used as an input help (F4 Help) for a particular field on which a check table is assigned.
But the contents of Value Table are never used in Input Help.
The Hierarchy which decides from where to use the Input Help is:
1. Input help defined explicitly in ABAP Program or Dialog Module.
2. Input Help Attached to the referenced Database Table field.
3. Using the contents of Check Table as an input help if neither (1) or (2) help are there.
4. Input help from fixed value or Value range given in Domain.


Check Table
Check Table is the dependent table to which the relationship is defined using the foreign keys. The contents of the check table field are shown in the input help for the referenced field.
Value Table
Value Table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the input help. The value table is the default check table.

Wednesday, December 17, 2014

ABAP RAW String not updating

If you have created a field of RAWSTRING type and while checking you will be seeing that when appending into the table and check in SE11 tcode, you may see that the field data is not visible.

Don't get panic, check once in SE16N and still its not visible then try by moving the field in the last in the SE11.

Monday, October 13, 2014

Add first line to field symbol

Issue : When Internal table is empty and no workarea is avalable, how to append workarea
Sol : APPEND INITIAL LINE TO it_tab ASSIGNING <fs>.

Thursday, December 19, 2013

Add Spaces at the end of the file


Issue : To add spaces at the end of the file
Sol : 
Adding spaces at the end of the file can be of two types
  1. By declaring any temporary field with "cl_abap_conv_in_ce=>uccp( '00a0' )"
  2. By adding Uni-code space in editor (Alt+255).

Wednesday, December 12, 2012

Friday, December 7, 2012

Adobe reader problem


Issue : Problem with Adobe
Sol :
Goto the link here

Use Secondary Index in program to fetch data


Issue : To make the program to pick the data from the database using the secondary index
Sol :
%_HINTS ORACLE 'INDEX("table" "table name~index name")'.

Thursday, November 15, 2012

Standard Text ID and Text object(BOM header Text)


Issue : Sometimes there will be a problem in finding the Text ID, Text Object. In such cases below is the way how to go
Menu -> GOTO -> Header Views

Thursday, October 25, 2012

DART View not visible when transported to other system


Issue : Dart view when transported from Dev to Qa or PRD will not be visible to extract the data.

Dart view when transported will be inactive state, we need to go to FTWY and activate it.
Tools->Administration -> Data Retention Tool ->Configuration ->Define data extract Views

SMART FORM while printing, only 1 page is getting printed pages are getting overlapped


Issue : When the sale order was seen in the print preview then it was displaying in 2 pages, when the same was printed then two pages were printed in same page causing the issue as below
This issue got solved by changing the page format in the spool
SP01->->Spool Request (Menu) ->Print->Print with change parameters
When changed the FORMAT to another the spool was printed in 2 pages, by this I confirmed the issue is with page format.
Page Format declaration: SMARTFORMS-> (Form name)->Form attributes->Output Options
How to check the missing?
SPAD->Full Administration->Device types->SWINCF (LOCL in ECC) ->Format (Menu) ->Double Click to check

Tuesday, July 10, 2012

ALV Errors


ALV errors can be majorly corrected by the changing the field catalog.
Errors observed
·           When alv output is transferred to EXCEL it was going to dump
Sol: Do consistency check by clicking the (Shift+2 right clicks), it will display fields which are not assigned properly define them or remove unwanted fields.
·           When summing a column in ALV the output is going to dump MESSAGE_TYPE_X
Sol: This might be due to wrong assignment of fieldcatlog; check the field name and field catalog are same and do changes accordingly

Thursday, July 5, 2012

Dynamic change of selection screens using push button in single program


Dynamic selection screen can be created using push buttons declared in single program
1. Declare parameters with modif id and declare push buttons.
2.In initialization get the user command stored in the memory location using import function and update the selection screen accordingly(disabling some parameters)
3. Selection screen gets displayed, whenever other button is clicked then event AT SELECTION-SCREEN gets triggered, if the sy-ucomm is ‘FC01 or FC02’ export it to the memory location else do screen validations.
4. In the event AT SELECTION-SCREEN OUTPUT change the screen by using LOOP AT SCREEN and MODIF ID



For test program find the attachment attachment

Tuesday, July 3, 2012

Dynamic selection screen using PF status between two programs


Dynamic selection screen using PF status between two programs
1. Changing initial screen options can be done as follows
2. PF status (MENU from SE41 Menu painter) need to be created.
3. In the event AT SELECTION-SCREEN OUTPUT following need to used

AT SELECTION-SCREEN OUTPUT.
*Use a custom PF-STATUS instead of the standard one
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'.
EXPORTING
p_status = 'EDIT_TEXT'
TABLES
p_exclude = exclitab.

DATA: exclitab TYPE TABLE OF sy-ucomm.


4. While creating the push button following need to be taken care, ie Function type need to be ‘E’—Exit command

5. Later in the event AT SELECTION-SCREEN ON EXIT-COMMAND, depending on the command declared in the menu painter get the selection screen inputs if required and submit it to the program.

AT SELECTION-SCREEN ON EXIT-COMMAND.
IF sy-ucomm = <command declared in menu painter> 
PERFORM submit_program.
ENDIF.

FORM submit_program .
DATA: sel_table TYPE TABLE OF rsparams.
CLEAR sel_table.
CLEAR p_detlay.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-repid
TABLES
selection_table = sel_table.

SUBMIT < to_which_program this need to be submitted
VIA SELECTION-SCREEN WITH SELECTION-TABLE sel_table
AND RETURN.
ENDFORM. " submit_program

Read SELECT-OPTIONS using DYNP_VALUES_READ


In general we use DYNP_VALUES_READ to read data in the screen. It will be very simple to get data from the screen when the required field is declared from parameter.
1. Declaration: Declare data for input and for output DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE,
return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.
2.Pass the required value to dynfields dynfields-fieldname = 'P_BUKRS'.
APPEND dynfields.

3.Get the data from selection screen CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = dynfields

4.Get the data from to the fields from selection to the fields READ TABLE dynfields WITH KEY fieldname = 'P_BUKRS'.
lv_bukrs = dynfields-fieldvalue.

5.Get the data from the required table to display SELECT bukrs branch name
FROM j_1bbranch
INTO CORRESPONDING FIELDS OF TABLE it_j_1bbranch
WHERE bukrs = lv_bukrs.

6.Display the using FM F4IF_INT_TABLE_VALUE_REQUEST CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BRANCH'
dynprofield = 'S_BRANCH-LOW'
value_org = 'S'
TABLES
value_tab = it_j_1bbranch
return_tab = return_tab.

7.Pass the data to output field READ TABLE return_tab WITH KEY fieldname = 'BRANCH'.
IF lv_shelp_low = 'X'.
s_branch-low = return_tab-fieldval.
ENDIF.


But when to get the data from SELECT-OPTIONS will be challenge, in order to overcome this we need to follow the below procedure in the attached document. Attachement for select options

Wednesday, June 20, 2012

Authorization Check


Authorization Check can be checked in SU20 – List Of Authorization Fields And SU21- List Of Object Class
Syntax:
AUTHORITY-CHECK OBJECT 'ZMM_WERKS
ID 'ACTVT' FIELD '03' "Display
ID 'WERKS' FIELD t001w-werks.

IF SY-SUBRC <> 0.
“User has no authority
ENDIF.

Saturday, June 16, 2012

Copy Varient from One report to another


To be able to test our changes on real data, we sometimes create a copy of a program, modify it and test it. The function RS_COPY_SELECTION_SETS will copy the variant content. You run it directly in the production system (carefully!) in SE37.

NOTE: “Create” and “Change” user for all variants will be user who does the copy! If you rely on those fields to search for variants, the user information will be lost.

SNOTE


Steps need to be followed during NOTE
1.     Go to transaction SNOTE and check(CTRL+F) whether the note is applied or not
2.      If not applied need to go to services.sap.com and check the note,
·        Note can be applied if the version of the particular service mentioned is higher than our server version
·        Whether it is information note?  If it is information note then no need to apply
·        Any manual corrections are there? For manual correction need to have access key
·        Prerequisites are there? Same process follows
3.     Download the note and apply it, for manual corrections need to go there and do the changes.

CTRL+F8 to download the note
CTRL+F9 to find all the details of note when it applied who has applied it

Friday, May 18, 2012