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

Cluster table problem with CDHDR and CDPOS

Former Member
0 Likes
2,963

Hi Expert

Managment in our company need a report which should show the anychanges made on the document number have to be displayed for each users could anyone help me in coding please

I want to create a report which will show the changes make to the documents

In that I want to join two tables CDHDR and CDPOS, but CDPOS is cluster table and CDHDR is transparent table so how can i join these both and create an SQL statement to fetch the records from CDHDR and CDPOS

SELECT CDHDR-OBJECTCLAS,

CDHDR-OBJECTID,

CDHDR-CHANGENR,

CDHDR-USERNAME,

CDHDR-UDATE,

CDHDR-UTIME,

CDPOS-VALUE_NEW,

CDPOS-VALUE_OLD FROM CDHDR,CDPOS

WHERE CDHDR-OBJECTCLAS='VERKBELEG'

AND CDHDR-OBJECTCLAS=CDPOS-OBJECTCLAS

AND CDHDR-OBJECTID=CDPOS.OBJECTID

AND CDHDR-CHANGENR=CDPOS.CHANGENR.

Do you think this will work , if not then how can i join both the tables to fetch the data

Anyhelp is highly appriciable

regards

Piroz

6 REPLIES 6
Read only

Former Member
0 Likes
1,567

Hi,

You can't create join using cluster table.

To solve your request, just try this step:


* First, select your data from Cluster Table ( CDPOS ) into internal table ( IT_CDPOS) .
* Select data from CDHDR using FOR ALL ENTRIES according IT_CDPOS.
* Join your data from IT_CDPOS and IT_CDHDR into new table using loop, and make your filter at looping procces.

Regards,

Read only

0 Likes
1,567

Hi Jatra

Thanks for your steps, I will create an internal table and insert the values into internal table but how to start it, Can you help me in some coding please

I know we can used inner join to link the tables

I know it is silly to ask but I need a push please can you guide me some steps in coding

regards

Piroz

Read only

0 Likes
1,567

basically what you are going to do is take your fields from the CDHDR and CDPOS and create an new internal table that combines the two. Loop through the CDPOS and do a read on table CDHDR. It would look something like this.

Loop at cdpos into x_cdpos_str.

read table cdhdr into x_cdhdr_str with key objectclas = x_cdpos_str-objectclas

objectID = x_cdpos_str-objectid

binary search.

endloop.

You get the general idea. Make sure that you have both internal tables sorted accordingly.

John

Award point if helpful.

Read only

ferry_lianto
Active Contributor
0 Likes
1,567

Hi,

Have you looked standard program RCC00300?

Regards,

Ferry Lianto

Read only

0 Likes
1,567

Hi Ferry Lianto

I check the standard report it is good, but how can I check the document no change for different plants and how it is link with cdpos and cdhdr please comment

regards

Piroz

Read only

0 Likes
1,567

Piroz,

If this is till not resolved - here is just a thought:

Not all fields are configured to be logged in CDHDR and CDPOS. So check in config (functional guys should know) if the particular Document Number field is meant for logging changes.

Again to work with CDHDR and CDPOS it is always good to use the relevant READ function modules.

Otherwise, you will face performance issues. 'for all entries"etc do not work good with CDHDR and CDPOS.

- Ven