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 text change in module pool program

Former Member
0 Likes
1,674

Hi All,

We have requirement of changing text of radio button dynamincally in module pool program.

We want to change text of radio button based on flag.

Can we do this in module pool program?

Regards,

Jigar Thakkar.

5 REPLIES 5
Read only

Former Member
0 Likes
1,109

Hi, Jigar!

Is it a selection-screen? You can make use of selection-screen comments as shown here.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,109

Just define the text field as an I/O field and a variable of program global data, check output only box, and change its value accordingly.

Regards,

Raymond

Read only

Former Member
0 Likes
1,109

Is that flag a listbox?

If yes I can help.

Read only

Former Member
0 Likes
1,109

pls check

Read only

Former Member
0 Likes
1,108

1) Create Screen (2000) as follows:

2) Module pool as following code:

PROCESS BEFORE OUTPUT.

MODULE STATUS_2000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_2000.

*&---------------------------------------------------------------------*

*& Include ZR_RADIO_BUTTON_MP_TOP                            Module Pool      ZR_RADIO_BUTTON_MP

*&

*&---------------------------------------------------------------------*

PROGRAM  ZR_RADIO_BUTTON_MP.

DATA: RAD1,RAD2,TEXT1.

      DATA: RADIO1 TYPE C LENGTH 20,

            RADIO2 TYPE C LENGTH 20.

      DATA: lang TYPE C LENGTH 20.

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_2000  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE USER_COMMAND_2000 INPUT.

  IF SY-UCOMM = 'LANGFT'.

    IF lang = '1'.

      RADIO1 = 'radio1'.

      ELSE.

      RADIO1 = 'radio2'.

      ENDIF.

  ENDIF.

IF SY-UCOMM = 'RADIO' AND RAD1 = 'X'.

  MESSAGE 'RADIO BUTTON1 CLICKED' TYPE 'I'.

ELSEIF SY-UCOMM = 'RADIO' AND RAD2 = 'X'.

  MESSAGE 'RADIO BUTTON2 CLICKED' TYPE 'I'.

ELSEIF SY-UCOMM = 'EXIT'.

  LEAVE TO SCREEN 0.

ENDIF.

ENDMODULE.                 " USER_COMMAND_2000  INPUT

*&---------------------------------------------------------------------*

*& Module Pool       ZR_RADIO_BUTTON_MP

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

INCLUDE ZR_RADIO_BUTTON_MP_TOP                  .    " global Data

* INCLUDE ZR_RADIO_BUTTON_MP_O01                  .  " PBO-Modules

* INCLUDE ZR_RADIO_BUTTON_MP_I01                  .  " PAI-Modules

* INCLUDE ZR_RADIO_BUTTON_MP_F01                  .  " FORM-Routines

*&---------------------------------------------------------------------*

*&      Module  STATUS_2000  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE STATUS_2000 OUTPUT.

  SET PF-STATUS 'RADIO'.

  SET TITLEBAR 'RAD'.

  TYPE-POOLS : VRM.

  DATA: ld_field    TYPE VRM_ID ,

        it_listbox  TYPE VRM_VALUES,

        wa_listbox  LIKE LINE OF it_listbox.

    REFRESH it_listbox.

    wa_listbox-key = '1'.

    wa_listbox-text = 'One'.

    append wa_listbox to it_listbox.

    clear wa_listbox.

    wa_listbox-key = '2'.

    wa_listbox-text = 'Two'.

    append wa_listbox to it_listbox.

    clear wa_listbox.

  ld_field = 'lang'.

  CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

      id     = ld_field

      values = it_listbox.

  IF lang = '1'.

    RADIO1 = 'Radio1'.

    RADIO2 = 'Radio2'.

  ELSE.

    RADIO1 = 'Radio2'.

    RADIO2 = 'Radio1'.

  ENDIF.

ENDMODULE.                 " STATUS_2000  OUTPUT

3) Listbox Property

4) GUI Status

5) Runtime Screen