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: 

Dialog Programming(module pool):call a screen to subscreen area.

Former Member
0 Kudos

Hi experts,

I want to call a screen created in the function group into my

subscreen area of current screen of main program.

I have done the below way :

1. Created a screen 100 in the module pool program z_bpmodule.

2.created a subscreen area SUB in screen 100.

3. I hav created function group :zfungroup

and a screen 300,a function module Z_EXPORT_FUN for exporting the data to the screen 300 from report.

Now my prog is lik below :

PROGRAM Z_SUBSCREEN1.

DATA : ZMATNR LIKE MARA-MATNR.

DATA : DYNNR LIKE SY-DYNNR .

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TITLE'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module EXPORT_DATA OUTPUT

&----


  • text

----


MODULE EXPORT_DATA OUTPUT.

CALL FUNCTION 'Z_EXPORT_FUN'

EXPORTING Z_INPUT = ZMATNR.

ENDMODULE. " EXPORT_DATA OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

  • CASE SY-UCOMM.

*

  • WHEN 'EXP'.

  • DYNNR = '0300'.

*ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

and the flow logic is lik this :

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

MODULE EXPORT_DATA.

CALL SUBSCREEN SUB INCLUDING SY-REPID ' 0300'.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

CALL SUBSCREEN SUB.

Now the main problem is i am not able to call the screen from function group to subscreen area...

kindly provide the solution.....

Thanks a lot in adv ....

Brahma.

1 ACCEPTED SOLUTION

valter_oliveira
Active Contributor
0 Kudos

I'm not sure about what does FM Z_EXPORT_FUN, but you should use it in screen '0300' PBO. In screen '0100' you only have to set dynnr as '0300' to call subscreen statement. In PBO of '0300' you should get it's values.

Regards,

Valter Oliveira.

8 REPLIES 8

valter_oliveira
Active Contributor
0 Kudos

I'm not sure about what does FM Z_EXPORT_FUN, but you should use it in screen '0300' PBO. In screen '0100' you only have to set dynnr as '0300' to call subscreen statement. In PBO of '0300' you should get it's values.

Regards,

Valter Oliveira.

0 Kudos

could any one please give reply for this...?

0 Kudos

Tried replacing SY-REPID with the name of the function group? And make sure 300 is defined as a subscreen.

But i don't understand why you created a separated function group for subscreen 300. Why not create it in your main program? That way you don' t have to worry about passing data back and forth.

0 Kudos

Hi,

I have replaced syrepid with function group as suggested :

MODULE EXPORT_DATA.

CALL SUBSCREEN SUB INCLUDING 'Z_TX1' DYNNR.

PROCESS AFTER INPUT.

CALL SUBSCREEN SUB.

MODULE USER_COMMAND_0100.

where ztx1 is the function group and dynnr is the subscreen tht

i am passing dynamically using the function modules.

you can see the code below :

PROGRAM Z_SUBSCREEN1.

DATA : ZMATNR LIKE MARA-MATNR.

DATA : DYNNR LIKE SY-DYNNR .

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TITLE'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module EXPORT_DATA OUTPUT

&----


  • text

----


MODULE EXPORT_DATA OUTPUT.

CALL FUNCTION 'Z_EXPORT_FUN'

EXPORTING Z_INPUT = ZMATNR.

ENDMODULE. " EXPORT_DATA OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

CASE SY-UCOMM.

WHEN 'EXP'.

CALL FUNCTION 'Z_IMPORT_FUN'

IMPORTING

DYNNR = dynnr.

.

write :dynnr.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

0 Kudos

And? Did you get your subscreen? Or not?

Getting any error messages? Dumps?

0 Kudos

I am just getting the main screen and the subscreen is not at all displaying .....

but when i perform the PAI .. I am getting the dump ..

Short text

Dynpro does not exist

What happened?

Error in the ABAP Application Program

The current ABAP program "Z_SUBSCREEN1" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

What can you do?

Note down which actions and inputs caused the error.

To process the problem further, contact you SAP system

administrator.

Using Transaction ST22 for ABAP Dump Analysis, you can look

at and manage termination messages, and you can also

keep them for a long time.

Error analysis

The system attempted to use dynpro 0000 in program "Z_TX1".

This dynpro does not exist.

How to correct the error

Probably the only way to eliminate the error is to correct the program.

-

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"DYNPRO_NOT_FOUND" " "

"Z_SUBSCREEN1" or "Z_SUBSCREEN1"

"EXPORT_DATA"

If you cannot solve the problem yourself and want to send an error

notification to SAP, include the following information:

1. The description of the current problem (short dump)

To save the description, choose "System->List->Save->Local File

(Unconverted)".

2. Corresponding system log

Display the system log by calling transaction SM21.

Restrict the time interval to 10 minutes before and five minutes

after the short dump. Then choose "System->List->Save->Local File

(Unconverted)".

3. If the problem occurs in a problem of your own or a modified SAP

program: The source code of the program

In the editor, choose "Utilities->More

Utilities->Upload/Download->Download".

4. Details about the conditions under which the error occurred or which

actions and input led to the error.

hope i have given the full information.

Thanks a lot.

0 Kudos
CALL SUBSCREEN SUB INCLUDING 'Z_TX1' DYNNR

Most likely DYNNR has no value.

Former Member
0 Kudos

check the subscreen area type you have declared

if it is local then follow your coding

if it is global

then no need of calling in pai.

and check the attributes of called screen whether it is subscreen or normal screen