Tip

Creating dictionary tables and structures from an ABAP program

Do you need to create or modify tables or structures in the Workbench from an ABAP program? It is easier than you think. This example demonstrates the use of the DDIF_TABL_GET, DDIF_TABL_PUT and DDIF_TABL_ACTIVATE function modules from the SDIF function group. First, it reads information from the COPA table CE31000 and then creates and activates a new dictionary structure with those fields whose name starts with 'VV'.


DATA: t_dd03p LIKE dd03p OCCURS 0 WITH HEADER LINE,
      wa_dd02v LIKE dd02v .

START-OF-SELECTION .

  CALL FUNCTION 'DDIF_TABL_GET'
       EXPORTING
            name      = 'CE31000'
       IMPORTING
            dd02v_wa  = wa_dd02v
       TABLES
            dd03p_tab = t_dd03p.

  DELETE t_dd03p WHERE fieldname(2) NE 'VV'.
  wa_dd02v-tabclass = 'INTTAB' .
  wa_dd02v-tabname  = 'YCOPAINC' .
  wa_dd02v-as4user  = sy-uname .
  wa_dd02v-as4time  = sy-uzeit .
  wa_dd02v-as4date  = sy-datum .
  wa_dd02v-applclass = '' .
  wa_dd02v-authclass = '' .

  FIELD-SYMBOLS: <fs> LIKE LINE OF t_dd03p.
  LOOP AT t_dd03p ASSIGNING <fs> .
    <fs>-tabname   = 'YCOPAINC'.
  ENDLOOP .

  CALL FUNCTION 'DDIF_TABL_PUT'
       EXPORTING
            name      = 'YCOPAINC'
            dd02v_wa  = wa_dd02v
       TABLES
            dd03p_tab = t_dd03p.

  CALL FUNCTION 'DDIF_TABL_ACTIVATE'
       EXPORTING
            name = 'YCOPAINC'.

    Requires Free Membership to View

This was first published in April 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.