Skip to Content
avatar image
Former Member

Authorization in tx. CRMD_ORDER for Sold-to Party

hi,

i need to do a validation in tx. crmd_order. when the user uses the help (F4) button for the field "Sold-to party" I need to check if it is user 15000. In that case, when acceding to the help, I have to display only partners corrsponding to some sales office, not to all of them.

Does anybody know how can i do that ???

Maybe with badi BUPA_AUGRP ??? but don't know what to do there....

thanks in advance !!!

regards !!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 10, 2007 at 11:50 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Maria,

      I misunderstood indeed!

      There is a little trick to identify if the current process/transaction calls a badi or not.

      Before you push F4 with the user 15000 activate debugging and place a breakpoint in the GET_INSTANCE method of the CL_EXITHANDLER class. This method is called each time a badi could be called (doens't matter if the badi has an implementation or not). Then check the badi to see if it is appropiate one you're looking for. The name of the badi is contained in the variable 'exit_name' of the class.

      I'm pretty sure there is a badi for BP lookup.

      Hope this helps,

      Joost

      Message was edited by:

      Joost Stallaert

  • avatar image
    Former Member
    Oct 10, 2007 at 12:14 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi again, i've been looking for this problem and i've found the following:

      there is already implemented the badi BUPA_AUGRP with method GET_AUGRP. In the source code it's being validated the roles the user has, if the user has one role or another, the badi does this:

      if loc_user_role_wa-agr_name eq 'Z_CR_PAC_ALEMANIA_00'.

      wa_AUTH_VALUES-sign = 'I'.

      wa_AUTH_VALUES-option = 'EQ'.

      wa_AUTH_VALUES-low = '03'.

      append wa_AUTH_VALUES to et_auth_values.

      wa_AUTH_VALUES-sign = 'E'.

      wa_AUTH_VALUES-option = 'EQ'.

      wa_AUTH_VALUES-low = space.

      append wa_AUTH_VALUES to et_auth_values.

      LT_AUTH_VALUES[] = et_auth_values[].

      LOOP AT LT_AUTH_VALUES INTO LS_AUTH_VALUES.

      CLEAR LS_AUTH_SELOPT.

      MOVE-CORRESPONDING LS_AUTH_VALUES TO LS_AUTH_SELOPT.

      LS_AUTH_SELOPT-SHLPFIELD = LC_SHLPFIELD.

      LS_AUTH_SELOPT-SHLPNAME = IV_SHLPNAME.

      APPEND LS_AUTH_SELOPT TO ET_AUTH_SELOPT.

      ENDLOOP.

      endif.

      As i can see when debugging, the system access table BUT000 with field AUGRP.

      I've also seen that the field sold-to party has an standard help search "COM_PARTNER", and the debug always arrives here, so i think maybe it's not possible to do what i need to ???

      thanks....