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

Submit report

Former Member
0 Likes
2,477

Hi All,

I have an ALV report and on the selection screen. I have a check on the user name(sy-uname) running the report and if they are 'Approvers'..the selection screen should not be displayed. These 'Approvers' are non-sap people so we dont want them to be confused.

I check if the user is an 'Approver' and I say

SUBMIT report_name AND RETURN. After this staement..I have the START-OF-SELECTION ETC.

The problem is, when the 'Approver' runs the report its giving an error..'Maximum number of internal sessions reached'. I checked help on the SUBMIT statement..it does say it has only 8 internal sessions.

Is there anyway I can by-pass this error? Can I use EXPORT to memory...pleae help

11 REPLIES 11
Read only

Former Member
0 Likes
1,516

Hi Rachana!

Please see the descriptions of the OSS notes which I picked up for a similiar problem which i encountered in my project...

OSS Search...

I checked the OSSNote......329835... the problem is acknowledged and it recommends....

To call up a report via Transaction 'Execute report group' (GR55) needs less internal sessions as if you call it up via the report tree.

Ossnote .... 34154 is very interesting.

This is concerned with internal sessions: The R/3 System offers the option to change from one information level to another: by branching in the menu path (for example "Goto" or "Information system"), double-clicking in ABAP lists, cross-references in hypertext and so on. Technically speaking, you call one program/transaction from within another one (ABAP/4 statements CALL DIALOG or CALL TRANSACTION, but not CALL SCREEN). For the user, it is desirable that this process is reversible, that is, that you can also go back step by step. The whole path is therefore stored in a stack of so-called internal sessions. If the maximum number of internal sessions is reached, you cannot go any further. This maximum number is hardcoded as 9, and this cannot be changed.

When creating programs in R/3, the developers try to make sure that such a situation does not occur. Thus, a SUBMIT is only used if it is useful to leave the calling program active. However, an overflow of the stack of internal sessions cannot always be avoided. If the developer makes the navigation user-friendly, there is in some cases the option that this limit is reached by nested transaction calls.

Ossnote.....393879

Recommends replace CALL with LEAVE.

  • CALL TRANSACTION sy-tcode.

LEAVE TO TRANSACTION sy-tcode.

Regards

Praneeth

Reward helpful answers

Message was edited by: Praneeth kumar

Read only

0 Likes
1,516

I read the OSS notes and it says 'If the error occurs, try to call up the report via a more direct (shorter) path'.

How do I do that? Any suggestions?

Read only

0 Likes
1,516

Hi Rachana,

You can try this out..

Attach the report to Transaction. Put the call transaction in side a custom function module & then realce your SUBMIT statement with a call to taht function ie

CALL FUNCTION ..starting new task..

Regards,

Suresh Datti

Read only

Former Member
0 Likes
1,516

hi

chk this link... same error reported earlier

<b></b>

Read only

Former Member
0 Likes
1,516

Hai Rachana

go through this document for Submit

SUBMIT rep.

Additions

1. ... LINE-SIZE col

2. ... LINE-COUNT lin

3. ... TO SAP-SPOOL

4. ... VIA SELECTION-SCREEN

5. ... AND RETURN

6. ... EXPORTING LIST TO MEMORY

7. ... USER user VIA JOB job NUMBER n

8. ... Various additions for parameter transfer to rep

9. ... USING SELECTION-SETS OF PROGRAM prog

Effect

Calls the report rep . Leaves the active program and starts the new report rep .

Addition 1

... LINE-SIZE col

Effect

Prints the report with the line width col .

Addition 2

... LINE-COUNT lin

Effect

Prints the report with lin lines (per page).

Addition 4

... VIA SELECTION-SCREEN

Effect

Displays the selection screen for the user. In this case, the selection screen is redisplayed after return from the report list display - the user's entries are retained.

Addition 5

... AND RETURN

Effect

Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal mode .

Addition 6

... EXPORTING LIST TO MEMORY

Effect

Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .

Addition 7

... USER user VIA JOB job NUMBER n

Effect

Schedules the specified report in the job specified by the job name job and the job number n . The job runs under the user name user and you can omit the addition USER user . The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT . This addition can only be used with the addition ...AND RETURN .

Note

When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.

Addition 9

... USING SELECTION-SETS OF PROGRAM prog

Effect

Uses variants of the program prog when executing the program rep .

Note

Important

The programs prog and rep must have the same SELECT-OPTIONS and PARAMETER s. Otherwise, variants of the program prog may be destroyed.

Note

When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari . On the other hand, all variant-related actions on the selection screen of rep (Get , Save as variant , Display , Delete ) refer to the variants of prog .

Example

SUBMIT REPORT01

VIA SELECTION-SCREEN

USING SELECTION-SET 'VARIANT1'

USING SELECTION-SETS OF PROGRAM 'REPORT00'

AND RETURN.

Effect

Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00 .

Note

Runtime errors

LOAD_PROGRAM_NOT_FOUND : The specified program was not found.

SUBMIT_WRONG_TYPE : The specified program is not a report.

SUBMIT_IMPORT_ONLY_PARAMETER : Only one value passed to a report parameter.

SUBMIT_WRONG_SIGN : Invalid value passed to a selection with the addition SIGN .

SUBMIT_IN_ITAB_ILL_STRUCTURE : Table passed to a selection with WITH sel IN itab had an unexpected structure.

Try with this Example

Data: listobject like abaplist occurs 1 with header line.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = listobject

EXCEPTIONS

OTHERS = 1 .

IF sy-subrc <> 0.

message ID '61' TYPE 'E' NUMBER '731'

with 'LIST_FROM_MEMORY'.

ENDIF.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
1,516

hii Rachana ,

only 6 internal sessions are allowed ..that is why problem occured.there is a limit in SAP for 6 internal sessions .

Syntax : <b>LEAVE TO TRANSACTION t and skip first screen .</b>

<b>This will end the current transaction session and open a new session.</b>

otherwise if you can use leave to transaction then

you can use function module <b>TH_USER_INFO</b>

you get back two parameters

<b>ACT_SESSIONS

and MAX_SESSIONS</b>

i guess this will solve your problem ..

Reward points if helpful .

Revert back for more help

Regards

Naresh

Read only

0 Likes
1,516

Create two programs.

REPORT ZTEST1.

if sy-uname = 'xyz'.

submit ztest2 and return with para1 = 'p1'

para2 = 'p2'.

else.

submit ztest2 and return.

endif.

ztest2 report contains required functionality (ALV report) with two parameters para1 and para2 (as per ur requirement)

Read only

Former Member
0 Likes
1,516

Hii Rachana ,

as regards direct path it can be <b>LEAVE TO TRANSACTION</b>.

OR <b>LEAVE PROGRAM OR CALL SCREEN</b> .

ANOTHER WAY you could use is <b>CALL FUNCTION ... IN BACKGROUND TASK.</b>

This not only prevents your issue with the sessions .

It will also see that the processes get queued, and executed on the application server when there is resource (background processes) available for them

regards

Naresh

Read only

Former Member
0 Likes
1,516

I think you are ending up in an infinite loop here. Is your ALV report and the report_name you are using in your submit statement same? I think it is.

When you do submit, you are opening another session for your report_name, which again will be executing the same program does the same logic and so you end up in an infinite loop. Luckily, system does not allow anything more than 7 such sessions, so you get the error. Otherwise you will be waiting there forever.

If your requirement is to skip the selection screen if the user is an approver, then my question is what values are you passing for your selection screen parameters? Do you have some defaults for the approvers?

Read only

0 Likes
1,516

If the user is an 'approver'..he will run the report wide open. I have logic in the program to show only items attched to his user id. The answer to ur question is YES.

The reply from Suresh...call function worked.

But I definitely like to know a easy fix.

Thanks

Read only

sridhar_k1
Active Contributor
0 Likes
1,516

call SUBMIT only if sy-calld eq space, see if it works.

Regards

Sridhar