‎2006 Sep 11 2:42 AM
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!
‎2006 Sep 11 3:30 AM
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.
‎2006 Sep 11 3:21 AM
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
‎2006 Sep 11 3:30 AM
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.