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

Selection screen data validation problem

Former Member
0 Likes
750

Hello all,

Transaction FBL3N has an authority check on company. If the user enters a company for which they have no authority, a message displays and they can then exclude that company. The following steps can be repeated as many times as are required to ensure that all selection-screen values can be used. The program, RFITEMGL, is doing all of the authorization using the code of the logical database that is part of the program.

I added the following logic in my program, which works fine, except when the entered values fail the authority check, I can't get off of screen 1000 and get to the sub-screen to exclude the unauthorized values unless I first change the range on screen 1000.

For an example:

If I enter range '100 ' through '900 ', and there is an unauthorized company, '200' in that range, I can't add '200' as an excluded value without first changing the range to '100 ' to ' 199 ' on screen 1000.

Any thoughts on a solution? I tried looking at the logical database code without much success.

*

at selection-screen on s_bukrs.

*

  • check if person entering company has authority

*

data: i_t001 type table of t001.

data: w_t001 type t001.

*

*

select * from t001

into table i_t001

where bukrs in s_bukrs.

*

loop at i_t001 into w_t001.

authority-check object 'F_BKPF_BUK'

id 'BUKRS' field w_t001-bukrs

id 'ACTVT' field '03'.

*

if sy-subrc ne 0.

message e000(zf) with 'Company'

w_t001-bukrs

'not authorized'.

endif.

*

endloop.

*

Thanks

Bruce

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
636

Hi

In program RFITEMGL, there is a function module called BUKRS_AUTHORITY_CHECK which is being used for authority check.

System is checking SY-COMM value for when 'ONLI' or 'PRIN' or 'INIT' or space.

Please have a look into the same.

Shiva

3 REPLIES 3
Read only

Former Member
0 Likes
637

Hi

In program RFITEMGL, there is a function module called BUKRS_AUTHORITY_CHECK which is being used for authority check.

System is checking SY-COMM value for when 'ONLI' or 'PRIN' or 'INIT' or space.

Please have a look into the same.

Shiva

Read only

0 Likes
636

Shiva ,

Thanks for the answer.

Bruce

Read only

Kiran_Valluru
Active Contributor
0 Likes
636

Hi,

Yes this is normal way as you entered wrong value in s_bukrs unless and until you change that you cannot proceed further.

instead of at selection-screen on s_bukrs.

use at selection-screen.

if s_bukrs is not initial.

do processing .,

and display info message'

endif.

or ., instead of error message use dispaly like 'E'

like.,

at selection-screen on s_bukrs.

check authority.,

MESSAGE 'You are not Authorized to use the Company Code' type 'S' display like 'E'.

hope this helps you,

Thanks & Regards.