‎2009 May 05 7:11 AM
hi,
i need to COPY standard report and add one of the field in zreport, the standard report fetches all the fields from GLPCA and displays the
same to output fields, so i cannt add new field in GLPCA as it is standard table
so ineed to copy the GLPCA table to ztable and add new field.
while copying the table GLPCA i am not getting the entries(data) to ztable.
so some of the experts in forum suggested to write the select query and fetch the data.
in the zreport if i write the select query all the data comes into the ztable.
DATA : t_itab TYPE TABLE OF GLPCA .
SELECT * FROM GLCPA INTO TABLE t_itab. " Selecting records from GLCPA
INSERT ZTABLE FROM TABLE t_itab.
if once the GLPCA table has updated how can i get the new values into my ztable or if the GLPCA has the same vaulues with out any update data , if i run the report 2 times
the select again fetches the same data and how i get the new field data.
new field is monat from BKPF.need to compare with GLPCA-DOCNR TO BKPF-BELNR.
thanks in advance
‎2009 May 05 7:13 AM
‎2009 May 05 7:32 AM
Hi neetu,
In that case you need to fire SELECT query in both tables and compare the contents and update the the disimilar data to your Z-table.
sort the table and add binary search to it for improving performance.
Loop at i_ztable into wa.
read table it_glpca with key in wa binary search.
is sy-subrc ne 0.
add record to a third internal table i_ztable_temp.
endif.
endloop.
update ztable from table i_ztable_temp.
hope this will solve your issue.
cheers,
Suvendu
‎2009 May 05 8:25 AM
Hi Neethu,
Instead of creating Ztable you can create view .
Regards
Pinaki