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

Creating Sub-screen

Former Member
0 Likes
2,167

Hi All,

My requirement is my intial screen has 4 radio button. If I clicked on a different radio button, a new screen should appear containging the selection parameters that I need. How do I implement this?

Thanks.

Jim

9 REPLIES 9
Read only

Former Member
0 Likes
1,260

hi jim,

first create a screen with four radio buttons and group it , then give the condition as if radio1 = 'X' and call the required screen . this way u have to give .

hope it helps.

with regards,

magesh.

Read only

0 Likes
1,260

hi magesh.

can you show me a sample code? thanks a lot.

jim

Read only

0 Likes
1,260

hi jim ,

try this.

parameters screen1 radiobutton group scr default 'X'.

parameters screen2 radiobutton group scr.

parameters screen3 radiobutton group scr.

parameters screen4 radiobutton group scr.

CALL SCREEN 100.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

IF SY-UCOMM = 'DISP' AND SCREEN1 = 'X'.

LEAVE TO SCREEN 200.

ELSEIF SY-UCOMM = 'DISP' AND SCREEN2 = 'X'.

LEAVE TO SCREEN 300.

ELSEIF SY-UCOMM = 'DISP' AND SCREEN3 = 'X'.

LEAVE TO SCREEN 400.

......

.....

endmodule. " USER_COMMAND_0100 INPUT

u give for all radiobuttons.

here u create a screen with a command button with fcode 'DISP' and the design the screen which r called in the program.

the function of the code is that when u select a radio button and press the command button the screen is called.

i think this is ur requirement.

with regards,

magesh.

Read only

Former Member
0 Likes
1,260

In Se 80,

data: rb1, rb2, rb3, rb4.

create screen 100.

add 4 radiobuttons with above names.

create screen 10 with required fields (when rb1 selected).

create screen 20 with required fields (when rb2 selected).

create screen 30 with required fields (when rb3 selected).

create screen 40 with required fields (when rb4 selected).

In 100 screen PAI:

If rb1 = 'x'.

call screen 10.

endif.

If rb2 = 'x'.

call screen 20.

endif.

If rb3 = 'x'.

call screen 30.

endif.

If rb4 = 'x'.

call screen 40.

endif.

Put a back push button in all 10,20,30,40 screens.

Coding in PAI's of all screens are.

case sy-ucomm.

when 'back'.

set screen 0.

endcase.

create a transaction and execute.

Read only

Former Member
0 Likes
1,260

Hi Jim,

Create a <b>normal screen</b> and in the screen layout create a subscreen area , it will ask for the subscreen area name, give it.

similary create as many <b>subscreen</b> as required using se51 and define selection parameters in the screen painter (layout) of the subscreen.

In flow logic of the normal screen after the module status use the below line to call the subscreen.

call subscreen <subscreen area name> sy-repid <subscreen -number>.

Read only

Former Member
0 Likes
1,260

Hi,

Use the code as follows:

parameters: r1 radiobutton group RAD1 <b>user-command ABC</b> default 'X',

r2 radiobutton group RAD1.

AT SELECTION-SCREEN.

check sy-ucomm = 'ABC'.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

if r1 = 'X' and screen-group1 = 'SC1' .

screen-input = 0.

ENDIF.

IF r2 = 'X'.

call screen 100.

endloop.

Hope this helps.

Reward if helpful.

regards,

Sipra

Read only

Former Member
0 Likes
1,260

Hi Jim,

If you want to acheive ur requirement using subscreen then follow the steps.

declare the variables in top include.

PARAMETER: r1 RADIOBUTTON GROUP one USER-COMMAND radio ,

r2 RADIOBUTTON GROUP one .

data: w_okcode type sy-ucomm.

DATA : w_page TYPE sy-dynnr.

In the report program at the selection screen type the following

AT SELECTION-SCREEN.

  • will determine which subscreen to called.

IF r1 = 'X'.

w_page = '2000'. "

ELSEIF r2 = 'X'.

w_page = '3000'.

ENDIF.

CALL SCREEN 4000.

Create a normal screen as '4000' as per example in se51 and create a subscreen area as 'area1' in the screen painter. Similary create screens as 'SUBSCREEN' . In this sample I have created two sub subscreens 2000 and 3000. In their layout define your selection fields (screen-fields) fields.

In flow logic of the normal screen 4000. use the following code.

PROCESS BEFORE OUTPUT.

MODULE status_4000.

CALL SUBSCREEN subarea INCLUDING sy-repid w_page.

*

PROCESS AFTER INPUT.

CALL SUBSCREEN subarea.

MODULE user_command_4000.

Read only

0 Likes
1,260

Hello all.

Please show me the code on how to do this.. am not familiar with syntax call screen.. If not too much, how can i make one field greyed out in my sub screen..

Thanks,

Jim

Read only

Former Member
0 Likes
1,260

Hi ,

See below code -

*-- Definitions to hold user command for subscreens

DATA:

ucomm1 LIKE sy-ucomm,

ucomm2 LIKE sy-ucomm,

ucomm3 LIKE sy-ucomm.

*-- Macro to put checkbox on selection screen

*-- &1 - checbox parameter name

*-- &2 - text element (description)

*-- &3 - default value for checkbox

DEFINE make_checkbox.

selection-screen begin of line.

parameters: &1 as checkbox default &3.

selection-screen comment 3(60) &2.

selection-screen end of line.

END-OF-DEFINITION.

*-- Macro to put radiobutton on selection screen

*-- &1 - radiobutton parameter name

*-- &2 - text element (description)

*-- &3 - radiobutton group

DEFINE make_radiobutton.

selection-screen begin of line.

parameters: &1 radiobutton group &3.

selection-screen comment 3(60) &2.

selection-screen end of line.

END-OF-DEFINITION.

*-- Macro to put a parameter on selection screen

*-- &1 - parameter name

*-- &2 - text element (description)

*-- &3 - like data element

*-- &4 - default value

DEFINE make_parameter.

selection-screen begin of line.

selection-screen comment 1(30) &2.

selection-screen position pos_low.

parameters: &1 like &3 default &4.

selection-screen end of line.

END-OF-DEFINITION.

*-- Macro to put a dropdown listbox on selection screen

*-- &1 - parameter name

*-- &2 - length of listbox

*-- &3 - default value

*-- &4 - text element (description)

DEFINE make_dropdown.

selection-screen begin of line.

selection-screen comment 1(30) &4.

selection-screen position pos_low.

parameters: &1 as listbox visible length &2 default &3 obligatory.

selection-screen end of line.

END-OF-DEFINITION.

*-- Define subscreen for upload options

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK file_options WITH FRAME.

make_parameter p_filein fil_desc rlgrap-filename '/filename.txt'.

make_radiobutton rb_unix unx_desc src.

make_radiobutton rb_local dos_desc src.

make_parameter p_filety typ_desc rlgrap-filetype 'DAT'.

SELECTION-SCREEN END OF BLOCK file_options.

SELECTION-SCREEN END OF SCREEN 1100.

*-- Define subscreen for BDC/CT Processing Options

SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK bdc_options WITH FRAME.

make_radiobutton rb_callt ctr_desc typ.

make_radiobutton rb_bdc bdc_desc typ.

make_dropdown p_mode(1) 30 'N' mod_desc.

make_dropdown p_uptyp(1) 30 'S' upd_desc.

SELECTION-SCREEN END OF BLOCK bdc_options.

SELECTION-SCREEN END OF SCREEN 1200.

*-- Define subscreen for Output Options

SELECTION-SCREEN BEGIN OF SCREEN 1300 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK output_opts WITH FRAME.

make_checkbox c_detail det_desc ' '.

make_checkbox c_error err_desc 'X'.

make_checkbox c_stats sta_desc 'X'.

SELECTION-SCREEN END OF BLOCK output_opts.

SELECTION-SCREEN END OF SCREEN 1300.

*-- Define Main Selection screen that will incorporate the subscreens

SELECTION-SCREEN BEGIN OF TABBED BLOCK tabs FOR 10 LINES.

SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1

DEFAULT SCREEN 1100.

SELECTION-SCREEN TAB (30) tabs2 USER-COMMAND ucomm2

DEFAULT SCREEN 1200.

SELECTION-SCREEN TAB (15) tabs3 USER-COMMAND ucomm3

DEFAULT SCREEN 1300.

SELECTION-SCREEN END OF BLOCK tabs.

*-- Fill the dropdown list boxes before displaying them

AT SELECTION-SCREEN OUTPUT.

PERFORM fill_dropdown_list USING 'P_MODE'.

PERFORM fill_dropdown_list USING 'P_UPTYP'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filein.

PERFORM choose_filename USING p_filein

CHANGING p_filein.

INITIALIZATION.

tabs1 = 'Upload Options'.

tabs2 = 'BDC/Call Transaction Options'.

tabs3 = 'Output Options'.

*-- Setup descriptions for Selection Screen items

err_desc = 'Show Errors (Call Transaction Only)'.

det_desc = 'Show details on records being processed'.

sta_desc = 'Show statistics on what has been processed'.

unx_desc = 'File is on App Server (unix)'.

dos_desc = 'File is on Presentation Server (pc)'.

typ_desc = 'File Type'..

fil_desc = 'Name of File'.

ctr_desc = 'Process in Call Transaction Mode'.

bdc_desc = 'Process in BDC Mode'.

mod_desc = 'Transaction Processing Mode'.

upd_desc = 'Update Type'.

START-OF-SELECTION.

*-- Open input file or Read data from database tables

END-OF-SELECTION.

*-- Loop at data, and create BDC/Call Transactions

----


  • FORM fill_dropdown_list *

----


  • Populate the dropdown list for the parameter provided *

----


  • --> VALUE(F_PARAMETER) *

----


FORM fill_dropdown_list USING value(f_parameter).

TYPE-POOLS: vrm. " For parameter drop down lists

*-- Definitions for parameter drop down lists

DATA:

name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

name = f_parameter.

CASE f_parameter.

WHEN 'P_MODE'.

value-key = 'N'. value-text = 'Do not display any screens'.

APPEND value TO list.

value-key = 'A'. value-text = 'Display ALL screens'.

APPEND value TO list.

value-key = 'E'. value-text = 'Only display screens in error'.

APPEND value TO list.

WHEN 'P_UPTYP'.

value-key = 'S'. value-text = 'Update in Synchronous Mode'.

APPEND value TO list.

value-key = 'A'. value-text = 'Update in Asynchronous Mode'.

APPEND value TO list.

WHEN OTHERS.

ENDCASE.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

ENDFORM." fill_dropdown_list

----


  • FORM choose_filename *

----


  • Select a filename. Only provied if a local file is selected *

  • as the source of the input file. A *

  • custom function or routine could be *

  • written to provide the same functionality *

  • for unix. *

----


  • --> F_FILENAME_IN *

  • <-- F_FILENAME_OUT *

----


FORM choose_filename USING f_filename_in

CHANGING f_filename_out.

DATA:

lc_fieldname LIKE dynpread-fieldname,

lc_fieldvalue LIKE dynpread-fieldvalue.

*-- Get the value of p_local

PERFORM read_value_from_screen USING sy-repid

sy-dynnr

'RB_LOCAL'

CHANGING lc_fieldname

lc_fieldvalue.

IF lc_fieldvalue = 'X'. " User chose a local file

PERFORM query_local_filename CHANGING f_filename_out.

ENDIF.

ENDFORM." get_filename

----


  • FORM READ_VALUE_FROM_SCREEN *

----


  • ........ *

----


  • --> F_REPID *

  • --> F_DYNNR *

  • --> VALUE(F_FIELDNAME_IN) *

  • <-- F_FIELDNAME_OUT *

  • <-- F_FIELDVALUE *

----


FORM read_value_from_screen USING f_repid

f_dynnr

value(f_fieldname_in)

CHANGING f_fieldname_out

f_fieldvalue.

DATA: ltab_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.

DATA: lc_dyname LIKE sy-repid.

DATA: lc_dynumb LIKE sy-dynnr.

DATA: lc_dummy(1) TYPE c.

*-- Read the screen to see if the user has entered a value for WERKS

ltab_fields-fieldname = f_fieldname_in.

APPEND ltab_fields.

lc_dyname = f_repid.

lc_dynumb = f_dynnr.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = lc_dyname

dynumb = lc_dynumb

TABLES

dynpfields = ltab_fields

EXCEPTIONS

OTHERS = 01.

READ TABLE ltab_fields INDEX 1.

*-- Return the value from the screen

IF sy-subrc EQ 0.

SPLIT ltab_fields-fieldname AT '-'

INTO lc_dummy

f_fieldname_out.

f_fieldvalue = ltab_fields-fieldvalue.

ENDIF.

ENDFORM. "read_value_from_screen

----


  • FORM query_filename *

----


  • ........ *

----


  • --> F_FILENAME_OUT *

  • --> DATA *

  • --> : *

  • --> L_FILENAME *

----


FORM query_local_filename CHANGING f_filename_out LIKE rlgrap-filename.

DATA: l_filename LIKE rlgrap-filename.

DATA: l_mask(80) TYPE c.

  • Build Filter

l_mask =

',All Files (.),..'.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = f_filename_out

def_path = 'c:\'

mask = l_mask

  • mode = O or S

title = 'Choose input file'

IMPORTING

filename = l_filename

EXCEPTIONS

inv_winsys = 01

no_batch = 02

selection_cancel = 03

selection_error = 04.

IF sy-subrc = 0.

f_filename_out = l_filename.

ENDIF.

ENDFORM. "query_local_filename

Reward points if helpful