2010 Feb 10 10:34 AM
Hi, I have a radiobutton to choose if the user wants to upload or download a file. And then a file parameter for the path. My problem is that in F4 help for path the value of the radiobutton selected is not updated.
The logic is the following (in the AT SELECTION-SCREEN ON VALUE-REQUEST p_up = 'X' always!)
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X',
p_down RADIOBUTTON GROUP rbg1.
p_file TYPE file_name OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CASE 'X'.
WHEN p_up.
PERFORM up_dialog CHANGING p_file.
WHEN p_down.
PERFORM down_dialog CHANGING p_file.
ENDCASE.
2010 Feb 10 11:02 AM
Hi,
Add user-command uc1 at the first radiobutton, and remove obligatory at the file parameter. And check if the file is initial on at selection-screen event...
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X' user-command gr1,
p_down RADIOBUTTON GROUP rbg1,
p_file TYPE file_name.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
IF p_up = 'X'.
PERFORM up_dialog CHANGING p_file.
ELSEIF p_down = 'X'.
PERFORM down_dialog CHANGING p_file.
ENDIF.
at selection-screen.
if sy-ucomm <> 'GR1' and p_file is initial.
message...
endif.
Regards,
Edited by: Diego Alvarez on Feb 10, 2010 12:03 PM
Hi, I have a radiobutton to choose if the user wants to upload or download a file. And then a file parameter for the path. My problem is that in F4 help for path the value of the radiobutton selected is not updated.
The logic is the following (in the AT SELECTION-SCREEN ON VALUE-REQUEST p_up = 'X' always!)
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X',
p_down RADIOBUTTON GROUP rbg1.
p_file TYPE file_name OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CASE 'X'.
WHEN p_up.
PERFORM up_dialog CHANGING p_file.
WHEN p_down.
PERFORM down_dialog CHANGING p_file.
ENDCASE.
2010 Feb 10 10:39 AM
Hi,
a small change..
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X' user-command app,
p_down RADIOBUTTON GROUP rbg1.
p_file TYPE file_name OBLIGATORY.
Regards,
Nagaraj
2010 Feb 10 10:46 AM
Hi nagaraj, thanks but it's still not working, the value of the radiobutton is not updated until START-OF-SELECTION.
2010 Feb 10 10:39 AM
hi,
try like this.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CASE p_up.
WHEN 'X'.
PERFORM up_dialog CHANGING p_file.
WHEN others.
PERFORM down_dialog CHANGING p_file.
ENDCASE.
regards,
sakshi
2010 Feb 10 10:46 AM
Hi Marshall,
This is quite tricky. Instead, why don't you have two separate parameters for the two radiobuttons: One parameter will take the file name as input for uploading, the other will take the file path for downloading.
You can handle the visibility of these two parameters in the AT SELECTION-SCREEN OUTPUT event, so that depending on which radiobutton is selected, the corresponding parameter is displayed.
This way, you don't have to worry about the F4 event, because you don't have to check the radiobutton at all.
Hope this helps! Do revert if you want the specific source code, or if have any further queries.
Cheers,
Shailesh
Always provide feedback for helpful answers
2010 Feb 10 10:47 AM
Hello,
Did you check the p_down radio-button & did an F4 on p_file ? After this in the debug mode you find that in the event AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file, the value for p_up = 'X' ?
Can you try like this & check ?
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X',
p_down RADIOBUTTON GROUP rbg1.
p_file TYPE file_name OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
IF p_up = 'X'.
PERFORM up_dialog CHANGING p_file.
ELSEIF p_down = 'X'.
PERFORM down_dialog CHANGING p_file.
ENDIF.@Nagaraja: Adding USER-COMMAND will trigger the AT SELECTION-SCREEN OUTPUT event & not AT SELECTION-SCREEN ON VALUE-REQUEST.
BR,
Suhas
2010 Feb 10 10:56 AM
Thanks suhas,
You pointed me , i was just checking the radiobutton part which was not working.. :)..Didn't check the event.. 😛
Regards,
Nagaraj
2010 Feb 10 10:58 AM
Hi Suhas, yes the problem is that the value of p_up is always 'X' in ON VALUE-REQUEST event. And p_down is always initial. Your solution doesn't correct this, but thanks!
To Shailesh: Yes, I had thought about this solution, or starting the file dialog when the user begins the program execution, deleting the p_file parameter from the selection screen. It seems that I must go this way
2010 Feb 10 11:02 AM
Hi,
Add user-command uc1 at the first radiobutton, and remove obligatory at the file parameter. And check if the file is initial on at selection-screen event...
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X' user-command gr1,
p_down RADIOBUTTON GROUP rbg1,
p_file TYPE file_name.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
IF p_up = 'X'.
PERFORM up_dialog CHANGING p_file.
ELSEIF p_down = 'X'.
PERFORM down_dialog CHANGING p_file.
ENDIF.
at selection-screen.
if sy-ucomm <> 'GR1' and p_file is initial.
message...
endif.
Regards,
Edited by: Diego Alvarez on Feb 10, 2010 12:03 PM
2010 Feb 10 11:06 AM
Thanks Diego, I didn't imagine that the OBLIGATORY option causes this.
Solved
2010 Feb 10 11:03 AM
Hi,
Check below code. It will work.
PARAMETERS: p_up RADIOBUTTON GROUP rbg1 DEFAULT 'X' USER-COMMAND ucomm,
p_down RADIOBUTTON GROUP rbg1 ,
p_file TYPE file_name .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CASE 'X'.
WHEN p_up.
PERFORM up_dialog CHANGING p_file.
WHEN p_down.
PERFORM down_dialog CHANGING p_file.
ENDCASE.
AT SELECTION SCREEN.
CHECK po_file IS IITIAL.
MESSAGE 'Please enter file name' TYPE 'E'.
This is because, till you fill all the OBLIGATORY fields, selection screen values are not updated.
Alternate way is, you need to call the FM DYNP_VALUES_UPDATE/DYNP_UPDATE_FIELDS which is not required with above code.
Thanks,
Vinod.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |