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

Deleting DB table contents using internal table

Former Member
0 Likes
538

Hi Gurus,

I have a requirement of deleting DB table contents. Requirement is as follows,

User will select the DB table description in the seletion screen using drop down list.

Whichever description he selects,the corresponding table contents should be deleted and we should not hardcode the table name in if or case conditions.

Is this possible?

Regards,

G.Srinivasan

Hi Gurus,

I have a requirement of deleting DB table contents. Requirement is as follows,

User will select the DB table description in the seletion screen using drop down list.

Whichever description he selects,the corresponding table contents should be deleted and we should not hardcode the table name in if or case conditions.

Is this possible?

Regards,

G.Srinivasan

3 REPLIES 3
Read only

Former Member
0 Likes
490

Hi,

You can get the Table name from the desciption from table DD02T.

Use the Key word DELETE to delete the contents of a table from program.

PARAMETERS : p_ddtext type ddtext.
select single * from dd02t into table db_tab where DDLANGUAGE = 'EN' and ddtext = p_ddtext.

DELETE DB_TAB-TABNAME
 FROM ITAB. " Take F1 help on this Key word

IMPORTANT --> Do not manually delete the contents of a DB table in SAP.

The individual records only deleted through BDC or any other Acceptable Methods.

Rest is left to you. Be careful about this activity. Take enough Authourizations/ Permissions or consult your BASIS or other team members.

Cheerz

Ram

Read only

deepak_dhamat
Active Contributor
0 Likes
490

hi ,

Why you want to delete db table ....

Regards

Deepak .

Read only

Former Member
0 Likes
490

Thanks