Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Is it possible to read user agent decision table?

Hi,

We're trying to implement notifications for approvers. We already have the BADI USMD_SSW_SYSTEM_METHOD implemented to notify the requestors. To identify the approvers (we have a few), we were thinking of getting the current processors from the user agent table based on the current step in the rule-based workflow.

Is there a way (Class, API,etc) to try and get the user agent on the rule-based workflow?

Tags:
Former Member replied

Hi Luqman,

Please see below sample code.

TYPES   ts_range TYPE if_fdt_range=>ts_range .
TYPESBEGIN OF s_table_data,
                col_no        TYPE int4,
                row_no        TYPE int4,
                expression_id TYPE if_fdt_types=>id,
                r_value       TYPE REF TO data,
                 ts_range      TYPE ts_range,
              END OF s_table_data .


DATA: lt_data TYPE ts_table_data.

DATA: lo_factory         TYPE REF TO if_fdt_factory,
          lo_query           TYPE REF TO if_fdt_query.

DATA: lv_name         TYPE fdt_name,
          lt_object_id    TYPE if_fdt_types=>ts_object_id,

          lv_objid        TYPE if_fdt_types=>id,

          lo_exp          TYPE REF TO if_fdt_expression,
          lo_exp_typ      TYPE REF TO cl_fdt_decision_table.


lv_name = 'DT_USER_AGT_GRP_YCRTYP'  " Give your User agent Decision table name


IF lo_factory IS NOT BOUND.
     lo_factory = cl_fdt_factory=>get_instance( ).
   ENDIF.


   lo_factory->get_query(
         EXPORTING
           iv_object_type        = 'EX'    " Objekttyp
           iv_expression_type_id = '0000EEEE000240FFFFFFFFFFFFFFFFFF'
          RECEIVING
           ro_query              =     lo_query
         ).


   lo_query->get_ids(
   EXPORTING
      iv_name           =   lv_name  " Beschreibung
     iv_object_type    =   'EX'  " Objekttyp
    IMPORTING
     ets_object_id     lt_object_id   " Object IDs
).


READ TABLE lt_object_id INTO lv_objid INDEX 1.

   lo_factory->get_expression(
     EXPORTING
       iv_id                 lv_objid   " Universal Unique Identifier
      RECEIVING
       ro_expression         lo_exp   " Expression
   ).


   lo_exp_typ ?= lo_exp.
   lo_exp_typ->if_fdt_decision_table~get_table_data(
      IMPORTING
       ets_data     = lt_data   " Output Data
   ).

Message was edited by: MDG User

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question