cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a Program in a New Session

former_member221770
Contributor
0 Kudos

Hi gurus,

I have a custom report which has a button that links to another custom report. When this button is clicked, I perform a SUBMIT xxx WITH xxx and RETURN to another ABAP Report.

Is it possible to open up a new Session (so that I don't lose my original report) and call the new report in there (sort of like how the System->User Profile->Own Data menu path works - I have tried to debug this but SAP does not let me debug this!).

Any help would be appreciated.

Cheers,

Pat.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you woluld like to call a transaction in a new session, use asynchronous RFC FM.

Example:

call function 'ECOP_CALL_NEW_MODUS' STARTING NEW TASK 'TEST'

EXPORTING TRANSACTION = 'FD01'.

If you don't have a transaction code, assigned to your program, create a new transaction or a new RFC FM with SUBMIT stmt inside.

Svetlin

former_member221770
Contributor
0 Kudos

Hi Svetlin,

Thanks for your reply, you got me on the right track. I have also found a FM called TH_CREATE_MODE which automatically creates a new session so there is no need for the 'STARTING NEW TASK' command.

So what I have done is call a custom program via a 'Z' tcode. In this program I put in my SUBMIT statement.

Thanks heaps,

Pat.

andreas_mann3
Active Contributor
0 Kudos

Hi,

or fm TH_CREATE_MODE

-> Patrick you're faster!

Andreas

Former Member
0 Kudos

Hello,

If you want a seperate session and run a program using a transaction use this function module. ABAP4_CALL_TRANSACTION

You can either use a bdctab table or can use the param id for the same.

FORM f_call_lt27 USING p_temp_nlenr TYPE y1mm_imac010_alv-nlenr.

DATA : lt_spagpa TYPE TABLE OF rfc_spagpa WITH HEADER LINE.

MOVE 'LGN' TO lt_spagpa-parid.

MOVE t2_lgnum TO lt_spagpa-parval.

APPEND lt_spagpa.

MOVE 'LEN' TO lt_spagpa-parid.

MOVE p_temp_nlenr TO lt_spagpa-parval.

APPEND lt_spagpa.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'

STARTING NEW TASK 'MSC3N'

EXPORTING

tcode = 'LT27'

skip_screen = 'X'

TABLES

spagpa_tab = lt_spagpa.

ENDFORM. " f_call_lt27

Regards,

Shekhar KUlkarni

Former Member
0 Kudos

If the report code is smart the new report does not replace the previous one (see indexes) but is on top of it.

So when you exit using F3 you should automatically redisplay the original unless the F3 standard functionality was overwritten...

Check out as well the different options for your hotbutton specifically "in Window" which should open a new window for you.

Enjoy

former_member221770
Contributor
0 Kudos

Hi FJ,

Thanks for your reply. I was actually hoping that a new session would be created kind of like a '/oZM30' command where ZM30 is the transaction code for the report I am calling.

Not sure what you mean when you said "Check out as well the different options for your hotbutton specifically "in Window" which should open a new window for you"...

Can you please clarify? Is this in the GUI Status?

Thanks,

Pat.