2007 Aug 03 12:13 PM
Initially my selection screen should contain 2 radio buttons and 2 Parameters , none of them are mandatory.............But once when i press execute in my ABAP Editor...den it takes to Sel screen....right...den at dat time both da parameters are not mandatory..............At dis instant if i select Radiobutton 1 den 1'st parameter shud bcum Mandatory...n no changes to 2'nd parameter...n if i select Radiobutton 2 both da parameters should bcum NON MANDATORY..........................Remember dis should happen in Selection Screen only.....without clicking EXECUTE button on Sel...screen
Pls help me out !!!!!
plz try to stick to the board Laguage, which is english. i cant understand a word what you are trying to achieve. So i cant help you.
2007 Aug 03 12:16 PM
plz try to stick to the board Laguage, which is english. i cant understand a word what you are trying to achieve. So i cant help you.
2007 Aug 03 12:18 PM
hai
in my opinion when u use parameters in selection screen the value entry to those
parameters is mandatory. we can give select options as optional.
2007 Aug 03 12:18 PM
Hi..
TABLES: SSCRFIELDS.
DATA : V_UCOMM TYPE SSCRFIELDS-UCOMM.
PARAMETERS : R1 RADIOBUTTON GROUP G1 USER-COMMAND RB,
P_FIELD1 TYPE I,
R2 RADIOBUTTON GROUP G1,
P_FIELD1 TYPE I.
AT SELECTION-SCREEN OUTPUT.
IF V_UCOMM = 'RB'.
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_FIELD1'.
SCREEN-REQUIRED = 1. "mandatory field
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ELSEIF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_FIELD2'.
SCREEN-REQUIRED = 1. "mandatory field
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
Try the Above code.
<b>Reward if Helpful.</b>
AT SELECTION-SCREEN .
V_UCOMM = SSCRFIELDS-UCOMM.
2007 Aug 03 12:19 PM
Hi.
PARAMETERS: rad1 type c RADIOBUTTON GROUP xxx DEFAULT 'X' USER-COMMNAD 'SEL'.
PARAMETERS: rad2 type c RADIOBUTTON GROUP xxx.
PARAMTERS: par1(10) TYPE c,
par2(10) type c.
AT USER-COMMAND.
AT SELECTION-SCREEN OUTPUT.
IF rad1 = 'X'.
loop at SCREEN.
if screen-name = 'PAR1'.
screen-required = 1.
modify screen.
endif.
ENDLOOP.
elseif rad2 = 'X'
if screen-name = 'PAR1' OR screen-name = 'PAR2'.
screen-required = 1.
modify screen.
endif.
ENDLOOP.
endif.
Regards,
Sesh
2007 Aug 03 12:21 PM
Hi...Test this code.
TABLES: SSCRFIELDS.
DATA : V_UCOMM TYPE SSCRFIELDS-UCOMM.
PARAMETERS : R1 RADIOBUTTON GROUP G1 USER-COMMAND RB,
P_FIELD1 TYPE I,
R2 RADIOBUTTON GROUP G1,
P_FIELD1 TYPE I.
<b>AT SELECTION-SCREEN OUTPUT.</b>
IF V_UCOMM = 'RB'.
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_FIELD1'.
SCREEN-REQUIRED = 1. "mandatory field
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ELSEIF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_FIELD2'.
SCREEN-REQUIRED = 1. "mandatory field
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
<b>AT SELECTION-SCREEN .</b>
V_UCOMM = SSCRFIELDS-UCOMM.
<b>Try the Above code.
Reward if Helpful.</b>
2007 Aug 03 12:41 PM
(1) A radio-button group is always mandatory, as one of the option should be selected, only one but one.
PARAMETERS: but1 RADIOBUTTON GROUP one,
but2 RADIOBUTTON GROUP one.
INITIALIZATION.
CLEAR: but1, but2.=> but1 is "ON" on the selection screen
Maybe you should have checkboxes and not radio buttons ?
(2) Mandatory fields, look a the following sample code
* Screen fields
TABLES: sscrfields.
* Are fields mandatory
DATA: field1_mandatory TYPE i,
field2_mandatory TYPE i.
* Parameters
PARAMETERS: button_1 RADIOBUTTON GROUP one USER-COMMAND one,
button_2 RADIOBUTTON GROUP one,
field1(10),
field2(10).
INITIALIZATION.
CLEAR: field1_mandatory,
field2_mandatory.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-name.
* Field1 mandatory or not
WHEN 'FIELD1'.
screen-required = field1_mandatory.
* Field2 mandatory or not
WHEN 'FIELD2'.
screen-required = field2_mandatory.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ONE'. " A button was selected
IF button_1 = 'X'.
field1_mandatory = 1.
ELSEIF button_2 = 'X'.
CLEAR: field1_mandatory,
field2_mandatory.
ENDIF.Regards
<i>"What is conceived well is stated clearly and the words for the statement come easily"</i>
2007 Aug 03 12:43 PM
NO.........Noce of the code's posted is accurate....pls...help me out.
2007 Aug 03 12:46 PM
Hi,
Actually your requirement itself is wrong, by default at least one radio button will be selected, so by default one paramter will be mandatory.
So I think the code give should not be problem.
Regards,
Sesh
2007 Aug 03 12:48 PM
Hi ...Raymond....
IT's giving an Error Msg...." USER-COMMAND"man only occur in the first parameter of a radio button group.
2007 Aug 03 12:58 PM
Hi CHRISTOPHER ,
"Here is the program for your requirement ....REPORT ZDSDFZX.
TABLES : S021, VBRK, VBRP.
SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: p_year for s021-spmon obligatory modif id a1,p_vbeln FOR vbrk-vbeln .
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
PARAMETERS: nrw RADIOBUTTON GROUP g1 default 'X' user-command check,
standard RADIOBUTTON GROUP g1 .
SELECTION-SCREEN END OF BLOCK blk2.
SELECTION-SCREEN END OF BLOCK blk.
AT SELECTION-SCREEN OUTPUT.
IF nrw = 'X'.
loop at screen.
if screen-group1 = 'A1' .
screen-input = 0.
CLEAR p_year[].
modify screen.
endif.
endloop.
endif.
if standard = 'X'.
loop at screen.
if screen-group1 = 'A1'.
screen-input = 1.
modify screen.
endif.
endloop.endif.Reward points if it is usefull.
Girish
2007 Aug 03 1:24 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |