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: 

New report from transaction ST03N

Former Member
0 Kudos

Hi everybody,

In transaction ST03N you can have an overview about User or transaction for a period.

This helps to let you know what kind of work has been done in the system.

The data is shown separated, you have one place for transactions and one for user.

The only problem is that we do not have a combined list which shows, user + transaction at once.

Is there a way to do this, or has anybody any idea where the data from this transaction are stored, so I can get them from the database

Regards,

Dren Selimi

1 ACCEPTED SOLUTION

Juwin
Active Contributor
0 Kudos

report zbc_r_tcodes_by_user.


data:begin     of   gv_output,

     user      type string,

     type      type c,

     title     type string,

     times     type i,

     end       of   gv_output,

     gt_output like standard table of gv_output,  "Output table

     gv_title  type char100.                      "Report title


perform get_data.


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

*&      Form  get_data

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

*       text

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

form get_data.

  data:lv_datum  type d,

       lt_data   type standard table of swncaggusertcode,

       lv_data   type swncaggusertcode.


  lv_datum = sy-datum.


  gv_title = 'Objects executed by users from'.

  write: sy-datum to gv_title+55.


  do.

    lv_datum+6 = '01'.

    refresh lt_data.

    call function 'SWNC_COLLECTOR_GET_AGGREGATES'

      exporting

        component     = 'TOTAL'

        periodtype    = 'M'

        periodstrt    = lv_datum

      tables

        usertcode     = lt_data

      exceptions

        error_message = 1

        no_data_found = 1

        others        = 2.

    if sy-subrc ne 0.

      exit.

    endif.

    write lv_datum to gv_title+40(10).

    subtract 1 from lv_datum.

    loop at lt_data into lv_data where tasktype = '01'.

      gv_output-user  = lv_data-account.

      gv_output-type  = lv_data-entry_id+72.

      gv_output-title = lv_data-entry_id(40).

      gv_output-times = lv_data-count.

      collect gv_output into gt_output.

    endloop.

  enddo.

  sort gt_output.

  gv_title+52(1) = '-'.

  condense gv_title.

endform.                    "get_data

9 REPLIES 9

Former Member
0 Kudos

Hi Dren,

You will get that data from transaction AL08(Current data). If you want the data for particular time you can use transaction STAD .

Regards

Santosh

0 Kudos

Hi Santosh,

Thank you for your reply,

I know there are transactions but I need to extract data in a custom way, that's why I need tables or FMs that store the data of ST03N

Regards,

Dren

0 Kudos

Hi Dren,

See sap note 1053634. This contains some of function module which fetch data from database and display in st03 tcode.

Regards

Santosh

Juwin
Active Contributor
0 Kudos

report zbc_r_tcodes_by_user.


data:begin     of   gv_output,

     user      type string,

     type      type c,

     title     type string,

     times     type i,

     end       of   gv_output,

     gt_output like standard table of gv_output,  "Output table

     gv_title  type char100.                      "Report title


perform get_data.


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

*&      Form  get_data

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

*       text

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

form get_data.

  data:lv_datum  type d,

       lt_data   type standard table of swncaggusertcode,

       lv_data   type swncaggusertcode.


  lv_datum = sy-datum.


  gv_title = 'Objects executed by users from'.

  write: sy-datum to gv_title+55.


  do.

    lv_datum+6 = '01'.

    refresh lt_data.

    call function 'SWNC_COLLECTOR_GET_AGGREGATES'

      exporting

        component     = 'TOTAL'

        periodtype    = 'M'

        periodstrt    = lv_datum

      tables

        usertcode     = lt_data

      exceptions

        error_message = 1

        no_data_found = 1

        others        = 2.

    if sy-subrc ne 0.

      exit.

    endif.

    write lv_datum to gv_title+40(10).

    subtract 1 from lv_datum.

    loop at lt_data into lv_data where tasktype = '01'.

      gv_output-user  = lv_data-account.

      gv_output-type  = lv_data-entry_id+72.

      gv_output-title = lv_data-entry_id(40).

      gv_output-times = lv_data-count.

      collect gv_output into gt_output.

    endloop.

  enddo.

  sort gt_output.

  gv_title+52(1) = '-'.

  condense gv_title.

endform.                    "get_data

Former Member
0 Kudos

Hi Juwin,

I have two more questions ?

why do you use the 'tasktype' or what does it mean ?

and how can I make the FM to show me the data about a day

Thanks and regards,

Dren

Juwin
Active Contributor
0 Kudos

Hi,

Tasktype 01 stands for Tcode. This is used to limit the report by Tcode data only.

Since most customers don't keep daily log, for more than 2 weeks, the data will be very limited, if you try to get the information per day.

In order to get the daily values, you may pass periodtype = 'D' and periodstrt  = required_date, to the above function module.

Thanks,

Juwin

Former Member
0 Kudos

Hi,

Okay I understand, thank you very much for your help

Regards,

Dren

Former Member
0 Kudos

Hi Juwin,

I was wondering is there a way to get the data from 2 or 3 or more different days, like getting the required_date as a select-option, so I can put intervals of days there, ex. 02.06.2014 - 06.06.2014

Regards,

Dren

Juwin
Active Contributor
0 Kudos

Sure you can. You just have to build a loop through those dates and call the same FM.

Thanks,

Juwin