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

Calling Program RKAEP000 with submit

Former Member
0 Likes
4,281

Hi Experts,

I need to call the program of transaction 'KSB1'. i know the pgm name - RKAEP000.

when i call using the submit statement, I'm getting the error - " - transaction code not defined."

I dont know how to pass the condition of transaction code in the SUBMIT statement.


ELSEIF repname = 'KSB1'.
    SUBMIT (repname) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                   SPOOL PARAMETERS lw_pripar
*                 VIA SELECTION-SCREEN
*                   t_code eq 'KSB1'
                     USING SELECTION-SCREEN 100
                   WITH SELECTION-TABLE rspar
*                      eq 'KSB1'
                   AND RETURN.

I found one thread which has the solution but the correct statement is not available. They say to give the condition of tcode with the submit statement. I dont know how to give the condition in the submit statement,

Guys waiting for your reply..

Help is appreciated.

Regards,

Abdur Rafique

3 REPLIES 3
Read only

Former Member
0 Likes
2,231

Hi,

please try

WITH p_tcode = 'KSB1'

This is defined in include RKAEPSCM.

Regards,

Klaus

Read only

0 Likes
2,231

Dear klaus,

I tried giving that code, when i debugged, it goes to the below function module.


CALL FUNCTION 'K_LINE_ITEM_LOGICAL_KEY_GET'
  EXPORTING
    i_tcode            = v_tcode
  IMPORTING
    e_item_group       = c_item_group
    e_rep_object       = c_rep_object
    e_update           = gd-update
  EXCEPTIONS
    unknow_transaction = 1.

IF sy-subrc = 1.
  MESSAGE e496(kb).

here in the debugging mode i saw the value for v_tcode as "SE38" and got the error as "Transaction code not defined".

Can you please help me on this.

Thanks again.

Regards,

Abdur Rafique

Read only

0 Likes
2,231

Dear Klaus,

I got the solution, thanks for you help.

Initially i declared the variable t_code as data but we need to define as parameter with no-display and pass the value with the Submit statement.


p_tcode TYPE sy-tcode NO-DISPLAY.
 ELSEIF repname = 'RKAEP000'.
   SUBMIT (repname) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                  SPOOL PARAMETERS lw_pripar
                VIA SELECTION-SCREEN
                  WITH p_tcode EQ 'KSB1'
                    USING SELECTION-SCREEN 100
                  WITH SELECTION-TABLE rspar
                  AND RETURN.

This submit statement will pick the required transaction from that particular program.

Regards,

Abdur Rafique