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

Module Pool

Former Member
0 Likes
766

Hi,

I have developed two screens. When the user Press Back Button it should come to first screen. In this case what we have to use ?

Set Screen 0. or leave screen ?

and if the user press back button on the first screen then what we have to use ?

what is the difference between set screen and leave screen ?

can i have some help on module pool programming and some model screens for <b>good looking ?</b> or some demo programs names ?

Bye,

Satya.

6 REPLIES 6
Read only

Former Member
0 Likes
734

Hi,

Call screen:

You can start a screen sequence from an ABAP program using the

CALL SCREEN <dynnr>.

statement. At the end of the screen sequence (next screen 0), the program continues processing directly after the CALL SCREEN statement.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbab2935c111d1829f0000e829fbfe/content.htm

Set Screen:

Every screen has a static next screen that specifies the next screen to be called after the current one, as long as it is not overwritten dynamically. In the processing logic, that is, a dialog module called by the screen, you can use the SET SCREENstatement to overwrite the statically-defined next screen dynamically:

SET SCREEN Folgedynpro.

This statement defines a new next screen for the current program run. You can also specify the number of the next screen as a field containing a screen number. The statically-defined next screen is ignored. However, this only overrides the static screen sequence temporarily. The static value for the next screen, as defined in the Screen Painter, is always retained.

The SET SCREEN does not interrupt the current screen processing.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab1c35c111d1829f0000e829fbfe/content.htm

Leave and Leave to screen:

In a program, you can use one of the two following ABAP statements to leave a screen:

LEAVE SCREEN.

or

LEAVE TO SCREEN Next Screen.

The LEAVE SCREEN statement ends the current screen and calls the subsequent screen. The next screen is either the static next screen or a dynamic next screen. In the second case, you must override the static next screen using the SET SCREEN statement before the LEAVE SCREEN statement.

The LEAVE TO SCREEN statement exits the current screen and calls the dynamic next screen, which you specify as part of the statement. The LEAVE TO SCREEN statement is no more than a contraction of the two statements

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab3635c111d1829f0000e829fbfe/content.htm

For your Requirement,

First screen no is 1000 and second is 2000 means,

When 'Back'.

Call screen 1000.

For First screen :

Leave program.

Thanks.

Message was edited by:

Viji

Read only

Former Member
0 Likes
734

Use

Set screen 0,.

Leave screen

Read only

Former Member
0 Likes
734

Hello Satyanarayana,

I've encountered the same problem.

Use '<b>BACK</b>' in the pf status of the both screens under back button.

in user command

when 'BACK'.

leave screen.

it will works fine.

set screen will sets the screen which you specified.

if you use leave screen control leavs from that screeen.

if you use leave to screen xxxx. it takes you to screen no. xxxx.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
734

Hi,

U use Call Screen <screen no> in the First Case.

In the Second Case,Use Leave Screen.

<b>Calling Screens Internally from the Same ABAP Program</b>

In any ABAP program that can have its own screens (type 1, M, or F), you can use the

CALL SCREEN <dynnr>.

statement to call a screen and its subsequent sequence within that program. The flow logic of each screen calls dialog modules in the program that called the screen.

When the screen sequence ends, control returns to the statement after the original CALL SCREEN statement.

<b>Leaving a Screen Sequence</b>

A screen sequence terminates when a screen ends and the defined next screen has the number 0.

You can leave a single screen within a sequence using the

LEAVE SCREEN.

or

LEAVE TO SCREEN <dynnr>.

statement. These statements exit the current screen and call the defined next screen. If the next screen is screen 0, the entire screen sequence concludes.

Here are links for sample code for understanding module pool programming ,

http://sap.mis.cmich.edu/sap-abap/abap09/index.htm

http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F

http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm

http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm

http://sap.mis.cmich.edu/sap-abap/abap09/index.htm

You can also check the transaction ABAPDOCU which gives you lot of sample programs.

Also you can see the below examples...

Go to se38 and give demodynpro and press F4.

YOu will get a list of demo module pool programs.

One more T-Code is ABAPDOCU.

YOu can find more examples there.

See the prgrams:

DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement

DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB

http://www.geocities.com/ZSAPcHAT

http://www.allsaplinks.com/files/using_table_in_screen.pdf

Regards,

Padmam.

Read only

Former Member
0 Likes
734

Whn u r in first screen --whn back - leave program.

whn u r in first screen -- whn enter --call screen 001(give the next screen number which has to be called .

Read only

Former Member
0 Likes
734

HI

SET SCREEN Folgedynpro.

This statement defines a new next screen for the current program run. You can also specify the number of the next screen as a field containing a screen number. The statically-defined next screen is ignored. However, this only overrides the static screen sequence temporarily. The static value for the next screen, as defined in the Screen Painter, is always retained.

The SET SCREEN does not interrupt the current screen processing.

The LEAVE SCREEN statement ends the current screen and calls the subsequent screen. The next screen is either the static next screen or a dynamic next screen. In the second case, you must override the static next screen using the SET SCREEN statement before the LEAVE SCREEN statement.

Rewards all helpfull answers.

Regards.

Jay