Skip to Content
avatar image
Former Member

How to drop a field/column of table in dictionary

Hi Experts,

Do anyone know standard class or method or any abap code can used to delete/drop a column in a table?

The table is a not internal table and also not ALV table.

EXEC SQL.

            ALTER TABLE source DROP COLUMN CLIENT

ENDEXEC.


I have tried something like but it did not work.


Thanks for help in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 15, 2014 at 08:35 AM

    If table is defined in ddic, use DDIF_TABL_PUT as written by Nabheet.

    Else look at ADBC class. But if MANDT is part of primary key, you may first have to drop SQL primary key constraint too, then alter table and last rebuilt it without MANDT.

    What are you exactly trying to do, in which context ?

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 15, 2014 at 08:27 AM

    Hi Leong

    You can use function module DDIF_TABL_PUT for the same. Please read the documentation for the same

    Nabheet

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 15, 2014 at 08:36 AM

    Hi,

    What is the purpose of this exercise ?

    Droping the CLIENT ?

    What is the table name ?

    See program ADBC_DEMO.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 15, 2014 at 09:35 AM

    Hi Leong,

    client field normally is the 1st key field in most of SAP standard tables and should be 1st key field in all custom tables.

    You mustn't drop it from SAP tables and you shouldn't drop it from your custom tables. Tables without a client field are client independent tables with several restrictions especially on production systems.

    Dropping a key field is a dangerous action. You have to check, that this field is not used by secondary indexes, table views and more. The table also needs a conversion after that (which may lead to duplicates, if you have identical keys in different clients).

    Which table do you want to change and why do you think, that you need to drop the client field?

    Regards,

    Klaus

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 15, 2014 at 09:20 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded