Application Development 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: 

How do I open a customization table for editing using my program?

Former Member
0 Kudos

Hi all,

How can I create a program that open a customization table in editing mode?

Thanks,

Roy

14 REPLIES 14

Clemenss
Active Contributor
0 Kudos

Hi Roy,

you may update just any table using a program. It is not advisable at all for customizing tables, because the maintenance views make sure any changes are logged and if required transported.

Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

I think that I did not explain myself clearly.

Let me try to clarify what I meant.

I do not want to edit the customizing table itself (the structure etc…). What I want to do is to directly open it in "editing mode" and edit the content within it.

Currently I need to follow two steps:

Enter SPRO, choose a customizing table and hit the "execute button" next to it.

What I want to know is if I can build a program that will allow me to skip the "SPRO" step and directly get the effect of hitting the "execute button", I will of course need to provide my program the name of the customizing table so that it will know which table to open.

Thanks for you help,

Roy

Former Member
0 Kudos

Hi Roy,

Find the maintainance view of the Customzing Table and use FM "VIEW_MAINTENANCE_CALL" in your program in update mode.

Then you can update the table without going into SPRO tcode

I think this solves your long steps.

Regards,

Sreenivasulu Nallani

uwe_schieferstein
Active Contributor
0 Kudos

Hello Roy

If you had debugged the "SAP Reference IMG" button in transaction SPRO you would have found the simple solution yourself. On ECC 6.0 you will find the following routine (in function group S_IMG_TOOL_5) that is called after pressing this button:


*&---------------------------------------------------------------------*
*&      Form  DISPLAY_REFERENCE_IMG
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM display_reference_img.
  CALL FUNCTION 'S_CUS_IMG_GET_REFERENCE_IMG_ID'
    IMPORTING
      reference_img_id = reference_img_id.
  IF reference_img_id NE space.
    CLEAR user_parameters. REFRESH user_parameters.
    PERFORM fill_user_parameters TABLES user_parameters
                                 USING ' '.
    CALL FUNCTION 'STREE_EXTERNAL_DISPLAY'
         EXPORTING
              structure_id          = reference_img_id
*                    LANGUAGE              = SY-LANGU
*                    DISPLAY_STRUCTURE     = 'X'
*                    NO_COMMIT_WORK        = 'X'
*                    USE_REMOTE_CONNECTION = ' '
*                    RFC_DESTINATION       = 'NONE'
*                    POSITION_ON_NODE      = ' '
*                    ID_FOR_USE_AS_FILTER  = ' '
*               IMPORTING
*                    MESSAGE               =
*                    TOGGLE                =
               TABLES
                    user_parameters       = user_parameters.
  ELSE.
  ENDIF.
ENDFORM.                               " DISPLAY_REFERENCE_IMG

Regards

Uwe

0 Kudos

Hello Uwe,

First, let me thank you for the help.

Second, you solution does not solve my issue. What I wanted to do is to open the SPRO through my transaction and during this process to deliver a parameter which is a specific customizing table name. Then, somehow by using the sent parameter, to highlight this customization table name in the presented tree. At this stage the only thing the user needs to do is to hit the "execute button" next to the highlighted table and it will be opened for editing.

Could you provide a way to solve this issue?

Thanks again,

Roy

0 Kudos

Hi Roy,

just coming to my mind: I know that some help texts have hyperlinks to the customizing tree - this would fulfill your request except that you will not see the customizing tree itself but will be taken to the transaction.

Please try to describe your request in business terms: Under what conditions will what program take a user to the customizing?

Regards,

Clemens

0 Kudos

Roy,

It sounds like you may need to use BDC and record the transaction you want. Then provide a screen to select the table you want and use the informatin to call the BDC session.

0 Kudos

Hi Clemens,

Let me describe a scenario:

1. A user executes the SPRO transaction and then hit the "SAP Reference IMG".

2. Then, the user navigates to the desired customizing table within the tree.

3. Finally, hitting the "IMG - Activity" button (which is presented next to the customizing table) leads the user to the editing mode of that table.

What I want to do is to generate some program that receives a customizing table id/name and then open that customizing tables.

I am sorry if my definitions are not so clear - I am not so familiar with the business terms.

I hope that I described it clear enough this time.

Thanks again for your help,

Roy

Former Member
0 Kudos

Create the table maintenance for that table-> create a Ztransaction for the table maintenance -> CALL that Ztransaction in your report program.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Mar 17, 2008 7:18 PM

uwe_schieferstein
Active Contributor
0 Kudos

Hello Roy

Clear question, straight answer:


*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_CALL_IMG_ACTIVITY
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_call_img_activity.


DATA: gs_objsub     TYPE objsub,
      gd_img_actvt  type CUS_IMG_AC.

PARAMETERS:
  p_view  TYPE viewname DEFAULT 'V_T001W'.

START-OF-SELECTION.

  SELECT SINGLE * FROM  objsub INTO gs_objsub
         WHERE  objectname  = p_view
         AND    objecttype  = 'V'.
**         AND    subobjname  = ___.
  CHECK ( syst-subrc = 0 ).

  gd_img_actvt = gs_objsub-doc_obj.
  CALL FUNCTION 'S_CUS_IMG_ACTIVITY_EXECUTE'
    EXPORTING
      img_activity                  = gd_img_actvt
*     PROJECT_ID                    = ' '
*     CALLED_VIA_GENERATED_TA       = ' '
            .

END-OF-SELECTION.

Alternatively you may call the transaction (OBJSUB-TCODE).

Please note that the sample report works only for maintenance views. However, there may be special transaction which either call a maintenance view or a customizing report. However, all the required information can be obtained from OBJSUB.

Regards

Uwe

uwe_schieferstein
Active Contributor
0 Kudos

Hello Roy

If you prefer a more generic solution which requires a few more button clicks but allows context-sensitive selection of the IMG activity have a look at this sample report:


*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_CALL_IMG_ACTIVITY_1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_call_img_activity_1.


DATA: gs_objsub     TYPE objsub,
      gd_img_actvt  TYPE cus_img_ac.

PARAMETERS:
  p_tabl  TYPE tabname DEFAULT 'T001W'.

START-OF-SELECTION.

  CALL FUNCTION 'OBJECT_MAINTENANCE_CALL'
    EXPORTING
*     OBJECTNAME                           = ' '
*     OBJECTTYPE                           = ' '
*     SUBOBJNAME                           = ' '
      TABNAME                              = p_tabl
*     LANGUAGE                             = SY-LANGU
*     IV_ENCLOSING_OBJECT                  = ' '
*   TABLES
*     SUBOBJ_LIST_FROM_T100O               =
    EXCEPTIONS
*     INTERFACE_NOT_CORRECT                = 1
*     TRANSACTION_NOT_MAINTAINED           = 2
*     TRANSACTION_NOT_FOUND                = 3
*     TABLE_NOT_ACTIV                      = 4
*     TABLE_NOT_FOUND                      = 5
*     SUBOBJECT_NOT_FOUND_IN_PROJECT       = 6
*     SUBOBJECT_NOT_FOUND_IN_GUIDE         = 7
*     OBJECT_NOT_FOUND_IN_PROJECT          = 8
*     OBJECT_NOT_FOUND_IN_GUIDE            = 9
*     TABLE_HAS_NO_OBJECT_IN_PROJECT       = 10
*     TABLE_HAS_NO_OBJECT_IN_GUIDE         = 11
*     OUTLINE_NOT_FOUND                    = 12
*     CALL_TRANSACTION_RECURRING           = 13
*     SYSTEM_FAILURE                       = 14
      OTHERS                               = 15
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


END-OF-SELECTION.

Regards

Uwe

0 Kudos

Hi Uwe,

Thanks a lot for your help, indeed there is some progress and this is more or less the direction I aimed for.

I tried the code you provided and I got the report that presents the table name and the "execute" button. However, when pressing on that button it seems that nothing happens. I would expect that it would lead me to the customizing table with the ability to change the values within the table.

Do you have any ideas what might be the problem?

Thanks again,

Roy

0 Kudos

Hell Roy

The coding was developed on ECC 6.0. When I execute this little report I get the popup where I can choose a specific (IMG) project or none. If I choose "Continue without project" then I am forwarded to the IMG.

If I remember correctly these new function modules for calling IMG transactions have been introduced with SAP release 6.20.

Are you working on an older release?

Regards

Uwe

0 Kudos

Hi Uwe,

The Truth is that I worked on a Solution Manager machine.

I know that through a project in the Solution Manager I can be forward to IMG so I assumed that also your code should work on it.

Am I wrong? Please let me know if I missed something.

(BTW - the SAP is ECC 6.0 and the Solution Manager is 4.0)

BR,

Roy