03-12-2009 5:01 AM
How can I fetch data for a struture, from a cluster table, based on the name of the structure?
03-12-2009 5:03 AM
Hi:
REPORT ZRPIMPORT.
TABLES: PCLn.
INCLUDE RPCnxxy0. "Cluster definition
Fill cluster Key
Import record
IMPORT TABLE1 FROM DATABASE PCLn(xx) ID xx-KEY.
IF SY-SUBRC EQ 0.
Display data object
ENDIF
Regards
Shashi
03-12-2009 5:42 AM
Hi,
Could you please elaborate on your requirement as of from which cluster you want to retrieve the data ?
Regards,
Sakkthiss.R
03-12-2009 5:44 AM
Hi,
I want to retrieve data from the table PCL1.
Regards
Meenakshi Parashar
03-12-2009 5:50 AM
Hi,
As of what i know is you can use the two function modules CU_READ_RGDIR and PYXX_READ_PAYROLL_RESULT function modules to retrieve data from the Payroll clusters.
The former is used to read payroll directory. Please refer the documentation of these Funcn. Modules to get a better idea. Feel free to write in case if you are not able to get it or if these two funcn modules cannot be the solution for your problem.
Regards,
Sakkthiss.R
03-12-2009 8:04 AM
Hi,
In order to read from Cluster DB Table use the following statement:
Syntax
IMPORT <f1> [ TO < g1 > ] <f2> [TO < g2 >] ...
FROM DATABASE <dbtab>(<ar>)
[CLIENT <cli>] ID <key>|MAJOR-ID <maid> [MINOR-ID <miid>].
This statement reads the data objects specified in the list from a cluster in the database <dbtab>.
You must declare <dbtab> using a TABLES statement. If you do not use the TO <gi> option, the
data object <fi> in the database is assigned to the data object in the program with the same
name. If you do use the option, the data object <fi> is read from the database into the field <gi>.
For <ar>, enter 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>.
The CLIENT <cli> option allows you to disable the automatic client handling of a client-specific cluster database, and specify the client yourself. The addition must always come directly after the name of the database.
For Eg:
PROGRAM SAPMZTS3.
TABLES INDX.
DATA: BEGIN OF JTAB OCCURS 100,
COL1 TYPE I,
COL2 TYPE I,
END OF JTAB.
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.
Regards,
Neha
Edited by: Neha Shukla on Mar 12, 2009 1:35 PM