Application Development and Automation 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: 
Read only

read data from cluster tables

Former Member
0 Likes
1,411

Hi,

I met a problem.

How to read data from cluster tables using:

b2-key-pernr = 20.

b2-key-pabrj = 2006.

b2-key-pabrp = 09.

b2-key-cltyp = '1'.

import saldo from database pcl2(b2) id b2-key.

the problem is that the sy-subrc is always 4, could anyone help me?

thank you very much!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
880

Hi,

I think u can using FM "HR_TIME_RESULTS_GET" to read data from Table Cluster B2. Here the sample code:


data: saldo like pc2b5 occurs 0 with header line.

    call function 'HR_TIME_RESULTS_GET'
      exporting
        get_pernr             = pernr
        get_pabrj             = pabrj
        get_pabrp             = pabrp
      tables
        get_saldo             = saldo
      exceptions
        no_period_specified   = 1
        wrong_cluster_version = 2
        no_read_authority     = 3
        cluster_archived      = 4
        technical_error       = 5
        others                = 6.

Regards,

JR.

2 REPLIES 2
Read only

Former Member
0 Likes
880

Hi,

Import and export to database is used in two programs and not in the same program.

<b>ZPROGRAM1.</b>

tables : indx.

Data : SALDO type i,

indxkey LIKE indx-srtfd VALUE 'ZAB1'.

indx-aedat = sy-datum.

indx-usera = sy-uname.

indx-pgmid = sy-repid.

EXPORT SALDO TO DATABASE indx(zc) ID indxkey.

In another program,

<b>ZPROGRAM2.</b>

tables : indx.

Data : SALDO type i,

indxkey LIKE indx-srtfd VALUE 'ZAB1'.

indx-aedat = sy-datum.

indx-usera = sy-uname.

indx-pgmid = sy-repid.

IMPORT SALDO FROM DATABASE indx(zc) ID indxkey.

Best regards,

Prashant

Read only

Former Member
0 Likes
881

Hi,

I think u can using FM "HR_TIME_RESULTS_GET" to read data from Table Cluster B2. Here the sample code:


data: saldo like pc2b5 occurs 0 with header line.

    call function 'HR_TIME_RESULTS_GET'
      exporting
        get_pernr             = pernr
        get_pabrj             = pabrj
        get_pabrp             = pabrp
      tables
        get_saldo             = saldo
      exceptions
        no_period_specified   = 1
        wrong_cluster_version = 2
        no_read_authority     = 3
        cluster_archived      = 4
        technical_error       = 5
        others                = 6.

Regards,

JR.