cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in fetching data from /SCMTMS/TOR trough Query in TMS system, BOPF 1909

0 Kudos
5,248

Hi Gurus,

I am new to SAP TM. I am trying to develop a report which will access different nodes of /SCMTMS/TOR to fetch data. While using the "srv_tor->query" method I am unable to get the "et_key" records for requested node. The data access path is /SCMTMS/TOR-->ROOT-->ITEM_TR I have tried to debug standard report "/SCMTMS/TOR_FO_PROC_BATCH" to check records. But unable to find any data in the internal tables after the query execution. I am finding records in the database table /SCMTMS/D_TORROT about 3,845 entries. The BOBT t-code is also unable to process the test of the same BO through query. Please help me to short out the issue. Is there some mistake I am doing or some system setting need to be done related to BOPF in TM. Please advice. I am attaching the code what I am using for the report. I have used three selections input TOR_ID, MTR, TOR_TYPE individually to access the records.

The system is S/4 HANA, TM 9.0, SAP AHAN BOPF 1909

Thanks in Advance

gv_srv_tor ?= /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /scmtms/if_tor_c=>sc_bo_key ).

IF gv_srv_tor IS BOUND.

lt_sel_param = VALUE #( FOR ls_fo IN s_fo

( attribute_name = /scmtms/if_tor_c=>sc_query_attribute-root-fo_data_by_attr-tor_id

sign = ls_fo-sign

option = ls_fo-option

low = ls_fo-low

high = ls_fo-high ) ).

lt_sel_param = VALUE #( FOR ls_mtr IN s_mtr

( attribute_name = /scmtms/if_tor_c=>sc_query_attribute-root-fo_data_by_attr-mtr

sign = ls_mtr-sign

option = ls_mtr-option

low = ls_mtr-low

high = ls_mtr-high ) ).

lt_sel_param = VALUE #( BASE lt_sel_param

( attribute_name = 'TOR_TYPE'

sign = 'I'

Option = 'EQ'

low = p_type ) ).

gv_srv_tor->query(

EXPORTING

iv_query_key = /scmtms/if_tor_c=>sc_query-root-fo_data_by_attr " Query

it_selection_parameters = lt_sel_param " Query Selection Parameters

iv_fill_data = abap_true " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')

IMPORTING

eo_message = DATA(gt_msg) " Message Object

et_key = lt_key

).

*CATCH /bobf/cx_frw_contrct_violation. " Caller violates a BOPF contract

ENDIF.

gv_srv_tor->retrieve(

EXPORTING

iv_node_key = /scmtms/if_tor_c=>sc_node-root " Node

it_key = lt_key " Key Table

iv_fill_data = abap_true " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')

IMPORTING

et_data = lt_fo

).

* CATCH /bobf/cx_frw_contrct_violation. " Caller violates a BOPF contract

***Items_tr

gv_srv_tor->retrieve_by_association(

EXPORTING

iv_node_key = /scmtms/if_tor_c=>sc_node-root " Node

it_key = lt_key " Key Table

iv_association = /scmtms/if_tor_c=>sc_association-root-item_tr " Association

iv_fill_data = abap_true " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')

IMPORTING

et_data = lt_item_tr

).

* CATCH /bobf/cx_frw_contrct_violation. " Caller violates a BOPF contract

Accepted Solutions (1)

Accepted Solutions (1)

GRABLERE
Product and Topic Expert
Product and Topic Expert

Hi,

did not have time to check your report in my system so far, but considering that the standard queries do also not return data, my strong expectation is that your user is missing permission to view TM.

Maybe you can set a breakpoint in /SCMTMS/CL_Q_SUPERCLASS=>DO_SELECT_NO_SUBQUERY, here the actual select is done and you can see if the select itself is actually returning data. If no data is returned by the query in the end reason is very likely as described above the authorization filtering, which is running afterwards.

Regards,

Emanuel

Answers (1)

Answers (1)

0 Kudos

Thanks Emanuel,

The problem have already solved. You are correct, I didn't have authorization to read data.