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: 

Calling the subscreen into main screen

Former Member
0 Kudos

Hi Guru's,

I am having a main screen, which holds 2 radio buttons.

If I select one radio button it has to call one table control, if I select 2nd radio button it has to call different table control.

For this I have created two subscreens, each one holds a table control.

based on the selection of radio button I have to call these subscreens in to the main screen.

Please help me how to call the subscreen into main screen.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi ravi,

the solutions above are perfect but i will just summerise it for u...

1) firstly define two variables

r1 type c,

r2 type c.

here, r1 and r2 represent the two radio buttons and be sure that the names r1 and r2 are the exact same name of the radio button as is defined in the screen layout.

2) then for defining the call for different subscreens :-

In PBO.

CALL SUBSCREEN subscreen_name INCLUDING 'program_name' dynnr.

In PAI.

CALL SUBSCREEN subscreen_name.

here 'program_name' is your module pool program name and,

dynnr is a variable(interger) which save the subscreen number to display the different subscreens dynamically. this we will do in the PAI part.

3) now for the final step we will set the value of dynnr variable depending on which radio button is pressed:-

in a function of the PAI part ->

IF r1 = 'X'. (remember the X should be in capital)

dynnr = 110. (let say the number for the 1st subscreen is 110)

ELSE

dynnr = 111. (there is no need for second if because there are only two radio buttons meaning either r1 is selected or r2 is selected)

ENDIF.

NOTE: when you define the two radio buttons in the screen layout pls make sure that u have grouped them together, otherwise both will be selected. for doing that select both the radio buttons and go to

edit > grouping > radio button grouping > define (in the main menu)

hopefully this helped solving ur problem.

regards,

sagar.

11 REPLIES 11

Former Member
0 Kudos

Basic process is:

In PAI detect which button is selected and set variable with screen number required. Leave Screen.

In PBO have "CALL SUBSCREEN sub_area INCLUDING prog dynnr" with dynnr being the variable you set in PAI.

Andrew

former_member196299
Active Contributor
0 Kudos

Hi Ravi ,

You can try like this .

In PAI of the main screen , capture the radio buttion which has been clicked and put it in a variable say RAD and no need to leave the screen there the PBO will be automatically called .

Then in PBO call the subscreen based on the value present in the radio button variable RAD .

Revert if further help needed .

Ranjita

paruchuri_nagesh
Active Contributor
0 Kudos

hi

keep below logic

process before output.

call subscreen subscreenareaname including 'modulepoolprgname' 'screennum'.

process after input.

call subscreen subscreenareaname

regards

Nagesh.Paruchuri

Former Member
0 Kudos

hi ravi,

the solutions above are perfect but i will just summerise it for u...

1) firstly define two variables

r1 type c,

r2 type c.

here, r1 and r2 represent the two radio buttons and be sure that the names r1 and r2 are the exact same name of the radio button as is defined in the screen layout.

2) then for defining the call for different subscreens :-

In PBO.

CALL SUBSCREEN subscreen_name INCLUDING 'program_name' dynnr.

In PAI.

CALL SUBSCREEN subscreen_name.

here 'program_name' is your module pool program name and,

dynnr is a variable(interger) which save the subscreen number to display the different subscreens dynamically. this we will do in the PAI part.

3) now for the final step we will set the value of dynnr variable depending on which radio button is pressed:-

in a function of the PAI part ->

IF r1 = 'X'. (remember the X should be in capital)

dynnr = 110. (let say the number for the 1st subscreen is 110)

ELSE

dynnr = 111. (there is no need for second if because there are only two radio buttons meaning either r1 is selected or r2 is selected)

ENDIF.

NOTE: when you define the two radio buttons in the screen layout pls make sure that u have grouped them together, otherwise both will be selected. for doing that select both the radio buttons and go to

edit > grouping > radio button grouping > define (in the main menu)

hopefully this helped solving ur problem.

regards,

sagar.

0 Kudos

Hi sagar,

i did the same. But it is giving the dump. In the dump analysis it is giving like there is no help text for this dump.

this is the code I wrote in main screen.

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

CALL SUBSCREEN sub INCLUDING SY-REPID v_screen.

*

PROCESS AFTER INPUT.

CALL SUBSCREEN sub.

MODULE USER_COMMAND_0100.

Thanks,

Ravi

0 Kudos

hi,

can u paste me the error (when u press CTRL + Y u can select multiple line of text)

or atleast when the execution stops, u can scroll down the dump screen to see exactly where the dumpp comes..

regards,

sagar.

0 Kudos

There is no help text for this dump

Either the text was inadvertently deleted or the release of

the kernel differs from the release of the database

Refer to the Note system for further information on this dump.

000160 %_archive TYPE arc_params,

000170 END OF COMMON PART.

000180 *

000190 FIELD-SYMBOLS: <%_1> %_PREDEFINED.

000200

000210 DATA: %_repid TYPE syst-repid %_PREDEFINED,

000220 %_viaselscr TYPE x VALUE '04' %_PREDEFINED.

000230

000240 SYSTEM-EXIT.

000250 PERFORM (sy-xform) IN PROGRAM (sy-xprog).

000260

000270 * Nach Laden des Dynpros

000280 MODULE %_ctl_init OUTPUT.

000290 %_repid = sy-repid.

000300 PERFORM %_ctl_init IN PROGRAM sapmssyd USING %_repid IF FOUND.

> ENDMODULE.

000320

000330 * Um DCO

000340 MODULE %_ctl_output OUTPUT.

000350 %_repid = sy-repid.

000360 PERFORM %_ctl_output IN PROGRAM sapmssyd USING %_repid IF FOUND.

000370 ENDMODULE.

000380

000390 * Um DCI

000400 MODULE %_ctl_input INPUT.

000410 %_repid = sy-repid.

000420 PERFORM %_ctl_input IN PROGRAM sapmssyd USING %_repid IF FOUND.

000430 ENDMODULE.

000440

000450 * Erstes Modul in PAI

000460 MODULE %_ctl_pai INPUT.

000470 %_repid = sy-repid.

000480 PERFORM %_ctl_pai IN PROGRAM sapmssyd USING %_repid IF FOUND.

000490 ENDMODULE.

0 Kudos

Hi Sagar,

The issue is resolved. the problem is in my coding in declaration part of table control. Thanks for your help.

Thanks

Ravi

0 Kudos

hi ravi,

is the dump error comming after u wrote the code for the radio button??? i am asking this bcos by seeing the following dump, i cannot gather why it has cum or rather after what it has cum.

if u r unsure whether ur adding of radio button is the root cause of this problem then please comment the code for the radio button as well as the subscreen calls (thats what ever changes u have made related to the radio button)

also please give a default value to the variable <b>v_screen</b>.

regards,

sagar

Former Member
0 Kudos

hi,

As u want to call the diff screens which u already make.

Then no need to use the concept of subscreen.

Simply in the UserCommand according to the CASE.

Call the screen whatever u want.

like

CASE OK_CODE.

when 'RD_B1'.

call screen '1001'.

when 'RD_B2'.

call screen '1002'.

ENDCASE.

thanks

Dharmishta.

Former Member
0 Kudos

HI GURUS,

i am having a main screen where there are two tab strip and a push button, in which on clicking on a push button it should show a table control screen . but the problem arises when i click the push button it goes a new screen , whereas i want it in the same screen where the other tab strips are there and on again clicking the push button the table control must disappear.

Thanks in Advance