*lv_string1 = IV_PARTNER_NUMBER+0(1).
Select single partner_guid from but000 into ls_but000 where partner_guid = IV_PARTNER_GUID .
if sy-subrc EQ 0 and iv_partner_number+0(1) NE 'E'.
*You can also use partner grouping instead of number range in below
IF ( iv_partner_number+0(1) = '0' AND ( iv_partner_number+4(1) = '9' OR iv_partner_number+4(1) = '7' ) ) . " M01
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = sy-uname
TABLES
activitygroups = lt_groups
return = lt_return .
DATA: lv_string TYPE string,
lv_delete_roles TYPE xfeld.
lv_string = 'ZVENDOR_ROLE'.
* convert retrieved value to range table
* Add your condition here;
* if else endif. Below is the condition based on restricting on role
LOOP AT lt_roles INTO DATA(ls_role).
READ TABLE lt_groups INTO ls_group WITH KEY agr_name = ls_role.
IF sy-subrc EQ 0. " Vendor matching role exist
lv_delete_roles = 'X'. "so delete the other roles
EXIT.
ENDIF.
ENDLOOP.
IF lv_delete_roles IS NOT INITIAL.
FIELD-SYMBOLS: <fs_struct> TYPE any.
FIELD-SYMBOLS <fv_value> TYPE any.
DATA: lv_tabix TYPE sy-tabix.
LOOP AT it_possible_roles ASSIGNING <fs_struct> .
lv_tabix = sy-tabix.
ASSIGN COMPONENT 'ROLE' OF STRUCTURE <fs_struct> TO <fv_value.
IF <fv_value> IS ASSIGNED AND ( ( <fv_value> = '000000' ) OR ( <fv_value> = 'FLVN00' ) OR ( <fv_value> = 'FLVN01' ) ) .
ELSE.
DELETE it_possible_roles INDEX lv_tabix..
* DELETE gt_partner_role_values INDEX lv_tabix.
ENDIF.
ENDLOOP.
ENDIF.
*ENDiF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |