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

Populate values at selection screen

Former Member
0 Likes
4,839

Hi All,

My requirement is:

There are 2 radio buttons and 2 parameter fields.

By default, one radio button is selected and the two fields are populated with some values at the selection screen.

If the other radio button is selected, we need to pass different values to the two parameter fields.

Can you please suggest me how to populate values at selection screen.

I have tried populating them using AT SELECTION SCREEN OUTPUT, but didn't work.

Any pointers are helpful.

Thanks & Regards

Gowthami

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,359

hi,

Check this code..

PARAMETER:p_rad1 RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .
PARAMETER:p_rad2 RADIOBUTTON GROUP g.

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
PARAMETERs :Value TYPE kna1-kunnr.
SELECTION-SCREEN END OF BLOCK b1.


START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
IF p_rad1 EQ 'X'.
  Value = '1111'.
ENDIF.
IF p_rad2 EQ 'X'.
  Value = '2222'.
ENDIF.

15 REPLIES 15
Read only

faisalatsap
Active Contributor
0 Likes
2,359

Hi,

Can you Please Past your code so that we will be able to understand it in more better way?

Test My Sample Code in the following Thread May it will solve out your problem,

[AT SELECTION-SCREEN OUTPUT |]

Kind Regards,

Faisal

Read only

Former Member
0 Likes
2,359

Hi,

[]

Read only

0 Likes
2,359

Hi,

Please find below the piece of code.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.

PARAMETERS: p_fiscal RADIOBUTTON GROUP g_r1,

p_cal RADIOBUTTON GROUP g_r1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

PARAMETERS: p_month TYPE monat,

p_year TYPE gjahr.

SELECTION-SCREEN END OF BLOCK b2

INITIALIZTION.

p_month = sy-datum+4(2).

p_year = sy-datum+0(4).

AT SELECTION SCREEN OUTPUT.

if p_cal = 'X'.

clear p_month, p_year.

p_month = some value.

p_year = some value.

endif.

Thanks & Regards

Gowthami

Read only

0 Likes
2,359

Hi,

I have Changed the Code it is working fine now Test it Please and let me know if any issue,

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETERS: p_fiscal RADIOBUTTON GROUP g_r1 USER-COMMAND a,
p_cal RADIOBUTTON GROUP g_r1.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
PARAMETERS: p_month TYPE monat,
p_year TYPE gjahr.
SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  p_month = sy-datum+4(2).
  p_year = sy-datum+0(4).

  IF p_cal = 'X'.
    CLEAR: p_month, p_year.
    p_month = '99'.
    p_year = '9999'.
  ELSE.
    p_month = p_month.
    p_year = p_year.
  ENDIF.

Kind Regards,

Faisal

Read only

Former Member
0 Likes
2,359

hi,

create one program CALLING_PROGRAM and try this code...


DATA : i_result TYPE char1.

CALL FUNCTION 'K_KKB_POPUP_RADIO2'
  EXPORTING
    i_title   = 'Choose The Option'
    i_text1   = 'Option 1'
    i_text2   = 'Option 2'
    i_default = '1'
  IMPORTING
    i_result  = i_result
  EXCEPTIONS
    cancel    = 1
    OTHERS    = 2.

IF sy-subrc EQ  0.
  IF i_result EQ '1'.
    SUBMIT called_program1 VIA SELECTION-SCREEN AND RETURN.
    SUBMIT calling_program.
  ELSEIF i_result EQ '2'.
    SUBMIT called_program2 VIA SELECTION-SCREEN AND RETURN.
    SUBMIT calling_program.
  ENDIF.
ENDIF.

Read only

0 Likes
2,359

Hi Arunima,

Which one is the calling program and which one is the called program?

Please clarify.

Thanks & Regards

Gowthami

Read only

Former Member
0 Likes
2,359

Hi gowthami,

here is sample code to populate the select-options ..it works fine


data w_int type i.
select-options: s_opt for w_int.
at selection-screen output.
s_opt-low = 5.
s_opt-high = 7.
append s_opt.

Regards,

Mdi.Deeba

Read only

Former Member
0 Likes
2,359

Hi Gouthami,

Please paste your code here to check the issue.

However after providing the AT selection screen output event.

You will also have to define what Should be done if user selects the other radio button.

For ex :

IF R1 = 'X' .
  PERFORM SUB_DISP_ALV .
ENDIF .

IF R2 = 'X' .
  PERFORM SUB_UPLOAD_DATA .
  PERFORM SUB_FK01_CREATE .
ENDIF .

IF R3 = 'X' .
  PERFORM SUB_UPLOAD_DATA1.
  PERFORM SUB_FK02_CHANGE .
ENDIF .

Regards,

Kittu

Read only

0 Likes
2,359

Hi Kittu,

I am trying to populate some other values if the other radio button is selected.

But it is not working.

Read only

0 Likes
2,359

Thank you all for your inputs.

My problem got solved.

Read only

0 Likes
2,359

Hi.

Edited by: tahir naqqash on Feb 24, 2009 4:01 PM

Read only

Former Member
0 Likes
2,359

hello can you please paste code..and will see

and can you check below suggestion

If you want to display some parameter in then you need to use the Event AT SELECTION SCREEN OUTPUT. and inside the event you need to put a Loop at Screen and change it to the visible mode

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = <Paramter/Select Option> " 'P_PAR'.
screen-invisible = '1'. "Invisible
ELSE.
screen-invisible = '0'. "Visible
ENDIF.
MODIFY SCREEN.
ENDLOOP.

Thanks andregards

Durga.K

Read only

Former Member
0 Likes
2,360

hi,

Check this code..

PARAMETER:p_rad1 RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .
PARAMETER:p_rad2 RADIOBUTTON GROUP g.

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
PARAMETERs :Value TYPE kna1-kunnr.
SELECTION-SCREEN END OF BLOCK b1.


START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
IF p_rad1 EQ 'X'.
  Value = '1111'.
ENDIF.
IF p_rad2 EQ 'X'.
  Value = '2222'.
ENDIF.

Read only

Former Member
0 Likes
2,359

Hi. test the following code

selection-screen: begin of block a with frame title text-001.

parameters: rad1 radiobutton group  a DEFAULT 'X' USER-COMMAND a,
            rad2 radiobutton group a.
selection-screen skip.
PARAMETERS: input1 type i MODIF ID g1,
            input2 type i MODIF ID g2.

selection-screen end of block a.

    AT SELECTION-SCREEN OUTPUT.
    IF rad1 EQ 'X'.
     input1 = 200.
     input2 = 400.
    elseif rad2 EQ 'X'.
     input1 = 2.
     input2 = 4.
    endif.

Read only

Former Member
0 Likes
2,359

Hi Gowthami,

Try it this way:

PARAMETERS:
  R1 RADIOBUTTON group rad USER-COMMAND ABC default 'X',
  R2 RADIOBUTTON group rad.

Parameters:
  char1(10) type c,
  char2(10) type c.

Initialization.
  char1 = 'radio1'.
  char2 = 'radio1'.

At Selection-screen output.
  if r2 = 'X'.
*    loop at screen.
      char1 = 'radio2'.
      char2 = 'radio2'.
*      modify screen.
*    endloop.
  elseif r1 = 'X'.
*    loop at screen.
      char1 = 'radio1'.
      char2 = 'radio1'.
*      modify screen.
*    endloop.
  endif.

With luck,

Pritam.

Edited by: Pritam Ghosh on Feb 24, 2009 11:54 AM