Application Development 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: 

Question on Search Help and Authorization Check for Sales Order Type

former_member220801
Participant
0 Kudos

Question 1:

When I go to VA01 and click the search help, it shows only order type that are not blocked.

However, when I have sales order type in select-options of a Z program,

S_AUART FOR VBAK-AUART

I click on the search help, it gives all the sales order types. How can I have a list with unblocked sales order type only?

Question 2:

I want to check whether a use can extract data from a sales order type (e.g. OR and RE)that he/she authorized to use.

I have include the following in my program:

AUTHORITY-CHECK OBJECT 'AUART'

ID 'AUART' FIELD 'OR'.

It always returns SY-SUBRC = 12.

But order type 'OR' is granted to the user (he/she can create order with type OR in VA01)

Please kindly give me some ideas, thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

ad1

use following code:


AT SELECTION-SCREEN ON VALUE-REQUEST FOR auart.
  PERFORM auartGet.

FORM auartGet.
    CALL FUNCTION 'RV_HELP'
         EXPORTING
              KEY            = VKORG
              KEY2           = VTWEG
              KEY3           = SPART
              KEY4           = '0'
              NUMBER         = '008'
              FIELD_IN       = AUART
         IMPORTING
              FIELD          = AUART.
ENDFORM.

ad2.

example:


   AUTHORITY-CHECK OBJECT 'V_VBAK_AAT'
         ID 'AUART' FIELD 'OR'
         ID 'ACTVT' FIELD '01'. "01-create order, 02-change, 03 display
check sy-subrc eq 0.

regards,darek

1 REPLY 1

Former Member
0 Kudos

hi,

ad1

use following code:


AT SELECTION-SCREEN ON VALUE-REQUEST FOR auart.
  PERFORM auartGet.

FORM auartGet.
    CALL FUNCTION 'RV_HELP'
         EXPORTING
              KEY            = VKORG
              KEY2           = VTWEG
              KEY3           = SPART
              KEY4           = '0'
              NUMBER         = '008'
              FIELD_IN       = AUART
         IMPORTING
              FIELD          = AUART.
ENDFORM.

ad2.

example:


   AUTHORITY-CHECK OBJECT 'V_VBAK_AAT'
         ID 'AUART' FIELD 'OR'
         ID 'ACTVT' FIELD '01'. "01-create order, 02-change, 03 display
check sy-subrc eq 0.

regards,darek