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,156

Hi all,

i want to use radio buttons in which user must select the task manually(no task selected by default) and you can select only 1 task.

I am using function module named'POPUP_TO_DECIDE_LIST'.

Could any one know abt this.

Thanks And Regards:

Pramit Bagare

7 REPLIES 7
Read only

Former Member
0 Likes
916

try using the event AT SELECTION-SCREEN OUTPUT and in this initializer both the radiobutton values - RB_1 = space. RB_2 = SPACE.

Read only

Former Member
0 Likes
916

See sample usage:

Fill l_seltab with appropriate values

CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

EXPORTING

cursorline = 1

mark_flag = 'X'

mark_max = 0

start_col = 0

start_row = 0

textline1 = "List'

titel = 'Title'

TABLES

t_spopli = l_seltab.

Read only

Former Member
0 Likes
916

Hi Pramith

1. Function

Create a Popup to choose among any number of (up to 25) options. The

options can appear in the Popup as checkboxes or radio buttons. In the

first case you can return several chosen lines, you can specify the

maximum allowed number of choices.

The title can be up to 40 characters in length, the options 40

characters and the texts 50 characters.

To ensure that the variable text can be translated :

o use consecutive numbered texts, so that the translator can tell

which texts belong together.

o do not reuse phrases, make another copy.

o specify the maximum allowed length.

2. Example calls

A centered Popup allowing the choice of up to two of three possible

answers is to be created (Creditor, Material, Account). The third option

is to be chosen by default.

And Example for u

DATA: BEGIN OF SPOPLIST OCCURS 15.

INCLUDE STRUCTURE SPOPLI.

DATA: END OF SPOPLIST.

DATA: ANTWORT TYPE C.

SPOPLIST-VAROPTION = 'Creditor'(001).

APPEND SPOPLIST.

SPOPLIST-VAROPTION = 'Material'(002).

APPEND SPOPLIST.

SPOPLIST-VAROPTION = 'Account '(003).

SPOPLIST-SELFLAG = 'X'.

CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

EXPORTING TITEL = 'Possible entra: Order'(a01)

TEXTLINE1 = 'By which criteria'(b01)

TEXTLINE2 = 'should orders'(b02)

TEXTLINE3 = 'be selected?'(b03)

MARK_MAX = 2

MARK_FLAG = 'X'

IMPORTING ANSWER = ANTWORT

TABLES T_SPOPLI = SPOPLIST

EXCEPTIONS TOO_MUCH_ANSWERS = 1

TOO_MUCH_MARKS = 2.

IF SY-SUBRC = 2.

WRITE: 'Too many answers chosen.'.

ENDIF.

IF ANTWORT = 'A'.

WRITE: 'Popup canceled.'.

ELSE.

WRITE: 'Options chosen:'.

LOOP AT SPOPLI WHERE SELFLAG = 'X'.

WRITE /SPOPLI-VAROPTION.

ENDLOOP.

ENDIF.

It if helps reward with points..

Regards Rk

Read only

Former Member
0 Likes
916

Hi,

check the function module.

This function module

Displays internal table as radiobuttons. Like this:

Value 1

Value 2

Value 3

Value 4

Returns No of line or 'A' if cancelled

CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

EXPORTING

CURSORLINE = 1

MARK_FLAG = ' '

MARK_MAX = 1

START_COL = 0

START_ROW = 0

TEXTLINE1 = TEXT1

TEXTLINE2 = TEXT2

TITEL = TITLE

IMPORTING

ANSWER = ANSWER

TABLES

T_SPOPLI = DECIDELIST

EXCEPTIONS

NOT_ENOUGH_ANSWERS = 1

TOO_MUCH_ANSWERS = 2

TOO_MUCH_MARKS = 3

OTHERS = 4.

Regards,

Sruthi.V

Read only

Former Member
0 Likes
916

<b>Just try executing this code..

U will come to know...

IF u pass 'X' to MAX_FLAG then it is a Check box ,,if ' ' then radio buttons ..</b>

DATA: BEGIN OF SPOPLIST OCCURS 15.

INCLUDE STRUCTURE SPOPLI.

DATA: END OF SPOPLIST.

DATA: ANTWORT TYPE C.

SPOPLIST-VAROPTION = 'Creditor'(001).

APPEND SPOPLIST.

SPOPLIST-VAROPTION = 'Material'(002).

APPEND SPOPLIST.

SPOPLIST-VAROPTION = 'Account '(003).

SPOPLIST-SELFLAG = 'X'.

APPEND SPOPLIST.

CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

EXPORTING TITEL = 'Possible entra: Order'(a01)

TEXTLINE1 = 'By which criteria'(b01)

TEXTLINE2 = 'should orders'(b02)

TEXTLINE3 = 'be selected?'(b03)

MARK_MAX = 1

MARK_FLAG = ' '

IMPORTING ANSWER = ANTWORT

TABLES T_SPOPLI = SPOPLIST

EXCEPTIONS TOO_MUCH_ANSWERS = 1

TOO_MUCH_MARKS = 2.

IF SY-SUBRC = 2.

WRITE: 'Too many answers chosen.'.

ENDIF.

IF ANTWORT = 'A'.

WRITE: 'Popup canceled.'.

ELSE.

WRITE: 'Options chosen:'.

LOOP AT SPOPLIst WHERE SELFLAG = 'X'.

WRITE / spoplist-varoption.

ENDLOOP.

ENDIF.

<b>By default if u want all the radio buttons non checked , u cannot do that with radio buttions.. go fot Check boxes and set the field MARK_MAX = 1.</b>

Hope it solves ur problem...

<b>reward if it helps u...

sai ramesh</b>

Message was edited by:

Sai ramesh

Read only

Former Member
0 Likes
916

Hi.......

in a radio button group one radio button should always be selected.....

Reward points if useful...

Suresh....

Read only

Former Member
0 Likes
916

you either have to use group radio button hardcoding or copy the standard FM and change the code the flag is getting set 'X'