Application Development and Automation 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: 
Read only

delete transparent table

former_member196517
Contributor
0 Likes
1,017

Hi ,

How can i delete DB table.. there is no comand like DROP in abap

Regards

Anuj

5 REPLIES 5
Read only

Former Member
0 Likes
815

HI,

programatically u cannot delete a table.

goto se11 there u can find delete button i the application toolbar.give the table name and press delete.

rgds,

bharat.

Read only

0 Likes
815

Hi Bharat,

I have to delete some autogenerated tables and i have to do it programitacally.. I think there is a way

Regards

Anuj

Read only

0 Likes
815

why dont u take the help of basis people for that?

Rewards

sas

Read only

0 Likes
815

Hi,

yaa u can do it using BDC program.if u can get the list of tables.

do recording in through tcode SHDB for tcode SE11(deleting table) and make a bdc program.

sample code


DATA:BEGIN OF itab OCCURS 0,
  table like RSRD1-TBMA_VAL,
  END OF itab.

itab-table = 'ZBHABC'."append all your tables to be deleted to itab here
APPEND itab.

DATA:bdctab like bdcdata occurs 0 WITH HEADER LINE.

start-of-selection.

CALL FUNCTION 'BDC_OPEN_GROUP'
 EXPORTING
   CLIENT                    = SY-MANDT
*   DEST                      = FILLER8
   GROUP                     = 'del_tab'
*   HOLDDATE                  = FILLER8
   KEEP                      = 'X'
   USER                      = sy-uname.

LOOP AT itab.
refresh bdctab.
perform bdc_dynpro      using 'SAPMSRD0' '0102'.
perform bdc_field       using 'BDC_CURSOR'
                             'RSRD1-TBMA_VAL'.
perform bdc_field       using 'BDC_OKCODE'
                              '=DELE'.
perform bdc_field       using 'RSRD1-TBMA'
                              'X'.
perform bdc_field       using 'RSRD1-TBMA_VAL'
                              itab-table.
perform bdc_dynpro      using 'SAPLSPO1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              '=YES'.
perform bdc_dynpro      using 'SAPMSRD0' '0102'.
perform bdc_field       using 'BDC_CURSOR'
                              'RSRD1-TBMA_VAL'.
perform bdc_field       using 'BDC_OKCODE'
                              '=BACK'.
perform bdc_field       using 'RSRD1-TBMA'
                              'X'.
perform bdc_field       using 'RSRD1-TBMA_VAL'
                              itab-table.

CALL FUNCTION 'BDC_INSERT'
 EXPORTING
   TCODE                  = 'SE11'
  TABLES
    DYNPROTAB              = bdctab.
ENDLOOP.


CALL FUNCTION 'BDC_CLOSE_GROUP'.

SUBMIT rsbdcsub WITH MAPPE = 'DEL_TAB' AND RETURN.

FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR bdctab.
  bdctab-PROGRAM  = PROGRAM.
  bdctab-DYNPRO   = DYNPRO.
  bdctab-DYNBEGIN = 'X'.
  APPEND bdctab.
ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.
  CLEAR bdctab.
  bdctab-FNAM = FNAM.
  bdctab-FVAL = FVAL.
  APPEND bdctab.
ENDFORM.

rgds,

bharat.

Read only

Former Member
0 Likes
815

Hi You Want to delete z table or only transparent table..?

or data of trnasparent table?

can u much miore specific your requirement..so that any one might help regarding those..

Reward points for all useful answers