Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Related Items

Home arrow Utilities arrow ABAP Utilities arrow Viewing queues in other systems
Viewing queues in other systems PDF Print E-mail
User Rating: / 1
PoorBest 
Written by Kevin Wilson   
Wednesday, 04 April 2007

This report takes an RFC destination in as an input option. It then retireves the inbound and outbound queues (SMQ1/2) for the applicable RFC destinations and displays it on a page. It allows you to flag older entries as red as well as queues with more than the threshhold stated.

A great tool for a middleware queue administrator.... 

*&---------------------------------------------------------------------*

*& Report  ZCA_QUEUE

*&---------------------------------------------------------------------*

 

REPORT  zca_queue NO STANDARD PAGE HEADING.

 

INCLUDE zca_queue_data.

 

PARAMETERS:     qname    LIKE trfcqout-qname DEFAULT '*',

                qdest    LIKE trfcqout-dest DEFAULT '*',

                total    LIKE sy-index DEFAULT 1000,

                minutes  type i default 10.

 

SELECT-OPTIONS: target FOR rfcdes-rfcdest.

 

START-OF-SELECTION.

 

  SET PF-STATUS 'GUI'.

 

  t_total = total.

  t_minutes = minutes.

 

  CALL FUNCTION 'AUTHORITY_CHECK_TCODE'

    EXPORTING

      tcode  = 'SMQ1'

    EXCEPTIONS

      ok     = 0

      not_ok = 1

      OTHERS = 2.

  IF sy-subrc NE 0.

    MESSAGE e172(00) WITH 'SMQ1'.

  ELSE.

 

    LOOP AT target.

 

*** Outbound

      REFRESH: itab_qview,

               itab_qtable.

 

      CALL FUNCTION 'TRFC_QOUT_OVERVIEW'

        DESTINATION target-low

        EXPORTING

          qname  = qname

          dest   = qdest

          client = '*'

        TABLES

          qview  = itab_qview

          qtable = itab_qtable.

 

      IF NOT itab_qview[] IS INITIAL.

 

        PERFORM print_heading_out

          USING target.

 

        PERFORM print_data

          TABLES itab_qview

                 itab_qtable.

 

      ELSE.

        FORMAT COLOR COL_POSITIVE.

        ULINE.

        WRITE: /1 'Target system:', target-low.

        FORMAT COLOR COL_KEY.

        WRITE: /1 'OUTBOUND'.

        FORMAT COLOR COL_NORMAL.

        WRITE: /1 'No entries!!!'.

        FORMAT COLOR OFF.

      ENDIF.

 

*** Inbound

      REFRESH: itab_qview,

               itab_qtable.

 

      CALL FUNCTION 'TRFC_QIN_OVERVIEW'

        DESTINATION target-low

        EXPORTING

          qname  = qname

          client = '*'

        TABLES

          qview  = itab_qview

          qtable = itab_qtable.

 

      IF NOT itab_qview[] IS INITIAL.

 

        PERFORM print_heading_in

          USING target.

 

        PERFORM print_data

          TABLES itab_qview

                 itab_qtable.

 

      ELSE.

        FORMAT COLOR COL_KEY.

        WRITE: /1 'INBOUND'.

        FORMAT COLOR COL_NORMAL.

        WRITE: /1 'No entries!!!'.

        FORMAT COLOR OFF.

      ENDIF.

 

      SKIP 2.

 

    ENDLOOP.

 

  ENDIF.

 

END-OF-SELECTION.

  INCLUDE zca_queue_forms.

 

AT USER-COMMAND.

  CASE sy-ucomm.

    WHEN 'REFRESH'.

      LOOP AT target.

 

*** Outbound

        REFRESH: itab_qview,

                 itab_qtable.

 

        CALL FUNCTION 'TRFC_QOUT_OVERVIEW'

          DESTINATION target-low

          EXPORTING

            qname  = qname

            dest   = qdest

            client = '*'

          TABLES

            qview  = itab_qview

            qtable = itab_qtable.

 

        IF NOT itab_qview[] IS INITIAL.

 

          PERFORM print_heading_out

            USING target.

 

          PERFORM print_data

            TABLES itab_qview

                   itab_qtable.

 

        ELSE.

          FORMAT COLOR COL_POSITIVE.

          ULINE.

          WRITE: /1 'Target system:', target-low.

          FORMAT COLOR COL_KEY.

          WRITE: /1 'OUTBOUND'.

          FORMAT COLOR COL_NORMAL.

          WRITE: /1 'No entries!!!'.

          FORMAT COLOR OFF.

        ENDIF.

 

*** Inbound

        REFRESH: itab_qview,

                 itab_qtable.

 

        CALL FUNCTION 'TRFC_QIN_OVERVIEW'

          DESTINATION target-low

          EXPORTING

            qname  = qname

            client = '*'

          TABLES

            qview  = itab_qview

            qtable = itab_qtable.

 

        IF NOT itab_qview[] IS INITIAL.

 

          PERFORM print_heading_in

            USING target.

 

          PERFORM print_data

            TABLES itab_qview

                   itab_qtable.

 

        ELSE.

          FORMAT COLOR COL_KEY.

          WRITE: /1 'INBOUND'.

          FORMAT COLOR COL_NORMAL.

          WRITE: /1 'No entries!!!'.

          FORMAT COLOR OFF.

        ENDIF.

 

        SKIP 2.

 

      ENDLOOP.

 

      sy-lsind = sy-lsind - 1.

 

  ENDCASE.

 

*----------------------------------------------------------------------*

***INCLUDE ZCA_QUEUE_DATA .

*----------------------------------------------------------------------*

include <sys000>.

 

tables: trfcqout, arfcsstate, qrfcevent, rfcdes.

 

data: itab_qview  type standard table of TRFCQVIEW,

      wa_qview    type TRFCQVIEW,

      itab_qtable type standard table of TRFCQOUT,

      wa_qtable   type TRFCQOUT,

      t_total     like TRFCQVIEW-qdeep,

      t_minutes type i.

 

*----------------------------------------------------------------------*

***INCLUDE ZCA_QUEUE_FORMS .

*----------------------------------------------------------------------*

*&---------------------------------------------------------------------*

*&      Form  print_data

*&---------------------------------------------------------------------*

FORM print_data  TABLES   p_itab_qview  STRUCTURE trfcqview

                          p_itab_qtable STRUCTURE trfcqout.

 

  CONSTANTS:   gc_timezone_system      TYPE timezone    VALUE 'MSTNO'.

 

  DATA:  t_first(14) TYPE c,

         t_last(14)  TYPE c,

         t_firsttime TYPE timestamp,

         t_lasttime  TYPE timestamp,

         t_time_diff TYPE i.

 

  ULINE AT /1(163) NO-GAP.

  FORMAT COLOR COL_HEADING.

  WRITE: /1 '| Q Name',

          28  '| Destination',

          63  '| Entries',

          77  '| Status',

          88  '| Waiting for Q',

          115  '| First',

          128  '| Time',

          139  '| Last',

          152  '| Time', 163 '|'.

  FORMAT COLOR OFF.

 

  ULINE AT /1(163) NO-GAP.

 

  LOOP AT p_itab_qview INTO wa_qview.

 

    IF wa_qview-qdeep > t_total OR

       wa_qview-qstate = 'SYSLOAD' OR

       wa_qview-qstate = 'SYSFAIL' OR

       wa_qview-qstate = 'STOP' OR

       wa_qview-qstate = 'CPICERR' OR

       wa_qview-qstate = 'WAITSTOP' OR

       wa_qview-qstate = 'VBERROR'.

 

      FORMAT COLOR COL_NEGATIVE.

 

    ELSEIF wa_qview-qstate = 'WAITING'.

 

      FORMAT COLOR COL_NEGATIVE.

 

    ELSE.

 

      IF wa_qview-fdate < sy-datum.

        FORMAT COLOR COL_NEGATIVE.

      ELSE.

        CLEAR t_time_diff.

        CONCATENATE wa_qview-fdate wa_qview-ftime INTO t_first.

        CONCATENATE wa_qview-ldate wa_qview-ltime INTO t_last.

        t_firsttime = t_first.

        t_lasttime  = t_last.

 

        CALL FUNCTION 'TIMECALC_DIFF'

          EXPORTING

            timestamp1 = t_firsttime

            timestamp2 = t_lasttime

            timezone   = gc_timezone_system

          IMPORTING

            difference = t_time_diff.

 

        t_time_diff = t_time_diff / 60.

 

        IF t_time_diff > t_minutes.

          FORMAT COLOR COL_NEGATIVE.

        ENDIF.

 

      ENDIF.

 

    ENDIF.

 

    WRITE: /1 '|', wa_qview-qname,

              '|', wa_qview-dest,

              '|', wa_qview-qdeep,

              '|', wa_qview-qstate,

              '|', wa_qview-wqname,

              '|', wa_qview-fdate,

              '|', wa_qview-ftime,

              '|', wa_qview-ldate,

              '|', wa_qview-ltime,'|'.

 

    FORMAT COLOR OFF.

  ENDLOOP.

  IF sy-subrc <> 0.

    FORMAT COLOR COL_NORMAL.

    WRITE: /1 'No entries!!!'.

    FORMAT COLOR OFF.

  ELSE.

    ULINE AT /1(163) NO-GAP.

  ENDIF.

 

 

ENDFORM.                    " print_data

*&---------------------------------------------------------------------*

*&      Form  print_heading

*&---------------------------------------------------------------------*

FORM print_heading_out  USING    target STRUCTURE selopt.

  FORMAT COLOR COL_POSITIVE.

  ULINE.

  WRITE: /1 'Target system:', target-low.

  FORMAT COLOR COL_KEY.

  WRITE: /1 'OUTBOUND'.

  FORMAT COLOR OFF.

ENDFORM.                    " print_heading

*&---------------------------------------------------------------------*

*&      Form  print_heading

*&---------------------------------------------------------------------*

FORM print_heading_in  USING    target STRUCTURE selopt.

  FORMAT COLOR COL_KEY.

  SKIP 1.

  WRITE: /1 'INBOUND'.

  FORMAT COLOR OFF.

ENDFORM.                    " print_heading


 
< Prev   Next >

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor