2012 Feb 23 9:03 AM
Hi All,
I am facing one issue, I am having 2 radio button on selection screen and based on toggle between both we need to hide and display some parameter. but when I toggle between both the radio button, its trigger the start-of selection event.
Please find the code below and let me know why its start-of-selection event gets trigger without pressing execute button.
&----
*& SELECT-OPTIONS
&----
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS: s_pl_no FOR mara-matnr NO INTERVALS.
SELECTION-SCREEN: BEGIN OF LINE,
COMMENT 1(11) text-001,
POSITION 33.
PARAMETERS: p_plant TYPE marc-werks,
p_desc TYPE t001w-name1.
SELECTION-SCREEN END OF LINE.
PARAMETERS: p_mfrgr TYPE marc-mfrgr,
p_maabc TYPE marc-maabc,
p_year(4) TYPE c OBLIGATORY ,
r1 RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND onli MODIF ID mod ,
r2 RADIOBUTTON GROUP rad1,
p_month TYPE s031-spmon OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
&----
*& INITIALIZATION
&----
INITIALIZATION.
g_date = sy-datum.
SELECT SINGLE parva FROM usr05
INTO g_plant
WHERE bname = sy-uname
AND parid = c_plant.
IF sy-subrc EQ 0.
SELECT SINGLE name1 FROM t001w
INTO g_name1
WHERE werks = g_plant.
ENDIF.
CLEAR: g_bukrs, g_i_bukrs.
SELECT SINGLE bukrs FROM t001k INTO g_bukrs
WHERE bwkey = g_plant.
IF sy-subrc EQ 0.
g_i_bukrs = g_bukrs.
g_i_gjahr = p_year.
ENDIF.
*********************************************************
*AT SELECTION-SCREEN.
*********************************************************
AT SELECTION-SCREEN ON p_mfrgr.
PERFORM validate_mfrgr.
AT SELECTION-SCREEN ON p_maabc.
PERFORM validate_maabc .
AT SELECTION-SCREEN ON s_pl_no.
PERFORM validate_pl_no.
*********************************************************
*AT SELECTION-SCREEN OUTPUT.
*********************************************************
AT SELECTION-SCREEN OUTPUT.
p_year = g_date.
IF g_plant IS NOT INITIAL.
p_plant = g_plant.
CLEAR g_plant.
p_desc = g_name1.
ENDIF.
LOOP AT SCREEN.
IF screen-name EQ 'P_PLANT' OR screen-name EQ 'P_DESC'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
IF r1 EQ c_x.
IF screen-name = '%_P_MONTH_%_APP_%-TEXT' OR
screen-name = 'P_MONTH'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF r2 EQ c_x.
IF screen-name = '%_P_YEAR_%_APP_%-TEXT' OR
screen-name = 'P_YEAR'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
IF r1 EQ c_x.
CLEAR: p_month, sy-ucomm.
p_year = sy-datum+0(4).
ELSEIF r2 EQ c_x.
CLEAR: p_year, sy-ucomm.
p_month = sy-datum+0(6).
ENDIF.
************************************************************************
START-OF-SELECTION
************************************************************************
START-OF-SELECTION.
IF r1 = 'X'.
PERFORM sub_get_details.
ELSEIF r2 EQ 'X'.
ENDIF.
Thanks,
Jaten Sangal
2012 Feb 23 9:31 AM
HI,
Change onli from USER-COMMAND to any name like sample below to stop triggering the START-OF-SELECTION event because ONLI is the Fcode of the EXECUTE(F8).
USER-COMMAND TESTRevert back if you have any question or clarification.
Thanks,
iostreamax
Edited by: iostreamax on Feb 23, 2012 10:32 AM
2012 Feb 23 9:25 AM
Hi,
why dont you change the visibility of elements based on modification Id assigned to them. Explore and find out about MODIF ID and use it.
if p_class = 'X'.
LOOP AT SCREEN.
if screen-group1 = 'A'.
screen-active = 1.
elseif screen-group1 = 'B'.
screen-active = 0.
endif.
MODIFY SCREEN.
ENDLOOP.
elseif p_char = 'X' AND p_class = ' '.
LOOP AT SCREEN.
if screen-group1 = 'A'.
screen-active = 0.
elseif screen-group1 = 'B'.
screen-active = 1.
endif.
MODIFY SCREEN.
ENDLOOP.
endif.Thanks and regards,
kartik
2012 Feb 23 9:34 AM
Hi kartik,
I believe that it does not matter to change the visibility of elements based on modification Id assigned to them.
I am having an issue when I click on any radio button, control goes to Stat-OF-Selection even. It suppose to go only on at selection on output.
Is there any issue that code I have pasted above and this is ALV simple report, not Module pool programing.
Thanks for your reply, Kinldy explore more if you can.
Regards,
Jaten Sangal
2012 Feb 23 9:38 AM
As iostreamax said don't use ONLI but another user-command!
Regards,
Klaus
2012 Feb 23 9:31 AM
HI,
Change onli from USER-COMMAND to any name like sample below to stop triggering the START-OF-SELECTION event because ONLI is the Fcode of the EXECUTE(F8).
USER-COMMAND TESTRevert back if you have any question or clarification.
Thanks,
iostreamax
Edited by: iostreamax on Feb 23, 2012 10:32 AM
2012 Feb 23 9:36 AM
Hi,
Try to activate the program by removing 'MODIF ID' mod after the user command onli.
Regards,
Sharin