Quantcast
Channel: SCN : Unanswered Discussions - SAP Business Process Management
Viewing all articles
Browse latest Browse all 3160

swc_get_table

$
0
0

Hi everyone,

 

I have a problem with a custom agent rule FM and macro  swc_get_table.

I've created a multivalue container element "ETPARTNER" (table with two cols) and wrote a FM.

In my WF i've populated container "ETPARTNER" with values like this:

ROLEPARTNER
PMUSER1
KMUSER2

 

 

So, i want to use this data in my rule FM. I want to determine agent-PARTNER (user name) with ROLE 'PM'.

The problem is  'swc_get_table ac_container 'ETPARTNER' lt_partners' returns no values (sy-subrc =4).

Please, advice.

 

 

 

FUNCTION ZWF_RULE_001.

*"----------------------------------------------------------------------

*"*"Локальный интерфейс:

*"  TABLES

*"      AC_CONTAINER STRUCTURE  SWCONT

*"      ACTOR_TAB STRUCTURE  SWHACTOR

*"  EXCEPTIONS

*"      APPROVER_NOT_FOUND

*"----------------------------------------------------------------------

INCLUDE <cntn01>.

 

DATA :

        lv_pm_name TYPE I_PARNR,

        lv_ppm_name TYPE I_PARNR,

        wa_actor TYPE swhactor,

        num_lines TYPE i.

DATA:

       lt_partners LIKE BAPI_BUS2001_PARTNER occurs 0,

       ls_pm type BAPI_BUS2001_PARTNER.

 

swc_get_table ac_container 'ETPARTNER' lt_partners.

 

LOOP AT lt_partners INTO ls_pm WHERE PARTN_ROLE EQ 'PM'.

ENDLOOP.


lv_pm_name = ls_pm-partner.

     wa_actor-otype = 'US'.

    wa_actor-objid = lv_pm_name.

    APPEND wa_actor TO actor_tab.

 

  DESCRIBE TABLE actor_tab LINES num_lines.

                IF num_lines IS INITIAL.

                   RAISE approver_not_found.

                ENDIF.

ENDFUNCTION.


Viewing all articles
Browse latest Browse all 3160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>