cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Transport Request List from Clients

Former Member
0 Kudos

Hi,

I need to fetch all the transport request list which exist in other clients from development client. Is there any function module to fetch the data.

Can someone provide me the code so that it will be useful for coding in my program.

People will be rewarded for the solution which helps me a lot.

Thanks,

Jyothi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This question was long back shown on the SDN. It can be serached within SDN. Still, here is the function module which can be used to fetch the transport request list.

Use FM 'TMS_TM_GET_TRLIST.

CALL FUNCTION 'TMS_TM_GET_TRLIST'

EXPORTING

IV_SYSTEM = <Client>

IV_DOMAIN = <Client Domain>

IV_STARTDATE = <Start Date>

IV_STARTTIME = <Start Time>

IV_ENDDATE = <End Date>

IV_ENDTIME = <End Time>

IV_ALLCLI = 'X'

IV_IMPORTS = 'X'

IMPORTING

ET_TMSTPALOG = <int'table>

EXCEPTIONS

ALERT = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

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

ENDIF.

The <int'table> will have all the transport request list of the corresponding client.

This can be run from development system.

Pl. award appropriate points if it helps u.

Answers (1)

Answers (1)

FredericGirod
Active Contributor
0 Kudos

Hi,

You will like the french comment



*----------------------------------------------------------------------*
*   Procédure P_FIND_DATA.                                             *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
form p_find_data.


  data : it_request     type tmsiqreqs ,
         it_tmp_request type tmsiqreqs with header line ,
         it_e070        type sorted table of e070
                             with header line
                             with unique key trkorr .
  data : begin of it_trfunction occurs 10 ,
           domvalue_l type domvalue_l ,
           ddtext     type val_text ,
         end   of it_trfunction ,
         begin of it_trstatus occurs 10 ,
           domvalue_l type domvalue_l ,
           ddtext     type val_text ,
         end   of it_trstatus ,
         begin of it_trimpflg occurs 10 ,
           domvalue_l type domvalue_l ,
           ddtext     type val_text ,
         end   of it_trimpflg .




* Recherche des données sur le système C27.
  call function 'TMS_UIQ_IQD_READ_QUEUE'
    exporting
      iv_system               = 'C27'
      iv_domain               = 'DOMAIN_D27'
    importing
      et_requests             = it_request.

  it_tmp_request[] = it_request[].
  loop at it_tmp_request
       where owner  in s_bname
       and   trkorr in s_trkorr.
    move-corresponding it_tmp_request to it_data.
    move : it_tmp_request-sysnam to it_data-csysnam ,
           it_tmp_request-impflg to it_data-cimpflg ,
           it_tmp_request-maxrc  to it_data-cmaxrc .
    append it_data.
    clear  it_data.
  endloop.
* Tri.
  sort it_data.


* Recherche des données sur le système P27.
  refresh : it_tmp_request, it_request.
  call function 'TMS_UIQ_IQD_READ_QUEUE'
    exporting
      iv_system               = 'P27'
      iv_domain               = 'DOMAIN_D27'
    importing
      et_requests             = it_request.

  it_tmp_request[] = it_request[].
  loop at it_tmp_request
       where owner  in s_bname
       and   trkorr in s_trkorr.
    read table it_data
         with key trkorr = it_tmp_request-trkorr.
    if sy-subrc eq space.
      move : it_tmp_request-sysnam to it_data-psysnam ,
             it_tmp_request-impflg to it_data-pimpflg ,
             it_tmp_request-maxrc  to it_data-pmaxrc .
      modify it_data
             transporting : psysnam pimpflg pmaxrc
             where trkorr = it_tmp_request-trkorr.
    else.
      move-corresponding it_tmp_request to it_data.
      move : it_tmp_request-sysnam to it_data-psysnam ,
             it_tmp_request-impflg to it_data-pimpflg ,
             it_tmp_request-maxrc  to it_data-pmaxrc .
      append it_data.
      clear  it_data.
    endif.
  endloop.


* Recherche des données générales sur l'ordre.
  select trkorr trfunction trstatus as4user as4date as4time
         into corresponding fields of table it_e070
         from e070
         where as4user in s_bname
         and   strkorr eq space
         and   trkorr  in s_trkorr.

* Recherches des textes desciptifs.
  select domvalue_l ddtext
         into table it_trfunction
         from dd07t
         where domname    eq 'TRFUNCTION'
         and   ddlanguage eq sy-langu.
  select domvalue_l ddtext
         into table it_trstatus
         from dd07t
         where domname    eq 'TRSTATUS'
         and   ddlanguage eq sy-langu.
  select domvalue_l ddtext
         into table it_trimpflg
         from dd07t
         where domname    eq 'TRTPIMPFLG'
         and   ddlanguage eq sy-langu.


* Enregistre les informations dans la table IT_DATA.
  loop at it_data.
    read table it_e070
         with key trkorr = it_data-trkorr.
    if sy-subrc eq space.
*     Recherche libelle du code TRFUNCTION.
      read table it_trfunction
           with key domvalue_l = it_e070-trfunction.
      if sy-subrc eq space.
        move it_trfunction-ddtext to it_data-trfunctiont.
      endif.
*     Recherche libelle du code TRSTATUS.
      read table it_trstatus
           with key domvalue_l = it_e070-trstatus.
      if sy-subrc eq space.
        move it_trstatus-ddtext to it_data-trstatust.
      endif.
*     Recherche libelle du code CIMPFLG.
      read table it_trimpflg
           with key domvalue_l = it_data-cimpflg.
      if sy-subrc eq space.
        move it_trimpflg-ddtext to it_data-cimpflgt.
      endif.
*     Recherche libelle du code PIMPFLG.
      read table it_trimpflg
           with key domvalue_l = it_data-pimpflg.
      if sy-subrc eq space.
        move it_trimpflg-ddtext to it_data-pimpflgt.
      endif.
      move-corresponding it_e070 to it_data.
      modify it_data.
      delete it_e070
             where trkorr = it_data-trkorr.
    endif.
  endloop.


* Ajoute les ordres qui n'ont pas encore été liberrés.
  loop at it_e070.
    clear it_data.
    move-corresponding it_e070 to it_data.
*   Recherche libelle du code TRFUNCTION.
    read table it_trfunction
         with key domvalue_l = it_e070-trfunction.
    if sy-subrc eq space.
      move it_trfunction-ddtext to it_data-trfunctiont.
    endif.
*   Recherche libelle du code TRSTATUS.
    read table it_trstatus
         with key domvalue_l = it_e070-trstatus.
    if sy-subrc eq space.
      move it_trstatus-ddtext to it_data-trstatust.
    endif.
*   Recherche libelle du code CIMPFLG.
    read table it_trimpflg
         with key domvalue_l = it_data-cimpflg.
    if sy-subrc eq space.
      move it_trimpflg-ddtext to it_data-cimpflgt.
    endif.
*   Recherche libelle du code PIMPFLG.
    read table it_trimpflg
         with key domvalue_l = it_data-pimpflg.
    if sy-subrc eq space.
      move it_trimpflg-ddtext to it_data-pimpflgt.
    endif.
    append it_data.
  endloop.
  sort it_data.


* Recherche des libellés des ordres.
  loop at it_data.
    select single as4text
           into it_data-as4text
           from e07t
           where trkorr eq it_data-trkorr
           and   langu  eq sy-langu.
    if sy-subrc eq space.
      modify it_data.
    endif.
  endloop.


* Modifie les codes pour positionner les icones.
  loop at it_data.
    case it_data-cmaxrc.
      when '    '.
        move '@EB@' to it_data-cmaxrc.
      when '0000'.
        move '@08@' to it_data-cmaxrc.
      when '0004'.
        move '@09@' to it_data-cmaxrc.
      when others.
        move '@0A@' to it_data-cmaxrc.
    endcase.
    case it_data-pmaxrc.
      when '    '.
        move '@EB@' to it_data-pmaxrc.
      when '0000'.
        move '@08@' to it_data-pmaxrc.
      when '0004'.
        move '@09@' to it_data-pmaxrc.
      when others.
        move '@0A@' to it_data-pmaxrc.
    endcase.
    modify it_data.
  endloop.


endform.                     " P_FIND_DATA