Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can we activate Database table dynamically?

Former Member
0 Kudos
569

I have deleted a field and index from a DB table dynamically.

now my requirement is to activate the dbtable dynamically.

I have tried as

call tranction 'SE14' using scrdata mode 'A' update 'A'.

here it is showing all the screens with ok-kode correctly but it not activated.

can anybody help in this regard?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
250

Hi Ravi,

After Modification to the database table, u can use this standard function module to activate it dynamically,

CALL FUNCTION 'DDIF_TABL_ACTIVATE'

EXPORTING

name = 'YSHELL' "Name of the db table

  • AUTH_CHK = 'X'

  • PRID = -1

  • IMPORTING

  • RC =

EXCEPTIONS

NOT_FOUND = 1

PUT_FAILURE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

If found helpful, please do reward.

8 REPLIES 8

Former Member
0 Kudos
251

Hi Ravi,

After Modification to the database table, u can use this standard function module to activate it dynamically,

CALL FUNCTION 'DDIF_TABL_ACTIVATE'

EXPORTING

name = 'YSHELL' "Name of the db table

  • AUTH_CHK = 'X'

  • PRID = -1

  • IMPORTING

  • RC =

EXCEPTIONS

NOT_FOUND = 1

PUT_FAILURE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

If found helpful, please do reward.

0 Kudos
250

thanx satya

But even I am unable to activate the DBtable by using Func. Module.

can u suggest me other methods.

0 Kudos
250

Here are the useful Functon MOdules in activating the database tables:

DD_TABL_ACTIVATE_CV

DD_TABT_ACTIVATE

DDIF_TABL_ACTIVATE

DDIF_TABT_ACTIVATE

DD_TABL_ACTIVATE

Regards,

Ravi

0 Kudos
250

it is workin.

CALL FUNCTION 'DDIF_TABL_ACTIVATE'

EXPORTING

name = 'znegi' "Name of the db table

AUTH_CHK = 'X'

PRID = '1'

  • IMPORTING

  • RC =

EXCEPTIONS

NOT_FOUND = 1

PUT_FAILURE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

go to se11 do the deactive table.

now go to se37 run this fm.

enter table name it activate dbtab.

0 Kudos
250

Hi Ravi,

With this FM, the database table is getting activated. I checked it. It's working fine.

After calling this FM also, u r not able to activate the table...Please let me know what's the problem?

0 Kudos
250

thank u satya.

I have cheaked RC value(imported value) from the function module it always returns the value 8 not 0 in my system. 0 means successfully activated.

0 Kudos
250

Hi Ravi,

Go to se14 and activate it manually.

If you are able to do that without any errors, then you can do it using the FM.

If you couldn't do it manually due to some reasons, then you cannot do it dynamically as well

Regards,

ravi

0 Kudos
250

hi satya

It is activating if I do manually thru se14 but in case of calling function module or call traction 'SE14' using scrdata. its not done successfully.

when calling transation it is terminating after pressing ok-code 'yes' in the popup window 'Request Adjust'. this i had found when calling transaction.

After i had debugg the popup program i found the ok-code is not 'yes'.