06-26-2008 7:15 PM
Hello,
I am using a group of radio buttons as follows:
parameters: p_desk radiobutton group 1, "Desktop location
p_unix radiobutton group 1. "Unix location
Now if p_desk ='X', I want the file path to be set as follows and use function F4_FILENAME at value request
PARAMETERS: p_file LIKE rlgrap-filename.
AND if p_unix is 'X', then I want the filepath to be set as follows and use function F4_DXFILENAME_TOPRECURSION at avlue request
PARAMETERS: p_file LIKE filename-fileextern.
Is it possible to define parameters at runtime ? How can we do this.
Regards,
Rajesh,
06-26-2008 7:50 PM
Check out this code:
*&---------------------------------------------------------------------*
*& Report ZTEST_SOURAV9
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ztest_sourav9.
PARAMETERS:
p_desk RADIOBUTTON GROUP 1 DEFAULT 'X' USER-COMMAND flag, "Desktop location
p_unix RADIOBUTTON GROUP 1 , "Unix location
p_file1 LIKE rlgrap-filename MODIF ID m1 DEFAULT 'File 1' ,
p_file2 LIKE filename-fileextern MODIF ID m2 DEFAULT 'File 2'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_desk = 'X' AND
screen-group1 = 'M2'.
screen-active = '0'.
ELSEIF p_unix = 'X' AND
screen-group1 = 'M1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
*....
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file2.
*...
START-OF-SELECTION.
IF p_desk = 'X'.
WRITE: p_file1.
ELSE.
WRITE: p_file2.
ENDIF.
06-26-2008 7:22 PM
Don't define them in runtime...rather hide or unhide it at runtime in AT SELECTION SCREEN OUTPUT event.
06-26-2008 7:27 PM
06-26-2008 7:30 PM
Why not use the ABAP Help for AT SELECTION SCREEN OUTPUT. You might get an answer faster and learn something on your own.
06-26-2008 7:30 PM
Hi Rajesh,
You define only a single parameter of type C lenght 1.
At selection-screen on Field even of that parameter you check the value whether it is '1' set the flag w_flag = 'X' else set it w_flag = ' '.
so check a condition depending on that flag and carry with your operation..
Hope this would help you.
Regards
Narin Nandivada
06-26-2008 7:38 PM
Try using a toggle in the AT SELECTION-SCREEN OUTPUT.
Constants:
c_mod_group1 type c value 'A',
c_mod_group2 type c value 'B',
c_hide type c value '0',
c_show type c value '1'.
Selection screen.....
Parameters: p_desk radiobutton group rad1 user-command uc1,
p_unix radiobutton group rad1 default 'X',
p_filedesk type......MODIF ID b Lower case,
p_fileunix type..... MODIF ID a lower case.
end of selection screen....
At selection-screen output.
Perform toggle.
FOrm toggle.
if p_unix = 'x'.
LOOP AT SCREEN.
CASE screen-group1.
WHEN c_mod_group1.
screen-active = c_hide. "show field
MODIFY SCREEN.
ENDCASE.
CASE screen-group1.
WHEN c_mod_group2.
screen-active = c_show.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ELSEIF p_desk = 'X'.
LOOP AT SCREEN.
CASE screen-group1.
WHEN c_mod_group1.
screen-active = c_show. "show field
MODIFY SCREEN.
ENDCASE.
CASE screen-group1.
WHEN c_mod_group2.
screen-active = c_hide.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDIF.
This will allow for the file to be input for only one option. Then when the user executes you can pull the data for the file based on the radiobutton selected.
or AT Selection-Screen output.
If p_desk = 'X'.
Perform ........
else.
Perform ......
Endif.
Hopes this helps
Regards,
C
06-26-2008 7:50 PM
Check out this code:
*&---------------------------------------------------------------------*
*& Report ZTEST_SOURAV9
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ztest_sourav9.
PARAMETERS:
p_desk RADIOBUTTON GROUP 1 DEFAULT 'X' USER-COMMAND flag, "Desktop location
p_unix RADIOBUTTON GROUP 1 , "Unix location
p_file1 LIKE rlgrap-filename MODIF ID m1 DEFAULT 'File 1' ,
p_file2 LIKE filename-fileextern MODIF ID m2 DEFAULT 'File 2'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_desk = 'X' AND
screen-group1 = 'M2'.
screen-active = '0'.
ELSEIF p_unix = 'X' AND
screen-group1 = 'M1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
*....
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file2.
*...
START-OF-SELECTION.
IF p_desk = 'X'.
WRITE: p_file1.
ELSE.
WRITE: p_file2.
ENDIF.