Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch data for a struture from a cluster table

Former Member
0 Kudos

How can I fetch data for a struture, from a cluster table, based on the name of the structure?

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Could you please elaborate on your requirement as of from which cluster you want to retrieve the data ?

Regards,

Sakkthiss.R

0 Kudos

Hi,

I want to retrieve data from the table PCL1.

Regards

Meenakshi Parashar

0 Kudos

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

Former Member
0 Kudos

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