cancel
Showing results for 
Search instead for 
Did you mean: 

Which FM can append table sturcture(add key fields and so on)

Former Member
0 Kudos

Hi everybody,

does any one of u know a FM which append structures of table (to add the key fields and so on) in ABAP dictionary.

The FM DDIF_TABL_PUT is only used to write a new table and I don't want to call this FM twice to realize my application.

Thanks in advance!

Liying

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

check out this FM

DB_ADD_TABLE_FIELDS

Regards

Raja

Former Member
0 Kudos

Thanks,I will try

athavanraja
Active Contributor
0 Kudos

I havent tested it, but checked the source quickly and it seems it will do what you are expecting.

Do post back your experience.

all the best

Regards

Raja

Former Member
0 Kudos

Hi Raja,

I got a runtime error:Perform_NOT_FOUND

EXCEPTION:CX_SY_DYN_CALL_ILLEGAL_FORM

following is my codes:

DATA ATA DDFIELDS LIKE DDFIELD OCCURS 2 WITH HEADER LINE.

DATA NAME LIKE DD02L-TABNAME.

DDFIELDS-FIELDNAME = 'F3'.

DDFIELDS-POSITION = '3'.

DDFIELDS-KEYFLAG = 'X'.

DDFIELDS-DATATYPE = 'INT4'.

APPEND DDFIELDS.

DDFIELDS-FIELDNAME = 'F4'.

DDFIELDS-POSITION = '4'.

DDFIELDS-KEYFLAG = ''.

DDFIELDS-DATATYPE = 'INT4'.

APPEND DDFIELDS.

NAME = 'ZTEST'.

CALL FUNCTION 'DB_ADD_TABLE_FIELDS'

EXPORTING

TABNAME = NAME

TABLES

DDFIELDS = DDFIELDS

EXCEPTIONS

FIELDS_NOT_ADDED = 01

PROGRAM_NOT_GENERATED = 02

PROGRAM_NOT_WRITTEN = 03

TABLE_DOES_NOT_EXIST = 04.

What might be the reason?

B.R.

Liying

Former Member
0 Kudos

can you try the below parameters

EXPORTING

NO_EXEC = 'X'

TABNAME = TABNAME

PROGNAME = '$MEMORY'

Former Member
0 Kudos

I tried them, but it still doesn't help:-(

DATA DDFIELDS LIKE DDFIELD OCCURS 2 WITH HEADER LINE.

DATA NAME LIKE DD02L-TABNAME.

DDFIELDS-FIELDNAME = 'F3'.

DDFIELDS-POSITION = '3'.

DDFIELDS-KEYFLAG = 'X'.

DDFIELDS-DATATYPE = 'INT4'.

APPEND DDFIELDS.

DDFIELDS-FIELDNAME = 'F4'.

DDFIELDS-POSITION = '4'.

DDFIELDS-KEYFLAG = ''.

DDFIELDS-DATATYPE = 'INT4'.

APPEND DDFIELDS.

NAME = 'ZFMHIST1'.

CALL FUNCTION 'DB_ADD_TABLE_FIELDS'

EXPORTING

TABNAME = NAME

NO_EXEC = 'X'

PROGNAME = '$MEMORY'

TABLES

DDFIELDS = DDFIELDS

EXCEPTIONS

FIELDS_NOT_ADDED = 01

PROGRAM_NOT_GENERATED = 02

PROGRAM_NOT_WRITTEN = 03

TABLE_DOES_NOT_EXIST = 04.

B.R.

Liying