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

How to delete mulitple ABAP Programs?

Former Member
0 Likes
2,198

Hi,

I want to delete multiple programs in the SAP Production server using a Transport Request(TR).

Can someone suggest a FM(Function Module) or code by which i can delete multiple programs in development system and all the deleted programs come under the same Transport Request?

This will help me in deleting the same in Production system as well.

Basically i would say if u delete programs using SE38, the system prompts u for a TR.If u give the same TR for all programs, then all of them(deleted programs) would come under the same

TR.

This is wht i want to replicate. I cannot manually delete the programs as the no. of programs is close to 300.

Hi,

I want to delete multiple programs in the SAP Production server using a Transport Request(TR).

Can someone suggest a FM(Function Module) or code by which i can delete multiple programs in development system and all the deleted programs come under the same Transport Request?

This will help me in deleting the same in Production system as well.

Basically i would say if u delete programs using SE38, the system prompts u for a TR.If u give the same TR for all programs, then all of them(deleted programs) would come under the same

TR.

This is wht i want to replicate. I cannot manually delete the programs as the no. of programs is close to 300.

5 REPLIES 5
Read only

Former Member
0 Likes
1,220

you can modify this meet your need..

REPORT ZE071 MESSAGE-ID ZZ NO STANDARD PAGE HEADING

LINE-SIZE 170 LINE-COUNT 58.

TABLES: E071, TADIR, TLOCK.

PARAMETERS: OBJECT LIKE E071-OBJECT DEFAULT 'PROG'.

SELTEXTE* "Object Type

PARAMETERS: OBJNAME LIKE E071-OBJ_NAME DEFAULT 'ZP9925'.

SELTEXTE* "Object Name

PARAMETERS: TRKORR LIKE E071-TRKORR DEFAULT 'DEVK901009'.

SELTEXTE* "Transport/Corr Number

DELETE FROM E071 WHERE TRKORR EQ TRKORR

AND OBJECT EQ OBJECT

AND OBJ_NAME EQ OBJNAME.

DELETE FROM TADIR WHERE OBJECT EQ OBJECT

AND OBJ_NAME EQ OBJNAME.

DELETE FROM TLOCK WHERE OBJECT EQ OBJECT

AND LOKEY EQ OBJNAME

AND TRKORR EQ TRKORR.

COMMIT WORK.

Read only

former_member186741
Active Contributor
0 Likes
1,220

can you do a recording of SE38 marking a program for deletion and then use this as the basis for a program to delete many programs? you can read the programs in from a file or save them all as parameter values in a variant as you prefer.

Read only

0 Likes
1,220

Hi Neil,

Can u please tell how to do recording of SE38 marking a program for deletion??

Read only

0 Likes
1,220

you can use function module 'RS_DELETE_PROGRAM' to delete reports.

to delete multiple reports, collect the report names to be deleted into an itab and loop at itab and call this function.

call function 'RS_DELETE_PROGRAM'

exporting

program = l_s_pdir-progname

  • suppress_checks = ' '

suppress_commit = 'X'

suppress_popup = 'X'

WITH_CUA = 'X'

WITH_DOCUMENTATION = 'X'

WITH_DYNPRO = 'X'

WITH_INCLUDES = ' '

WITH_TEXTPOOL = 'X'

with_variants = i_with_variants

  • TADIR_DEVCLASS =

  • IMPORTING

  • CORRNUMBER =

  • PROGRAM =

exceptions

enqueue_lock = 1

object_not_found = 0

permission_failure = 3

reject_deletion = 4

others = 5.

Regards

Raja

Read only

0 Likes
1,220

use transaaction SM35... you can record a session of transaction SE38 and then generATE A PROGRAM FROM THIS. yOU CAN THEN COPY CHUNKS OF THIS CODE TO A PROGRAM OF YOUR own which will operate on the list of programs you have and perfrom the recorded portion of code for each one. You can get it to add to the same transport.

In SE38 you can delete a program by entering the name and hitting the delete button. This is what you want to record in SM35. So to do the recording delete aone of your programs, save to the transport you wish to use. Once you have created your program you can run it with a few other programs as input to test if they get deleted and added to your transport.

Message was edited by: Neil Woodruff