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: 

Running tcode redirects to SAP's initial screen if no results

0 Kudos

Hi All,

If I run a custom report from SE80 and there are no results I get an error message e.g. no results.

If I use a tcode that points to the program above, I will get redirected to SAP's initial screen.

Any ideas?

thanks

10 REPLIES 10

former_member660513
Participant
0 Kudos

Hello,

did you create a tcode and assign it to the report?

Then why do you want to prohibit the execution by a tcode?

It is possible to restrict the tcode execution on the authorisation level, authorisation object S_TCODE,

https://answers.sap.com/questions/3237811/what-is-the-concept-of-stcode.html

former_member660513
Participant
0 Kudos

Other possibility is to check in your report code against the current tcode ( i guess the sy-tcode field).

If it is equal to se38, then all is fine, otherwise abort the processing.

But i don't understand why you would want to do that.

0 Kudos

The problem is that when I run the program using the tcode it sends me back to the SAP initial screen. I DO NOT want that, that's the problem.

If I run it from se80 then everything works fine. I get a no results message and everything is fine.

PS there are no LEAVE TRANSACTION LEAVE PROGRAM statements.

Sandra_Rossi
Active Contributor

Nothing bizarre here. In ABAP, you have statements LEAVE TRANSACTION, LEAVE PROGRAM, and you can choose your logic depending on the context... Difficult to help without more information.

matt
Active Contributor
0 Kudos

Change your program so it doesn't issue an error message.

E.g. MESSAGE i100(z) DISPLAY LIKE 'E'.

0 Kudos

It did not work. But I need that message

matt
Active Contributor

"did not work". No, I don't recognise that error message. Maybe you need to start sharing your code?

Sandra_Rossi
Active Contributor
0 Kudos

Do a line by line ABAP trace (SAT) and look what happens after the last line of the program.

former_member660513
Participant
0 Kudos

Can you copy paste the line where you raise the message so that we see the syntax?

And also the next couple(~5) of lines afterwards.

0 Kudos

Issue was resolved by recreating the tcode and maintaining it as program and screen. Why the down vote though?