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

selection-screen

Former Member
0 Likes
561

hi experts,

i have one requirement that on first screen there shold b three radiobuttons..if i click on to 1 then a new selection screen opens with some parameters n radiobuttons..plz tell me how cud i do dis..how can i use SET SCREENS OR CALL SCREENS..i have never made these kind of reports..plz send some usefull examples.

regards,

raman

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Hello Sharma,

I created and tested the code right now.

It is working as per your requirement. But in this program there are only 2 radio buttons, you can include 3rd rad button also.

Design screen number 100 and 200 according to your coding.

in this program if you click on radio button 'FLIGHT' one more screen will popup. Otherwise, if you click on 2nd rad button 'BOOKING' another screen will popup.

&----


*& Report ZBC_09_CALL_SEL_SCREEN *

*& *

&----


*& *

*& *

&----


REPORT zbc_09_call_sel_screen.

TABLES: sflight, sbook.

DATA: it_sflight TYPE TABLE OF sflight,

wa_sflight LIKE LINE OF it_sflight.

DATA: it_sbook TYPE TABLE OF sbook,

wa_sbook LIKE LINE OF it_sbook.

PARAMETERS: p_carrid LIKE sflight-carrid,

flight RADIOBUTTON GROUP rad1 DEFAULT 'X',

booking RADIOBUTTON GROUP rad1.

SELECTION-SCREEN: BEGIN OF SCREEN 100.

SELECT-OPTIONS: s_connid FOR sflight-connid,

s_fldate FOR sflight-fldate.

SELECTION-SCREEN: END OF SCREEN 100.

SELECTION-SCREEN: BEGIN OF SCREEN 200.

SELECT-OPTIONS: s_conid FOR sbook-connid,

s_fldat FOR sbook-fldate,

s_bookid FOR sbook-bookid.

SELECTION-SCREEN: END OF SCREEN 200.

START-OF-SELECTION.

IF flight = 'X'.

CALL SELECTION-SCREEN 100.

PERFORM get_sflight.

PERFORM display_sflight.

ELSE.

CALL SELECTION-SCREEN 200.

PERFORM get_sbook.

PERFORM display_sbook.

ENDIF.

&----


*& Form get_sflight

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_sflight.

SELECT carrid connid fldate price

currency planetype seatsmax seatsocc

paymentsum

FROM sflight

INTO CORRESPONDING FIELDS OF TABLE it_sflight

WHERE carrid EQ p_carrid AND

connid IN s_connid AND

fldate IN s_fldate.

ENDFORM. " get_sflight

&----


*& Form display_sflight

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_sflight.

LOOP AT it_sflight INTO wa_sflight.

WRITE: / wa_sflight-carrid, wa_sflight-connid,

wa_sflight-fldate, wa_sflight-price,

wa_sflight-currency, wa_sflight-planetype,

wa_sflight-seatsmax, wa_sflight-seatsocc,

wa_sflight-paymentsum.

ENDLOOP.

ENDFORM. " display_sflight

&----


*& Form get_sbook

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_sbook.

SELECT carrid connid fldate bookid

customid custtype smoker luggweight

wunit invoice class forcuram

forcurkey loccuram loccurkey order_date

counter agencynum cancelled

FROM sbook

INTO CORRESPONDING FIELDS OF TABLE it_sbook

WHERE carrid EQ p_carrid AND

connid IN s_conid AND

fldate IN s_fldat AND

bookid IN s_bookid.

ENDFORM. " get_sbook

&----


*& Form display_sbook

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_sbook.

LOOP AT it_sbook INTO wa_sbook.

WRITE: / wa_sbook-carrid, wa_sbook-connid,

wa_sbook-fldate, wa_sbook-bookid,

wa_sbook-customid, wa_sbook-custtype,

wa_sbook-smoker, wa_sbook-luggweight,

wa_sbook-wunit, wa_sbook-invoice,

wa_sbook-class, wa_sbook-forcuram,

wa_sbook-forcurkey, wa_sbook-loccuram,

wa_sbook-loccurkey, wa_sbook-order_date,

wa_sbook-counter, wa_sbook-agencynum,

wa_sbook-cancelled.

ENDLOOP.

ENDFORM. " display_sbook

Rewards iF Helpful.

Regards

--

Sasidhar Reddy Matli.

5 REPLIES 5
Read only

Former Member
0 Likes
531

Hi..

check this code..

"RADIO BUTTON for report display & DOWNload & FOR Both

SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-004.

PARAMETERS: P_DOWN RADIOBUTTON GROUP RAD2 USER-COMMAND AB,

P_REPORT RADIOBUTTON GROUP RAD2,

P_DW_RP RADIOBUTTON GROUP RAD2 .

SELECTION-SCREEN END OF BLOCK B4.

"Radio button for list and grid Selection

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS: P_GRID RADIOBUTTON GROUP RAD1

DEFAULT 'X' ,

P_LIST RADIOBUTTON GROUP RAD1 .

SELECTION-SCREEN END OF BLOCK B2.

"FILE PATH

SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT-007.

PARAMETERS: P_PATH(128) type C modif id PTH default '.\gaurav'.

SELECTION-SCREEN END OF BLOCK B5.

INITIALIZATION.

V_PROGNAME = SY-REPID.

  • Display default variant using FM REUSE_ALV_VARIANT_DEFAULT_GET

PERFORM DEFAULT_VARIANT.

perform HEADER_NAME.

AT SELECTION-SCREEN OUTPUT.

if P_report = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 0.

screen-input = 0.

screen-invisible = 1.

screen-required = 0.

modify screen.

clear screen.

endif.

endloop.

ELSEif P_DOwn = 'X' or P_dw_rp = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

*screen-required = 1.

modify screen.

clear screen.

endif.

endloop.

endif.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PATH.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = ' '

IMPORTING

FILE_NAME = P_PATH.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VAR.

  • Display a list of various variants of the report when the

  • user presses F4 key in the variant field

PERFORM VARIANT_F4. "USING FM REUSE_ALV_VARIANT_F4

******AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.

*******.

AT SELECTION-SCREEN.

*val....1 Variant check

  • Once the user has entered variant, check about its existence

PERFORM CHECK_PVAR. "Using FM REUSE_ALV_VARIANT_EXISTENCE

*val....2 Sd do not exists

SELECT SINGLE VBELN INTO WA_HEADER-VBELN FROM VBAK WHERE VBELN IN

S_VBELN.

IF SY-SUBRC <> 0.

MESSAGE E010 WITH TEXT-010.

ENDIF.

*val.....3 Date of creation check

LOOP AT S_DOC.

IF S_DOC-LOW > SY-DATUM OR S_DOC-HIGH > SY-DATUM.

MESSAGE E011 WITH TEXT-011.

ENDIF.

ENDLOOP.

*VAL....4

if P_DOWN = 'X' AND P_PATH is initial.

MESSAGE E011 WITH TEXT-011.

endif.

if P_DW_RP = 'X' AND P_path is initial.

MESSAGE E011 WITH TEXT-011.

endif.

REWARD IF USEFUL

GAURAV J>

Read only

Former Member
0 Likes
532

Hello Sharma,

I created and tested the code right now.

It is working as per your requirement. But in this program there are only 2 radio buttons, you can include 3rd rad button also.

Design screen number 100 and 200 according to your coding.

in this program if you click on radio button 'FLIGHT' one more screen will popup. Otherwise, if you click on 2nd rad button 'BOOKING' another screen will popup.

&----


*& Report ZBC_09_CALL_SEL_SCREEN *

*& *

&----


*& *

*& *

&----


REPORT zbc_09_call_sel_screen.

TABLES: sflight, sbook.

DATA: it_sflight TYPE TABLE OF sflight,

wa_sflight LIKE LINE OF it_sflight.

DATA: it_sbook TYPE TABLE OF sbook,

wa_sbook LIKE LINE OF it_sbook.

PARAMETERS: p_carrid LIKE sflight-carrid,

flight RADIOBUTTON GROUP rad1 DEFAULT 'X',

booking RADIOBUTTON GROUP rad1.

SELECTION-SCREEN: BEGIN OF SCREEN 100.

SELECT-OPTIONS: s_connid FOR sflight-connid,

s_fldate FOR sflight-fldate.

SELECTION-SCREEN: END OF SCREEN 100.

SELECTION-SCREEN: BEGIN OF SCREEN 200.

SELECT-OPTIONS: s_conid FOR sbook-connid,

s_fldat FOR sbook-fldate,

s_bookid FOR sbook-bookid.

SELECTION-SCREEN: END OF SCREEN 200.

START-OF-SELECTION.

IF flight = 'X'.

CALL SELECTION-SCREEN 100.

PERFORM get_sflight.

PERFORM display_sflight.

ELSE.

CALL SELECTION-SCREEN 200.

PERFORM get_sbook.

PERFORM display_sbook.

ENDIF.

&----


*& Form get_sflight

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_sflight.

SELECT carrid connid fldate price

currency planetype seatsmax seatsocc

paymentsum

FROM sflight

INTO CORRESPONDING FIELDS OF TABLE it_sflight

WHERE carrid EQ p_carrid AND

connid IN s_connid AND

fldate IN s_fldate.

ENDFORM. " get_sflight

&----


*& Form display_sflight

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_sflight.

LOOP AT it_sflight INTO wa_sflight.

WRITE: / wa_sflight-carrid, wa_sflight-connid,

wa_sflight-fldate, wa_sflight-price,

wa_sflight-currency, wa_sflight-planetype,

wa_sflight-seatsmax, wa_sflight-seatsocc,

wa_sflight-paymentsum.

ENDLOOP.

ENDFORM. " display_sflight

&----


*& Form get_sbook

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_sbook.

SELECT carrid connid fldate bookid

customid custtype smoker luggweight

wunit invoice class forcuram

forcurkey loccuram loccurkey order_date

counter agencynum cancelled

FROM sbook

INTO CORRESPONDING FIELDS OF TABLE it_sbook

WHERE carrid EQ p_carrid AND

connid IN s_conid AND

fldate IN s_fldat AND

bookid IN s_bookid.

ENDFORM. " get_sbook

&----


*& Form display_sbook

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_sbook.

LOOP AT it_sbook INTO wa_sbook.

WRITE: / wa_sbook-carrid, wa_sbook-connid,

wa_sbook-fldate, wa_sbook-bookid,

wa_sbook-customid, wa_sbook-custtype,

wa_sbook-smoker, wa_sbook-luggweight,

wa_sbook-wunit, wa_sbook-invoice,

wa_sbook-class, wa_sbook-forcuram,

wa_sbook-forcurkey, wa_sbook-loccuram,

wa_sbook-loccurkey, wa_sbook-order_date,

wa_sbook-counter, wa_sbook-agencynum,

wa_sbook-cancelled.

ENDLOOP.

ENDFORM. " display_sbook

Rewards iF Helpful.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
531

RAMAN,

PARAMETERS : R1 TYPE C RADIOBUTTON

GROUP RAD1 USER-COMMAND radio,

R2 TYPE C RADIOBUTTON

GROUP RAD1,

R3 TYPE C RADIOBUTTON

GROUP RAD1.

SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW .

SELECTION-SCREEN BEGIN OF BLOCK SEL1

WITH FRAME.

PARAMETERS: R5 TYPE C AS RADIOBUTTON

GROUP RAD2,

R6 TYPE C AS RADIOBUTTON

GROUP RAD2.

SELECTION-SCREEN END OF BLOCK SEL1.

SELECTION-SCREEN END OF SCREEN 500.

Like screen 500 Make 2 more screens as per your requirement

AT SELECTION-SCREEN .

IF R1 EQ 'X'.

CALL SELECTION-SCREEN 500 STARTING

AT 10 10.

ELSEIF R2 EQ 'X'.

CALL SELECTION-SCREEN 600 STARTING

AT 10 10.

ELSE.

CALL SELECTION-SCREEN 700 STARTING

AT 10 10.

ENDIF.

Don't forget to reward if useful....

Read only

Former Member
0 Likes
531

Hi,

you cna use module pool programming i.e. SE80 to design your two screens screen 1 (screen no: 9000) with radio buttons and parameters. Also design screen2 (screen no: 9001_with radio buttons adn other selection screen paratmeters.

Give a function code e.g. 'RAD1' to the radio button on whose click u want to call screen 2

in the PAI of the screen1 i.e. screen no 9000:

case sy-ucomm.

when 'RAD1'.

call screen 9001.

endcase.

Reward Appropriate points.

Regards,

Mansi.

Read only

Former Member
0 Likes
531

hi,

selection-screen pushbutton 10(20) but0 user-command a.

parameters : rb1 radiobutton group rad user-command com,
             rb2 radiobutton group rad,
             rb3 radiobutton group rad.

selection-screen begin of screen 100.
selection-screen pushbutton 10(20) but1 user-command b.
selection-screen end   of screen 100.

selection-screen begin of screen 200.
selection-screen pushbutton 10(20) but2 user-command b.
selection-screen end   of screen 200.

selection-screen begin of screen 300.
selection-screen pushbutton 10(20) but3 user-command b.
selection-screen end   of screen 300.

data flag.

at selection-screen output.
if flag = 'X'.
loop at screen.
case screen-name.
when 'BUT0'.
screen-invisible = 1.
when 'RB1'.
screen-invisible = 0.
when 'RB2'.
screen-invisible = 0.
when 'RB3'.
screen-invisible = 0.
endcase.
modify screen.
endloop.
else.
loop at screen.
case screen-name.
when 'BUT0'.
screen-invisible = 0.
when 'RB1'.
screen-invisible = 1.
when 'RB2'.
screen-invisible = 1.
when 'RB3'.
screen-invisible = 1.
endcase.
modify screen.
endloop.
endif.

at selection-screen. 

case sy-ucomm.
when 'A'.
flag = 'X'.
endcase.

case 'X'.
when rb1.
call selection-screen 100.
when rb2.
call selection-screen 200.
when rb3.
call selection-screen 300.
endcase.

initialization.
move : 'First  screen' to but1,
       'Second screen' to but2,
       'Third screen'  to but3,
       'START'         to but0.

Cheers,

Will.