SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Howto transport Travel expenses across SAP systems…



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Mar 02, 2008 12:49 pm    Post subject: Howto transport Travel expenses across SAP systems… Reply with quote

Howto transport Travel expenses across SAP systems…
Original: geocities.com/krapinskij/TRV2CR.htm

It happens that there are systems with identical customizing (fed from the same DEV system automatically) that are used to hold data of different employees.

Whatever reason there might be to do so I think it is somewhat crazy, but it happens.

Prerequisites:

First of all we need to identify what travel expense for an employee are:
1) Transparent table PTRV_HEAD (subkey pernr reinr)
2) Transparent table PTRV_PERIO (subkey pernr reinr)
3) Cluster TE in table PCL1 (srtfd pernr(8 ) concatenated with reinr(10))
In this few thoughts I ignore the versioning of the travel expenses because I want to take all versions with me in the new system.

Todays task:
move the travel expenses from one system to the other, without having an RFC from one system to the other.

Solution:
write the data to a Transport request (pro: one program only. Con: depending on the system it might be quite hard to write data to a Transport request)

Alternatives could have been to create an RFC and use it to transfer the data (provide Unicode is the same and releases are the same) (cons: requires to open ports in a firewall and requires 2 programs to be written) or to download the data to a file (cons: requires 2 programs and is quite error prone)

The program:
The program is quite simple it uses a simple local class to write data to a transport request.

The selection part of the Travel expenses data is really trivial.
Here it is:
Code:

*
*Copyright (C) 2006  Krapinskij ([email protected])
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or (at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

*REPORT  z_trv_2_cr                 .

TABLES: t777d, pcl1.


PARAMETERS:     wbtrkorr TYPE trkorr.
*Here put the pernr concateneted with the trip number
SELECT-OPTIONS: cidreinr FOR pcl1-srtfd.

DATA     uname     TYPE sy-uname.


INITIALIZATION.
  uname = sy-uname.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR wbtrkorr.

  PERFORM select_tr_korr USING uname 'SYST' CHANGING wbtrkorr.


*---------------------------------------------------------------------*
*       CLASS lcl_tabu_k_2_trkorr_writer DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_tabu_k_2_trkorr_writer DEFINITION.
  PUBLIC SECTION.


* gets the name of the receiver given the temse file type.
    METHODS: init    IMPORTING p_trkorr        TYPE trkorr
                               p_wb_trkorr     TYPE trkorr
                               p_tabname       TYPE tabname
                     CHANGING  p_error         TYPE i.

    METHODS: write_to_trkorr     CHANGING p_error TYPE i.

    METHODS: add_line_key IMPORTING p_line     TYPE any
                          CHANGING  p_error TYPE i .
    METHODS: add_object   IMPORTING pgmid     TYPE pgmid
                                    object    TYPE trobjtype
                                    obj_name  TYPE trobj_name
                                    p_trkorr  TYPE trkorr
                          CHANGING  p_error TYPE i .
    METHODS: add_star_key CHANGING  p_error TYPE i .

    METHODS: get_metahead CHANGING p_error TYPE i.

  PRIVATE SECTION.

    DATA: a_trkorr        TYPE trkorr.
    DATA: a_wb_trkorr     TYPE trkorr.
    DATA: as_obj          TYPE LINE OF tredt_objects.
    DATA: as_metahead     TYPE x030l.
    DATA: a_tabname       TYPE tabname.
    DATA: ar_typedescr    TYPE REF TO cl_abap_typedescr.
    DATA: ar_tableline    TYPE REF TO data.
    DATA: at_key          TYPE tredt_keys.


ENDCLASS.                    "DEFINITION


*---------------------------------------------------------------------*
*       CLASS lcl_tabu_k_2_trkorr_writer IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_tabu_k_2_trkorr_writer IMPLEMENTATION.


  METHOD: init.

    CLEAR:   as_obj,
             as_metahead,
             ar_typedescr,
             ar_tableline,
             a_tabname,
             at_key.
    FREE at_key.

    a_trkorr     = p_trkorr.
    a_wb_trkorr  = p_wb_trkorr.
    a_tabname    = p_tabname.

    CALL METHOD get_metahead CHANGING p_error = p_error.

  ENDMETHOD.

  METHOD: add_object.
*                          IMPORTING pgmid     TYPE pgmid
*                                    object    type TROBJTYPE
*                                    obj_name  type TROBJ_NAME
*                                    p_trkorr  type trkorr
*                          CHANGING  p_error TYPE i .

    as_obj-trkorr   = p_trkorr.
    as_obj-pgmid    = pgmid.
    as_obj-object   = object.
    as_obj-obj_name = obj_name.
    as_obj-objfunc  = space.


  ENDMETHOD.

  METHOD: add_star_key.
* MAKE TABU *
    DATA: ls_key          TYPE LINE OF tredt_keys.

* Transport object
    as_obj-trkorr   = a_trkorr.
    as_obj-pgmid    = 'R3TR'.
    as_obj-object   = 'TABU'.
    as_obj-obj_name = as_metahead-tabname.
    as_obj-objfunc  = 'K'.

* Initialize entry for table key transport
    MOVE-CORRESPONDING as_obj TO ls_key.
    ls_key-objname    = as_obj-obj_name.
    ls_key-objfunc    = space.
    ls_key-mastername = as_obj-obj_name.
    ls_key-mastertype = as_obj-object.
    ls_key-tabkey     = '*'.


*   Insert key of tableline into transport request
    INSERT ls_key INTO TABLE at_key.
  ENDMETHOD.

  METHOD: add_line_key.
*MAKE TABU K
    FIELD-SYMBOLS:
      <ls_tableline>  TYPE ANY,
      <lv_xtableline> TYPE x,
      <lv_xtabkey>    TYPE x.

    DATA: ls_key          TYPE LINE OF tredt_keys.

*4.7 Only
* Get metadata of the linetype of the given table
*  lo_typedescr = cl_abap_typedescr=>describe_by_data(
*      p_data = line ).
*  CALL METHOD lo_typedescr->get_ddic_header
*    RECEIVING
*      p_header = ls_metahead
*    EXCEPTIONS
*      OTHERS   = 1.
*  IF sy-subrc <> 0.
*    pv_error = 1.
*    EXIT.
*  ENDIF.

* Transport object
    as_obj-trkorr   = a_trkorr.
    as_obj-pgmid    = 'R3TR'.
    as_obj-object   = 'TABU'.
    as_obj-obj_name = as_metahead-tabname.
    as_obj-objfunc  = 'K'.

* Initialize entry for table key transport
    MOVE-CORRESPONDING as_obj TO ls_key.
    ls_key-objname    = as_obj-obj_name.
    ls_key-objfunc    = space.
    ls_key-mastername = as_obj-obj_name.
    ls_key-mastertype = as_obj-object.


*   Extract tablekey
    CLEAR ls_key-tabkey.
    ASSIGN ls_key-tabkey TO <lv_xtabkey> CASTING.

*   If table has fields of type STRING or RAWSTRING, casting to type
*   'X' is not possible -> generic solution unknown -> indiv. handling
    CASE as_metahead-tabname.
      WHEN 'PCL2' OR 'PCL1'.
        DATA l_key(46) TYPE c.
        l_key+0(45) = p_line.
        l_key+45(1) = '*'.
        ASSIGN l_key TO <lv_xtableline> CASTING.
        <lv_xtabkey>(46) = <lv_xtableline>(46).
        INSERT ls_key INTO TABLE at_key.
        EXIT.
      WHEN OTHERS.
        ASSIGN p_line TO <lv_xtableline> CASTING.
    ENDCASE.

*   Copy key prefix
    <lv_xtabkey>(as_metahead-keylen) = <lv_xtableline>.

*   Insert key of tableline into transport request
    INSERT ls_key INTO TABLE at_key.
  ENDMETHOD.


  METHOD: write_to_trkorr.
    DATA lt_ko200 TYPE TABLE OF ko200.
    DATA ls_e071 TYPE e071.

    IF as_obj IS INITIAL.
      EXIT.
    ENDIF.

    IF as_obj-objfunc = 'K' AND
       at_key IS INITIAL.
      EXIT.
    ENDIF.

    APPEND as_obj TO lt_ko200.

** Check data for transport request
* Add data to transport request
    CALL FUNCTION 'TR_OBJECTS_CHECK'
         TABLES
              wt_ko200 = lt_ko200
              wt_e071k = at_key
         EXCEPTIONS
              OTHERS   = 1.


*This one swallows correction requests too
    CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
         EXPORTING
              wi_order                     = a_trkorr
              wi_with_dialog               = 'X' "'D'
              wi_send_message              = 'X' "' '
*            iv_no_show_option            = iv_no_show_option
*            iv_no_standard_editor        = iv_no_standard_editor
*            iv_externalps                = iv_externalps
*            iv_externalid                = iv_externalid
*            iv_no_ps                     = iv_no_ps
         IMPORTING
              we_order                     = a_trkorr
*            we_task                      = we_task
         TABLES
              wt_e071                      = lt_ko200
              wt_e071k                     = at_key
*            wt_tadir                     = tt_tadir
         EXCEPTIONS
              show_only_user_after_error   = 1
              cancel_edit_user_after_error = 2
              OTHERS                       = 2.

    IF sy-subrc NE 0.
      CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
           EXPORTING
                wi_order                     = a_wb_trkorr
                wi_with_dialog               = 'X'
                wi_send_message              = 'X'
*            iv_no_show_option            = iv_no_show_option
*            iv_no_standard_editor        = iv_no_standard_editor
*            iv_externalps                = iv_externalps
*            iv_externalid                = iv_externalid
*            iv_no_ps                     = iv_no_ps
           IMPORTING
                we_order                     = a_wb_trkorr
*            we_task                      = we_task
           TABLES
                wt_e071                      = lt_ko200
                wt_e071k                     = at_key
*            wt_tadir                     = tt_tadir
           EXCEPTIONS
                show_only_user_after_error   = 1
                cancel_edit_user_after_error = 2
                OTHERS                       = 2.
      IF sy-subrc NE 0.
        WRITE:/ 'Errore scrittura trkorr tabella', a_tabname.
      ENDIF.
    ENDIF.


    CLEAR:   as_obj,
             as_metahead,
             ar_typedescr,
             ar_tableline,
             a_tabname,
             at_key.
    REFRESH at_key.

  ENDMETHOD.


  METHOD: get_metahead.

* call dictionary interface
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname           = a_tabname
        all_types         = 'X'
*     LFIELDNAME        = ' '
*     GROUP_NAMES       = ' '
*     UCLEN             =
      IMPORTING
        x030l_wa          = as_metahead
*     DTELINFO_WA       =
*     TTYPINFO_WA       =
*     DDOBJTYPE         =
*     DFIES_WA          =
*     LINES_DESCR       =
*   TABLES
*     X031L_TAB         =
*     DFIES_TAB         =
      EXCEPTIONS
        not_found         = 1
        OTHERS            = 2
              .
    IF sy-subrc <> 0.
      p_error = 1.
    ENDIF.

  ENDMETHOD.

ENDCLASS.                    "lcl_tabu_k_2_trkorr_writer IMPLEMENTATION

START-OF-SELECTION.
  DATA l_cnt      TYPE i.
  DATA l_cnt_cid  TYPE i.

  CLEAR l_cnt.
  CLEAR l_cnt_cid.

  DATA lt_pcl1    TYPE TABLE OF pcl1.
  DATA ls_pcl1    TYPE pcl1.
  DATA lt_perio   TYPE TABLE OF ptrv_perio.
  DATA lt_head    TYPE TABLE OF ptrv_head.
  DATA ls_head    TYPE ptrv_head.
  DATA lt_tperio  TYPE TABLE OF ptrv_perio.
  DATA ls_perio   TYPE ptrv_perio.
  DATA l_error    TYPE i.
  DATA l_tabname1 TYPE tabname VALUE 'PCL1'.

  DATA lr_trkk TYPE REF TO lcl_tabu_k_2_trkorr_writer .



  IF lr_trkk IS INITIAL.
    CREATE OBJECT lr_trkk.
  ENDIF.

  LOOP AT cidreinr.

    cidreinr-low+18(1) = '%'.
    SELECT * FROM pcl1 APPENDING TABLE lt_pcl1 WHERE relid = 'TE' AND
                                                srtfd LIKE cidreinr-low.
    l_cnt = l_cnt + sy-dbcnt.

    SELECT * FROM ptrv_perio APPENDING TABLE lt_perio
                                      WHERE pernr = cidreinr-low+0(8)
                                        AND reinr = cidreinr-low+8(10).


    SELECT * FROM ptrv_head APPENDING TABLE lt_head
                                      WHERE pernr = cidreinr-low+0(8)
                                        AND reinr = cidreinr-low+8(10).

  ENDLOOP.

  lt_tperio = lt_perio.

  SORT lt_tperio BY pernr.

  DELETE ADJACENT DUPLICATES FROM lt_tperio COMPARING pernr.

  DESCRIBE TABLE lt_tperio LINES l_cnt_cid.

  l_tabname1 = 'PCL1'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_pcl1 INTO ls_pcl1.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_pcl1
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.

  l_tabname1 = 'PTRV_PERIO'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_perio INTO ls_perio.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_perio
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.


  l_tabname1 = 'PTRV_HEAD'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_head INTO ls_head.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_head
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.

END-OF-SELECTION.

  WRITE: / 'Elaborate', l_cnt, 'TRASFERTE'.
  WRITE: / 'Elaborati', l_cnt_cid, 'CID'.

*---------------------------------------------------------------------*
*       FORM select_tr_korr                                           *
*---------------------------------------------------------------------*
FORM select_tr_korr USING     p_uname p_type
                    CHANGING  p_korr.

  DATA lv_user TYPE trexreqhd-author.
  DATA ls_sel_korr TYPE   trexreqhd.
  DATA lv_selected_index TYPE sy-tabix.
  DATA lt_rem_trkorr_list TYPE STANDARD TABLE OF trexreqhd.

  lv_user = p_uname.

*  IF uname = sy-uname.
** Korrekturauftrag fьr Transportobjekte auswдhlen
*    CALL FUNCTION 'TR_ORDER_CHOICE_CORRECTION'
*         EXPORTING
*              iv_category            = p_type
*              iv_cli_dep             = ' '
*         IMPORTING
*              ev_order               = p_korr
**            ev_task                = we_task
*         EXCEPTIONS
*              invalid_category       = 1
*              no_correction_selected = 2
*              OTHERS                 = 3.
*
*    IF sy-subrc NE 0.
*      MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
*              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*    ENDIF.
*  ELSE.

  CALL FUNCTION 'TR_F4_REQUESTS'
   EXPORTING
     iv_username                   = uname
*   IV_TRKORR_PATTERN             =
*   IV_TRFUNCTIONS                =
*   IV_TRSTATUS                   =
*   IV_FROM_DATE                  =
*   IV_TO_DATE                    =
*   IV_CLIENT                     =
*   IV_PROJECT                    =
*   IV_TITLE                      =
*   IV_VIA_SELECTION_SCREEN       = 'X'
*   IV_COMPLETE_REQUESTS          = 'X'
   IMPORTING
     ev_selected_request           = p_korr
*   ES_SELECTED_REQUEST           =
            .
*  ENDIF.

ENDFORM.                    " SELECT_TR_KORR


One thing that is worth mentioning is that in order to write the TABU K into the transport request for a cluster table, it is not sufficient to cast the table line to X and to write the first N xchar to the key field where N is the key length from the DDIC meta-header.

You need to put a star in the seqnr field to that all cluster lines of the same srtfd key

Actually transferring only the first line would cause corrupt clusters, but the nice thing is that there is a check that does not allow you to write to a transport request a cluster table with a fully specified key. I really wonder about this. I would have expected to have corrupt clusters after the transport.

The obstacles:
On a dev system it works fine. On a production system not. Depending on the configuration.

I had once written on a production system to a transport request and it worked just fine so i was confident. But i was too much confident. And it was a mistake. Maybe it was a CUST request that worked, but this time it was a SYST request, and the TR_* functions do check whether the system is closed or not. So all the work done is useless.

Shall we stop in front of these obstacles? We could ask sysops to temporarily allow us to do it late in the evening when no one is working. But they are not very collaborative Wink And they are right. So you have to remember that you are superman… just kidding, but there was no time to make a RFC (again for the collaborative sysops it takes a week) or to put a program on the destination system (guess why i cannot Smile )

So I started debugging and found the include LSTR9U05 . It is very interesting.
Code:

FUNCTION tr_sys_params.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       EXPORTING
*"             VALUE(SYSTEMEDIT) LIKE  TADIR-EDTFLAG
*"             VALUE(SYSTEMNAME) LIKE  SY-SYSID
*"             VALUE(SYSTEMTYPE) LIKE  SY-SYSID
*"             VALUE(SYSTEM_CLIENT_EDIT) LIKE  T000-CCCORACTIV
*"             VALUE(SYS_CLIINDDEP_EDIT) LIKE  T000-CCNOCLIIND
*"             VALUE(SYSTEM_CLIENT_ROLE) LIKE  T000-CCCATEGORY
*"             VALUE(EV_C_SYSTEM) LIKE  TRPARI-S_CHECKED
*"       EXCEPTIONS
*"              NO_SYSTEMNAME
*"              NO_SYSTEMTYPE
*"----------------------------------------------------------------------
  DATA: gcon_tr_sys_params  TYPE context_tr_sys_params,
        lt_symsg            LIKE symsg OCCURS 0,
        ls_symsg            LIKE symsg,
        lv_use_context      TYPE c       VALUE 'X'.

  IF lv_use_context = 'X'.
*   use of context (with security mechanism)
*   Context buffer is implicitely client dependent, so we do not need to
*   set the client explicitely
    SUPPLY i_dummy = 'X' TO CONTEXT gcon_tr_sys_params.
    DEMAND  e_systemedit     = systemedit
            e_systemname     = systemname
            e_systemtype     = systemtype
            e_client_edit    = system_client_edit
            e_cliinddep_edit = sys_cliinddep_edit
            e_client_role    = system_client_role
                         FROM CONTEXT gcon_tr_sys_params
                         MESSAGES INTO lt_symsg.

    READ TABLE lt_symsg INDEX 1 INTO ls_symsg.
    IF sy-subrc   = 0                  "  ERROR OCCURED!!!!
    OR systemname = space.
      MESSAGE ID     ls_symsg-msgid
              TYPE   'I'               "ls_symsg-msgty
              NUMBER ls_symsg-msgno
              WITH   ls_symsg-msgv1 ls_symsg-msgv2
                     ls_symsg-msgv3 ls_symsg-msgv4.

      CALL FUNCTION 'TR_SYS_PARAMS_CONTEXT_MODULE'
           EXPORTING
                dummy            = 'X'
           IMPORTING
                systemedit       = systemedit
                systemname       = systemname
                systemtype       = systemtype
                system_client_ed = system_client_edit
                sys_cliinddep_ed = sys_cliinddep_edit
                system_client_ro = system_client_role
           EXCEPTIONS
                no_systemname    = 1
                no_systemtype    = 2.
      CASE sy-subrc.
        WHEN 1. current_message_raising no_systemname.
        WHEN 2. current_message_raising no_systemtype.
      ENDCASE.
    ENDIF.

  ELSE.                                "" old behaviour
    DATA: lv_len              TYPE i,
          ls_tadir            LIKE tadir,
          ls_t000             LIKE t000,
          lv_system_type      LIKE sy-sysid.

*** find system name **************************************************
    SELECT SINGLE * FROM tadir INTO ls_tadir
           WHERE pgmid     =  'HEAD'
           AND   object    =  'SYST'
           AND   obj_name  =  space.
    IF   sy-subrc  <>   0.
      MESSAGE e732(tk) RAISING no_systemname.
    ENDIF.

*** find system type **************************************************
    CALL 'C_SAPGPARAM'  ID 'NAME'  FIELD 'transport/systemtype'
                        ID 'VALUE' FIELD lv_system_type.
    IF   sy-subrc  <>   0.
      MESSAGE e105(tk)
              WITH     'transport/systemtype'
              RAISING  no_systemtype.
    ELSE.
      lv_len  =    strlen( ls_tadir-srcsystem ).
      IF   lv_len  <>   3.
        MESSAGE e842(tr)
                WITH    ls_tadir-srcsystem
                RAISING no_systemname.
      ENDIF.
    ENDIF.
    IF   sy-sysid  ><   ls_tadir-srcsystem.
      MESSAGE e732(tk) RAISING no_systemname.
    ENDIF.

    systemname = ls_tadir-srcsystem.
    systemedit = ls_tadir-edtflag.
    systemtype = lv_system_type.

*** development system for C-sources?
* IF ls_tadir-cproject(1) = 'C'.
*   ev_c_system = 'X'.
* ELSE.
    ev_c_system = ' '.
* ENDIF.


*** find client editable **********************************************
    IF system_client_edit IS REQUESTED
    OR sys_cliinddep_edit IS REQUESTED
    OR system_client_role IS REQUESTED.

      SELECT SINGLE * FROM t000 INTO ls_t000
                                WHERE mandt = sy-mandt.
      IF   sy-subrc  =  0.
        system_client_edit  =  ls_t000-cccoractiv.
        sys_cliinddep_edit  =  ls_t000-ccnocliind.
        system_client_role  =  ls_t000-cccategory.
      ELSE.
        system_client_edit  =  ' '.
        sys_cliinddep_edit  =  ' '.
        system_client_role  =  ' '.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFUNCTION.


The TR_SYS_PARAMS are stored in a context (SE33). When one logs on (I suppose or when the system starts) a generated function is called that calls TR_SYS_PARAMS_CONTEXT_MODULE. TR_SYS_PARAMS_CONTEXT_MODULE reads the T000 and a special TADIR line extracting the sysparams and putting them into the context. Then when the TR_SYS_PARAMS function is called the context is read.

Let’s recap where each parameter is stored:
Code:
   systemname = ls_tadir-srcsystem.  (PGMID = HEAD OBJECT = SYST
    systemedit = ls_tadir-edtflag.
    systemtype = lv_system_type. (from the parameter 'transport/systemtype')
    CALL 'C_SAPGPARAM'  ID 'NAME'  FIELD 'transport/systemtype'
                        ID 'VALUE' FIELD lv_system_type.
        system_client_edit  =  ls_t000-cccoractiv.
        sys_cliinddep_edit  =  ls_t000-ccnocliind.
        system_client_role  =  ls_t000-cccategory.


Overcoming the obstacles.

Now there are several hacks possible to bypass this check: Change T000 and TADIR (key HEAD SYST) (this is the mysterious place where it is written whether a system can be modified or not!!! I was looking for it since a long time). Or simply hack the TR_SYS_PARAMS in order to return the wanted parameters.

I choose the last one. Run a program
Code:
*
*Copyright (C) 2005  Krapinskij ([email protected])
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or (at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*
REPORT zupload_code .

PARAMETERS: pfile TYPE rlgrap-filename DEFAULT 'c:\code.txt'.
PARAMETERS: progr TYPE programm DEFAULT 'Z_CODE'.

TYPES t_code(72) TYPE c.

DATA lt_code TYPE TABLE OF t_code.


START-OF-SELECTION.

  CALL FUNCTION 'HR_99S_UPLOAD'
   EXPORTING
   p_initial_directory         = ''
     p_filename                  = pfile
*   DEFAULT_EXTENSION           =
*   P_FILETYPE_NO_SHOW          = ' '
*   P_FILETYPE                  = 'ASC'
     p_fsdialog                  = ' '
*   P_ITEM                      = ' '
*   P_HAS_FIELD_SEPARATOR       = ' '
* IMPORTING
*   P_FILELENGTH                =
    TABLES
      data_tab                    = lt_code
   EXCEPTIONS
     upload_error                = 1
     OTHERS                      = 2
            .
  IF sy-subrc <> 0.
    WRITE: / 'Error in upload'.
    EXIT.
  ENDIF.

  INSERT REPORT progr FROM lt_code.

  IF sy-subrc <> 0.
    WRITE: / 'Error in insert'.
    EXIT.
  ENDIF.

that overwrites LSTR9U05 with this one LSTR9U05-mod.
Code:

FUNCTION tr_sys_params.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       EXPORTING
*"             VALUE(SYSTEMEDIT) LIKE  TADIR-EDTFLAG
*"             VALUE(SYSTEMNAME) LIKE  SY-SYSID
*"             VALUE(SYSTEMTYPE) LIKE  SY-SYSID
*"             VALUE(SYSTEM_CLIENT_EDIT) LIKE  T000-CCCORACTIV
*"             VALUE(SYS_CLIINDDEP_EDIT) LIKE  T000-CCNOCLIIND
*"             VALUE(SYSTEM_CLIENT_ROLE) LIKE  T000-CCCATEGORY
*"             VALUE(EV_C_SYSTEM) LIKE  TRPARI-S_CHECKED
*"       EXCEPTIONS
*"              NO_SYSTEMNAME
*"              NO_SYSTEMTYPE
*"----------------------------------------------------------------------
  DATA: gcon_tr_sys_params  TYPE context_tr_sys_params,
        lt_symsg            LIKE symsg OCCURS 0,
        ls_symsg            LIKE symsg,
        lv_use_context      TYPE c       VALUE 'X'.

  IF lv_use_context = 'X'.
*   use of context (with security mechanism)
*   Context buffer is implicitely client dependent, so we do not need to
*   set the client explicitely
    SUPPLY i_dummy = 'X' TO CONTEXT gcon_tr_sys_params.
    DEMAND  e_systemedit     = systemedit
            e_systemname     = systemname
            e_systemtype     = systemtype
            e_client_edit    = system_client_edit
            e_cliinddep_edit = sys_cliinddep_edit
            e_client_role    = system_client_role
                         FROM CONTEXT gcon_tr_sys_params
                         MESSAGES INTO lt_symsg.

    READ TABLE lt_symsg INDEX 1 INTO ls_symsg.
    IF sy-subrc   = 0                  "  ERROR OCCURED!!!!
    OR systemname = space.
      MESSAGE ID     ls_symsg-msgid
              TYPE   'I'               "ls_symsg-msgty
              NUMBER ls_symsg-msgno
              WITH   ls_symsg-msgv1 ls_symsg-msgv2
                     ls_symsg-msgv3 ls_symsg-msgv4.

      CALL FUNCTION 'TR_SYS_PARAMS_CONTEXT_MODULE'
           EXPORTING
                dummy            = 'X'
           IMPORTING
                systemedit       = systemedit
                systemname       = systemname
                systemtype       = systemtype
                system_client_ed = system_client_edit
                sys_cliinddep_ed = sys_cliinddep_edit
                system_client_ro = system_client_role
           EXCEPTIONS
                no_systemname    = 1
                no_systemtype    = 2.
      CASE sy-subrc.
        WHEN 1. current_message_raising no_systemname.
        WHEN 2. current_message_raising no_systemtype.
      ENDCASE.
    ENDIF.

  ELSE.                                "" old behaviour
    DATA: lv_len              TYPE i,
          ls_tadir            LIKE tadir,
          ls_t000             LIKE t000,
          lv_system_type      LIKE sy-sysid.

*** find system name **************************************************
    SELECT SINGLE * FROM tadir INTO ls_tadir
           WHERE pgmid     =  'HEAD'
           AND   object    =  'SYST'
           AND   obj_name  =  space.
    IF   sy-subrc  <>   0.
      MESSAGE e732(tk) RAISING no_systemname.
    ENDIF.

*** find system type **************************************************
    CALL 'C_SAPGPARAM'  ID 'NAME'  FIELD 'transport/systemtype'
                        ID 'VALUE' FIELD lv_system_type.
    IF   sy-subrc  <>   0.
      MESSAGE e105(tk)
              WITH     'transport/systemtype'
              RAISING  no_systemtype.
    ELSE.
      lv_len  =    strlen( ls_tadir-srcsystem ).
      IF   lv_len  <>   3.
        MESSAGE e842(tr)
                WITH    ls_tadir-srcsystem
                RAISING no_systemname.
      ENDIF.
    ENDIF.
    IF   sy-sysid  ><   ls_tadir-srcsystem.
      MESSAGE e732(tk) RAISING no_systemname.
    ENDIF.

    systemname = ls_tadir-srcsystem.
    systemedit = ls_tadir-edtflag.
    systemtype = lv_system_type.

*** development system for C-sources?
* IF ls_tadir-cproject(1) = 'C'.
*   ev_c_system = 'X'.
* ELSE.
    ev_c_system = ' '.
* ENDIF.


*** find client editable **********************************************
    IF system_client_edit IS REQUESTED
    OR sys_cliinddep_edit IS REQUESTED
    OR system_client_role IS REQUESTED.

      SELECT SINGLE * FROM t000 INTO ls_t000
                                WHERE mandt = sy-mandt.
      IF   sy-subrc  =  0.
        system_client_edit  =  ls_t000-cccoractiv.
        sys_cliinddep_edit  =  ls_t000-ccnocliind.
        system_client_role  =  ls_t000-cccategory.
      ELSE.
        system_client_edit  =  ' '.
        sys_cliinddep_edit  =  ' '.
        system_client_role  =  ' '.
      ENDIF.
    ENDIF.
  ENDIF.
 
 
                systemedit         = 'C'.
*               systemname         = systemname.
                systemtype         = 'CUSTOMER'.
                system_client_edit = 1.
                sys_cliinddep_edit = space.
                system_client_role = 'C'.

ENDFUNCTION.


Then run the program
Code:

*
*Copyright (C) 2006  Krapinskij ([email protected])
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or (at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

*REPORT  z_trv_2_cr                 .

TABLES: t777d, pcl1.


PARAMETERS:     wbtrkorr TYPE trkorr.
*Here put the pernr concateneted with the trip number
SELECT-OPTIONS: cidreinr FOR pcl1-srtfd.

DATA     uname     TYPE sy-uname.


INITIALIZATION.
  uname = sy-uname.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR wbtrkorr.

  PERFORM select_tr_korr USING uname 'SYST' CHANGING wbtrkorr.


*---------------------------------------------------------------------*
*       CLASS lcl_tabu_k_2_trkorr_writer DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_tabu_k_2_trkorr_writer DEFINITION.
  PUBLIC SECTION.


* gets the name of the receiver given the temse file type.
    METHODS: init    IMPORTING p_trkorr        TYPE trkorr
                               p_wb_trkorr     TYPE trkorr
                               p_tabname       TYPE tabname
                     CHANGING  p_error         TYPE i.

    METHODS: write_to_trkorr     CHANGING p_error TYPE i.

    METHODS: add_line_key IMPORTING p_line     TYPE any
                          CHANGING  p_error TYPE i .
    METHODS: add_object   IMPORTING pgmid     TYPE pgmid
                                    object    TYPE trobjtype
                                    obj_name  TYPE trobj_name
                                    p_trkorr  TYPE trkorr
                          CHANGING  p_error TYPE i .
    METHODS: add_star_key CHANGING  p_error TYPE i .

    METHODS: get_metahead CHANGING p_error TYPE i.

  PRIVATE SECTION.

    DATA: a_trkorr        TYPE trkorr.
    DATA: a_wb_trkorr     TYPE trkorr.
    DATA: as_obj          TYPE LINE OF tredt_objects.
    DATA: as_metahead     TYPE x030l.
    DATA: a_tabname       TYPE tabname.
    DATA: ar_typedescr    TYPE REF TO cl_abap_typedescr.
    DATA: ar_tableline    TYPE REF TO data.
    DATA: at_key          TYPE tredt_keys.


ENDCLASS.                    "DEFINITION


*---------------------------------------------------------------------*
*       CLASS lcl_tabu_k_2_trkorr_writer IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_tabu_k_2_trkorr_writer IMPLEMENTATION.


  METHOD: init.

    CLEAR:   as_obj,
             as_metahead,
             ar_typedescr,
             ar_tableline,
             a_tabname,
             at_key.
    FREE at_key.

    a_trkorr     = p_trkorr.
    a_wb_trkorr  = p_wb_trkorr.
    a_tabname    = p_tabname.

    CALL METHOD get_metahead CHANGING p_error = p_error.

  ENDMETHOD.

  METHOD: add_object.
*                          IMPORTING pgmid     TYPE pgmid
*                                    object    type TROBJTYPE
*                                    obj_name  type TROBJ_NAME
*                                    p_trkorr  type trkorr
*                          CHANGING  p_error TYPE i .

    as_obj-trkorr   = p_trkorr.
    as_obj-pgmid    = pgmid.
    as_obj-object   = object.
    as_obj-obj_name = obj_name.
    as_obj-objfunc  = space.


  ENDMETHOD.

  METHOD: add_star_key.
* MAKE TABU *
    DATA: ls_key          TYPE LINE OF tredt_keys.

* Transport object
    as_obj-trkorr   = a_trkorr.
    as_obj-pgmid    = 'R3TR'.
    as_obj-object   = 'TABU'.
    as_obj-obj_name = as_metahead-tabname.
    as_obj-objfunc  = 'K'.

* Initialize entry for table key transport
    MOVE-CORRESPONDING as_obj TO ls_key.
    ls_key-objname    = as_obj-obj_name.
    ls_key-objfunc    = space.
    ls_key-mastername = as_obj-obj_name.
    ls_key-mastertype = as_obj-object.
    ls_key-tabkey     = '*'.


*   Insert key of tableline into transport request
    INSERT ls_key INTO TABLE at_key.
  ENDMETHOD.

  METHOD: add_line_key.
*MAKE TABU K
    FIELD-SYMBOLS:
      <ls_tableline>  TYPE ANY,
      <lv_xtableline> TYPE x,
      <lv_xtabkey>    TYPE x.

    DATA: ls_key          TYPE LINE OF tredt_keys.

*4.7 Only
* Get metadata of the linetype of the given table
*  lo_typedescr = cl_abap_typedescr=>describe_by_data(
*      p_data = line ).
*  CALL METHOD lo_typedescr->get_ddic_header
*    RECEIVING
*      p_header = ls_metahead
*    EXCEPTIONS
*      OTHERS   = 1.
*  IF sy-subrc <> 0.
*    pv_error = 1.
*    EXIT.
*  ENDIF.

* Transport object
    as_obj-trkorr   = a_trkorr.
    as_obj-pgmid    = 'R3TR'.
    as_obj-object   = 'TABU'.
    as_obj-obj_name = as_metahead-tabname.
    as_obj-objfunc  = 'K'.

* Initialize entry for table key transport
    MOVE-CORRESPONDING as_obj TO ls_key.
    ls_key-objname    = as_obj-obj_name.
    ls_key-objfunc    = space.
    ls_key-mastername = as_obj-obj_name.
    ls_key-mastertype = as_obj-object.


*   Extract tablekey
    CLEAR ls_key-tabkey.
    ASSIGN ls_key-tabkey TO <lv_xtabkey> CASTING.

*   If table has fields of type STRING or RAWSTRING, casting to type
*   'X' is not possible -> generic solution unknown -> indiv. handling
    CASE as_metahead-tabname.
      WHEN 'PCL2' OR 'PCL1'.
        DATA l_key(46) TYPE c.
        l_key+0(45) = p_line.
        l_key+45(1) = '*'.
        ASSIGN l_key TO <lv_xtableline> CASTING.
        <lv_xtabkey>(46) = <lv_xtableline>(46).
        INSERT ls_key INTO TABLE at_key.
        EXIT.
      WHEN OTHERS.
        ASSIGN p_line TO <lv_xtableline> CASTING.
    ENDCASE.

*   Copy key prefix
    <lv_xtabkey>(as_metahead-keylen) = <lv_xtableline>.

*   Insert key of tableline into transport request
    INSERT ls_key INTO TABLE at_key.
  ENDMETHOD.


  METHOD: write_to_trkorr.
    DATA lt_ko200 TYPE TABLE OF ko200.
    DATA ls_e071 TYPE e071.

    IF as_obj IS INITIAL.
      EXIT.
    ENDIF.

    IF as_obj-objfunc = 'K' AND
       at_key IS INITIAL.
      EXIT.
    ENDIF.

    APPEND as_obj TO lt_ko200.

** Check data for transport request
* Add data to transport request
    CALL FUNCTION 'TR_OBJECTS_CHECK'
         TABLES
              wt_ko200 = lt_ko200
              wt_e071k = at_key
         EXCEPTIONS
              OTHERS   = 1.


*This one swallows correction requests too
    CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
         EXPORTING
              wi_order                     = a_trkorr
              wi_with_dialog               = 'X' "'D'
              wi_send_message              = 'X' "' '
*            iv_no_show_option            = iv_no_show_option
*            iv_no_standard_editor        = iv_no_standard_editor
*            iv_externalps                = iv_externalps
*            iv_externalid                = iv_externalid
*            iv_no_ps                     = iv_no_ps
         IMPORTING
              we_order                     = a_trkorr
*            we_task                      = we_task
         TABLES
              wt_e071                      = lt_ko200
              wt_e071k                     = at_key
*            wt_tadir                     = tt_tadir
         EXCEPTIONS
              show_only_user_after_error   = 1
              cancel_edit_user_after_error = 2
              OTHERS                       = 2.

    IF sy-subrc NE 0.
      CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
           EXPORTING
                wi_order                     = a_wb_trkorr
                wi_with_dialog               = 'X'
                wi_send_message              = 'X'
*            iv_no_show_option            = iv_no_show_option
*            iv_no_standard_editor        = iv_no_standard_editor
*            iv_externalps                = iv_externalps
*            iv_externalid                = iv_externalid
*            iv_no_ps                     = iv_no_ps
           IMPORTING
                we_order                     = a_wb_trkorr
*            we_task                      = we_task
           TABLES
                wt_e071                      = lt_ko200
                wt_e071k                     = at_key
*            wt_tadir                     = tt_tadir
           EXCEPTIONS
                show_only_user_after_error   = 1
                cancel_edit_user_after_error = 2
                OTHERS                       = 2.
      IF sy-subrc NE 0.
        WRITE:/ 'Errore scrittura trkorr tabella', a_tabname.
      ENDIF.
    ENDIF.


    CLEAR:   as_obj,
             as_metahead,
             ar_typedescr,
             ar_tableline,
             a_tabname,
             at_key.
    REFRESH at_key.

  ENDMETHOD.


  METHOD: get_metahead.

* call dictionary interface
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname           = a_tabname
        all_types         = 'X'
*     LFIELDNAME        = ' '
*     GROUP_NAMES       = ' '
*     UCLEN             =
      IMPORTING
        x030l_wa          = as_metahead
*     DTELINFO_WA       =
*     TTYPINFO_WA       =
*     DDOBJTYPE         =
*     DFIES_WA          =
*     LINES_DESCR       =
*   TABLES
*     X031L_TAB         =
*     DFIES_TAB         =
      EXCEPTIONS
        not_found         = 1
        OTHERS            = 2
              .
    IF sy-subrc <> 0.
      p_error = 1.
    ENDIF.

  ENDMETHOD.

ENDCLASS.                    "lcl_tabu_k_2_trkorr_writer IMPLEMENTATION

START-OF-SELECTION.
  DATA l_cnt      TYPE i.
  DATA l_cnt_cid  TYPE i.

  CLEAR l_cnt.
  CLEAR l_cnt_cid.

  DATA lt_pcl1    TYPE TABLE OF pcl1.
  DATA ls_pcl1    TYPE pcl1.
  DATA lt_perio   TYPE TABLE OF ptrv_perio.
  DATA lt_head    TYPE TABLE OF ptrv_head.
  DATA ls_head    TYPE ptrv_head.
  DATA lt_tperio  TYPE TABLE OF ptrv_perio.
  DATA ls_perio   TYPE ptrv_perio.
  DATA l_error    TYPE i.
  DATA l_tabname1 TYPE tabname VALUE 'PCL1'.

  DATA lr_trkk TYPE REF TO lcl_tabu_k_2_trkorr_writer .



  IF lr_trkk IS INITIAL.
    CREATE OBJECT lr_trkk.
  ENDIF.

  LOOP AT cidreinr.

    cidreinr-low+18(1) = '%'.
    SELECT * FROM pcl1 APPENDING TABLE lt_pcl1 WHERE relid = 'TE' AND
                                                srtfd LIKE cidreinr-low.
    l_cnt = l_cnt + sy-dbcnt.

    SELECT * FROM ptrv_perio APPENDING TABLE lt_perio
                                      WHERE pernr = cidreinr-low+0(8)
                                        AND reinr = cidreinr-low+8(10).


    SELECT * FROM ptrv_head APPENDING TABLE lt_head
                                      WHERE pernr = cidreinr-low+0(8)
                                        AND reinr = cidreinr-low+8(10).

  ENDLOOP.

  lt_tperio = lt_perio.

  SORT lt_tperio BY pernr.

  DELETE ADJACENT DUPLICATES FROM lt_tperio COMPARING pernr.

  DESCRIBE TABLE lt_tperio LINES l_cnt_cid.

  l_tabname1 = 'PCL1'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_pcl1 INTO ls_pcl1.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_pcl1
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.

  l_tabname1 = 'PTRV_PERIO'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_perio INTO ls_perio.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_perio
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.


  l_tabname1 = 'PTRV_HEAD'.
  CALL METHOD lr_trkk->init EXPORTING p_trkorr    = wbtrkorr
                                      p_wb_trkorr = wbtrkorr
                                      p_tabname   = l_tabname1
                            CHANGING  p_error     = l_error.



  LOOP AT lt_head INTO ls_head.

    CALL METHOD lr_trkk->add_line_key
                             EXPORTING  p_line         = ls_head
                              CHANGING  p_error        = l_error .
  ENDLOOP.

  IF sy-subrc EQ 0.
    CALL METHOD lr_trkk->write_to_trkorr CHANGING p_error = l_error.
    COMMIT WORK.
  ENDIF.

END-OF-SELECTION.

  WRITE: / 'Elaborate', l_cnt, 'TRASFERTE'.
  WRITE: / 'Elaborati', l_cnt_cid, 'CID'.

*---------------------------------------------------------------------*
*       FORM select_tr_korr                                           *
*---------------------------------------------------------------------*
FORM select_tr_korr USING     p_uname p_type
                    CHANGING  p_korr.

  DATA lv_user TYPE trexreqhd-author.
  DATA ls_sel_korr TYPE   trexreqhd.
  DATA lv_selected_index TYPE sy-tabix.
  DATA lt_rem_trkorr_list TYPE STANDARD TABLE OF trexreqhd.

  lv_user = p_uname.

*  IF uname = sy-uname.
** Korrekturauftrag fьr Transportobjekte auswдhlen
*    CALL FUNCTION 'TR_ORDER_CHOICE_CORRECTION'
*         EXPORTING
*              iv_category            = p_type
*              iv_cli_dep             = ' '
*         IMPORTING
*              ev_order               = p_korr
**            ev_task                = we_task
*         EXCEPTIONS
*              invalid_category       = 1
*              no_correction_selected = 2
*              OTHERS                 = 3.
*
*    IF sy-subrc NE 0.
*      MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
*              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*    ENDIF.
*  ELSE.

  CALL FUNCTION 'TR_F4_REQUESTS'
   EXPORTING
     iv_username                   = uname
*   IV_TRKORR_PATTERN             =
*   IV_TRFUNCTIONS                =
*   IV_TRSTATUS                   =
*   IV_FROM_DATE                  =
*   IV_TO_DATE                    =
*   IV_CLIENT                     =
*   IV_PROJECT                    =
*   IV_TITLE                      =
*   IV_VIA_SELECTION_SCREEN       = 'X'
*   IV_COMPLETE_REQUESTS          = 'X'
   IMPORTING
     ev_selected_request           = p_korr
*   ES_SELECTED_REQUEST           =
            .
*  ENDIF.

ENDFORM.                    " SELECT_TR_KORR

to write the TRV data to the transport request, and finally I put the LSTR9U05 back to the original.

And voila’ the transport request is full of precious TRV data.

Now downloading the data and cofiles from R/3 is easy, and importing in the destination system is also easy.


Conclusion.

The Travel expenses (provided the customizing in the systems is identical) can be transported from one system to the other, by verbatim copying of three tables. Transporting these data from one production system to the other however can be tricky… if you use the procedure i used. A better solution (not really a 50 lines one) could be to extend the HRMD_A message type adding the TRV cluster and table data… and transfer this data via ALE.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.