Application Development 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: 

Query Regarding SUMBIT report

RatneshSisodiy1
Active Participant
0 Kudos

I want to create a report which displays common output of RM06EM00 and RM06EK00 both....for that I am using SUBMIT statements as below.

SUBMIT RM06EM00 USING SELECTION-SCREEN '1000' WITH SELECTION-TABLE t_m00 AND RETURN .

SUBMIT RM06EK00 USING SELECTION-SCREEN '1000' WITH SELECTION-TABLE t_m00 AND RETURN .

t_m00 and t_k00 are of type of output table of RM06EM00 and RM06EK00 respectively....boto reports are using one include...there I have created an implicit enhancement...I export output tables in that include and import it into my Z report.....

My query is that when I execute above SUBMIT statements...Z report displays ALV output of RM06EM00 and stops there....My requirement is that both R reports (RM06EM00 etc) should not be displayed..and my z report 's flow of control should directly come to next statement of SUBMIT...

Please help me !!

Thanks in Advance

8 REPLIES 8

glauco
Active Contributor
0 Kudos

Hi.

I'm confused with your needs.

Why don't you use EXPORT/IMPORT a value to memory to so you can make conditions depending on its value ?

e.g.:

MAIN PROGRAM:

DATA: l_x type c value 'X'.
EXPORT l_x TO MEMORY ID 'MY_PRIGRAM'.

CALLED PROGRAM:

DATA: l_x type c value 'X'.
IMPORT l_x FROM MEMORY ID 'MY_PRIGRAM'.
IF L_X = 'X'.
*---STATEMENTS....
ENDIF.

Glauco

MarcinPciak
Active Contributor
0 Kudos

Z report displays ALV output of RM06EM00 and stops there....My requirement is that both R reports (RM06EM00 etc) should not be displayed..and my z report 's flow of control should directly come to next statement of SUBMIT...

By using SUMIT you load your report into memory which means that on ABAP stack there is one internal session opened. Only after it terminates (i.e. when user leaves called report the control will be returned to calling program - old internal session). Using addition AND RETURN means that after called program ends, its caller get control back. If you want to submit both and skip result use additon EXPORTING LIST TO MEMORY. This way flow will come just right after both SUBMITs and you will be able to process results in your Z report.

Regards

Marcin

former_member186741
Active Contributor
0 Kudos

I think you'll find that if you run your program as a part of a background job that it will operate in the way you desire. If you want it to work like that in foreground try using the 'submit ....to sap-spool' option (see the help for the submit command).

0 Kudos

I think you'll find that if you run your program as a part of a background job that it will operate in the way you desire.

But that would mean he runs both programs asynchronously, so caller will not get correct results once he requests them from memory, as they wouldn't be probably exported yet by callees.

For frontend I agree that both solutions are fine (via spool or via exporting results to memory).

Regards

Marcin

Former Member
0 Kudos

Hi Ratnesh,

try this


SUBMIT RM06EM00 WITH SELECTION-TABLE t_m00 EXPORT LIST TO MEMORY AND RETURN.

In case you want to read the data from memory. Use FM 'LIST_FROM_MEMORY.

Thanks,

Anmol.

RatneshSisodiy1
Active Participant
0 Kudos

Hi All,

Thanks a lot for your reply...my other problems got resolved except one as below.

In include LMEREPI03, I have created an implicit enhancement ZMM_EXPORT_PO_DATA.

**********************************************************************

ENHANCEMENT 1 ZMM_EXPORT_PO_DATA. "active version

FIELD-SYMBOLS: <lt_table> TYPE ANY TABLE.

IF ex_table_ref IS INITIAL. EXIT. ENDIF.

ASSIGN ex_table_ref->* TO <lt_table>.

EXPORT itab = <lt_table> TO MEMORY ID 'ZPOREP_MEMID1' .

REFRESH <lt_table>.

**********************************************************************

ex_table_ref is coming from below method.

**********************************************************************

CALL METHOD my_current_datablade->if_reader_mm~read_table

EXPORTING

im_name = im_name

IMPORTING

ex_structname = ex_structname

ex_fieldcatalog = ex_fieldcatalog

ex_table_ref = ex_table_ref

EXCEPTIONS

OTHERS = 0.

**********************************************************************

but this export (EXPORT itab = <lt_table> TO MEMORY ID 'ZPOREP_MEMID1' ) is not working...I checked ABAP memory in debugger...Data is not being exported..please suggest something..

Also, please suggest for import also....I am using ( IMPORT t_me2m FROM MEMORY ID 'ZPOREP_MEMID1'.) for importing

Thanks in advance !!

0 Kudos

Hi RatneshSisodiyaSAP .

Your command EXPORT doens't need to put = symbol.

EXPORT itab = <lt_table> TO MEMORY ID 'ZPOREP_MEMID1'

TRY like this in first program:

DATA: itab TYPE STANDARD TABLE XPTO.
EXPORT itab TO MEMORY ID 'ZPOREP_MEMID1' .

...

try like this in second program:

DATA: itab TYPE STANDARD TABLE XPTO.
IMPORT itab FROM  MEMORY ID 'ZPOREP_MEMID1'.

Important 1: I'm not sure about variables names but I always use SAME NAME for table variables in both programs.

Important 2: Internal table itab must have same structure in declaration in both programs.

best regards.

Glauco

Edited by: Glauco Kubrusly on Jul 19, 2011 11:32 AM

0 Kudos

As for checking correctness of data export to memory, check SY-SUBRC after EXPORT and ensure you are able to IMPORT this back in the same program.

As for syntax, I always use golden rule for that which is easy to remember. If you know how to call Function Module in ABAP, you know that both for EXPORTING and IMPORTING parameters syntax is as follows


EXPORTING/IMPORTING
   f1 = your_field
   f2 = your_field2

For EXPORTING this means that formal parameters f1, f2 receive values of your_field1, your_field2 . During IMPORTING this works in opposite direction. The same rule is used for ABAP memory. You have to use the same formal parameters on the left and actual parameters on the right in both cases. Depending on which statement is used EXPORT/IMPORT, it will either pass your data to formal parameters, or receive data from formal parameters.

I think if you remember this rule you will never get confused about how to proper use any statement which uses EXPORT.../IMPORT...

Regards

Marcin