‎2007 Oct 19 3:03 AM
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
‎2007 Oct 19 3:08 AM
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,
‎2007 Oct 19 3:23 AM
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
‎2007 Oct 24 6:25 PM
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.
‎2007 Oct 24 6:37 PM
Hi,
Have you looked standard program RCC00300?
Regards,
Ferry Lianto
‎2007 Oct 26 4:59 AM
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
‎2008 Jan 04 3:11 PM
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