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

activate a report program programmatically into a particular package and request id.

Former Member
0 Likes
3,756

Hi Experts,

How to activate a report program programmatically into a particular package and request id.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,998

Hi Riju,

Please check the following FM:

RS_RENAME_PROGRAM

With regards,

Ashish Kumar.

11 REPLIES 11
Read only

former_member183073
Active Participant
0 Likes
2,998

Hi,

I found this FM 'RS_WORKING_OBJECT_ACTIVATE'

you need to pass object type as 'REPS' and Object Name.

Read only

0 Likes
2,998

Hi Syed,

Thanks for the reply.

But I cant find any option to input the package name and request id.

Read only

0 Likes
2,998

Not sure about your actual requirement, but this FM activates any objects if Object Type and Object name is passed.

Read only

0 Likes
2,998

Hii Riju,

Go to table E071 in se 11

here type ur request task(not request id, exaple if ur request id is id59657 then ur request task will be id59658) because in request task data are store , u can also input extra field like objetc type and object name. programm Id,Object type are like R3TR DOMA for domain,

R3TR DTEL for data element,

R3TR  PROG for programm

R3TR TABL for data base table

R3TR LDB for logical database,

R3TR VIEW for view

so and so

regards

Syed

Read only

Former Member
0 Likes
2,998

Hi Riju,

Can you provide more information about your requirement ? Input -Process- Output ?

Regard's

Smruti

Read only

0 Likes
2,998

Hi Smruti,

My input is

1. Program Name (Newly created program, Not saved in any package/request)

2. Package Name

3. Request ID

Output:

Programmed should be activated in the corresponding package and request.

I hope it is more clear to you now.

Regards,

Riju.

Read only

0 Likes
2,998

Hi Riju,

As your main goal is to activate the program you can code a program to validate and then activate using the FM which i gave earlier.

  • validate if the Program name specified exists in the given TR by writing a select on E071 table and passing the Program name to obect name.
  • validate if the Program belong to the specified package by wrriting a select on TADIR and passing the program name to OBJ_NAME and Package name to DEVCLASS fields
  • if all the conditions satisfies activate the object by passing the Program name and Program Type to this FM 'RS_WORKING_OBJECT_ACTIVATE'
Read only

0 Likes
2,998

Hi Riju,

Use "TR_EDIT_CHECK_OBJECTS_KEYS" to assign request id and package name to respective custom program , and for activation use program "RS_WORKING_OBJECT_ACTIVATE" .

TABLES : RS38L,TADIR,E071,E071K,KO200.

DATA : S_TADIR TYPE TADIR ,

        S_E071  LIKE KO200 OCCURS 0 WITH HEADER LINE,

        S_E071K LIKE E071K OCCURS WITH HEADER LINE,

        SE_ORDER LIKE E070-TRKORR ,

        SE_TASK LIKE E070-TRKORR,

        SE_OBJECTS_APPENDABLE  LIKE TRPARI-S_CHECKED,

        SV_ERRNUM LIKE TRPARI-TRERRNUMEC,

        SV_OBJECT_UNLOCKED LIKE TRPARI-S_CHECKED ,

        S_OBJECT LIKE DWINACTIV OCCURS 0 WITH HEADER LINE .

S_E071-TRKORR = 'xxxxxxxxx'.         " Workbech Reqest ID

S_E071-AS4POS = '000000'.                  " Line item Number

S_E071-PGMID = 'R3TR'.                       "Program ID

S_E071-OBJECT = 'PROG'.                   "Object Type

S_E071-OBJ_NAME = 'Y001'.                "Program Name

S_E071-LANG = 'EN'.                            "language

S_E071-DEVCLASS = 'ZABAP'.            "package name

S_E071-OPERATION = 'I' .                    "Insert

APPEND S_E071 .

CLEAR S_E071 .

CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'

  EXPORTING

    WI_ORDER                                  = 'xxxxxxxx'             " Workbench Request ID

    WI_WITH_DIALOG                       = 'X'

    WI_OBJ_CATEGOGY_MIX            = 'X'

    WI_SEND_MESSAGE                  = 'X'

    IV_NO_SHOW_OPTION                = ' '

    IV_NO_STANDARD_EDITOR         = ' '

    IV_EXTERNALPS                          = ' '

    IV_EXTERNALID                            = ' '

    IV_NO_PS                                     = ' '

    IV_READ_ACTIVITY_FROM_MEMORY         = 'X'

    IV_APPEND_TO_ORDER                             = ' '

    IV_INSERT_INTO_SBCSETS                        = 'X'

    IV_OLD_CALL                                              = ' '

  IMPORTING

    WE_ORDER                                                = SE_ORDER

    WE_TASK                                                   = SE_TASK

    WE_OBJECTS_APPENDABLE                     = SE_OBJECTS_APPENDABLE

    EV_ERRNUM                                               = SV_ERRNUM

    EV_OBJECT_UNLOCKED                             = SV_OBJECT_UNLOCKED

   TABLES

     WT_E071                                                    = S_E071    .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE .

CALL FUNCTION 'RS_WORKING_OBJECT_ACTIVATE'

  EXPORTING

    OBJECT                                               = 'REPS'

    OBJ_NAME                                          = 'Y001'    " Program Name

    ACTIVATE_ONLY_THIS_OBJECT           = 'X'

  TABLES

    OBJECTS                                             S_OBJECT

           .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

  WRITE:/ 'Successfully Object Activated '.

  ENDIF.

ENDIF.

Regard's

Smruti

Read only

Former Member
0 Likes
2,996

Hi Raju,

It is 3 step process,

Say for Example I Input objects as follow,

Program Name: ZCH_DEMO_2

Package Name: ZCH_DEMO

Request ID:        D48K905165

Write the logic as follow,

1. Update table PROGDIR with your program name having set STATE = 'A'. (A-Active,I-Inactive).

2. Update TADIR with program name and package as shown below

3.Update E071 table as shown below

Hope it helps.

Regards,

KangArun

Read only

0 Likes
2,996

There has to be a better way than updating these important tables directly!!!

Read only

Former Member
0 Likes
2,999

Hi Riju,

Please check the following FM:

RS_RENAME_PROGRAM

With regards,

Ashish Kumar.