‎2006 Jun 16 10:40 AM
Hi all,
Can we add some fields to selection screen dynamically on pushbutton click?
Regards,
Dnyanesh
‎2006 Jun 16 10:45 AM
Hi Dnyanesh,
What you can do is to define fields which are initially in invisible mode and dynamically change them to visible on the button click.
at selection-screen output.
if sy-ucomm = <Button Fcode>
loop at screen.
if screen-group1 = <screen group name for all the field>
screen-invisible = 0.
screen-active = 1.
modify screen.
endif.
endloop.
endif.
Regards,
ravi
‎2006 Jun 16 10:46 AM
Ravi....this wont serve my purpose.....
Message was edited by: Dnyanesh Tamboli
‎2006 Jun 16 10:45 AM
I don't think it's possible. Instead you can define your own screen and call them using CALL SUB SCREEN or CALL SCREEN.
rgds,
TM.
‎2006 Jun 16 10:47 AM
Hi dnyanesh,
1. If the requirement is fixed for the number of fields,
then we can
pre-define the fields.
2. But they will appear only at the click of button.
regards,
amit m.
‎2006 Jun 16 10:56 AM
yes the number of fields are fixed .....
there are 4 fields .....
say a b c d.....
initially these 4 fields are displayed .along with a pushbutton
when user clicks the push button the selection screen would look like
a b c d pushbutton
a b c d
again if the user clicks the pushbutton
the screen should look like
a b c d pushbutton
a b c d
a b c d
‎2006 Jun 16 10:47 AM
just have look below code
REPORT zrsdvsr1
LINE-SIZE 220
LINE-COUNT 65(5).
TYPE-POOLS : slis.
**********************************************************************
TABLES
**********************************************************************
TABLES: vbak.
**********************************************************************
DATA DECLARATIONS
**********************************************************************
Ranges
RANGES: r_posnr FOR vbap-posnr.
DATA: BEGIN OF t_veramt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
END OF t_veramt.
DATA: BEGIN OF t_disamt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
netwr_v TYPE vbap-netwr,
mwsbp_v TYPE vbap-mwsbp,
disc_val TYPE vbap-mwsbp,
END OF t_disamt.
&----
*& ALV FIELDS
&----
DATA : alv_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
alv_layout TYPE slis_layout_alv.
**********************************************************************
SELECTION SCREEN
**********************************************************************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_ver RADIOBUTTON GROUP g1 USER-COMMAND rad DEFAULT 'X',
p_sab RADIOBUTTON GROUP g1 .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln NO INTERVALS MODIF ID gr1.
PARAMETERS: p_dwfile TYPE rlgrap-filename
DEFAULT 'C:\test1.txt' MODIF ID gr2, "#EC NOTEXT
p_upfile TYPE rlgrap-filename
DEFAULT 'C:\test.txt' MODIF ID gr3. "#EC NOTEXT
SELECTION-SCREEN END OF BLOCK b2.
************************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_upfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dwfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_dwfile.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_sab = 'X'.
IF screen-group1 = 'GR1' OR screen-group1 = 'GR2'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ELSE.
IF screen-group1 = 'GR3'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
**********************************************************************
START-OF-SELECTION
**********************************************************************
START-OF-SELECTION.
Check Radio Button
IF p_ver = 'X'.
PERFORM get_details_open_so_vertex.
ELSE.
PERFORM get_details_open_so.
ENDIF.
Display the output.
PERFORM diplay_report .
regards
vinod
‎2006 Jun 16 10:53 AM
Hi,
follow below logic
1) define all the fields and disable fields
which are not required using no-display option
in select-option.
2) On click of button
loop at screen
if screen-name = 'Test'.
screen-active = 1.
endif.
endloop.
Regards
Amole
‎2006 Jun 16 10:57 AM
Hi again,
1. U can use expand/collapse concept
where the fields will APPEAR
on the click of the button/icon present
on the selection-screen.
2. just copy paste to get a taste of it.
(run and press the button/icon in the middle of selection screen)
--- fields will appear
3.
REPORT abc.
INCLUDE icons.
*----
DATA : iv TYPE i,
in TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER : a(10) TYPE c MODIF ID m2.
PARAMETER : b(10) TYPE c MODIF ID m2.
PARAMETER : c(10) TYPE c MODIF ID m2.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECTION-SCREEN PUSHBUTTON /1(4) p1 USER-COMMAND btn1.
SELECTION-SCREEN:
BEGIN OF LINE,
COMMENT 1(3) text-001 MODIF ID m1,
POSITION 8.
PARAMETERS:date10 LIKE rpctaxin-taxdt MODIF ID m1,
bank10(60) TYPE c MODIF ID m1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN:
BEGIN OF LINE,
COMMENT 1(3) text-001 MODIF ID m1,
POSITION 8.
PARAMETERS:date11 LIKE rpctaxin-taxdt MODIF ID m1,
bank11(60) TYPE c MODIF ID m1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.
*----
INITIALIZATION.
iv = 1.
in = 0.
AT SELECTION-SCREEN OUTPUT.
IF iv = 0.
WRITE icon_collapse AS ICON TO p1(4).
ENDIF.
IF iv = 1.
WRITE icon_expand AS ICON TO p1(4).
ENDIF.
LOOP AT SCREEN.
WRITE : screen-name , screen-group1.
IF screen-group1 = 'M1'.
screen-invisible = iv.
screen-input = in.
*SCREEN-INPUT = V.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*----
AT SELECTION-SCREEN.
IF iv = 1.
iv = 0.
in = 1.
ELSE.
iv = 1.
in = 0.
ENDIF.
regards,
amit m.
‎2006 Jun 16 11:01 AM
try this options to see if it meets ur requirement
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9c2e35c111d1829f0000e829fbfe/content.htm