‎2010 Apr 27 9:45 AM
In my requirement I have to give selction range beside radio buttons. for ex-
rad1 - Customer(Label) -> Customer value range
rad2 - Vendor(Label) -> Vendor value range
Kindly tell me how to do that.
‎2010 Apr 27 9:50 AM
hi,
Could you please make this more clear..like do u need to just mention the range of customer numbers etc allowed for that specifica radiobutton or is it sumthing else.
In case you need to mention the range besides the description then why dont you mention it in the text element itself.After the description of the label you can give the range as well.
Regards,
Shlesha
‎2010 Apr 27 9:57 AM
it's like ,
when user will select radio button for customer, he will get a option to give the range for customer and at this time vendor field has to be greyed out and vice-versa. Hope my requirement is clear now.
‎2010 Apr 27 10:01 AM
use event
at selection scrren output.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p1_kunnr TYPE kunnr MODIF ID aaa,
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: p1_anred TYPE anred DEFAULT 'COMPANY' MODIF ID bbb,
SELECTION-SCREEN END OF BLOCK b4.
at selection scrren output.
LOOP AT SCREEN.
IF screen-group1 = 'AAA'.
IF p_id = 'E'.
screen-active = 1.
ELSEIF p_id = 'C'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ELSEIF screen-group1 = 'BBB'.
IF p_id = 'E'.
screen-active = 0.
ELSEIF p_id = 'C'.
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
try by taking help from this code.
‎2010 Apr 27 10:20 AM
see u are not getting my requirement.
the selection has to be based on radio button.
‎2010 Apr 27 10:39 AM
So you have achieved getting the radio button along with the range you mentioned and just looking as to how to enable/disable the fields based on the radio button?
Vikranth
‎2010 Apr 27 10:41 AM
Hi Nabanita,
TABLES : kna1, lfa1. " Tested Code Just execute
" You can you single Input field for both KUNNR and LIFNR since their Lengths are same and Have
"ALFA Conversion Exits any how check the below code
PARAMETERS: r1 RADIOBUTTON GROUP r DEFAULT 'X' USER-COMMAND r,
r2 RADIOBUTTON GROUP r.
SELECT-OPTIONS: kunnr FOR kna1-kunnr,
lifnr FOR lfa1-lifnr.
AT SELECTION-SCREEN OUTPUT.
IF r1 = 'X'.
LOOP AT SCREEN.
IF screen-name = '%_LIFNR_%_APP_%-VALU_PUSH' " You get these from Screen Layout
OR screen-name = '%_LIFNR_%_APP_%-TEXT'
OR screen-name = 'LIFNR-LOW'
OR screen-name = 'LIFNR-HIGH'.
screen-active = 0. " TO make it invisible
screen-input = 0 " To Make is Non Editable Mode
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = '%_KUNNR_%_APP_%-VALU_PUSH' " You get these from Screen Layout
OR screen-name = '%_KUNNR_%_APP_%-TEXT'
OR screen-name = 'KUNNR-LOW'
OR screen-name = 'KUNNR-HIGH'.
screen-active = 0. " TO make it invisible
screen-input = 0 " To Make is Non Editable Mode
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.Cheerz
Ram
‎2010 Apr 27 10:41 AM
ok nabnita try it in this way
if r_1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'AAA'.
screen-active = 1.
ELSEIF screen-group1 = 'BBB'
screen-active = 0.
ENDIF.
MODIFY SCREEN.
endloop.
elseif r_2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'AAA'.
screen-active = 0.
ELSEIF screen-group1 = 'BBB'
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
endif.
here r_1 and r_2 are radio buttons.
Edited by: gaurav.singh on Apr 27, 2010 11:41 AM
‎2010 Apr 27 10:45 AM
REPORT zsl_teste.
TABLES:vbak.
PARAMETERS: rb1 RADIOBUTTON GROUP 1,
rb2 RADIOBUTTON GROUP 1.
SELECT-OPTIONS: kun1 FOR vbak-kunnr,
kun2 FOR vbak-kunnr.
DATA: my_vbak LIKE vbak OCCURS 0.
IF rb1 = 'X'.
SELECT * FROM vbak INTO TABLE my_vbak
WHERE kunnr IN kun1.
ELSEIF rb2 = 'X'.
SELECT * FROM vbak INTO TABLE my_vbak
WHERE kunnr IN kun2.
ENDIF.this doenst fit your requirements?
(this code is using always kunnr but I think you get the point)
to change the labels just go to "goto"-> "text elements"-> selection texts
‎2010 Apr 27 10:50 AM
Hi Nabanita,
Please check with the below code.
TABLES: lfa1,kna1.
Selection screen part*
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS rad1 RADIOBUTTON GROUP rad USER-COMMAND com.
SELECT-OPTIONS s_kunnr for kna1-kunnr MODIF ID ABC.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS rad2 RADIOBUTTON GROUP rad .
SELECT-OPTIONS s_lifnr for lfa1-lifnr MODIF ID XYZ.
SELECTION-SCREEN END OF LINE.
Here the dynamic display part.*
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rad2 ='X'.
IF screen-group1 = 'ABC'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'XYZ'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ELSE.
IF screen-group1 = 'ABC'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'XYZ'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP .
Hope this may help you.
Regards,
Smart Varghese
‎2010 Apr 27 11:17 AM
Hi Nabanita....
I think the below piece of code should satisfy your requirement...
tables knvk.
selection-screen : begin of block b1.
Parameters cust radiobutton group lab
DEFAULT 'X' USER-COMMAND flag1.
select-options cust_rng for knvk-name1 modif id CUS.
Parameters vend radiobutton group lab.
select-options vend_rng for knvk-name1 modif id VEN.
selection-screen : end of block b1.
at selection-screen output.
loop at screen.
if cust = 'X' and screen-group1 = 'VEN'.
screen-input = 0.
modify screen.
endif.
if vend = 'X' and screen-group1 = 'CUS'.
screen-input = 0.
modify screen.
endif.
endloop.
Please revert back in case of any issues..
Sanju Saha
‎2010 Apr 27 11:31 AM
or
TABLES: lfa1,kna1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: rb1 RADIOBUTTON GROUP 1.
SELECT-OPTIONS: kna FOR kna1-kunnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: rb2 RADIOBUTTON GROUP 1.
SELECT-OPTIONS: lfa FOR lfa1-lifnr.
SELECTION-SCREEN END OF LINE.
DATA: my_kna1 LIKE kna1 OCCURS 0,
my_lfa1 LIKE lfa1 OCCURS 0.
IF rb1 = 'X'.
SELECT * FROM kna1 INTO TABLE my_kna1
WHERE kunnr IN kna.
ELSEIF rb2 = 'X'.
SELECT * FROM lfa1 INTO TABLE my_lfa1
WHERE kunnr IN lfa.
ENDIF.and then execute the program check the status, click twice in the screen number
and edit the layout of the screen.
delete those two fields were should be your labels and put yours in there.
😛 I don't know if we should do this...but it was the only way I found to do this easily
‎2010 Apr 27 3:22 PM
Moderator message - Please do not ask or answer basic questions - thread locked Rob