Application Development and Automation 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: 
Read only

Reg : Authority check.

Former Member
0 Likes
491

Hi,

I have requirement where authority check for a field in selection screen.

so_cost is cost center with range in selection screen.

In FM

CALL FUNCTION 'AUTHORITY_CHECK'

EXPORTING

aut_obj = co_auth_obj

field1_object = co_KOSTL(KOSTL)

field1_value = ???????

field2_object = co_actvt

field2_value = co_03

EXCEPTIONS

NO_AUTHORITY = 1

OTHERS = 2.

so how shud i pass the so_cost here? As it select option it may have high and low or ranges.

i have tried using Range and passing ra_cost into FM .

IF NOT so_cost-low IS INITIAL.

ra_cost-sign = co_i.( I )

ra_cost-option = co_eq.(=)

ra_cost-low = so_cost-low.

APPEND ra_cost.

ENDIF.

IF NOT so_cost-high IS INITIAL.

ra_cost-sign = co_i.

ra_cost-option = co_eq.

ra_cost-low = so_cost-high.

APPEND ra_cost.

ENDIF.

But its giving dump

You attempted to pass the field "FIELD2_VALUE" to the formal parameter

"FIELD2_VALUE"

but the formal parameter "FIELD2_VALUE" can accept only fields of

type "C". The field "FIELD2_VALUE" has the type "u".

But i declared as C type only.

so please guide me regarding this.

regards,

Savitha.

Edited by: savitha s on Dec 8, 2008 1:33 PM

Hi,

I have requirement where authority check for a field in selection screen.

so_cost is cost center with range in selection screen.

In FM

CALL FUNCTION 'AUTHORITY_CHECK'

EXPORTING

aut_obj = co_auth_obj

field1_object = co_KOSTL(KOSTL)

field1_value = ???????

field2_object = co_actvt

field2_value = co_03

EXCEPTIONS

NO_AUTHORITY = 1

OTHERS = 2.

so how shud i pass the so_cost here? As it select option it may have high and low or ranges.

i have tried using Range and passing ra_cost into FM .

IF NOT so_cost-low IS INITIAL.

ra_cost-sign = co_i.( I )

ra_cost-option = co_eq.(=)

ra_cost-low = so_cost-low.

APPEND ra_cost.

ENDIF.

IF NOT so_cost-high IS INITIAL.

ra_cost-sign = co_i.

ra_cost-option = co_eq.

ra_cost-low = so_cost-high.

APPEND ra_cost.

ENDIF.

But its giving dump

You attempted to pass the field "FIELD2_VALUE" to the formal parameter

"FIELD2_VALUE"

but the formal parameter "FIELD2_VALUE" can accept only fields of

type "C". The field "FIELD2_VALUE" has the type "u".

But i declared as C type only.

so please guide me regarding this.

regards,

Savitha.

Edited by: savitha s on Dec 8, 2008 1:33 PM

2 REPLIES 2
Read only

Former Member
0 Likes
460

you can try with type XUFIELD..

Read only

Former Member
0 Likes
460

Hi ,

Please check the below code, which may give some idea.

we have to provide the field name and authorization object name( contact basis person)


 auth_object = 'S_BTCH_ADM'.
  auth_field1 = 'BTCADMIN'.
  auth_value1 = 'Y'.

  call function 'AUTHORITY_CHECK'  " Jobs einplanen
       exporting field1  = auth_field1
                 field2  = auth_field2
                 field3  = auth_field3
                 object  = auth_object
                 user    = auth_user
                 value1  = auth_value1
                 value2  = auth_value2
                 value3  = auth_value3
       exceptions user_is_authorized =  1
                  others             = 99.