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

Show Transport Request Moved from Dev System



 
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: Tue Jan 15, 2008 4:20 pm    Post subject: Show Transport Request Moved from Dev System Reply with quote

Checking Transport Request from Dev System - Moved to Other Systems

This program is for checking the Transport Requests moved to Other Systems from Development System with the execution of program in SE38 of the Dev System.
The list is displayed in ALV format and one can know the status of a Transport Request. The concept of RFC comes into picture wherein the Function Module TMS_TM_GET_TRLIST is been used for the retrieval of the status of the Request Numbers.
On the selection screen the variables like Request/task & Type of Request/task & Status of Request/task & Request or task category are been declared as Select-Options.
Code:
SELECT-OPTIONS:
  s_trkorr for e070-trkorr,
  s_trfunc for e070-trfunction,
  s_trstat for e070-trstatus,
  s_kdev for e070-korrdev.

Various additional variables & field-symbols & internal tables need to be declared for use within the program.
1) Using Select statement the Transport Request details are been fetched from database based on the Selection-Screen details.
2) The field catalog list should be prepared for various fields which will be used at the time of displaying the report.
3) The code for the same is as below:
Code:
SELECT a~trkorr b~as4text a~trfunction a~trstatus a~korrdev a~as4user a~as4date a~as4time
       c~mandt c~sourcemand c~tstamp c~final_stat
FROM e070 AS a JOIN e07t AS b ON a~trkorr = b~trkorr AND b~langu = syst-langu
LEFT OUTER JOIN cccflow AS c ON a~trkorr = c~comfile
INTO CORRESPONDING FIELDS OF TABLE i_getlist
WHERE a~trkorr IN s_trkorr
AND a~trfunction IN s_trfunc
AND a~trstatus IN s_trstat
AND a~korrdev IN s_kdev
AND a~strkorr = space.


5) A perform statement needs to be used for each and every system which needs to be checked for getting the data. I will be showing the code for 1 System and the same needs to be implemented for the rest of the Systems.

Code:
PERFORM f_get_pr1history
USING 'PR1CLNT100' 'PR1' 'DOMAIN_DR1'
CHANGING i_tmstpalogs1.


7) This perform will have the code as shown below.
Code:

FORM f_get_pr1history
  USING p_destination p_system p_domain
  CHANGING pi_tmstpalogs.
  DATA: l_startdate TYPE d VALUE '20040101'.
  CALL FUNCTION 'TMS_TM_GET_TRLIST'
    EXPORTING
      iv_system    = p_system
      iv_domain    = p_domain
      iv_startdate = l_startdate
      iv_starttime = syst-uzeit
      iv_enddate   = syst-datum
      iv_endtime   = syst-uzeit
      iv_allcli    = 'X'
      iv_imports   = 'X'
    IMPORTING
      et_tmstpalog = pi_tmstpalogs.
  SORT i_tmstpalogs DESCENDING.
ENDFORM. " f_get_pr1history

9) The data fetched needs to be collect into the catalog list which is used for display purposes. The code for collecting the data is shown below using PERFORM f_collect_translist.

Code:
FORM f_collect_translist .
  FIELD-SYMBOLS: <fs_wa_translist>,
  <fs_wa_translist_hdr>,
  <fs_wa_translist_det>,
  <fs_wa_translist_pr1>,
  <fs_wa_translist_comp>,
  <fs_tstamp>,
  <fs_status>,
  <fs_tstamp1>,
  <fs_status1>,
  <fs_compare> TYPE ANY.
  DATA: f_tstamp(30) TYPE c,
  f_status(30) TYPE c,
  f_tstamp1(30) TYPE c,
  f_status1(30) TYPE c,
  wa_pr1log LIKE tmstpalog,
  v_len TYPE i.
  ASSIGN LOCAL COPY OF INITIAL LINE OF <fs_table_translist>
  TO <fs_wa_translist>.
  ASSIGN LOCAL COPY OF INITIAL LINE OF lt;fs_table_translist_hdr>
  TO <fs_wa_translist_hdr>.
  ASSIGN LOCAL COPY OF INITIAL LINE OF lt;fs_table_translist_det>
  TO <fs_wa_translist_det>.
  ASSIGN LOCAL COPY OF INITIAL LINE OF lt;fs_table_translist_pr1>
  TO <fs_wa_translist_pr1>.
  ASSIGN LOCAL COPY OF INITIAL LINE OF lt;fs_table_translist_comp>
  TO <fs_wa_translist_comp>.
  ASSIGN LOCAL COPY OF INITIAL LINE OF <fs_table_translist_pr1_user>
  TO <fs_wa_translist_pr1_user>.
  SORT i_getlist.
  LOOP AT i_getlist.
    AT NEW trkorr.
      CLEAR: <fs_wa_translist_hdr>,
      <fs_wa_translist_det>,
      <fs_wa_translist_pr1>,
      <fs_wa_translist_comp>,
      f_result,
      c_flag.
    ENDAT.
    SELECT SINGLE name_text FROM v_username
    INTO i_getlist-name_text
    WHERE bname = i_getlist-as4user
    IF syst-subrc NE 0.

    SELECT SINGLE name_text FROM v_username CLIENT SPECIFIED
    INTO i_getlist-name_text
    WHERE bname = i_getlist-as4user
    AND mandt = i_getlist-sourcemand.
  ENDIF.
  MOVE-CORRESPONDING i_getlist TO <fs_wa_translist_hdr>.
  CONCATENATE i_getlist-mandt '-TSTAMP'
  INTO f_tstamp.
  CONCATENATE i_getlist-mandt '-STATUS'
  INTO f_status.
  ASSIGN COMPONENT f_tstamp OF STRUCTURE <fs_wa_translist_det>
  TO <fs_tstamp>.
  ASSIGN COMPONENT f_status OF STRUCTURE <fs_wa_translist_det>
  TO <fs_status>.
  IF NOT i_getlist-tstamp IS INITIAL.
    <fs_tstamp> = i_getlist-tstamp.
  ENDIF.
  IF NOT i_getlist-final_stat IS INITIAL.
    <fs_status> = i_getlist-final_stat.
  ENDIF.
  CLEAR wa_pr1log.
  READ TABLE i_tmstpalogs1 INTO wa_pr1log
  WITH KEY trkorr = i_getlist-trkorr
  trcli = '100'.
  IF sy-subrc = 0.
    CONCATENATE 'PR1' '-TSTAMP'
    INTO f_tstamp.
    CONCATENATE 'PR1' '-STATUS'
    INTO f_status.
    ASSIGN COMPONENT f_tstamp OF STRUCTURE <fs_wa_translist_pr1>
    TO <fs_tstamp>.
    ASSIGN COMPONENT f_status OF STRUCTURE <fs_wa_translist_pr1>
    TO <fs_status>.
    IF NOT wa_pr1log-trtime IS INITIAL.
      <fs_tstamp> = wa_pr1log-trtime.
    ENDIF.
    IF NOT wa_pr1log-retcode IS INITIAL.
      <fs_status> = wa_pr1log-retcode.
    ENDIF.
  ENDIF.
  DATA : name_pr1 LIKE v_username-name_text.
  CLEAR name_pr1.
  ASSIGN COMPONENT 'USERMOVEDTOPR1' OF STRUCTURE
  <fs_wa_translist_pr1_user> TO <fs_pr1_user>.
  SELECT SINGLE name_text FROM v_username
  INTO name_pr1
  WHERE bname = wa_pr1log-admin.
  IF syst-subrc NE 0.
    SELECT SINGLE name_text FROM v_username CLIENT SPECIFIED
    INTO name_pr1
    WHERE bname = wa_pr1log-admin
    AND mandt = i_getlist-sourcemand.
    IF syst-subrc NE 0.
      name_pr1 = wa_pr1log-admin.
    ENDIF.
  ENDIF.
  <fs_pr1_user> = name_pr1.
  MOVE <fs_pr1_user> TO <fs_wa_translist_pr1_user>.
  AT END OF trkorr.
    MOVE-CORRESPONDING <fs_wa_translist_hdr> TO <fs_wa_translist>.
    MOVE-CORRESPONDING <fs_wa_translist_det> TO <fs_wa_translist>.
    MOVE-CORRESPONDING <fs_wa_translist_pr1> TO <fs_wa_translist>.
    MOVE-CORRESPONDING <fs_wa_translist_comp> TO <fs_wa_translist>.
    APPEND <fs_wa_translist> TO <fs_table_translist>.
  ENDAT.
ENDLOOP.
ENDFORM. "f_collect_translist

10) The final data is stored in the Internal table <fs_table_translist>. This will be displayed by calling screen 9010. The PF-Status is been set for 9010. The data is been called by creating the layout set for the first time. The code is as below.
Code:
MODULE m_display_data OUTPUT.
  IF custcontnr_flresults IS INITIAL.
    grid_layout-sel_mode = 'C'.
    grid_layout-cwidth_opt = 'X'.
    CREATE OBJECT custcontnr_flresults
    EXPORTING container_name = contnr_flresults.
    CREATE OBJECT grid_flresults
    EXPORTING i_parent = custcontnr_flresults.
    CALL METHOD grid_flresults->set_table_for_first_display
      EXPORTING
        is_layout       = grid_layout
      CHANGING
        it_outtab       = <fs_table_translist>[]
        it_fieldcatalog = i_fldcat_translist[].
  ENDIF.
ENDMODULE. " m_display_data OUTPUT

11) This way we can check for any number of systems just adding the required code in the various Performs.
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.