2007 Jun 09 8:52 AM
HI,
can anyone plz tell me how to use radiobutton in my report for a standard field name .actually, i have to output moment type field as radiobutton, and i have to specify the moment type condition in my code.
abinash verma.
2007 Jun 09 9:13 AM
2007 Jun 09 9:39 AM
declare the radiobutton in the selection screen as:
parameter: p_rad1 type radiobutton grour g1 default 'X',
p_rad1 type radiobutton grour g1.
when the selection screen will disply there will be two radiobutton p_rad1 and p_rad2.
now in selection screen, if you do not change the radiobutton then p_rad1 will hold 'X' else p_rad2 will hold 'X'.
Ex:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-003.
PARAMETERS: p_locl RADIOBUTTON GROUP g1
DEFAULT 'X' USER-COMMAND fil,
p_phys RADIOBUTTON GROUP g1,
p_ofile TYPE dxfile-filename LOWER CASE.
SELECTION-SCREEN END OF BLOCK b1.
*---------------------------------------------------------------------
* AT SELECTION SCREEN ON VALUE REQUEST
*---------------------------------------------------------------------
* Value request for the filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ofile.
PERFORM help_audit_file USING p_phys
p_locl
CHANGING p_ofile.
*---------------------------------------------------------------------
* AT SELECTION-SCREEN OUTPUT
*---------------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_sess = 'X'.
IF screen-group1 = 'CTU'.
screen-active = 0.
ENDIF.
ELSEIF p_ctu = 'X'.
IF screen-group1 = 'SES'.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form help_audit_file
*&---------------------------------------------------------------------*
* Application Server path for Audit File
*----------------------------------------------------------------------*
FORM help_audit_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_audit_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_OFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_audit_path.
ENDIF.
ENDFORM. " help_audit_file
*&---------------------------------------------------------------------*
*& Form help_local_file
*&---------------------------------------------------------------------*
* Local File Path
*----------------------------------------------------------------------*
FORM help_local_file CHANGING p_path TYPE any .
DATA: lt_file_table TYPE filetable,
la_file_table LIKE LINE OF lt_file_table,
l_rc TYPE i,
l_pcdsn TYPE cffile-filename.
REFRESH lt_file_table.
CLEAR la_file_table.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_file_table
rc = l_rc.
READ TABLE lt_file_table INTO la_file_table INDEX 1.
l_pcdsn = la_file_table-filename.
MOVE l_pcdsn TO p_path.
ENDFORM. " help_local_file
In the above program, according to the radiobutton selected, a file will selected from local server or application server.
2007 Jun 09 10:10 AM