Using submit..............

hello guys,
Actually i am trying to call a program'B' from program 'A', using submit and return.i want to capture the output of program 'B' which is list output, i have used 'LIST_FROM_MEMORY' functional module in program 'A', to download from abap memory, but how do i convert this file into a normal internal table to read the output.
i have tried 'LIST_TO_TXT' Func Mod to convert from abaplist to txt but its not working.
could anybody pls suggest a solution.

dear anbu,
thanks for the code ,but i have a problem here
my code...........
DATA list_tab TYPE TABLE OF abaplist.
      data : t_ascii type LIST_STRING_TABLE.
      data : wa_ascii type LIST_STRING_TABLE.
      SUBMIT Zrabest_alv01 USING SELECTION-SET 'DEEPAK'
                    EXPORTING LIST TO MEMORY
                    AND RETURN.
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = list_tab
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc = 0.
       CALL FUNCTION 'LIST_TO_ASCI'
      TABLES
        listasci           = t_ascii " list converted to ASCII
        listobject         = list_tab
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    IF sy-subrc NE 0.
    ENDIF.
it is giving me a dump in the function module LIST_TO_ASCI.
IT SAYS:
"  At the statment
      "DESCRIBE"
only character-type data objects are supported at the argument position
"LISTASCI", but no strings are supported (data types STRING and XSTRING).
In this particular case, the operand "LISTASCI" has the
type "g".  "

Similar Messages

  • How to get spool number when using SUBMIT job

    Hi All,
    I am calling standard program using SUBMIT through JOB as below. Now I need spool number for this job to covert the output to PDF and send to mail. See the below code and guide me.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      data: Zscreen type table of RSPARAMS with header line.
       Zscreen-selname = 'PM_AENNR'.
       Zscreen-kind = 'P'.
       ZSCREEN-LOW = '500000000125'.
       APPEND ZSCREEN.
    SUBMIT RCC00130 WITH selection-table Zscreen TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                       WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5

    Hi,
    Do this way, first get print parameters by using function module 'GET_PRINT_PARAMETERS'
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = 'LP01'
          list_name      = 'TEST'
          list_text      = 'SUBMIT ... TO SAP-SPOOL'
          immediately    = ' '
          line_size      = '1023'
          no_dialog      = 'X'
        IMPORTING
          out_parameters = wa_pri_params
          valid          = w_valid.
    If it returns success then
        IF w_valid EQ 'X'.
          CONCATENATE 'R'                                   
                       w_tabix                                
                       sy-datum+4(4)
                       sy-uzeit INTO
                       wa_pri_params-plist.
        ENDIF.
        SUBMIT rprccc00
               WITH firmennr = w_cid
               WITH bel_clus = 'X'
               WITH testlauf = ' '
               WITH not_lokl = 'X'
               WITH file_in  = w_arc_out
               TO SAP-SPOOL WITHOUT SPOOL DYNPRO
               SPOOL PARAMETERS wa_pri_params AND RETURN.
        COMMIT WORK AND WAIT.
    SELECT rqident
             FROM tsp01
             INTO w_rqident
             UP TO 1 ROWS
             WHERE rq2name = wa_pri_params-plist.
      ENDSELECT.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid     = w_rqident
          no_dialog       = 'X'
          dst_device      = 'LP01'
          pdf_destination = 'X'
        TABLES
          pdf             = t_pdf.
    Hope it solves your problem
    Regards
    Krishna

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • Using SUBMIT program command in Background

    Hi,
    I am submitting the program in Background using Submit<program> command.
    Job is getting released but not fininishing(not executing the program) in ECC6.0.
    Same program is working in fine in 4.5b.
    Please let me know if any one faces this situation. Its very urgent.
    Expecting the reply from you soon..
    Thanks
    Regards,
    Raj A

    Hi,
    perhaps you or your admin have configured to less batch-workprocess or they are all configured only for A-class jobs.
    Try to start the job as A-Class job. If the program is executed, then ask your administrator to configure more batch workprocess that are not reserved for A-class jobs.
    Regards,
    Stefan

  • To run a program in BACKGROUND using SUBMIT

    I need to run a program in background using the SUBMIT option. Here i have to pass an internal table form one program to another which will be used to update sales orders using BDC.
    Questions
    1} Can we execute a program in background using SUBMIT?
    2} I am sending data to a MEMORY ID , if i run the program in background will the memory id work. As in do  memory IDs work in the background.
    Thanks in Advance

    refer  same thread.
    Re: Problem with SUBMIT in Background

  • Calling a Report Program In Web Dynpro Using Submit statment

    Hi all,
             Can any one suggest how can i call a report program form Web Dynpro using Submit statment. I tried to call it its showing Field symbols not defined error. Is their any other ways to call Report in a Web Dynpro?. I have posted the error message when i tried using SUBMIT ZRR AND RETURN CONTROL
    Field symbol has not yet been assigned.
    The error occurred on the application server mnghcmsap_HRS_00 and in the work process 1 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Form: CHECKBOX_OUT of program SAPLKKBL
    Form: GEN_LINE_OUT of program SAPLKKBL
    Form: DATA_OUT_SIMPLE of program SAPLKKBL
    Form: LIST_OUTPUT_NEW of program SAPLKKBL
    Form: FIRST_LIST_DISPLAY of program SAPLKKBL
    Module: LIST_DISPLAY of program SAPLKKBL
    Function: K_KKB_LIST_DISPLAY of program SAPLKKBL
    Method: PRINT_BACKEND of program CL_GUI_ALV_GRID===============CP
    Method: SET_TABLE_FOR_FIRST_DISPLAY of program CL_GUI_ALV_GRID===============CP
    Form: PBO of program SAPLSLVC_FULLSCREEN
    Edited by: VINMANO on Jul 22, 2009 2:54 PM

    HI,
    Its possible to call report program from Web dunpro...
    chk out dis link,
    calling report(se38) in webdynpro abap
    By the way are using field symbol anywhere and left it unassigned?
    Thanks,
    Divya.S

  • In RFC can we use SUBMIT satement?

    Dear all,
    Thank u vvery much for ur response,
    In RFC can we use SUBMIT statement?
    I had a doubt Please clarify me.
    Thanks and Regards,

    Hi Lakshman,
    I am facing similar situation like Ravi.
    I am using Submit program inside RFC function module in BW.
    And one point here, I am using EXPORT and IMPORT memory IDs in the same RFC to retrive data in BW.
    I am calling this from R3.
    In BW it is working fine, where as in R3 nothing is coming.
    Please help me.
    Thanks,
    Veerendra.

  • How to use SUBMIT key word in the program in the program

    Hello Folks,
                     I want use SUBMIT statment in the program for calling the other program. My query is
    I have one report named REPORT1 and I am using the SUBMIT statment in this report to call the second report named as REPORT2. The flow of the program is I excute the first report REPORT1 and entr the value on selection screen of REPORT1, selection screen is having one parameter. then SUBMIT statment comes into picture to call the second report REPORT2 in this second report, I would like to pass the selection screen value of first report REPORT1.
          I want to know how to pass the selection screen value of the first REPORT1  to second REPORT2.
    Anyone please guide me in this regards.
    Thanks & Regards
    Chetan

    Hi Chetan,
    Try this report.
    Create two reports namely ztry, ztry1 as below.
    Run report ztry.
    When you run report ztry,
    ztry1 will get excuted first(through 'submit'),
    getting values from report ztry through 'import' and 'get parameter'.
    Report ztry.
    *Export and Import
    DATA: text(20) VALUE 'Hello',
          mem(20).
    WRITE:/ 'Export and Import' COLOR = 1.
    EXPORT text TO MEMORY ID mem.
    SUBMIT zawi_try AND RETURN.
    WRITE:/ ''' Hello'' exported to ZAWI_TRY successfully '.
    WRITE:/.
    *Set and Get Parameter ID
    DATA: var(20) VALUE 'Master'.
    WRITE:/ 'Set and Get Parameter' COLOR = 1.
    SET PARAMETER ID 'abc' FIELD var.
    WRITE:/ 'Set Parameter ID is success'.
    WRITE:/.
    Report ztry1.
    DATA: text(5),
          mem(20).
    IMPORT text FROM MEMORY ID mem.
    WRITE:/ 'Importing '' Hello'' from ztry:', text color = 1.
    FREE MEMORY ID mem.
    write:/ mem.
    DATA: var(6).
    GET parameter id 'abc' field var.
    write:/ 'Value got through Get Parameter ID from ztry:',var color = 1 .
    Thanks....

  • But how to use submit??

    but how to use submit?? i mean how to generate an event thru submit and how to receive these values in the next page

    but how to use submit??You can do it by using Simple HTML Code
    <INPUT TYPE="SUMBIT" VALUE="SUBMIT">
    i mean how to generate an event thru submit and how to receive these values in the next pageTo generate an event through Submit! You need to do this using java script.
    I think you are talking about assingning some values on the click of submit and collecting those values in the next page!
    To do that
    keep some input fields in page1. Then try to assign the values to those input fileds using javascript through onclick event.
    <INPUT TYPE="SUMBIT" VALUE="SUBMIT" onclick="javascript:callSomeFunc()">
    In
    callSomeFunc() {
    //Assign values to the hidden fields
    In next page say page2 collect those values using request.getAttribute(" InputHiddenFieldsName);
    That's it.

  • Create spool for background jobs which uses submit statement

    Hi Gurus,
                 I have a quick question regarding the backgroud jobs. When we run a program in the background , it should create a spool for us, but, the problem comes when I am running a program in the background, its not creating the spool. This program uses SUBMIT statement. This program collects the data and it will submit to the other program and then retuen. In this case, its not creating a spool. Its very important for us to look at the spool for this program. Does anybody cam across this kind of problem? I need ur inputs.
    Thanks in advance, <REMOVED BY MODERATOR>
    Regards,
    Srinivas.
    Edited by: Alvaro Tejada Galindo on Mar 18, 2008 4:31 PM

    hi check this link ...
    Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately.
    DATA: number TYPE tbtcjob-jobcount,
          name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT submitable TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDIF.
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=backgroundsubmit&adv=false&sortby=cm_rnd_rankvalue
    sy-subrc  Meaning
    0            Background task scheduled successfully.
    4            Scheduling cancelled by user on the selection screen.
    8            Error during scheduling, i.e. when accessing JOB_SUBMIT internally.
    12          Error in internal number assignment.
    regards,
    venkat.
    Edited by: venkat  appikonda on Mar 18, 2008 6:32 PM

  • Problem using Submit statement

    Dear Experts,
    I am trying to use submit statement in a report for transaction ML85. I have used the below code.
    submit RMSRVF00 with FRGCO = 'S1'
                    with FRGGR = 'S1'
                    with listu = 'ENTRY_REL'
                    with ebeln = '4500000309'
                    AND RETURN.
    But when I execute the report the values which I set are not filled and the screens opens with error message as '' Fill in all required entry fields". I am passing values for fields Releasecode - FRGCO, Release group - FRGGR, Purchase Order - EBELN, Scope of list - LISTU.
    Please tell me why this message is coming and values are not set for fields.
    KR,
    Bharath

    hai,
    try like this
    SUBMIT ZVENDOR_REPORT_NEW1 USING SELECTION-SCREEN '100'
                  WITH SELECTION-TABLE TB_OUTPUT
                   WITH P_DATE = SY-DATUM
                   WITH S_ERDAT BETWEEN '01.01.2008' AND '01.06.2008'
                   AND RETURN.
    or you can go in this way using type pools:
    TYPE-POOLS RSDS.
    DATA: TRANGE                        TYPE RSDS_TRANGE,
          TRANGE_LINE                   LIKE LINE OF TRANGE,
          TRANGE_FRANGE_T_LINE          LIKE LINE OF TRANGE_LINE-FRANGE_T,
          TRANGE_FRANGE_T_SELOPT_T_LINE LIKE LINE OF TRANGE_FRANGE_T_LINE-SELOPT_T,
          TEXPR                         TYPE RSDS_TEXPR.
    TRANGE_LINE-TABLENAME = 'TB_OUTPUT'.
    TRANGE_FRANGE_T_LINE-FIELDNAME = 'S_ERDAT'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-SIGN   = 'I'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-OPTION = 'BT'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-LOW    = '01.01.2008'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-HIGH   = '01.06.2008'.
    APPEND TRANGE_FRANGE_T_SELOPT_T_LINE TO TRANGE_FRANGE_T_LINE-SELOPT_T.
    TRANGE_FRANGE_T_SELOPT_T_LINE-SIGN   = 'I'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-OPTION = 'NE'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-LOW    = SY-DATUM.
    APPEND TRANGE_FRANGE_T_SELOPT_T_LINE  TO TRANGE_FRANGE_T_LINE-SELOPT_T.
    APPEND TRANGE_FRANGE_T_LINE TO TRANGE_LINE-FRANGE_T.
    APPEND TRANGE_LINE TO TRANGE.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        FIELD_RANGES = TRANGE
      IMPORTING
        EXPRESSIONS  = TEXPR.
    SUBMIT ZVENDOR_REPORT_NEW1 VIA SELECTION-SCREEN
                   WITH SELECTION-TABLE TB_OUTPUT
                    WITH FREE SELECTIONS TEXPR AND RETURN.

  • Problem in using Submit

    Hi Experts.
    I am calling another report in my program inside a method using SUBMIT statement.I can't use Export-Import because OO Concept does not support Export-Import inside a method.
    Please tell me how to pass a value stored in a variable using Submit?
    Thanks
    Abhishek

    Hi Abhishek,
    try out this code whether it is helpful.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    jobname = l_jobname
    IMPORTING
    jobcount = l_jobcount
    EXCEPTIONS
    cant_create_job = 1
    invalid_job_data = 2
    jobname_missing = 3
    OTHERS = 4.
    DATA list_tab TYPE TABLE OF abaplist.
    IF sy-subrc <> 0.
    RETURN.
    ENDIF.
    Submit report to job
    SUBMIT rkpep005
    USING SELECTION-SET 'TEST1'
    VIA JOB l_jobname
    NUMBER l_jobcount
    TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    SPOOL PARAMETERS ls_params
    AND RETURN.
    Regards,
    prasad

  • Get table cell value on click without using submit or action

    hello ,
    i am having html table containing values retrieved from database.
    i want to create table cell as a link and want to pass cell's value to the next page without using submit, radio button, checkbox.
    it is feasible in PHP and ASP but i want to solve in jsp. pls suggest the solution.
    Edited by: Avinash123 on Dec 16, 2008 2:58 AM

    Here is sample code
    <script type="text/javascript">
    function callForm(data)
    frm.action="anotherjsp.jsp?value="+data;
    frm.submit();
    </script>
    <form name="frm" action="">
    <table id="test" border='1'>
    <tr >
    <td onclick="callForm('Data1')" > Data1 </td>
    <td onclick="callForm('Data2')" > Data2 </td>
    <td onclick="callForm('Data3')" > Data3 </td>
    <td onclick="callForm('Data4')" > Data4 </td>
    </tr>
    </table>
    </form>

  • How to get current row using submit button ?

    Hello Friends ,
    Is there any way i can capture the value of current row by submit button ?
    Here is my requirement , i have seeded OAF screen and it has table region one of the column has radio button , the existing
    functionality is when ever the radio button is selected and click on submit button ( submit button attached on top of the table region )
    other oaf page is getting opened .
    Now i wish to restrict the navigation based on some condition , but i don't know how to get the current row using submit button .
    Note : there is no Fire Action event for radio button column ? I dont' know how orale is selecting a specific row
    Any suggestion please ?
    Regards ,
    Vamsi

    Thanks sushant for your response ,
    Well i have tried your approch , i am not getting values for current row .
    if (pageContext.getParameter("paApply") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject localOAViewObject1 = (OAViewObject)am.findViewObject("ProjectDatesVO");
    if(localOAViewObject1!=null) {
    Row DateVoROw = localOAViewObject1.first();
    RowSetIterator iterator = localOAViewObject1.createRowSetIterator("iterator");
    iterator.setRangeStart(0);
    iterator.setRangeSize(localOAViewObject1.getRowCount());
    for(int i=0; i<iterator.getRowCount(); i++)
    DateVoROw=iterator.getRowAtRangeIndex(i);
    String vacancyValue= DateVoROw .getAttribute("vacancyname).toString();
    Could you please let me know where i am going wrong
    Thanks again ,
    Vamsi

  • Passing an internal to another program using SUBMIT

    Hi,
       I need to pass one internal table from one program to another which i am calling using SUBMIT. Is there any way to pass this data without using export/import or selection screen.
       If i do use EXPORT is there a retriction to the maximum size i can export?
    Thanks

    Hi Pankaj,
    Consider these two programs I have done using both WITH SELECTION-TABLE and IMPORT/EXPORT.
    In Program 1(ZZTEST_ARUN_1).
    I have two radio buttons. If I select Material the program executes its own code. If I select plant data is fetched and exported to memory. Then it gets the selection parameters of the Program 2(ZZTEST_ARUN_2) through the FM RS_REFRESH_FROM_SELECTOPTIONS. Then I populate the values for selection screen and pass using the
    SUBMIT....WITH SELECTION-TABLE option.
    REPORT zztest_arun_1.
      TABLES: t001w.
      DATA : it_marc TYPE STANDARD TABLE OF marc WITH HEADER LINE,
             it_werks TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
       PARAMETERS material RADIOBUTTON  GROUP  abc.     "Material General Details
       PARAMETERS plant RADIOBUTTON GROUP abc DEFAULT 'X'.      "Material Plant Details
       START-OF-SELECTION.
       IF material EQ 'X'.
    *If Material selected own code executes  
        SELECT * FROM marc INTO TABLE it_marc UP TO 200 ROWS .
         LOOP AT it_marc.
         WRITE :/ it_marc-matnr,
                it_marc-werks.
         ENDLOOP.
       ENDIF.
      IF plant EQ 'X'.
    *If Plant selected data fetched  
        SELECT * FROM t001w INTO TABLE it_werks UP TO 50 ROWS.
    *Exported to Memory
        EXPORT it_werks[] TO MEMORY ID 'TEST'.
    *Declare on selection table type RSPARAMS
        DATA :   stable     LIKE     rsparams OCCURS 0 WITH HEADER LINE.
    *Call this FM to get the Selection screen details
    *of Program ZZTEST_ARUN_2 (it returns Select Options, Parameters..)
        CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
           EXPORTING
             curr_report     = 'ZZTEST_ARUN_2'
          TABLES
             selection_table = stable
          EXCEPTIONS
             not_found       = 1
             no_report       = 2
             OTHERS          = 3.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
       stable-sign = 'I'.
       stable-option = 'BT'.
    * populate some selection condition
       READ TABLE it_werks INDEX 10.
       stable-low = it_werks-werks.
       READ TABLE it_werks INDEX 40.
       stable-high = it_werks-werks.
       APPEND stable.
    *Submit it then
       SUBMIT zztest_arun_2
           WITH SELECTION-TABLE stable
           AND RETURN.
       ENDIF.
    <b>Second Program.</b>
    REPORT zztest_arun_2.
    TABLES: t001w.
    DATA : it_werks TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
    SELECT-OPTIONS : s_werks FOR t001w-werks.
    *Import the stored data.
    IMPORT it_werks[] FROM MEMORY ID 'TEST'.
    *Display the data based on selection criteria got
    *form ZZTEST_ARUN_1
    LOOP AT it_werks WHERE werks  IN s_werks.
      WRITE : / it_werks-werks,
                it_werks-name1.
    ENDLOOP.
    Regards,
    Arun Sambargi.

  • How to use Submit program of RAIMCOPY for a specific TCode - IM34

    Hi Experts,
    I have to use submit program RAIMCOPY.  but the program intend used in differnt Tcodes (IM27,IM27_Close,IM27_REPEAT,IM34,IM44,IM54,IM64).
    I used the following code but it is some other selection instead of IM34.
    SUBMIT RAIMCOPY VIA SELECTION-SCREEN with PA_PRNAM = gv_improg
                                                 WITH PA_GJAHR = gv_appyear
                                                 with SO_VERSN-LOW = 'G00'
                                                 with P_XVOVR = 'X'
                                                 and RETURN.
    Please help me to write a submit program RAIMCOPY for only IM34.
    Regards,
    Thulasiram.

    Yes at start of report (events LOAD-OF-PROGRAM and INITIALIZATION) the variant / parameters are not yet transfered to program, they are only passed just before the AT SELECTION-SCREEN OUTPUT, so that could have been nice ... before OSS note  927693 - Report variants used incorrectly in program RAIMCOPY which triggers now an error if sy-tcode <> pa_tcode in interactive mode ...
    So either you look for an implicit enhancement option to force again pa_tcode to required value (e.g. stored in memory) and disable effect of the OSS note (*) /or/ you replace the SUBMIT statement with a CALL TRANSACTION with a small BDC data.
    Regards,
    Raymond
    (*) SAP did that for transaction  IMCAOV, 1023920 - IMCAOV: Unberechtigter Abbruch 00368

Maybe you are looking for