Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

radio button

Former Member
0 Likes
1,414

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.

12 REPLIES 12
Read only

Former Member
0 Likes
1,363

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

Read only

0 Likes
1,363

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.

Read only

0 Likes
1,363

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.

Read only

0 Likes
1,363

see u are not getting my requirement.

the selection has to be based on radio button.

Read only

0 Likes
1,363

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

Read only

0 Likes
1,363

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

Read only

0 Likes
1,363

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

Read only

0 Likes
1,363

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

Read only

Former Member
0 Likes
1,363

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

Read only

Former Member
0 Likes
1,363

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

Read only

0 Likes
1,363

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

Read only

Former Member
0 Likes
1,363

Moderator message - Please do not ask or answer basic questions - thread locked Rob