04-16-2008 5:23 AM
Hi ,
How can i delete DB table.. there is no comand like DROP in abap
Regards
Anuj
04-16-2008 5:27 AM
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.
04-16-2008 5:33 AM
Hi Bharat,
I have to delete some autogenerated tables and i have to do it programitacally.. I think there is a way
Regards
Anuj
04-16-2008 5:50 AM
04-16-2008 5:58 AM
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.
04-16-2008 5:27 AM
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