Using SUBMIT in an ABAP program.

Hello,
There is a need in my function module where I need to take the help of a transaction wherein I would require the values of an internal table ( which is populated somewhere in the transaction program ) to be passed back to my function module where I intend to use these values to populate in a structure and to do some other mumbo jumbo with it.
So, I did the following:
In my function module, I was able to create a structure which would hold the exact same stuff like the data of the internal table in the transaction program.
I then wrote the following SUBMIT code so it jumps to the transaction program to get the values I need.
EXPORT internaltable TO MEMORY ID c_memory.
        SUBMIT ZTRANSACTIONPROGRAM
          WITH w_param1 EQ '1000'
          WITH w_param2 EQ iw_something
          AND RETURN.
IMPORT internaltable FROM MEMORY ID c_memory.
What is happening basically is :- When I debug the code, I find that the execution does go to the transaction program I want it to go. But, soon after it jumps back to the calling FM code. ( Is this because of the return statement I have added here?) And, the internal table which is imported is empty. No values whatsoever.
If I want it to go all the way to the line of code in the transaction program - exactly after which that internal table( which I need ) is getting populated - what would I have to do?
I could insert some code which basically says " Hey! If my calling program is "this"(my FM)  -> only then copy this particular internal table at this line ( I would want to insert the code at the place where I would need a data transfer) to the memory id. " Plus, I would want this internal table to be exported so I can import it back to my FM and use it. And, may be an EXIT statement after that? So, I would not want the whole of the transaction program to execute.
Could you help me figure out how I need to code this requirement of mine in the transaction program? Is this doable? Please provide how I would need to code this out in the transaction program.
Would appreciate suggestions and alternatives to this approach.
Thanks & Regards,
Alice.

Try this code:
1] code for function module:
data: isel type table of rsparams.
data: xsel type rsparams.
data s_matnr type matnr.
loop at it_matnr into s_matnr.  "Select option
xsel-selname = 'S_MAT'.
xsel-kind    = 'S'.
xsel-sign    = 'I'.
xsel-option  = 'EQ'.
xsel-low     = s_matnr.
append xsel to isel.
clear: xsel, s_matnr.
endloop.
xsel-selname = 'PB_IND'."Radio button
xsel-kind    = 'S'.
xsel-sign    = 'I'.
xsel-option  = 'EQ'.
xsel-low     = 'X'.
append xsel to isel.
clear xsel.
xsel-selname = 'DIADATE'. "Parameters
xsel-kind    = 'S'.
xsel-sign    = 'I'.
xsel-option  = 'EQ'.
xsel-low     = sy-datum.
append xsel to isel.
clear xsel.
submit zgk_test_program
with selection-table isel
and return.
  import t_display to it_display1 from memory id 't_display'.
free memory id 't_display'.
append lines of it_display1 to it_display.
2] code for program:zgk_test_program
       export t_display to memory id 't_display'.    "t_display is internal table
    leave program.

Similar Messages

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Question about using TVARV in an ABAP program

    Hello gurus, Im sorry about the silly question.
    I have a question about using TVARV in an ABAP program.
    A program is presenting a problem and I think that in this code:
    SELECT SIGN OPTI LOW HIGH
      FROM TVARV
      INTO TABLE R_1_163431035_VELOCIDADE
      WHERE  NAME = '1_163431035_VELOCIDADE'
      AND    TYPE = 'S'.
      IF ZMM001-VELOCIDADE_B   IN R_1_163431035_VELOCIDADE AND
          ZOPERADORAS-OPERADORA = 'ABCD' AND
          ZMM001-MATERIAL       IN R_1_163431035_PRODUTO.
      ELSE.
      ENDIF.
    What happens is that the value "ZMM001-SPEED" B not exist in "R1_163431035_VELOCIDADE" but the program executes commands under the IF and not under the ELSE, as I imagine it would work. Is this correct ?
    I am new to ABAP programming, but I have a lot of XP in other programming languages ​​and this makes no sense to me.
    Anyone know where I can find some documentation of the use of "TVARV" in ABAP programs?
    I search the Internet if other programmers use TVARV this way, but found nothing, which leads me to think that was a quick and dirty solution that used here.
    If this is a bad way to program, what would be the best way?
    Regards
    Ronaldo.

    Hi Ronaldo,
    But in this case, the range is not empty, there are 17 records, in this way.:
    For the column "SING" all values ​​are "E"
    It means that the result is false if ZMM001-VELOCIDADE_B has the same value as one of the 17 records (E = exclude).
    For instance, if it has value 'C' and one of 17 records matches C, then the result is false.
    The "IF" with "IN" using "TVARV" as used in the program of the post above has the same behavior of a selection screen?
    Yes, the same behavior as the selection criterion to be exact. You can press the help key in the complex selection dialog for more info.
    I know it's a silly and very basic question, but other language that I used, only the SQL has the "IN" operator, but I think they work in different ways, so I would like to understand how it works in ABAP.
    Not silly ;-). Yes they work differently.
    More info here:
    - http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/frameset.htm
    - http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/frameset.htm
    BR
    Sandra

  • Updating liveCache Data using Function Module or ABAP program.

    Is it possible to update APO Live Cache using Function Module or ABAP Program.
    Will the aggregation/disaggreagation remain the same if data is modified using Function Module or ABAP Program.
    Regards,
    Vikas

    ello Vikas,
    -> Please click at
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    & read about 'SAP liveCache'.
    As you know objects stored in liveCache in the class containers can be accessed
    and manipulated only via LCA routines which are methods of LCA objects.
    The registration of the LCA routines is done automatically when
    the liveCache is started by the LC10, check the lcinit.log file.
    The shared procedures in the LiveCache are written in C++ and shipped
    to the customers as binary shared libraries(LCA-Routines) < LCA build >
    together with the LiveCache. The original C++ source code of the
    libraries is not generally available to the customers.
    The LCA routines could be called via "/SAPAPO/OM*" ABAP functions.
    -> For SAP liveCache documentation in English:
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    < -> Database Administration in CCMS: SAP liveCache -> liveCache Assistant ->
    liveCache: Monitoring -> Problem Analysis-> DB Procedures >
    In transaction LC10 for the LCA connection choose liveCache:Monitoring
    then go to Problem Analysis -> DB Procedures=>
    The system displays an overview of all database procedures loaded into
    liveCache, their input and output parameters, and other details.
    -> Tr. /n/SAPAPO/OM16 ( in further releases /n/sapapo/om19 ) is provided by
    SAP to get information about data stored in the LiveCache. If you would
    like to get your own views, you should write a special report in ABAP using
    "/SAPAPO/OM"-development class functionality.
    -> There are standard function modules in ABAP available to extract/change data from/in liveCache.
    -> In addition to the given information => find more information at:
    SCM 4.0 -> http://help.sap.com/saphelp_scm40/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 4.1 ->
    http://help.sap.com/saphelp_scm41/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 5.0 ->
    http://help.sap.com/saphelp_scm50/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    You can go to the Advanced Planner and Optimizer documentation from the above links < Supply Network Planning Run -> Aggregated Planning -> SNP Disaggregation Or SNP aggregation . >.
    If you still have open questions on the posted topic =>
    Could you please give more information on your application scenario.
    Thank you and best regards, Natalia Khlopina

  • Submit statement in ABAP program

    Hi All,
          I am using two submit statements in my program for two different reports. When i run the program i get the output screens of the two reports at the ouptut. Is there any way i can hide the user seeing the output screens of the two programs and display only the output screen of my program. If you have any clues please post it.
    Thanks & Regards,
    Rahul Rathi

    You can call executable programs from other ABAP programs using the following statement:
    SUBMIT <rep>|(<field>) [AND RETURN] [<options>].
    You can either specify the name of the program you want to call statically by entering the program name in the code of the calling program, or dynamically by specifying the name of a field (in parentheses) containing the name of the program. If the system cannot find the specified executable program when trying to execute the SUBMIT statement, a runtime error occurs.
    If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal session) are deleted. After the called executable program has finished, control returns to the level from which you started the calling program.
    If you use AND RETURN, the system stores the data of the calling executable program and returns to the calling after processing the called program. The system resumes executing the calling program at the statement following the call.
    The SUBMIT statement has a set of additions <options> for passing data to the called program and specifying various other processing options. Some of them are described in the following sections:
    Have a look at below link. It will help you.
    http://www.sapdevelopment.co.uk/reporting/rep_submit.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9dd035c111d1829f0000e829fbfe/content.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • How to use FTI_TR_CASH_FLOWS ldb in abap programming.

    I want to use FTI_TR_CASH_FLOWS  logical database in existing ABAP program but i am not able to use this logical data base in the program.Please suggest how to use this logical database in the program.

    I have developed a customized report and i want to use  logical database "FTI_TR_CASH_FLOWS" into my program . i don't know how to use SAPDBFTI_TR_CASH_FLOWS  into my report. how i pass data from my report to this LDB report. plz suggest.

  • Using SQ02 for writing ABAP programs

    Hello,
    I am using SQ02 coding section for writing some simple ABAP programs, mainly for reporting purposes. I would like introduce more power into my programs, but SQ02/SQ01 reports return "ACCESS_DENIED" when I for example try to call a function (GUI_DOWNLOAD).
    Can You advise how to extend SQ02 authorization to enable function calls?
    Maybe You know other place from which You can write programs without a developer key?
    Thanks,
    Pawel

    Hi Uday,
    do You mean that I have to first make a recording on cg3y using transaction shdb, then create a function module basing on this recording, and then use this function module in my code?
    Pawel

  • Can i use XSD / XML in Abap Programs

    Hi friends
    I need to validate a xml file against xsd file. Can i validate it in abap program?
    Best Regards.
    P

    Hi Pedro,
    Simple transformations, or ST, is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    Check this out...
    Simple Transformations - SAP Library
    Regards,
    Raj
    <dead link corrected>
    Message was edited by: Manish Kumar

  • Sending a pdf file using submit without client email program.

    I need a solution on sending a completed pdf file to my email address without the clients email program poping up.  My website has a small pdf file that users can complete and return to me.  I get many complaints from users stating it requires them to save the file first and then they are unsure were it saved or how to attach it to a email.  To make this easer on my users I want the submit button to simply send me the file using some method from my website.  I use iPage to host the site now.  I was looking for a script to call or some way to do this automaticly.  I was woundering if urs/sbin/sendmail might work.  I am simply at a loss on this.

    Using a sendmail type script will send you the form data in the body of an email message, if the form is set up to submit as "HTML". You can create your own script to attach the form data as an FDF, XFDF, or even the complete PDF, but it's unlikely your provider supplies a script for this, so you'd have some custom programming to do.
    Sending just the form data also avoids the licensing restrictions for Reader-enabled forms. You can easily import an FDF or XFDF into a blank form to create a filled-in form.

  • Using submit to call RCCLORD program

    Hi,
              I want to call RCCLORD program in my zprogram by passing the below fields from my z program:
    Process order, Plant,Order Type.
    Can any one tell me how do i write it..  need the exact syntax to pass the values to the selection screen of the called program.
    thanks,

    Try something like following
    tables :aufk.
    SELECT-OPTIONS: S_AUFNR for aufk-aufnr,
                    S_WERKS for aufk-WERKS,
                    S_AUART for aufk-auart.
    SUBMIT RCCLORD
       with S_AUFNR in S_AUFNR
       with S_WERKS in s_werks
       with S_AUART in S_AUART
       AND RETURN.

  • Accessinng Table using Native SQL in ABAP Program

    Hi Experts,
    I need to access a table that is created in Oracle.
    But while writing a select query as below:
      EXEC sql.
       SELECT MAX(ID_EVENTO)
         INTO :LV_ID_EVENTO
         FROM ZTAB.
      ENDEXEC.
    I am getting a dump saying "ZTAB doesnot exist" or IF I use ZTAB@ifsap then it dumps saying "Database name is missing a component".
    Do I need to add some suffix to the table name like @ifsap to ZTAB?
    Also, can I use SY-SUBRC to check to the success and failure for SELECTION OR INSERTION Operation?
    Thanks
    Depesh

    Hello,
    Try using SAP<SID>.ZTAB in your query.
    For example SAPC05.ZTAB
    Regards,
    Yoganand.V

  • How to use RSAN_PROCESS_EXECUTE in abap program

    Hi all,
    Does someone know how to use RSAN_PROCESS_EXECUTE in a abap program to execute an analytical process created in the transaction RSANWB?
    I create a variant 'ZPC_ALIM_DL' for RSAN_PROCESS_EXECUTE. I would like to execute this program with this variant in a background job, but it seems that the job executed but it does nothing.
    See below a part of the code.
    SUBMIT RSAN_PROCESS_EXECUTE
                 WITH VARIANT = 'ZPC_ALIM_DL'
                 USER SY-UNAME VIA JOB L_JOBNM1 NUMBER L_JOBCOUNT1
                 AND RETURN.
    Thanks in advance,
    L.

    Hi Ludovic,
              I am using RSAN_PROCESS_EXECUTE with a variant in process chain. simply include 'abap program' type in process chain mention RSAN_PROCESS_EXECUTE as the program name and mention the variant you created for your apd process and run. I have tested it in dev and it has worked for me. let me know if this helps!
    Thanks
    Suresh R Kovvuru

  • How to get a parameter from BPC and use it in ABAP program

    Hello gurus!
    I got a problem...
    SAP BPC will send parameters such as year, division, category, company code and so on via script logic to SAP BW.
    I need to get these parameters from BPC and use them in a ABAP program as a filter.
    This ABAP program will do several routines and return new values to BPC. It must be made on ABAP and I need to filter data to avoid performance issues.
    Does anybody knows how to do it? or have a example of it?
    Thank you in advance.
    Regards,
    Rubens Kumori

    Hello, I'm looking for a suggest.
    I need to pass two parameters (users can input them in a data manager package in bpc) to a BAdI.
    In this BAdI I write a code that store those parameters in a InfoObject.
    The problem is:
    - one parameter is for CATEGORY value. CATEGORY is a dimension of the application and I read the value with a code like this:
          READ TABLE it_cv INTO l_s_it_cv
               WITH TABLE KEY dim_upper_case = 'C_CATEGORY'.
    - other parameter is a generic DATE. this parameter is not a dimension of the application and I don't know how I can retrieve this value in BAdI.
          READ TABLE it_cv INTO l_s_it_cv
               WITH TABLE KEY dim_upper_case = '.....'.
    The data manager dynamic script is:
    PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%")
    PROMPT(TEXT,%SELECTED_DAY%,"Write the date (format YYYYMMDD)",)
    I also have a dynamic constant that assign the name %CATEGORY_DIM% to "C_CATEGORY" value.
    Can anyone help me?
    thanks a lot
    Edited by: Luca Novali on Feb 13, 2012 3:49 PM

  • Problem in  using function module parameters in abap program

    i want to use the coding present in on one of the function module 'AS_API_INFOSTRUC_FIND'  i got the problem using the function module parameters in my abap program.
    these are the parameters inside fm
    ""Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(I_FIELDCAT) TYPE  AIND_FCAT
    *"             VALUE(I_FIELDS) TYPE  TABLE OPTIONAL
    *"             VALUE(I_OBLIGATORY_FIELDS) TYPE  TABLE OPTIONAL
    *"       EXPORTING
    *"             VALUE(E_INFOSTRUC) TYPE  AIND_DESC
    *"             REFERENCE(E_ALL_FIELDS) TYPE  TABLE
    *"             REFERENCE(E_MATCHING_FIELDS) TYPE  TABLE
    *"       EXCEPTIONS
    *"              NO_INFOSTRUC_FOUND
    i want to declare     E_ALL_FIELDS  parameter    in my abap program,
    i have declared as 
    data: E_ALL_FIELDS TYPE TABLE.
    but   the system throws error that
    'type of field 'TABLE'  is generic .no table line has been specified'.
    i want to use it in my abap program how can i declare in my abap program .

    You have to declare the table using any specific type.
    The type table in the FM is generic so you can pass any type you need.
    For instance:
    TYPES: BEGIN OF ty_fields,
             fieldname LIKE dfies-fieldname,
           END OF ty_fields,
    TYPES: TY_T_GLU1              LIKE GLU1                     OCCURS 0,
           ty_t_fields            type ty_fields                occurs 0.
      DATA: lt_info_struct_fields TYPE ty_t_fields WITH HEADER LINE,
            lt_matching_fields    TYPE ty_t_fields WITH HEADER LINE.
        CALL FUNCTION 'AS_API_INFOSTRUC_FIND'
             EXPORTING
                  i_fieldcat         = ft_fieldcat-fieldcat
                  i_fields           = ft_fields_filled[]
             IMPORTING
                  e_infostruc        = lv_info_struct_name
                  e_all_fields       = lt_info_struct_fields[]
                  e_matching_fields  = lt_matching_fields[]
             EXCEPTIONS
                  no_infostruc_found = 1.

  • 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....

Maybe you are looking for