SUBMIT and RETUTN with ALV output into a interanl table.
Hello Friends,
I have one z program which returns ALV output.
I have to create a one new Z program and in that I want to call this program and want the final output into an internal table into my Zreport.
I used SUBMIT statement with RETURN but not working.
can anybody tell me what I missed?
or
How can we do this.
Thanks in advance.
Suhas
Hi Suhas,
In Zreport1.
Just open the first report program and assign internal table to some memory id like...
EXPORT it_tab1 to MEMORY ID 'ZNITS'.
In Zreport2.
Now create an internal table with the same structure of it_tab1 and write the following in your program...
SUBMIT Zreport1 WITH SELECTION-TABLE it_input
AND RETURN.
Note: it_input is of type rsparams and contains all selection parameters for *Zreport1*
* Import internal table content from memory id
IMPORT it_tab1 TO it_tab2 FROM MEMORY ID 'ZNITS'.
FREE MEMORY ID 'ZNITS'.
Thanks
Nitesh
Similar Messages
-
SUBMIT and RETUTN with ALV output
Hello Friends,
I have one standard program (RSVTPROT) which returns ALV output.
I want this output as internal table into my Zreport.
I used SUBMIT statement with RETURN but not working.
can anybody tell me what I missed?
Regards,
RHHi Ronny,
ALV output of called Program will not displayed when you use Submit and Return.
if you want to get the output of it . Identify the final Internal table where all the output of program RSVTPROT will be collected.
i guess its <gtab> ( Field symbol Table ) . try to get the same. -
How to use Write statement along with ALV output
Hi expert,
currently i have a requirement where i am first displaying message with write statement and after that ALV should be displayed ...something like below:
vendor number is wrong.
material number is wrong.
plant is wrong.
and then here ALV output -list of records updated in the database.
but as of now the ALV is shown first and when going back then the write message information is dispayed.
can anyone help how we can get this in only one screen?
Thanks!!!
RajeshMay below example give you some idea.
TYPE-POOLS: slis.
DATA: BEGIN OF it_kna1 OCCURS 0,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
END OF it_kna1.
DATA: it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
START-OF-SELECTION.
SELECT kunnr name1 ort01
FROM kna1 INTO TABLE it_kna1 UP TO 10 ROWS.
END-OF-SELECTION.
WRITE:/ 'Write Statement Display' HOTSPOT ON.
AT LINE-SELECTION.
CLEAR it_fcat.
it_fcat-fieldname = 'KUNNR'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'Customer'.
APPEND it_fcat.
CLEAR it_fcat.
it_fcat-fieldname = 'NAME1'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'Customer Name'.
APPEND it_fcat.
CLEAR it_fcat.
it_fcat-fieldname = 'ORT01'.
it_fcat-tabname = 'IT_KNA1'.
it_fcat-seltext_l = 'City'.
APPEND it_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat[]
TABLES
t_outtab = it_kna1[]. -
How to put the alv output into the spool request?
Hi guys,
How to put the alv output into the spool request?
Thanks!Hi
Sending an ALV List screen output to SPOOL
Convert ALV list to PDF and send mails to respective persons
Regards
Pavan -
How to convert ALV output into XML format.
Hi all,
I just want to know how to convert an ALV output into a XML format, this is really urgent.
regards,
Ruchika sainiThis program exports an internal table to an XML file. *----
Report ZPRUEBA_MML_13 *
Export an internal table to XML document *
NO BORRAR ESTE CODIGO *
REPORT ZPRUEBA_MML_13.
PANTALLA SELECCION *
PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
PANTALLA SELECCION *
TYPE TURNOS *
TYPES: BEGIN OF TURNOS,
LU LIKE T552A-TPR01,
MA LIKE T552A-TPR01,
MI LIKE T552A-TPR01,
JU LIKE T552A-TPR01,
VI LIKE T552A-TPR01,
SA LIKE T552A-TPR01,
DO LIKE T552A-TPR01,
END OF TURNOS.
TYPE TURNOS *
TYPE SOCIO *
TYPES: BEGIN OF SOCIO,
NUMERO LIKE PERNR-PERNR,
REPOSICION LIKE PA0050-ZAUVE,
NOMBRE LIKE PA0002-VORNA,
TURNOS TYPE TURNOS,
END OF SOCIO.
TYPE SOCIO *
ESTRUCTURA ACCESOS *
DATA: BEGIN OF ACCESOS OCCURS 0,
SOCIO TYPE SOCIO,
END OF ACCESOS.
ESTRUCTURA ACCESOS *
START OF SELECTION *
START-OF-SELECTION.
PERFORM LLENA_ACCESOS.
PERFORM DESCARGA_XML.
END-OF-SELECTION.
END OF SELECTION *
FORM LLENA_ACCESOS *
FORM LLENA_ACCESOS.
REFRESH ACCESOS.
CLEAR ACCESOS.
MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
CLEAR ACCESOS.
MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
ENDFORM.
FORM LLENA_ACCESOS *
FORM DESCARGA_XML *
FORM DESCARGA_XML.
DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
G_IXML TYPE REF TO IF_IXML,
W_STRING TYPE XSTRING,
W_SIZE TYPE I,
W_RESULT TYPE I,
W_LINE TYPE STRING,
IT_XML TYPE DCXMLLINES,
S_XML LIKE LINE OF IT_XML,
W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
D LIKE LINE OF XML,
END OF XML_TAB.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
WRITE: / 'Converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'ACCESOS'
DATAOBJECT = ACCESOS[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
IF W_RC IS INITIAL.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
W_RC.
ENDIF.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = M_DOCUMENT
IMPORTING
XML_AS_STRING = W_STRING
SIZE = W_SIZE
TABLES
XML_AS_TABLE = IT_XML
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
LOOP AT IT_XML INTO XML_TAB-D.
APPEND XML_TAB.
ENDLOOP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = GK_RUTA
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Message was edited by:
Hymavathi Oruganti -
How create and work with Z output to meet the client requirment?
hi gurus,
I am SD functional consultant and need ur help
Please explain me how create and work with Z output .
How we arrange and change the fields in header and footer
where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
pls forward functional or Tech spec of Z output
points will be rewarded
thanx & regards
shabnumHi shabnum ,
I hope you can do it.
Goto SE71, enter form name--> click change
1) click in page window command button, Identify the header and footer window
2) single click on Header window and click change button(pencil symbol)
3) identify the fields and change order of the fields
I hope this will help to solve your issue
Regards,
SaiRam -
How create and work with Z output to meet user req
hi gurus,
I am SD functional consultant and need ur help
Please explain me how create and work with Z output .
How we arrange and change the fields in header and footer
where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
pls forward functional or Tech spec of Z output
points will be rewarded
thanx & regards
shabnumHi
From SPRO do the all steps.
Goto SD-> BASIC functions->Output control->Output determination->Output determination by condition technique->Maintain Output determination for sales documents
Here define all like access sequences, Output types, condition tables and assign them to Program and Forms.
From SE71 copy the script to a Zscript and to modify it to suit your requirements and the same Zscript has to be assigned to Output type, Program in NACE transaction.
Reward points if useful
Regards
Anji -
Compare String in a table and insert the common values into a New table
Hi all,
Anyone has idea on how to compare a string value in a table.
I have a Students Table with Student_id and Student_Subject_list columns as below.
create table Students( Student_id number,
Student_Subject_list varchar2(2000)
INSERT INTO Students VALUES (1,'Math,Science,Arts,Music,Computers,Law,Business,Social,Language arts,History');
INSERT INTO Students VALUES (2,'Math,Law,Business,Social,Language arts,History,Biotechnology,communication');
INSERT INTO Students VALUES (3,'History,Spanish,French,Langage arts');
INSERT INTO Students VALUES (4,'History,Maths,Science,Chemistry,English,Reading');
INSERT INTO Students VALUES (5,'Math,Science,Arts,Music,Computer Programming,Language arts,History');
INSERT INTO Students VALUES (6,'Finance,Stocks');
output
Student_id Student_Subject_list
1 Math,Science,Arts,Music,Computers,Law,Business,Social,Language arts,History
2 Math,Law,Business,Social,Language arts,History,Biotechnology,communication
3 History,Spanish,French,Langage arts
4 History,Maths,Science,Chemistry,English,Reading
5 Math,Science,Arts,Music,Computer Programming,Language arts,History
6 Finance,Stocks
I need help or some suggestion in write a query which can compare each row string value of Student_Subject_list columns and insert the
common subjects into a new table(Matched_Subjects).The second table should have the below colums and data.
create table Matched_Subjects(Student_id number,
Matching_studesnt_id Number,
Matched_Student_Subject varchar2(2000)
INSERT INTO Matched_Subjects VALUES (1,2,'Math,Law,Business,Social,Language arts,History');
INSERT INTO Matched_Subjects VALUES (1,3,'History,Langage arts');
INSERT INTO Matched_Subjects VALUES (1,4,'History,Maths,Science');
INSERT INTO Matched_Subjects VALUES (1,5,'Math,Science,Arts,Music,Language arts,History');
INSERT INTO Matched_Subjects VALUES (2,3,'History,Langage arts');
INSERT INTO Matched_Subjects VALUES (2,4,'History,Maths');
INSERT INTO Matched_Subjects VALUES (2,5,'Math,Language arts,History');
INSERT INTO Matched_Subjects VALUES (3,4,'History');
INSERT INTO Matched_Subjects VALUES (3,5,'Language arts,History');
INSERT INTO Matched_Subjects VALUES (4,5,'Math,Science');
output:
Student_id Match_Student_id Matched_Student_Subject
1 2 Math,Law,Business,Social,Language arts,History
1 3 History,Langage arts
1 4 History,Maths,Science
1 5 Math,Science,Arts,Music,Language arts,History
2 3 History,Langage arts
2 4 History,Maths
2 5 Math,Language arts,History
3 4 History
3 5 Language arts,History
4 5 Math,Science
any help will be appreciated.
Thanks.
Edited by: user7988 on Sep 25, 2011 8:45 AMuser7988 wrote:
Is there an alternate approach to this without using xmlagg/xmlelement What Oracle version are you using? In 11.2 you can use LISTAGG:
insert
into Matched_Subjects
with t as (
select student_id,
column_value l,
regexp_substr(student_subject_list,'[^,]+',1,column_value) subject
from students,
table(
cast(
multiset(
select level
from dual
connect by level <= length(regexp_replace(student_subject_list || ',','[^,]'))
as sys.OdciNumberList
select t1.student_id,
t2.student_id,
listagg(t1.subject,',') within group(order by t1.l)
from t t1,
t t2
where t1.student_id < t2.student_id
and t1.subject = t2.subject
group by t1.student_id,
t2.student_id
STUDENT_ID MATCHING_STUDESNT_ID MATCHED_STUDENT_SUBJECT
1 2 Math,Law,Business,Social,Language arts,History
1 3 Language arts,History
1 4 Science,History
1 5 Math,Science,Arts,Music,Language arts,History
2 3 Language arts,History
2 4 History
2 5 Math,Language arts,History
3 4 History
3 5 History,Language arts
4 5 History,Science
10 rows selected.
SQL> Prior to 11.2 you can create your own string aggregation function STRAGG - there are plenty of example on this forum. Or use hierarchical query:
insert
into Matched_Subjects
with t1 as (
select student_id,
column_value l,
regexp_substr(student_subject_list,'[^,]+',1,column_value) subject
from students,
table(
cast(
multiset(
select level
from dual
connect by level <= length(regexp_replace(student_subject_list || ',','[^,]'))
as sys.OdciNumberList
t2 as (
select t1.student_id student_id1,
t2.student_id student_id2,
t1.subject,
row_number() over(partition by t1.student_id,t2.student_id order by t1.l) rn
from t1,
t1 t2
where t1.student_id < t2.student_id
and t1.subject = t2.subject
select student_id1,
student_id2,
ltrim(sys_connect_by_path(subject,','),',') MATCHED_STUDENT_SUBJECT
from t2
where connect_by_isleaf = 1
start with rn = 1
connect by student_id1 = prior student_id1
and student_id2 = prior student_id2
and rn = prior rn + 1
STUDENT_ID MATCHING_STUDESNT_ID MATCHED_STUDENT_SUBJECT
1 2 Math,Law,Business,Social,Language arts,History
1 3 Language arts,History
1 4 Science,History
1 5 Math,Science,Arts,Music,Language arts,History
2 3 Language arts,History
2 4 History
2 5 Math,Language arts,History
3 4 History
3 5 History,Language arts
4 5 History,Science
10 rows selected.SY. -
How to caputre report output into an internal table?
Hi,
Is there a way to capture report output into one internal table?
Regards,
AmruthHi Amruth,
Use SUBMIT.. EXPORTING LIST TO MEMORY.
It saves the output of a report into memory. Use the function modules LIST_FROM_MEMORY. WRITE_LIST & DISPLAY_LIST to retrieve the data.
All these function modules belongs to function group 'SLST'.
However the submit does not display hte output list of the called report, but saves it in ABAP memory & leaves the called report immediately. Since the calling program can read the list from memory & process it furthe, you need to use the addition ..AND RETURN.
Regards,
Chandru -
Displaying alv output into excel with delimeter
Hai,
am downloading alv output to excel :
1. in that output one field is long text field with # delimeter at the end of sting .
while exporting this outout to excel it is not showing # and one empty column is adding after that field.Hi Satya,
Can you try out this piece of code below. It creates a demo Internal table to store some string with '#' as the final delimiter.
TYPES : BEGIN OF l_ty_demo,
data TYPE string,
END OF l_ty_demo.
DATA : l_i_demo TYPE STANDARD TABLE OF l_ty_demo.
DATA : l_wa_demo TYPE l_ty_demo.
DATA : l_v_i TYPE sy-tabix.
INCLUDE ole2incl.
* handles for OLE objects
DATA: h_excel TYPE ole2_object, " Excel object
h_mapl TYPE ole2_object, " list of workbooks
h_map TYPE ole2_object, " workbook
h_zl TYPE ole2_object, " cell
h_f TYPE ole2_object. " font
TABLES: spfli.
DATA h TYPE i.
WHILE l_v_i < 10.
l_wa_demo-data = 'Welcome to the world of computers#'.
APPEND l_wa_demo TO l_i_demo.
l_v_i = l_v_i + 1.
ENDWHILE.
* start Excel
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
PERFORM err_hdl.
SET PROPERTY OF h_excel 'Visible' = 1.
PERFORM err_hdl.
* get list of workbooks, initially empty
CALL METHOD OF h_excel 'Workbooks' = h_mapl.
PERFORM err_hdl.
* add a new workbook
CALL METHOD OF h_mapl 'Add' = h_map.
PERFORM err_hdl.
LOOP AT l_i_demo INTO l_wa_demo.
h = sy-tabix + 1.
PERFORM fill_cell USING h 1 0 l_wa_demo-data.
ENDLOOP.
*& Form FILL_CELL
* text
* -->I text
* -->J text
* -->BOLD text
* -->VAL text
FORM fill_cell USING i j bold val.
CALL METHOD OF h_excel 'Cells' = h_zl EXPORTING #1 = i #2 = j.
PERFORM err_hdl.
SET PROPERTY OF h_zl 'Value' = val .
PERFORM err_hdl.
GET PROPERTY OF h_zl 'Font' = h_f.
PERFORM err_hdl.
SET PROPERTY OF h_f 'Bold' = bold .
PERFORM err_hdl.
ENDFORM. "FILL_CELL
*& Form ERR_HDL
* text
FORM err_hdl.
IF sy-subrc <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
STOP.
ENDIF.
ENDFORM. "ERR_HDL
Please refer to the following Demo ABAP Code for a complete reference.
RSDEMO01.
Hope this helps.
Thanks,
Samantak. -
HI ,
I developed ALV report, the output is coming properly. But if i download that output into local file or spreadsheet from ALV output screen am unable to get the data only header and field headers are coming but data is not coming. But for other ALV with same importing parameters it is downloading properly. I donu2019t know whatu2019s problem only for this ALV, any one can please help me out from this situation pls.
ThxHi Lavanya
There can be two possibilities
1.) check the authorization, if it's missing, then this might happen...u hav said that the other report, it's downloading fine...r u trying to download the other report also with the same user id? is it a standard program or a customized report?
2.) just try reducing the security level in excel --> Tools -> Macros -> Security
regards
Sathish -
Hi,
I want to display a message on the status bar along with the output . That is output and message should appear on the same screen together. Neither before the output nor after the the output.
Best Regards,Hi,
One option is to use ALV Container. Create a screen with ALV container & keep some blank lines at the footer of the screen. Use classes to call the ALV footer for populating the message.
Thanks,
Best regards,
Prashant -
Problem with alv output export to text file
hi experts,
when iam exporting alv output to text file,
some data is missing in text file.say for example sold-to-party value is 1155027 in alv out put,but in text file it is showeing only 115502 ,
the last digit is missing,
can anyone help urgent!!!!!and when you export it to excel?
from here you could save it as text file too...
A. -
Issue with ALV output in production
Hi ,
Iam using REUSE_ALV_GRID_DISPLAY function module to display the alv output.
But the ALV is not displaying the data in production, where as it is working fine in Development and Quality.
I have checked the version there is no change.
Please advice how to fix this issue?I have checked all the Transport request for this particular report,
Even i did the Version management .
I didnt find any change in the versiopn management.
We didnt miss any Transport related to this Report.
Please see my coding for the same.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = V_ALV_LAYOUT
IT_FIELDCAT = V_ALV_FIELDCAT
I_DEFAULT = C_X
I_SAVE = 'A'
IT_EVENTS = V_ALV_EVENTS
TABLES
T_OUTTAB = IT_FINAL[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
Edited by: vinay raj on Nov 23, 2010 11:34 AM -
Sqvi join of Mara and Marc with erroneous output
hello all
I have made a join between Mara and Marc in a SQVI query.
as input i select material according to material type, material group and plants.
output i want the material, the group and the maintenance view of material for each plant.
not all the plants have the same maintenance view but the query returns the material for each plant with wrong maintenance view!
what can it be?i am trying to achieve the following:
material 12345 is in plants A, B, C
plant A has maintenance status KBVE
plant B has maintenance status BVE
plant C has maintenance status KVB
when I run the view, with the tables MARA and MARC joined by the material number, i requested the material filtering by material group, material type and maintenance view E.
i want the system to return material 12345 for plant A and B with the respective statuses and exclude C because it does not have the status E.
instead it returns material 12345 with plants A, B, C and all with maintenance status KBVE
is it clearer now?
also, what is the difference between mainenace status in MARA and in MARC?
Maybe you are looking for
-
i am trying to download itunes 10.7. i have windows vista 32-bit. when i click on download. the pop up window comes up and ask to save or cancel, and then the webpage says thank you for downloading. it hasn't downloaded it. what can i do to fix
-
How do I load music on a new ipod without using itunes?
I am having tons of problems with getting itunes to pull up on my computer. I believe that my computer has a pretty nasty virus in it and it is causing problems with many of my programs (internet explorer, norton, and other programs). I am having my
-
Prevent editing of a PDF file saved/exported from Preview?
I would like to create a PDF file that is viewable without a password but should not be editable either in Preview or any other software. What is happening now? I created a PDF file by placing rectangle boxes on confidential info as shown below. I sa
-
When apple tv syncs with itunes the media disappears from the apple tv
evrytime i purchase something through the apple tv i can play it on my tv until it syncs with itunes. after the sync the media just transfers over to my computer. how can I leave the stuff I buy in apple tv stay in the apple tv. and all of those othe
-
F110 Where to view outgoing mail requests
Hello, for suppliers having an email adress, when i run f110 , a mail is generated containing the payment advice and sent to them automatically. Where can i view and confirm that these emails have been sent to them? Edited by: Antish Awootar on Aug 3