2015 Jul 06 6:58 PM
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
2015 Jul 06 8:12 PM
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
2015 Jul 06 8:15 PM
2015 Jul 06 9:28 PM
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