SAP Tutorials Blog


 CONSTANTS: c_type TYPE ddeutype VALUE 'T'.


DATA: g_ok TYPE c.


PARAMETERS : p_source TYPE ddobjname,

             p_target TYPE ddobjname.


*Copy DDIC Table

CALL FUNCTION 'RS_DD_COPY_OBJ'

  EXPORTING

    source_name        = p_source

    target_name        = p_target

    objtype            = c_type

  EXCEPTIONS

    not_executed       = 1

    permission_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.

ELSE.

  WRITE:/ 'Table Copied Successfully'.


*Activate the copied table

  CALL FUNCTION 'RS_DD_ACTIVATE'

    EXPORTING

      objname = p_target

      objtype = c_type

    IMPORTING

      ok      = g_ok.

ENDIF.



Serkan AKKAVAK

Computer Engineer BSc

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com