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

Open new session on submitting a program thru FM call

Former Member
0 Likes
2,748

Hi expertz...need your help up here.

Have a situation where we need to trigger another program(say zabc : PO History) when the user selects a line in the ALV list and then clicks a button (to call zabc), the new program should run in the background and open up or display the results in a New Session.

Have tried to use FM 'SUBMIT_REPORT' with STARTING NEW TASK but it dosnt work. Please see the call below.

CALL FUNCTION 'SUBMIT_REPORT' "STARTING NEW TASK 'TEST1'

EXPORTING

  • RDIR = TRDIR

report = 'ZPRPP_WORKORDERPURCHASING'

RET_VIA_LEAVE = ' '

  • VARIANT = ' '

VARIPROG = 'ZPRPP_WORKORDERPURCHASING'

SKIP_SELSCREEN = 'X'

  • EXPRESSIONS =

  • IMPORTING

  • VARIANT =

TABLES

SELECTION_TABLE = i_rspar

EXCEPTIONS

JUST_VIA_VARIANT = 1

NO_SUBMIT_AUTH = 2

OTHERS = 3

Any Idea!.

Thanks

Jaif

Hi expertz...need your help up here.

Have a situation where we need to trigger another program(say zabc : PO History) when the user selects a line in the ALV list and then clicks a button (to call zabc), the new program should run in the background and open up or display the results in a New Session.

Have tried to use FM 'SUBMIT_REPORT' with STARTING NEW TASK but it dosnt work. Please see the call below.

CALL FUNCTION 'SUBMIT_REPORT' "STARTING NEW TASK 'TEST1'

EXPORTING

  • RDIR = TRDIR

report = 'ZPRPP_WORKORDERPURCHASING'

RET_VIA_LEAVE = ' '

  • VARIANT = ' '

VARIPROG = 'ZPRPP_WORKORDERPURCHASING'

SKIP_SELSCREEN = 'X'

  • EXPRESSIONS =

  • IMPORTING

  • VARIANT =

TABLES

SELECTION_TABLE = i_rspar

EXCEPTIONS

JUST_VIA_VARIANT = 1

NO_SUBMIT_AUTH = 2

OTHERS = 3

Any Idea!.

Thanks

Jaif

4 REPLIES 4
Read only

Former Member
0 Likes
1,290

Hello Jaif,

Did you check with 'wait 'for sometime before you call this FM?

Regards

Bindu

Read only

0 Likes
1,290

Hi Bindu ...

WAIT..!!!

I would appreciate a lill more explanation on this.

Thanks

Jaif.

Read only

Former Member
0 Likes
1,290

If anyone wants to do this..

Just create a FM with Remote enable..If do not know how to create one ..refer the attributes of any BAPI and all import & export parameters must have "Pass Value" checked.

Use the FM as below..

call function 'ANY_RFC_FM'

STARTING NEW TASK 'TEST'

DESTINATION 'NONE'

EXPORTING

XXXXXXXX = XXXXXXX.

Reference: https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=23658609

Read only

0 Likes
1,290

Hi,

copy your function module SUBMIT_REPORT to ZSUBMIT_REPORT and make it remote enabled.

Now, where ever you want to call this FM, call as below,

CALL FUNCTION 'ZSUBMIT_REPORT' STARTING NEW TASK 'T'
EXPORTING
* RDIR = TRDIR
report = 'ZPRPP_WORKORDERPURCHASING'
RET_VIA_LEAVE = ' '
* VARIANT = ' '
VARIPROG = 'ZPRPP_WORKORDERPURCHASING'
SKIP_SELSCREEN = 'X'
* EXPRESSIONS =
* IMPORTING
* VARIANT =
TABLES
SELECTION_TABLE = i_rspar
EXCEPTIONS
JUST_VIA_VARIANT = 1
NO_SUBMIT_AUTH = 2
OTHERS = 3.

Check it out, it works for me.