Application Development and Automation 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: 
Read only

Example- SWX_GET_MANAGER

Former Member
0 Likes
920

Hii,

please tell me how to pass parameters to swx_get_manager.

We can use PERNR also to find next level manager na?

I was passing like this, But im not getting any result.

DATA: LT_ACTOR_TAB type TABLE OF SWHACTOR,

LW_ACTOR_TAB TYPE SWHACTOR,

LT_AC_CONTAINER type TABLE OF SWCONT,

LW_AC_CONTAINER TYPE SWCONT.

LW_AC_CONTAINER-element = 'ORG_OBJECT'.

LW_AC_CONTAINER-ELEMLENGTH = '025'.

LW_AC_CONTAINER-type = 'C'.

concatenate 'P' WA_PA0001-pernr into LW_AC_CONTAINER-value separated by space.

APPEND LW_AC_CONTAINER TO LT_AC_CONTAINER.

CALL FUNCTION 'SWX_GET_MANAGER'

TABLES

ACTOR_TAB = LT_ACTOR_TAB

AC_CONTAINER = LT_AC_CONTAINER

EXCEPTIONS

NOBODY_FOUND = 1.

IF SY-SUBRC <> 0.

1 REPLY 1
Read only

Former Member
0 Likes
449

Hi,

In case of this post is still up-to-date

I did it almost the same way, the only difference is that I concatenated 'P' and pernr in additional variable (lv_value) and than transfered this variable to appropriate field (lw_ac_containter-value). It works fine in our system.

Bellow is the example.

Best regards, Ana

DATALT_ACTOR_TAB  type TABLE OF SWHACTOR,

           LW_ACTOR_TAB TYPE SWHACTOR,

           LT_AC_CONTAINER type TABLE OF SWCONT,

           LW_AC_CONTAINER TYPE SWCONT,

           lv_value type string.

    clear: lv_value, LW_AC_CONTAINER, lw_actor_tab.

  refresh: lt_actor_tab, Lt_AC_CONTAINER.

  concatenate 'P' pernr into lv_value separated by space .

  LW_AC_CONTAINER-element    = 'ORG_OBJECT'.

  LW_AC_CONTAINER-ELEMLENGTH = '025'.

  LW_AC_CONTAINER-type       = 'C'.

  LW_AC_CONTAINER-value      = lv_value.

  APPEND LW_AC_CONTAINER TO LT_AC_CONTAINER.

    CALL FUNCTION 'SWX_GET_MANAGER'

      TABLES

        actor_tab          = lt_actor_tab

        ac_container       = lt_ac_container

     EXCEPTIONS

       NOBODY_FOUND       = 1

       OTHERS             = 2

              .
    IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.