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

Execute program without going thru se38

Former Member
0 Likes
8,197

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,427

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.

8 REPLIES 8
Read only

Former Member
0 Likes
3,427

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

Read only

0 Likes
3,427

i did try ..but it opens in the same session as my interface

Read only

0 Likes
3,427

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.

Read only

0 Likes
3,427
PARAMETERS: P_REPORT TYPE SY-REPID.

CALL FUNCTION 'Z_FUFFA_SUBMIT' STARTING NEW TASK 'NONE'
  EXPORTING
    REPORT = P_REPORT.

It works

Max

Read only

0 Likes
3,427

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,427

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

Read only

0 Likes
3,427

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.

Read only

Former Member
0 Likes
3,428

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.