Table Maintenance BAdI - Meta Method Explained

In this article you will learn everything about the META method of the table maintenance BAdI. You will get an understanding of different types of fields and receive an overview of all parameters. At the end of the article you can find a sample implementation you can use for your own project.

Our Table Maintenance BAdI blog series in overview

  1. Table Maintenance - How to Implement a BAdI (general overview)
  2. Table Maintenance BAdI - Meta Method Explained
  3. Table Maintenance BAdI - Data Method Explained
  4. Table Maintenance BAdI - Update Method Explained
  5. Table Maintenance BAdI - Error Handling Explained

Using the logic inside the META method, you can control properties of table as a whole as well as the respective single fields. You can use this method to overwrite settings set in front end. Moreover, you can change editability and visibility of certain fields. Furthermore, you can change the search behaviour from dropdown to search and vice versa. Finally, you can utilize this method to execute authorization check on table level.

This exit is implemented via interface /NLY/IF_BADI_EDITOR, method SET_META_EXIT.

Method for meta data of table

There are different types of fields, which are explained below.

Key fields

Generally, key fields should not be changed in edit mode, as this would result in new entries. Therefore, in case of an update event, key fields should always be locked and not editable.

In any other scenario the following three cases are possible: 

  • 1 – locked            (the field is locked) 
  • 2 – editable - required     (the field is required and null is not allowed) 
  • 3 – editable - not required     (the field is not required and null is allowed)

In the table below you can find an overview.

Key Field

Insert

Update

true (X)

key field 

1

locked

1

locked (key fields are not editable)

2

editable (required)

3

editable (not required)

false ( )

non-key field

1

locked 

1

locked 

2

editable (required)

2

editable (required)

3

editable (not required)

3

editable (not required)

 

Required fields

Per default, key fields are configured as required and non-key fields as not required. But both settings can be changed.

A non-key field can be set as required or mandatory for input. For example, if business users want the customer category attribute to be always filled, you can set this field to required, even if it is not a key field.

The other way around, it is also possible to define a key field as not required, therefore not mandatory for input. This could be the case if your semantic key consists of multiple fields and you allow initial values (null) for one of them.

Non-editable fields

You can set fields to be not editable, so the user cannot change the values of the field on edit or insert actions. The best example are fields like "Changed by" or "Changed on", which will be populated automatically before the database update, but should not be manually changed by the user.

Overview of all parameters

In the tables below you can find an overview of all parameters and possible values.

Table parameters

Property

Type

Description

Possible Values

TBLLEN

CHAR 30

Table length

NextLytics internal use only

TECHNAME

CHAR 30

Technical name of the table (e.g. /BIC/AZOMACOST2)

 

TABNAME

CHAR 30

Table name (e.g. ZOMACOST)

 

DESCR

CHAR 30

Table description

 

EDITABLE

CHAR 1

Table edit setting

1    Editable

2    Insertable

3    Editable and Insertable

4    Deletable

5    Deletable and Editable

6    Deletable and Insertable

7    Deletable, Editable and Insertable

IS_INLINE

CHAR 1

Enable Inline Editing

1 Yes

2 No

IS_LOC_FILTER

CHAR 1

Enable Local Filter

1 Yes

2 No

IS_PRE_FILTER

CHAR 1

Enable Global Filter

1 Yes

2 No

SUPPRESS_EXPORT

CHAR 1

Suppress Export

X Suppress Export

JSFUNCTIONS

STRING

JavaScript Functions

NextLytics internal use only

BUTTONS

 

Table

Custom Buttons Settings

 

BUTTONS-NAME

CHAR 30

Button Name

 

BUTTONS-DESCR

CHAR 60

Description

 

BUTTONS-PARENT

CHAR 30

Button Name

 

BUTTONS-LOCATION

CHAR 10

Location of the Button in UI

 

BUTTONS-SORT_ORDER

NUMC 6

Sort order

 

BUTTONS-ACTION

CHAR 10

Action to be performed

 

F1HELP

STRING

F1 Help

NextLytics internal use only

CHECK_AUTH_INFOPROV

CHAR 1

Check analysis authorization for InfoProvider

1 Yes


ACTIVATION

CHAR 1

Activation

1 - activate at once (default value)

2 - no activation 

If no entry is maintained, automatic activation takes place.

ALIAS_TTYPE

CHAR 10

Alias Table Type

 

ALIAS_TABNAME

CHAR 10

Alias Table Name

 

 

Field parameters

Property

Type

Description

Possible Values

FNAME

CHAR 30

Field name

 

LEN

NUMC 6

Length (No. of Characters)

 

INTLEN

NUMC 6

Internal Length (No. of Characters)

 

TYPE

CHAR 1

ABAP Data Type

C    Character String

N    Character String with Digits Only

D    Date (Date: YYYYMMDD)

T    Time (Time: HHMMSS)

X    Byte Seq. (hexadecimal), in DDIC metadata also for INT1/2/4

I    Integer number (4-byte integer with sign)

b    1-byte integer, integer number <= 254

s    2-byte integer, only for length field before LCHR or LRAW

P    Packed number

F    Floating point number to accuracy of 8 bytes

g    Character string with variable length (ABAP type STRING)

y    Byte sequence with variable length (ABAP type XSTRING)

u    Structured type, flat

v    Structured type, deep

h    Table type

V    Character string (old Dictionary type VARC)

r    Reference to class/interface

l    Reference to data object

a    Decimal Floating Point Number, 16 Digits

e    Decimal Floating Point Number, 34 Digits

j    Static Boxed Components

k    Generic Boxed Components

z    Node Line for Structured Objects

8    Whole Number (8-Byte Integer with Sign)

M    HTML Content

INTTYPE

CHAR 1

Internal ABAP Data Type

C    Character String

N    Character String with Digits Only

D    Date (Date: YYYYMMDD)

T    Time (Time: HHMMSS)

X    Byte Seq. (hexadecimal), in DDIC metadata also for INT1/2/4

I    Integer number (4-byte integer with sign)

b    1-byte integer, integer number <= 254

s    2-byte integer, only for length field before LCHR or LRAW

P    Packed number

F    Floating point number to accuracy of 8 bytes

g    Character string with variable length (ABAP type STRING)

y    Byte sequence with variable length (ABAP type XSTRING)

u    Structured type, flat

v    Structured type, deep

h    Table type

V    Character string (old Dictionary type VARC)

r    Reference to class/interface

l    Reference to data object

a    Decimal Floating Point Number, 16 Digits

e    Decimal Floating Point Number, 34 Digits

j    Static Boxed Components

k    Generic Boxed Components

z    Node Line for Structured Objects

8    Whole Number (8-Byte Integer with Sign)

M    HTML Content

DECIMALS

NUMC 6

Number of Decimal Places

 

DESCR

CHAR 60

Short Description of Repository Objects

 

KEYFLAG

CHAR 1

Identifies a key field of a table

X    Key field

DISPLAY

CHAR 1

Show or hide field

1   Visible

2    Not Visible, but still in global filter (prefilter)

3   Only Visible in Table View

4   Not Visible - not transferred to frontend

So value 2 can be used if field should not be available for the user, but still be available in the global filter/ prefilter for backend filtering.

Value 4 is to be used, when data should not be sent to frontend and in no way be available to the end user.

EDITABLE

CHAR 1

Editabiltity setting

1    Locked

2    Editable - Required

3    Editable - Not Required

SUPPRESS_EXPORT

CHAR 1

Suppress Export

X    Suppress Export

SUPPRESS_LOC_FILTER

CHAR 1

Suppress local filter

X    Suppress local filter

SUPPRESS_PRE_FILTER

CHAR 1

Suppress global filter

X    Suppress global filter

SUPPRESS_GROUP_BY

CHAR 1

Suppress group by

X    Suppress group by

CELLRENDERER

STRING

Cell renderer as Function in JS

 

F4HELP

Table

Search Info, see next table for details

 

F1HELP

STRING

F1 Help

NextLytics internal use only

VARIABLES-NAME

CHAR 30

Variable Name

 

VARIABLES-DESCR

CHAR 60

Variable Description

 

INFOOBJECT

CHAR 30

InfoObject

 

CONVEXIT

CHAR 5

Conversion Routine

E.g. ALPHA or PERI6. Usually changes to this field are not needed

IOBJTP

CHAR 3

Type of an InfoObject

CHA    Characteristic

KYF    Key figure

TIM    Time characteristic

DPA    Data packet characteristic

UNI    Unit of measurement

XXL    XXL InfoObject

DDIC_POSITION

NUMC 4

Position of the table field in DDIC

 

UI_POSITION

NUMC 4

Position of the table field in User Interface

 

CHECK_INFOOBJECT_INTEGRITY

CHAR 1

Check InfoObject integrity

1 yes

IOBJ_AUTH_REL_FLAG

CHAR 1

Authorization relevant flag for InfoObject

X yes

DISPLAY_TEXT

Table

Characteristic display

NextLytics internal use only 

( not implemented yet

6    No Display

0    Key and Text

1    Text

2    Key

3    Text and Key

4    Long Text

5    Medium-Length Text

7    Short Text

B    Text and Key as Short Text

C    Text and Key as Medium Text

D    Text and Key as Long Text

E    Key and Text as Short Text

F    Key and Text as Medium Text

G    Key and Text as Long Text ) 

 

F4 Help

The table below explains the fields of F4HELP in detail.

Property

Type

Description

Possible Values

SEARCHMODE

CHAR 6

Search Type

DDIC    Search based on table and field in Data Dictionary

IOBJ    InfoObject

CUSTOM    Custom

SEARCHNAME

CHAR 60

Search Name

For example name of the InfoObject, if SEARCHMODE IOBJ is used

SEARCHSTYLE

CHAR 30

Search Style - dropdown or search bar

SEARCH show search bar

DROPDOWN    show dropdown

Remark: dropdown recommended only for less than 50 values 

MIN_CHAR

NUMC 3

Number of minimum characteristics to be entered before search will start

 

STRICT

CHAR 1

Defines whether adding results to dropdown is allowed.

X adding results is not allowed


BAdI Structure

You can use the following code snippet as orientation while implementing your own logic. You can find a practical application of this method in this article.


   FIELD-SYMBOLS:  <l_s_fields_info> TYPE /nly/ts_fields_info,
<l_s_f4help>      TYPE /nly/ts_search_info.

*Change properties as needed

    LOOP AT CH_T_FIELDS_INFO ASSIGNING <l_s_fields_info>.

      CASE <l_s_fields_info>-fname.

        WHEN 'FIELD_NAME_1'.

          <l_s_fields_info>-editable = '1'.

        WHEN 'FIELD_NAME_2'.

          loop at <l_s_fields_info>-f4help assigning <l_s_f4help>.

            <l_s_f4help>-searchstyle = 'DROPDOWN'.

            ENDLOOP.

      ENDCASE.

   ENDLOOP.

Error Handling and Messages

You can pass messages to the user using the CT_MESSAGES table. Please refer to this article for detailed information.

NextTables BAdI Reference