2009 Mar 26 1:42 PM
Hello,
We have flat file intensive programs, that use Read dataset..., that involves lot of i/o operations. Number of input/ output flat files range from 1 to 10 and each of them contain millions of records. Does SAP provide any facilty where in we can create temporary tables , load the data into them and discard when done. This is without involving data dictionary / basis help.
What is data cluster temporary tables concept ? any information is appriciated.
Thanks in advance
Hello,
We have flat file intensive programs, that use Read dataset..., that involves lot of i/o operations. Number of input/ output flat files range from 1 to 10 and each of them contain millions of records. Does SAP provide any facilty where in we can create temporary tables , load the data into them and discard when done. This is without involving data dictionary / basis help.
What is data cluster temporary tables concept ? any information is appriciated.
Thanks in advance
2009 Mar 26 1:48 PM
Hi Sam..
You can use the concept of "Cluster Databases", where you can store data into them using the EXPORT TO DATABASE statement.
Example of cluster database is INDX.
Syntax:
EXPORT <f1> [FROM <g1>] <f2> [FROM <g2>] ...
TO DATABASE <dbtab>(<ar>) [CLIENT <cli>] ID <key>.
This statement stores the data objects specified in the list as a cluster in the cluster database
<dbtab>. You must declare <dbtab> using a TABLES statement. If you do not use the option
FROM <fi>, the data object <fi> is saved under its own name. If you use the FROM <gi> option,
the data objet <gi> is saved under the name <fi>.
<ar> is the two-character area ID for the cluster in the database
The name <key> identifies the data in the database. Its maximum length depends on the length
of the name field in <dbtab>.
Let me know if you require further details.
Best Regards,
Pradeep.
2009 Mar 26 3:30 PM
Hello Pradeep,
Thanks , do you have any sample code by any chance? I wil also search SDN or internet.
2009 Mar 27 4:49 AM
Hi Sam..
Check if this is helpful..
PROGRAM SAPMZTS1.
TABLES INDX.
DATA: BEGIN OF ITAB OCCURS 100,
COL1 TYPE I,
COL2 TYPE I,
END OF ITAB.
DO 3000 TIMES.
ITAB-COL1 = SY-INDEX.
ITAB-COL2 = SY-INDEX ** 2.
APPEND ITAB.
ENDDO.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
INDX-PGMID = SY-REPID.
EXPORT ITAB TO DATABASE INDX(HK) ID 'Table'.
To read data..
IMPORT ITAB TO JTAB FROM DATABASE INDX(HK) ID 'Table'.
WRITE: / 'AEDAT:', INDX-AEDAT,
/ 'USERA:', INDX-USERA,
/ 'PGMID:', INDX-PGMID.
SKIP.
WRITE 'JTAB:'.
LOOP AT JTAB FROM 1 TO 5.
WRITE: / JTAB-COL1, JTAB-COL2.
ENDLOOP.
Best Regards,
Pradeep.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |