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: 

function code in GUI-Status

Former Member
0 Kudos

hello,

i have crated a new function in a gui-status. I

put the value 'T' (transaction code) in the field

"Functional type".

When i use the new function (in trans FD03), the

transaction is executed, as i want it. BUT: i want

to return to transaction FD03 after it. The problem

is that there is a 'leave to transaction' behind it and i get back to the sap-main-menu, which i don't want.

Any idea how i can return to the calling transaction (FD03) after executing my own trans. ?

9 REPLIES 9

abdul_hakim
Active Contributor
0 Kudos

use

<b>LEAVE TO SCREEN 0.</b>

Cheers,

Abdul

Former Member
0 Kudos

What you can do is to create a normal function code, and write the CALL TRANSACTION code manaully in there, so that after that it comes to your screen.

Regards,

Ravi

Note : Please mark the helpful answers

vinod_gunaware2
Active Contributor
0 Kudos

If a program has a transaction code, there are two ways of starting it from another program.

If you do not want to return to the calling program at the end of the new transaction, use the statement:

<b>LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].</b>

This statement ends the calling program and starts transaction <tcod>. This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.

If, on the other hand, you do not want to return to the calling program at the end of the new transaction, use the statement:

CALL TRANSACTION <tcod> [AND SKIP FIRST SCREEN] [USING <itab>].

This statement saves the data of the calling program, and starts transaction <tcod>. At the end of the transaction, the system returns to the statement following the call in the calling report. If the LEAVE statement occurs within the called transaction, the transaction ends and control returns to the program in which the call occurred.

You can use a variable to specify the transaction <tcod>. This allows you to call transactions statically as well as dynamically.

The addition AND SKIP FIRST SCREEN allows you to prevent the initial screen of the new transaction from being displayed. The first screen to be displayed is then the specified Next screen in the screen attributes of the initial screen. If the first screen calls itself as the next screen, you cannot skip it.

Furthermore, the AND SKIP FIRST SCREEN option works only if all mandatory fields on the initial screen of the new transaction are filled completely and correctly with input values from SPA/GPA parameters.

regards

vinod

Former Member
0 Kudos

Hi,

Try calling the program SAPMF02D using submit and then return back..

Regards,

Tanveer.

<b>Please mark helpful answers</b>

Former Member
0 Kudos

hello guys,

thanks for your hints ! but i have one big problem:

with the 'T' in the funct.type everything works perfect WITHOUT changing the standard ! but there is the problem with the returning !

when i use a exit (with type 'E' ???) i have to do changes in the sap-standard-program, right ? well, my 'wish' is not to change the sap-standard. is there a way ? i don't think so, right ?

0 Kudos

You can leave the function type blank and write one command CALL TRANSACTION in the PAI, for the function code so that the control comes back to your program.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

ravi,

i am new in 'dialog programming' (used to program interfaces)............when i push the button with the new function (with blank funct. type) and jump into debugging i get the following:

PROCESS AFTER INPUT.

MODULE EXIT_DEBITOR AT EXIT-COMMAND.

MODULE tabstrip_next.

CALL SUBSCREEN SUBKOPF.

CALL SUBSCREEN SUBTAB.

  • module tabstrip_init_screen_exit.

MODULE TABSTRIP_OKCODE.

MODULE OKCODE_BEARBEITEN.

WHERE do i have to enter my 'call transaction' ? where is the right point to put it in ?

regards, Martin

0 Kudos

Martin,

Looks like all the function codes are being handled inside MODULE OKCODE_BEARBEITEN. Go in there and see if there is a CASE statement on SY-UCOMM or a similar variable.

There introduce a statement

CASE 'function code you have give'.

CALL TRANSACTION 'XXXX'.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

hi martin,

create a new module next to okcode_bearbeiten say module ok_code.

inside that check your function code..

for eg..

WHEN 'CLICK'.

CALL TRANSACTION <tcode>.

Cheers,

Abdul