‎2006 Apr 10 10:37 AM
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
‎2006 Apr 10 11:00 AM
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
‎2006 Apr 10 10:41 AM
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>.
‎2006 Apr 10 10:41 AM
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.
‎2006 Apr 10 10:57 AM
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
‎2006 Apr 10 11:00 AM
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
‎2006 Apr 10 11:06 AM
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
‎2006 Apr 10 12:30 PM
at what point means what?
u write in start of selection and exactly where u want according to ur logic
‎2006 Apr 10 12:27 PM
‎2006 Apr 10 12:50 PM
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.
‎2006 Apr 10 12:53 PM
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.
‎2006 Apr 10 1:41 PM
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
‎2006 Apr 10 2:24 PM
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