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: 

How to refresh screen data ?

Former Member
0 Kudos

Dears:

I write a report . And before execute this report, I will check if user has authorization for the selection criteria data.

If not , I wish refresh the screen and assign new values to selection criteria.

Hope some can tell me how to refresh the screen and assign new vales into the selection criteria.

Thanks a lot.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

ucan frist check the authorization of that user in

event

At selection screen output

and if user have authorization it can go ahead and if not

loop at screen and provide the value that u want to apper on screen

Plz Reward If usefull

Cheers

Snehi

9 REPLIES 9

Former Member
0 Kudos

HI,

You can use refresh, clear stements to clear the selectio-screen values.

e.g. if s_matnr is the selection variable, you can clear the values using refresh s_matnr[], clear s_matnr. In the same way you can clear the parameters using clear key word. (clear p_test).

Former Member
0 Kudos

hi

ucan frist check the authorization of that user in

event

At selection screen output

and if user have authorization it can go ahead and if not

loop at screen and provide the value that u want to apper on screen

Plz Reward If usefull

Cheers

Snehi

Former Member
0 Kudos

Hi,

Use AT SELECTION-SCREEN OUTPUT event to clear the select-options field values.

Regards,

Chandu

former_member598013
Active Contributor
0 Kudos

Hi Gary,

Put an Authorisation code in the Initailization Event. It will resolve your problem.If you want to refresh or change the value in the selection criteria then what you need to do is just enter the value in the event " AT SELECTION SCREEN OUTPUT".

&***************Reward Point if helpful***************&

Former Member
0 Kudos

You can follow the below steps:

1. Use function module DYNP_VALUES_READ to read the current values of the fields on the screen.

2. Then change the values after your check and...

3. Use function moudule DYNP_VALUES_UPDATE to update the changed field values on the screen.

I used these to update the current screen values. Let me know if you need more details.

Thx,

Raj.

0 Kudos

Hi Raj:

I am interested in using DYNP_VALUES_READ and DYNP_VALUES_UPDATE . Can you show me the detail

about these two functions?

Thank.

Gary

0 Kudos

DYNP_VALUES_READ Read the values from a dynpro. This function can be used to read the values from a report's selection screen too

DYNP_VALUES_UPDATE Similar to DYNP_VALUES_READ, this function will allow the updating of fields on a dynpro. Very useful when you want to change a field based on the value entered for another field.

*********

The following code shows the syntax of the FM 'DYNP_VALUES_UPDATE'.

*Internal table to store dy dynpro fields and values

DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.

DATA: l_stepl LIKE sy-stepl.

REFRESH dynpfields.

CLEAR dynpfields.

dynpfields-fieldname = 'SCREENFIELD1-COL1'. "Screen field name

dynpfields-fieldvalue = 10. "New value

dynpfields-stepl = l_stepl. "Step loop for table controls

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'SAPLBDT_GMGR' "Program name

dynumb = '0270' "Screen number

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS = 0.

Former Member
0 Kudos

Hi Gary,

You can put the authority check in at selection-scree event and before that event put an intialization event also.

FORM authority_check.

  • Checking Whether the User has authorization for the Plant.

AUTHORITY-CHECK OBJECT 'ZMMD_PROD' ID 'WERKS' FIELD pa_werks.

IF sy-subrc <> 0.

  • NO AUTHORIZATION FOR PLANT.

MESSAGE e167

ENDIF.

Cheers

Mohinder Singh Chauhan

Former Member
0 Kudos

Thanks for everyone's help.

below is my program code.

***************************************

at selection-screen on radiobutton group RB1 .

***r3 and r4 are radiobutton

if r3 = 'X' or r4 = 'X'.

AUTHORITY-CHECK OBJECT 'S_TCODE'

ID 'TCD' FIELD 'ME28' .

IF SY-SUBRC NE 0 .

message W000 with 'No authorization for purchase release'.

R3 = ''.

R4 = ''.

R1 = 'X'.

ENDIF.

endif.