cancel
Showing results for 
Search instead for 
Did you mean: 

PatterN Filter based on Authorization Role in Transformation

former_member241605
Active Participant
0 Kudos


Hello,

I need to update only particular set of Roles to Target DSO for that i need to filter based on pattern as the Roles Prefix will be like ZS_ROLE_CC_XXXX,

ZS_ROLE_GD_XXXXX & ZS_ROLE_M_XXXXXXX

i need to Update only obove mention Pattern to the Target DSO and the rest of Roles should be deleted if it is not on this pattern.

Can some one help me out in the Code in Transformation.

Waiting For Your Replies.

Regards,

PJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi PJ,

You could use a code similar to the one below to delete from the source_package the records not needed.

DELETE source_package WHERE

                                   'YourField' CS 'ZS_ROLE_CC_' OR

                                   'YourField' CS 'ZS_ROLE_GD_'  OR

                                   'YourField' CS 'ZS_ROLE_M_'..

former_member241605
Active Participant
0 Kudos

Hello Greg,

Thanks for the Reply!!!!

But i need to bring this Roles and the rest of the roles should be deleted.

is there any way of deleting the SOURCE_PACKAGE where AGR_NAME NP *ZS_ROLE_CC_XXXX* OR *ZS_ROLE_GD_XXXXX* OR *ZS_ROLE_M_XXXXXXX* ?

Kindly Let know plz.

Waiting For ur Reply.

former_member241605
Active Participant
0 Kudos

Hello,

Any updates please!!!

i am waiting for your reply

Regards,

PJ

former_member241605
Active Participant
0 Kudos


Hello,

Please correct my Code if i make any mistake

  DATA : ZAGR_NAM TYPE STRING.

TYPES : BEGIN OF ZSTR,
       ZAGR_NAME TYPE AGR_NAME,
      END OF ZSTR.

Loop at source_package assigning <source_fields>.

SELECT SINGLE /BIC/SC_AUTH FROM /BIC/SSC_AUTH INTO ZAGR_NAM
where /BIC/SC_AUTH = <SOURCE_FIELDS> - AGR_NAME CP '*ZS_SP3_CC*' OR
                                       AGR_NAME CP '*ZS_SP3_GD*' OR
                                       AGR_NAME CP '*ZS_SP3_M*'.

IF SY-SUBRC EQ 0.

RESULT = ZAGR_NAM.

ELSE.

DELETE source_package WHERE

                                   ZAGR_NAM NP '*ZS_SP3_CC*' OR

                                   ZAGR_NAM NP '*ZS_SP3_GD*'  OR

                                   YourField NP '*ZS_SP3_M*'.

ENDIF.
ENDLOOP.

Please let me know if it right or wrong and if it is wrong then let me know the correction code.

With Regards,

PJ.

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

DATA : ZAGR_NAM TYPE STRING.

TYPES : BEGIN OF ZSTR,
       ZAGR_NAME TYPE AGR_NAME,
      END OF ZSTR.

SELECT SINGLE /BIC/SC_AUTH FROM /BIC/SSC_AUTH INTO ZAGR_NAM
where /BIC/SC_AUTH = <SOURCE_FIELDS> - AGR_NAME CP '*ZS_SP3_CC*' OR
                                       AGR_NAME CP '*ZS_SP3_GD*' OR
                                       AGR_NAME CP '*ZS_SP3_M*'.

Loop at source_package assigning <source_fields>.


IF SY-SUBRC EQ 0.

RESULT = ZAGR_NAM.

ELSE.

DELETE source_package WHERE

                                   ZAGR_NAM NP '*ZS_SP3_CC*' OR

                                   ZAGR_NAM NP '*ZS_SP3_GD*'  OR

                                   YourField NP '*ZS_SP3_M*'.

ENDIF.
ENDLOOP.

Thanks,

Phani.

former_member241605
Active Participant
0 Kudos

Hello Phani,

Thanks for the reply!!!

i have placed the Loop at Source_package in the place what u r saying but now i am getting error message

E:Incorrect expression "-" in logical condition.

With Regards,

PJ.

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

but your are not yet declared RESULT_PACKAGE.

please go with the your code.

DATA : ZAGR_NAM TYPE STRING.

TYPES : BEGIN OF ZSTR,
       ZAGR_NAME TYPE AGR_NAME,
      END OF ZSTR.

Loop at source_package assigning <source_fields>.

SELECT SINGLE /BIC/SC_AUTH FROM /BIC/SSC_AUTH INTO ZAGR_NAM
where /BIC/SC_AUTH = <SOURCE_FIELDS> - AGR_NAME CP '*ZS_SP3_CC*' OR
                                       AGR_NAME CP '*ZS_SP3_GD*' OR
                                       AGR_NAME CP '*ZS_SP3_M*'.

IF SY-SUBRC EQ 0.

RESULT = ZAGR_NAM.

ELSE.

DELETE source_package WHERE

                                   ZAGR_NAM NP '*ZS_SP3_CC*' OR

                                   ZAGR_NAM NP '*ZS_SP3_GD*'  OR

                                   YourField NP '*ZS_SP3_M*'.

ENDIF.
ENDLOOP.

Thanks,

Phani.

former_member241605
Active Participant
0 Kudos

Hello Phani,

Issue has been resolved!!!!

i have implemented code

   LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.

            IF <source_fields>-agr_name CP 'ZS_SP3_CC_*' OR
          <source_fields>-agr_name CP 'ZS_SP3_GD_*' OR
          <source_fields>-agr_name CP 'ZS_SP3_M*'.
        ELSE.
          DELETE SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.

Regards,

PJ.

Answers (0)