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 value not changing

Former Member
0 Likes
4,001

guyz!

i have one problem. in my selection screen, i am having one input file path and two radio buttons. one radio button for application server and the other one is for presentation server.when i'll select the radio button application server, the input help associated with input file path should show application server directory, and when i'll select radio button presentation server, it should show me directories in local work station. but my problem is, when i'm selecting presentation server radio button the respective value for that is not triggering. so as a result it is showing all the files in application server. so wat i got to do over here?

thnx & regds

manas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,087

Hi,

Need to do some things...., i faced the similar one before.call the FM marked in bold and see the coding.implement the same this will work definitely.

copy paste and see.

REPORT  ZTEST_REPORT1                           .
DATA: V_FILE TYPE STRING,
      V_FILE1(120).


PARAMETERS: P_FILE(120) LOWER CASE.
PARAMETERS: P_APPL RADIOBUTTON GROUP G1 user-command ABC default 'X',
            P_PRES RADIOBUTTON GROUP G1.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
  DATA IT_FIELDVALUES TYPE DYNPREAD OCCURS 0 WITH HEADER LINE.

  IT_FIELDVALUES-FIELDNAME = 'P_PRES'.
  APPEND IT_FIELDVALUES.
  IT_FIELDVALUES-FIELDNAME = 'P_APPL'.
  APPEND IT_FIELDVALUES.


  <b>CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME                         = SY-REPID
      DYNUMB                         = SY-DYNNR
    TABLES
      DYNPFIELDS                     = IT_FIELDVALUES
   EXCEPTIONS
     INVALID_ABAPWORKAREA           = 1
     INVALID_DYNPROFIELD            = 2
     INVALID_DYNPRONAME             = 3
     INVALID_DYNPRONUMMER           = 4
     INVALID_REQUEST                = 5
     NO_FIELDDESCRIPTION            = 6
     INVALID_PARAMETER              = 7
     UNDEFIND_ERROR                 = 8
     DOUBLE_CONVERSION              = 9
     STEPL_NOT_FOUND                = 10
     OTHERS                         = 11
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.</b>
  READ TABLE IT_FIELDVALUES WITH KEY FIELDNAME = 'P_APPL'.
  IF IT_FIELDVALUES-FIELDVALUE = 'X'.
    DATA: L_PATH  LIKE DXFIELDS-LONGPATH ,
          L_ABEND_FLAG LIKE DXFIELDS-ABENDFLAG .
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
      EXPORTING
        I_LOCATION_FLAG       = 'A'
        I_SERVER              = ' '
        I_PATH                = '/usr/users/'
      IMPORTING
        O_PATH                = L_PATH
        ABEND_FLAG            = L_ABEND_FLAG
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        RFC_ERROR             = 3.
    IF SY-SUBRC EQ 0.
      P_FILE = L_PATH.
    ENDIF.
    IF L_ABEND_FLAG = 'X'.
      EXIT.
    ENDIF.
  ELSE.
    DATA: FILE LIKE RLGRAP-FILENAME.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME  = SYST-CPROG
        DYNPRO_NUMBER = SYST-DYNNR
        FIELD_NAME    = ' '
      IMPORTING
        FILE_NAME     = FILE.
    IF SY-SUBRC = 0.
      P_FILE = FILE.
      V_FILE = P_FILE.
    ENDIF.
  ENDIF.

Regards

vijay

9 REPLIES 9
Read only

Former Member
0 Likes
2,087

Hi Manas,

YOu can define two differnt parameters to hold the file paths for application and presentation servers.

Regards,

ravi

Read only

0 Likes
2,087

ravi is rite u have to make diffrent parameter for both type of file depending on radio button.

Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch ,

kishan1(10) type c modif id ID1,

rd2 RADIOBUTTON group g1 ,

kishan2(10) TYPE C modif id ID2,

AT SELECTION-SCREEN.

check sy-ucomm = 'CH'.

AT SELECTION-SCREEN output.

IF rd1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID2' .

screen-ACTIVE = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF RD2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID1' .

screen-ACTIVE = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

LOOP AT SCREEN.

IF RD1 = 'X' .

CLEAR : KISHAN2.

ENDIF.

IF RD2 = 'X' .

CLEAR : KISHAN1.

ENDIF.

endloop.

u can use this logic to fullfill ur requirment.

now for file ...

*--F4 FILE HELP for detail legacy file from app. server.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR kishan1.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

  • FIELD_NAME = ' '

IMPORTING

file_name = p_syfilh .

*----


*--F4 FILE HELP for detail legacy file from local PC

AT SELECTION-SCREEN ON VALUE-REQUEST FOR kishan2. .

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

  • FIELD_NAME = ' '

IMPORTING

file_name = p_syfild.

*

Read only

0 Likes
2,087

write ur code

AT selection-screen output.

Reward points if it helps

Regards

Gunjan

Read only

Former Member
0 Likes
2,087

I guess you have written your own code for the Help request on the file field.

In that code, you need to check which radio button is active and call the appropriate function that will show the files either from the app server or the prez server.

Regards,

Ravi

Read only

Former Member
0 Likes
2,087

Here we go...

report ztest_tm.

**   SELECTON SCREEN

SELECTION-SCREEN BEGIN OF BLOCK selscr.
PARAMETERS: p_rad1   RADIOBUTTON GROUP rad1 USER-COMMAND a DEFAULT 'X'.
PARAMETERS: p_rad2   RADIOBUTTON GROUP rad1.
SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(20) text-001 FOR FIELD p_sfile MODIF ID mo1.
PARAMETERS : p_sfile(100) TYPE c MODIF ID mo1
    DEFAULT '\serverDATATABLE.TXT'.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text-001 FOR FIELD p_gfile MODIF ID mo2
.
PARAMETERS : p_gfile(100) TYPE c MODIF ID mo2
    DEFAULT 'C:DATATABLE.TXT'.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK selscr.

* At selection Screen Output Event
AT SELECTION-SCREEN OUTPUT.

  IF p_rad1 EQ 'X'.
    LOOP AT SCREEN.
      IF  screen-group1 = 'MO2'.
        screen-input = 0.
        screen-invisible = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'MO1'.
        screen-input = 0.
        screen-invisible = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Read only

Former Member
0 Likes
2,087

Hi Manas,

check the following code.


PARAMETER: r_prs  RADIOBUTTON GROUP g1 USER-COMMAND radio1 DEFAULT 'X',
           r_apps  RADIOBUTTON GROUP g1 .

at selection-screen output.
  if r_prs = 'X'.
   write 'presentation server'.
elseif r_apps = 'X'.
  write 'application server'.
endif.


hope it helps.

Regards,

Kinshuk

Read only

Former Member
0 Likes
2,087

guyz!

thnx a lot for your wonderful ideas. but let me make clear about one thing. my input file path is only one. but two radio buttons. depending on the radio button i chose, it has to show files either in app server or in prez server. and this logic i have written in my at selection-screen on value request. but my problem is, even though i am selecting presentation server radio button,its value is not changing. still the value is '' i.e. space. so respective function module is not getting invoked.

regds

manas

Read only

Former Member
0 Likes
2,088

Hi,

Need to do some things...., i faced the similar one before.call the FM marked in bold and see the coding.implement the same this will work definitely.

copy paste and see.

REPORT  ZTEST_REPORT1                           .
DATA: V_FILE TYPE STRING,
      V_FILE1(120).


PARAMETERS: P_FILE(120) LOWER CASE.
PARAMETERS: P_APPL RADIOBUTTON GROUP G1 user-command ABC default 'X',
            P_PRES RADIOBUTTON GROUP G1.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
  DATA IT_FIELDVALUES TYPE DYNPREAD OCCURS 0 WITH HEADER LINE.

  IT_FIELDVALUES-FIELDNAME = 'P_PRES'.
  APPEND IT_FIELDVALUES.
  IT_FIELDVALUES-FIELDNAME = 'P_APPL'.
  APPEND IT_FIELDVALUES.


  <b>CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME                         = SY-REPID
      DYNUMB                         = SY-DYNNR
    TABLES
      DYNPFIELDS                     = IT_FIELDVALUES
   EXCEPTIONS
     INVALID_ABAPWORKAREA           = 1
     INVALID_DYNPROFIELD            = 2
     INVALID_DYNPRONAME             = 3
     INVALID_DYNPRONUMMER           = 4
     INVALID_REQUEST                = 5
     NO_FIELDDESCRIPTION            = 6
     INVALID_PARAMETER              = 7
     UNDEFIND_ERROR                 = 8
     DOUBLE_CONVERSION              = 9
     STEPL_NOT_FOUND                = 10
     OTHERS                         = 11
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.</b>
  READ TABLE IT_FIELDVALUES WITH KEY FIELDNAME = 'P_APPL'.
  IF IT_FIELDVALUES-FIELDVALUE = 'X'.
    DATA: L_PATH  LIKE DXFIELDS-LONGPATH ,
          L_ABEND_FLAG LIKE DXFIELDS-ABENDFLAG .
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
      EXPORTING
        I_LOCATION_FLAG       = 'A'
        I_SERVER              = ' '
        I_PATH                = '/usr/users/'
      IMPORTING
        O_PATH                = L_PATH
        ABEND_FLAG            = L_ABEND_FLAG
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1
        SYSTEM_FAILURE        = 2
        RFC_ERROR             = 3.
    IF SY-SUBRC EQ 0.
      P_FILE = L_PATH.
    ENDIF.
    IF L_ABEND_FLAG = 'X'.
      EXIT.
    ENDIF.
  ELSE.
    DATA: FILE LIKE RLGRAP-FILENAME.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME  = SYST-CPROG
        DYNPRO_NUMBER = SYST-DYNNR
        FIELD_NAME    = ' '
      IMPORTING
        FILE_NAME     = FILE.
    IF SY-SUBRC = 0.
      P_FILE = FILE.
      V_FILE = P_FILE.
    ENDIF.
  ENDIF.

Regards

vijay

Read only

0 Likes
2,087

Vijay Babu Dudla

Hello!

THNX A LOT. SUPERB. LIKED UR SOLUTION. SIMPLY SUPERB.

THNX

MANAS