06-20-2008 4:26 PM
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.
06-20-2008 4:34 PM
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
06-20-2008 4:32 PM
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).
06-20-2008 4:34 PM
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
06-20-2008 4:39 PM
Hi,
Use AT SELECTION-SCREEN OUTPUT event to clear the select-options field values.
Regards,
Chandu
06-20-2008 7:22 PM
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***************&
06-20-2008 11:31 PM
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.
06-24-2008 2:13 AM
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
06-24-2008 2:19 AM
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.
06-24-2008 5:52 AM
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
06-27-2008 3:47 PM
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.