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

Conditional call to a subscreen in module pool program

Former Member
0 Likes
902

Hi,

How to call a subscreen in module pool after to click on push buttons ?

My code:

PROCESS BEFORE OUTPUT.

CALL SUBSCREEN sub_tela INCLUDING V_PROG v_dynnr.

MODULE status_9001.

*----------------------------------------------------------------------------------------------*


PROCESS AFTER INPUT.

MODULE init_subscreen.

   CALL SUBSCREEN sub_tela.

*---------------------------------------------------------------------------------------------*

module INIT_SUBSCREEN input.

   CASE ok_code.

   WHEN 'INSERIR'. "when user clicks a button to call table control

     V_PROG = sy-repid.

     V_DYNNR = '0901'.

   ENDCASE.

endmodule.

*----------------------------------------------------------------------------------------*

*----------------------------------------------------------------------------------------*

ESTÁ APARECENDO DUMP

DUMP IS APPEARING

3 REPLIES 3
Read only

SwadhinGhatuary
Active Contributor
0 Likes
632

Hi,

You get error "DYNPRO_NOT_FOUND" this because of v_dynnr.

as before assign value to v_dynnr you call screen 9001 where v_dynnr have 0000 value


CALL SUBSCREEN sub_tela INCLUDING V_PROG v_dynnr.


so make change in declaration


data v_dynnr type sy-DYNNR VALUE '0001'. and make 0001 as subscreen


so when you call 9001 screen a default subscreen 0001(Having no screen element) so after click 'INSERIR'


v_dynnr = 0901


then normal screen 9001 with subscreen 0901 will call

Read only

SwadhinGhatuary
Active Contributor
0 Likes
631

screen shot for detail understanding

Read only

Juwin
Active Contributor
0 Likes
631

You need to assign values into V_PROG v_dynnr, before the screen is called the first time. Here, I see that you are assigning values at PAI event, which means that the 1st time the main screen is called, SAP doesn't know which subscreen to include in the subscreen area. Hence, the dump.

Thanks,

Juwin