‎2011 Sep 07 7:01 PM
Hello Experts,
I am building an interface which will allow user to access some zprograms without having to go thru se38 (therefore no need to remember program name).
To accessthe program they will just need to click on the push button in the screen explaining wat the program does.
I want the program to open in a different session than that of my interface.
-- I do not have the option here to attach a transaction code to the program and call the transsaction code instead of the program.
Any suggestions?
‎2011 Sep 08 8:27 AM
Hi,
As said, create a custom function module as RFC enabled function module and call FM with starting new task.
CALL FUNCTION 'ZXXX' STARTING NEW TASK 'NONE'
EXPORTING
prog_name = 'PROG'
.
FUNCTION ZXXX.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(PROG_NAME) TYPE SY-REPID
*"----------------------------------------------------------------------
submit (PROG_NAME) AND RETURN.
ENDFUNCTION.This will work.. you can also add other import parameters to be submitted with program.
Regards,
Ravi.
‎2011 Sep 07 7:22 PM
Hi
U can call (I suppose you mean SUBMIT) your progroam in a function module and call the function module with the option NEW TASK
Max
‎2011 Sep 07 7:24 PM
i did try ..but it opens in the same session as my interface
‎2011 Sep 07 7:38 PM
What about TH_CREATE_MODE ?
CALL FUNCTION 'TH_CREATE_MODE'
EXPORTING
transaktion = 'SE38'
del_on_eot = 0
PARAMETERS = 'RS38M-PROGRAMM=ZXXXXX'
PROCESS_DARK = 'X'
EXCEPTIONS
max_sessions = 1
internal_error = 2
no_authority = 3
OTHERS = 4.
‎2011 Sep 07 7:39 PM
PARAMETERS: P_REPORT TYPE SY-REPID.
CALL FUNCTION 'Z_FUFFA_SUBMIT' STARTING NEW TASK 'NONE'
EXPORTING
REPORT = P_REPORT.It works
Max
‎2011 Sep 08 5:29 AM
My thoughts,
The "starting new task" will help you create a new main mode, but you will have to keep in mind the user cannot have more than Six main modes failing which an error will be issued. Not sure if it would look good for end users who multitask with all six sessions. Read the F1 on Starting new task.
Could you share more info on the need for a new main session, i mean you could always create a new internal session with "Submit and Return Program"
Regards,
Chen
‎2011 Sep 08 6:18 AM
The "starting new task" will help you create a new main mode, but you will have to keep in mind the user cannot have more than Six main modes failing which an error will be issued.
Hello Chen,
This is partially correct. Default no. of sessions in 6(as you've mentioned) but you can extend this via the profile param rdisp/max_alt_modes.
BR,
Suhas
‎2011 Sep 08 7:23 AM
The function code 'TH_CREATE_MODE' only opens a new session of se38, with the field program name filled by the ZPROGRAM. But the aim here is to access the program.
How to run it from the interface i am creating?
Regards.
‎2011 Sep 08 8:27 AM
Hi,
As said, create a custom function module as RFC enabled function module and call FM with starting new task.
CALL FUNCTION 'ZXXX' STARTING NEW TASK 'NONE'
EXPORTING
prog_name = 'PROG'
.
FUNCTION ZXXX.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(PROG_NAME) TYPE SY-REPID
*"----------------------------------------------------------------------
submit (PROG_NAME) AND RETURN.
ENDFUNCTION.This will work.. you can also add other import parameters to be submitted with program.
Regards,
Ravi.