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: 

Issue with submit and return statement

Former Member
0 Kudos

Hi ALL,

I have 2 programs (Zpgm1 and Zpgm2) and i am calling this program from another a customer screen based on a push button.

if pgm1 = 'X'.

submit ZPGM1 via selection-screen

with p_e = 'X' and return.

ELSEIF PGM2 = 'X'.

submit ZPGM2 via selection-screen

with p_t = 'ABC' and return.

ENDIF.

In ZPGM1

parameters : p_ET radiobutton group gp1,

p_TT radiobutton group gp1,

p_E type c no-display.

at selection-screen output.

if p_E = 'X'.

loop at screen.

if screen-name = 'P_ET' .

screen-INPUT = '0'.

modify screen.

endif.

ELSE.

Loop at screen.

if screen-name = 'P_TT' .

screen-INPUT = '0'.

modify screen.

endif.

ENDIF.

In ZPGM2

parameters : p_WERKS LIKE MARC-WERKS,

p_T type c no-display.

at selection-screen output.

if p_T = 'X'.

loop at screen.

if screen-name = 'P_WERKS' .

screen-INPUT = '0'.

modify screen.

endif.

ELSE.

Loop at screen.

if screen-name = 'P_WERKS' .

screen-INPUT = '1'.

modify screen.

endif.

ENDIF.

In zpgm1 when i hit the back button on the selection screen, it triggers the at selection-screen output. and if i press the back button thats when it takes me to orginal pgm from where iam calling

but in zpgm2 when i press the back button the at selection-screen output. doesnot triggers and takes me to orginal program

This is what i want

The only diff bet 2 pgms is one is tradition ALV programs and other is OO alv PROGRAMS

IS THAT A REASON FOR ITS BEHAVIOUR

LET ME KNOW

Thanks

1 REPLY 1

former_member223537
Active Contributor
0 Kudos

Hi,

In the BACK button, add following logic:

sy-lsind = sy-lsind - 1.

if above doesnt work, then hardcode as follows:

sy-lsind = 1.

Best regards,

Prashant