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: 

Activate change pointers for Z-idocs

Former Member
0 Kudos

Hi friends,

I've created a Z-idoc for some standard SAP tables (like TCJ1T, TCJ05 etc). I've written a function module which fetches all the data from the above-mentioned tables and pass it on to the idoc. So far so good.

Now the requirement is like, I need to pass only the updated records (insert/update/delete) in these tables to the idoc. I found that there are concepts like change document and change pointers assosciated with it. Again, the fields that I need to transfer in the above tables have their change document flag set. I've also created a Z-Object through SCDO to capture the changes. (I initially tried adding the tables in the standard object PROJ regenerated the programs, but the approach didn't work). The function modules generated through SCDO, i guess, have to be called somewhere, may be in an exit (I got an info in a previous question that it is never called automatically, but has to be called explicitly). The entries for most of the tables I'm working with are created via SPRO (which links to the Table Maintainence Generator for the above tables). I found that there are no user-exits for the transactions SPRO and SM30, to call these function modules in the first place.

Change pointers refer to the tables CDHDR and CDPOS, the tables which the change document updates (as found in the function module CHANGE_POINTERS_CREATE). Now, how do I track the updates on these tables, since the change pointers itself is dependent on the change documents and I couldn't find a place to incorporate the function module call that would update the change document tables?

Any help is appreciated.

Thanks & Regards

Anil Madhavan

5 REPLIES 5

srinivas_akiri
Active Participant
0 Kudos

Hi,

In general change pointers will be read by the FM, MASTER_IDOC_SMD_MESSAGETYPE which inturn call the FM,

CHANGE_POINTERS_READ this will read the change pointers from BDCP table and process the corresponding change documents in CDHDR, CDPOS tables.

To process our custom change we need to copy the above fm module and create a custom FM which will process our change pointers.

Thanks

0 Kudos

Hi Srinivas,

Thanks for the reply.

I guess I've made my question a bit complex. The main problem that I'm facing is that the updated entries of my standard SAP tables are not getting reflected in CDHDR/CDPOS. I created a change document class and generated the function modules. Now I don't know where I can call these, 'coz I couldn't find any user-exits assosciated with the transaction SM30. (TCJ1T is the Project Types table, for which entries are created through SPRO, which has linked it to the Table Maintainence Generator for the table).

My question is, how do I direct the updated entries into CDHDR/CDPOS. Are exits the only option available?

Thanks & Regards

Anil Madhavan

0 Kudos

The only way I've seen it done is with a custom change pointer message type.

WE81 to create the custom message type

BD52 to assign the fields to the message type

BD50 to activate

0 Kudos

Hi Chris,

Thanks for the inputs.

I've done these steps already. But be it a custom pointer or a standard one, I guess, it refers to the tables CDHDR/CDPOS. Pardon me if my understanding is flawed. The basis of this problem is that these tables are not getting updated. My question is, how can these table be populated as soon as some inserts/updates happen in the standard table (there is no object class for the tables I've already mentioned).

Thanks & Regards

Anil Madhavan

0 Kudos

Hi Anil,

In SM30 you have programmable events:

Environment -> Modification -> Events

Here's the link to documentation teaching how to create change documents:

http://help.sap.com/saphelp_47x200/helpdata/en/2a/fa015b493111d182b70000e829fbfe/frameset.htm

I'm also trying to learn how to access the needed data in these SM30 events so that I can call the function to generate the change document with the right data in SM30

Let me know if this was useful.

Bye,

Nuno