Application Development 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: 

Issue in using radio button in module pool

Former Member
0 Kudos

For same field I need 2 different search help. Based on radio button on screen I need company codeu2019s from different table. Issue is, at execution radio button remains blank. Radio button works only when I use them in PAI under CASE SY-UCOMM. WHEN u2018DONEu2019. IF Normal_Run = u2018Xu2019u2026u2026

Can I use radio button with the below code. Please refer the below code.

PROCESS ON VALUE-REQUEST.
FIELD COMP_CODE MODULE POPULATE_COMP_CODE.

MODULE POPULATE_COMP_CODE INPUT.
IF REPEAT_RUN = 'X'.
PERFORM COMP_CODE_POPULATE.
ELSEIF NORMAL_RUN = 'X'.
PERFORM COMP_CODE_POPULATE_N.
ENDIF.
ENDMODULE.   

FORM COMP_CODE_POPULATE .
    SELECT COMP_CODE
      FROM  ZIFRS_D_PROCESS
      INTO  CORRESPONDING FIELDS OF TABLE VALUES_TAB_CC
      WHERE PROC_NAME = 'DEPRECIATION RUN'.
  READ TABLE VALUES_TAB INDEX 1.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD    = 'COMP_CODE'
      DYNPPROG    = PROGNAME
      DYNPNR      = DYNNUM
      DYNPROFIELD = 'COMP_CODE'
      VALUE_ORG   = 'S'
    TABLES
      VALUE_TAB   = VALUES_TAB_CC.
ENDFORM.                    " COMP_CODE_POPULATION

FORM COMP_CODE_POPULATE_N .
  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      TABNAME     = '/BI0/SCOMP_CODE'
      FIELDNAME   = 'COMP_CODE'
      DYNPPROG    = PROGNAME
      DYNPNR      = DYNNUM
      DYNPROFIELD = 'COMP_CODE'.
ENDFORM.                    " COMP_CODE_POPULATE_N

Moderator Message: Please use "code" tags to format the code snippet.

Edited by: Suhas Saha on Nov 23, 2011 5:13 PM

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Yes it will not be available inside it. What you can do is call one module and use function DYNP_VALUES_READ inside it. Also select both the radio buttons in the screen layout, right click and group it.

example

in PBO


 CLEAR: field_value, dynpro_values.
  field_value-fieldname = 'P1'.
  APPEND field_value TO dynpro_values.
    field_value-fieldname = 'P2'.
  APPEND field_value TO dynpro_values.

In POV


CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname             = progname
            dynumb             = dynnum
            translate_to_upper = 'X'
       TABLES
            dynpfields         = dynpro_values.

Now The radio button and the value for which its marked will be available, now based on the option process the logic

2 REPLIES 2

kesavadas_thekkillath
Active Contributor
0 Kudos

Yes it will not be available inside it. What you can do is call one module and use function DYNP_VALUES_READ inside it. Also select both the radio buttons in the screen layout, right click and group it.

example

in PBO


 CLEAR: field_value, dynpro_values.
  field_value-fieldname = 'P1'.
  APPEND field_value TO dynpro_values.
    field_value-fieldname = 'P2'.
  APPEND field_value TO dynpro_values.

In POV


CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname             = progname
            dynumb             = dynnum
            translate_to_upper = 'X'
       TABLES
            dynpfields         = dynpro_values.

Now The radio button and the value for which its marked will be available, now based on the option process the logic

former_member1245113
Active Contributor
0 Kudos

Hi

You need to make the Grouping for these Radio button on the screen

Search for how to make Radio buttons grouping

http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCDWBTUT/BCDWBTUT.pdf

and search for Radio button Group in this document

assign a Function Code for one of the radio buttons(It allows for only one Radio Button)

This triggers automatic PAI so when you take the F4 Help this is readily available

In TOP include make sure you define the variables corresponding to the Radio buttons on the screen and also provide default value X to one of the Radio buttons

Hope this serves your purpose

Cheerz

Ramchander Rao.K