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

Help on SUMBIT statement

Former Member
0 Likes
1,436

Hi Friends,

I have a customer report say 'ZAA' which needs the output of a standard report say 'SAPABC' .......

My requirement:

I have some records in an internal table....ITAB ( with only one field and 100s of records ) i have to loop at the internal table and for each record of the internal table i have to call the program 'SAPABC' using submit statement .... actually the 'sapabc' program will display a list ... i want that list in my 'zaa' program as a table ( how can i do this ) and then list it with other fields ....

Now my question is :

1. How ill pass the parameters in my internal table one by one to the submit program

2. how will i get the output list of report 'sapabc' into my report 'zaa'

3. how will i display the list from 'sapabc' through 'zaa'.

Hope iam clear with my requirement and doubt

Expecting your answers !!

Thanks in advance

Cheers

R.Kripa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,396

Hai Kripa

the syntax is like this

SUBMIT <REPORT>.

To Export data in some memory location and getting data from that memary location using the following syntax

EXPORT v_matnr to memoryid 'matnr'.

called program :

Import v_matnr from memoryid 'matnr'. this will return sy-subrc.

submit <report> with p_matnr = v_matnr.

Here we are passing values directly to the paramerers or select-Options.

we can give the ranges for select-options also like this

submit <report> with s_matnr between 'Low' and 'High'.

submit <report> with s_matnr Not between 'Low' and 'High'.

submit <report> with s_matnr <Operation> ' ' sign ' ' .

here sign = EQ,NE,GT,LT,GE,LE.

if you have a varient then pass this varient from transaction code to report.

submit <report> using selection-set <varient>.

data : v_matnr like mara-matnr,

v_matnr1 like mara-matnr.

ranges : r_matnr for mara-matnr.

r_matnr-low = v_matnr.

r_matnr-option = 'BT'.

r_matnr-sign = 'I'.

r_matnr-high = v_matnr1.

append r_matnr.

submit <report> with s_matnr in r_matnr.

thanks & regards

Sreenivas P

11 REPLIES 11
Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,396

u need to use export & import parameters and submit statement.

1. copy the standard report to a zreport EX: ZABC.

2.in report 'ZAA' write

EXPORT <PARAM> TO MEMORY ID <MID>.

SUBMIT ZABC.

3. IN ZABC WRITE

IMPORT <PARAM> FROM MEMORY ID <MID>.

Read only

Former Member
0 Likes
1,396

Hi Kripa,

Try this Example:

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT report 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 'WRITE_LIST'

TABLES

listobject = list_tab.

ENDIF.

Regards,

YJR.

Read only

Former Member
0 Likes
1,396

Hi Hymavathi Oruganti ,

I ve written in my ZAA as

EXPORT ITAB_FINAL-BNAME TO MEMORY ID 'KRI'.

and in my 'zsapabc'.

IMPORT ITAB_FINAL-BNAME FROM MEMORY ID 'KRI'.

the problem is ....

In the 'sapabc' program, the selection screen has this ITAB_FINAL-BNAME as a parameter .... and the program is doing many validations in the 'at-selection-screen' event .....itself ...

My doubt..

where should i write the IMPORT .. bla bla.. code in 'ZSAPABC' PROGRAM

Thanks in advance

Cheers;-)

R.Kripa

Read only

Former Member
0 Likes
1,397

Hai Kripa

the syntax is like this

SUBMIT <REPORT>.

To Export data in some memory location and getting data from that memary location using the following syntax

EXPORT v_matnr to memoryid 'matnr'.

called program :

Import v_matnr from memoryid 'matnr'. this will return sy-subrc.

submit <report> with p_matnr = v_matnr.

Here we are passing values directly to the paramerers or select-Options.

we can give the ranges for select-options also like this

submit <report> with s_matnr between 'Low' and 'High'.

submit <report> with s_matnr Not between 'Low' and 'High'.

submit <report> with s_matnr <Operation> ' ' sign ' ' .

here sign = EQ,NE,GT,LT,GE,LE.

if you have a varient then pass this varient from transaction code to report.

submit <report> using selection-set <varient>.

data : v_matnr like mara-matnr,

v_matnr1 like mara-matnr.

ranges : r_matnr for mara-matnr.

r_matnr-low = v_matnr.

r_matnr-option = 'BT'.

r_matnr-sign = 'I'.

r_matnr-high = v_matnr1.

append r_matnr.

submit <report> with s_matnr in r_matnr.

thanks & regards

Sreenivas P

Read only

Former Member
0 Likes
1,396

Thanks ..

but where should i write the following statements??

To Export data in some memory location and getting data from that memary location using the following syntax

EXPORT v_matnr to memoryid 'matnr'. --> <b>(ZAA)</b>

called program :

Import v_matnr from memoryid 'matnr'. this will return sy-subrc. --> <b>(ZSAPABC)</b>

submit <report> with p_matnr = v_matnr. <b>(ZAA)</b>

Here we are passing values directly to the paramerers or select-Options.

Am I right ??

If yes at what point should i include "IMPORT" statement in the zsapabc report ???

thanks In advance

Cheers;-)

R.Kripa

Read only

0 Likes
1,396

at what point means what?

u write in start of selection and exactly where u want according to ur logic

Read only

Former Member
0 Likes
1,396

Any Inputs ?????

Cheers

R.Kripa

Read only

Former Member
0 Likes
1,396

Hey Hymavathi Oruganti,

If iam giving the Import statement(IMPORT ITAB_FINAL-BNAME FROM MEMORY ID 'KRI'.) in my 'zsapabc' after start-of-selection ... it is giving me an error "FIELD ITAB_FINAL-BNAME IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLE NOR DEFINED BY 'DATA' STATEMET )

This is what iam getting ;-(

What should i do now ?

Expecting your answers

Thanks in advance

Cheers

R.Kripa.

Read only

Former Member
0 Likes
1,396

Hey Hymavathi Oruganti,

If iam giving the Import statement(IMPORT ITAB_FINAL-BNAME FROM MEMORY ID 'KRI'.) in my 'zsapabc' after start-of-selection ... it is giving me an error "FIELD ITAB_FINAL-BNAME IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLE NOR DEFINED BY 'DATA' STATEMET )

This is what iam getting ;-(

What should i do now ?

Expecting your answers

Thanks in advance

Cheers

R.Kripa.

Read only

0 Likes
1,396

with import u should not give ITAB_FINAL-BNAME , because, import will be used in called program and in called program there is no need to have the same internal table.

so, in the called program , give the variable name, to which u want to import value

Read only

Former Member
0 Likes
1,396

sorry to say but it seems that you are on the wrong way.

the second answer of YJR already showed the right way.

if you want to submit a program you have to use the following notation:

loop over your internal table.

SUBMIT sapabc WITH parameter1 = your_value_from_zaa

WITH parameter2 = your_value_from_zaa

WITH parameter3 = your_value_from_zaa

WITH ....

EXPORTING LIST TO MEMORY AND RETURN.

then use the two function modules as mentioned by YJR.

endloop.

if i don't misunderstand you this works.

best regards,

matthias