cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization Using Exits Special characters (*)

Former Member
0 Kudos

Hi Dear ABAP Developer,

I would like add to my code a Special character logic. i need like this; if corresponding field had Null from Table (zabwp017), output should star '*'. its help me, that the user is authenticated all values. Could anyone help me for edit this code?

Table ZAWP017 :

Exampe : Testuser3 has authentication all of the "Sales_Grp" beucause there is NULL.

My Code worked, but i need *(Star) Logic.

another question:

I use BW on HANA. I got a Warning if i using statement "Select * from *.

WHEN 'Z0SALES_OFF_MC'.
IF i_step EQ '0'.

  CALL FUNCTION 'RSEC_GET_USERNAME'
    IMPORTING
      e_username = l_username.
  REFRESH lt_abwp017.
  SELECT * FROM zabwp017 INTO TABLE lt_abwp017 WHERE s_bbiuser = l_username
                                                            AND s_bberanz >= 1 .
    IF sy-subrc = 0.
      LOOP AT lt_abwp017 INTO wa_abwp017.
        CLEAR: l_s_range.
        l_s_range-low = wa_abwp017-sales_off.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
        CLEAR wa_abwp017.
      ENDLOOP.
    ENDIF.
  ENDIF.

Thanks Alot

Sascha

Sandra_Rossi
Active Contributor
0 Kudos

I don't understand the question, at all.

DoanManhQuynh
Active Contributor

I don't understand your question. if your code worked what logic you need for *? beside, are you setting for value authorization or hierarchy authorization? they will be difference.

Former Member
0 Kudos

Why u dont understand my Question, i dont know how can i make clear it.

i am using value authorization..

Accepted Solutions (1)

Accepted Solutions (1)

Loed
Active Contributor
0 Kudos

Try this:

WHEN 'Z0SALES_OFF_MC'.

IF i_step EQ '0'.



  CALL FUNCTION 'RSEC_GET_USERNAME'

    IMPORTING

      e_username = l_username.

  REFRESH lt_abwp017.

  SELECT * FROM zabwp017 INTO TABLE lt_abwp017 WHERE s_bbiuser = l_username

                                                            AND s_bberanz >= 1 .

    IF sy-subrc = 0.

      LOOP AT lt_abwp017 INTO wa_abwp017.

          CLEAR l_s_range.

          IF wa_abwp017-sales_off IS NOT INITIAL.

            DELETE lt_abwp017 WHERE sales_off = ''.

            l_s_range-low = lt_abwp017-sales_off.

            l_s_range-sign = 'I'.

            l_s_range-opt = 'EQ'.

            APPEND l_s_range TO e_t_range.

          ELSE.

            l_s_range-low = '*'.

            l_s_range-sign = 'I'.

            l_s_range-opt = 'EQ'.

            APPEND l_s_range TO e_t_range.

          ENDIF.

        ENDLOOP.

    ENDIF.

  ENDIF.

Regards,

Loed

Former Member
0 Kudos

Thx Alot its work..

i have a warning like this : need a pseudo code?

Database features are functional enhancements in Open SQL that are no longer implementedon alldatabases. ... The name of thedatabase featurespecified in the warning is defined as a constant in the class CL_ABAP_DBFEATURES.

or should i ignore it?
thanks you..

DoanManhQuynh
Active Contributor

don't understand why you have to delete inside loop, and you should set the correct value of opt for *. also when someone have ALL authorization, there is no use of loop.

Answers (2)

Answers (2)

FCI
Active Contributor

Just put a new record in e_t_range (I CP *) in case SALES_GRP is blank for your user.

What warning do you exactly have for your SELECT *. On Hana, a SELECT * could be costly (due to its column storiage), try to specify all the needed fields.

Regards,

Frederic

Former Member
0 Kudos

Thanks alot.. I am very beginner. Could you please write this code?

DoanManhQuynh
Active Contributor
0 Kudos

what I mean I don't understand is that your code worked so what stop you use the same logic for *. do you mean that you don't know how to IF...ELSE?. I can write pseudo code like below:

CASE i_vnam.
  WHEN 'Z0SALES_OFF_MC'.
    IF i_step EQ '0'.
      CALL FUNCTION 'RSEC_GET_USERNAME'
        IMPORTING
          e_username = l_username.
      SELECT sale_grp, sales_off
         FROM zabwp017
         INTO TABLE @lt_abwp017
        WHERE s_bbiuser = @l_username
          AND s_bberanz >= 1 .
      IF line_exists( lt_abwp017[ sale_grp = space ] ). " All authorization
        e_t_range = VALUE #( ( low  = '*'
                               sign = 'I'
                               opt  = 'CP' ) ).
      ELSE.
        e_t_range = VALUE #( FOR wa_abwp017 IN lt_abwp017 ( low  = wa_abwp017-sales_off
                                                            sign = 'I'
                                                            opt  = 'EQ' ) ).
      ENDIF.
    ENDIF.
ENDCASE.