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

line-level changes not posting to CDPOS when header level changes are made

bruce_hartley
Active Participant
0 Likes
1,542

First of all, I understand a lot about how CDHDR and CDPOS work. I've written a program to go and add up changes created by the VERKBELEG object. I've even used SCDO to make SAP log the details on deletes ( CHNGIND = E ) instead of just a delete ( D ).

Where I am having a problem is when a user modifies the header level conditions and/or partners. If they modify the header level partner for example, I get a record like the following saying that it was changed as follows:

<b>VERKBELEG 0000003695 283240 VBPA 1100000003695000000YC LIFNR U 1 0000200346 0000200340</b>

As you can see, it definitely logs a change for it. My issue is that it's also not logging a record for the affected partners at the line level. What I would have also expected to see was the following:

<b>VERKBELEG 0000003695 283240 VBPA 1100000003695000010YC LIFNR U 1 0000200346 0000200340</b>

I was expecting the output of the above to tell me that it matched on line 10 and that it was changed from 200340 to 200346.

The application requires that I track every change to every sales order line in certain areas and I need this to be tracked at the line level. I don't know why it's not outputting the line-level change record - can it be done ?

PS - Shortly I would love to publish what I have found out about CDHDR and CDPOS and how they work. There is a LOT more to it than meets the eye and there are "traps" that one can avoid - IF you know about them up front.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,341

Actually, the partners which you have mentioned are only maintained at header level. At the line item, level they have only the reference.

To check this go to table VBPA and enter you order 3695, you will only entries with the POSNR = '000000' which means they were maintained at only header level.

If you have added or changed any partner at line item level than it shold definatly got an entry in the CDHDR and CDPOS.

Regards,

Naimesh Patel

First of all, I understand a lot about how CDHDR and CDPOS work. I've written a program to go and add up changes created by the VERKBELEG object. I've even used SCDO to make SAP log the details on deletes ( CHNGIND = E ) instead of just a delete ( D ).

Where I am having a problem is when a user modifies the header level conditions and/or partners. If they modify the header level partner for example, I get a record like the following saying that it was changed as follows:

<b>VERKBELEG 0000003695 283240 VBPA 1100000003695000000YC LIFNR U 1 0000200346 0000200340</b>

As you can see, it definitely logs a change for it. My issue is that it's also not logging a record for the affected partners at the line level. What I would have also expected to see was the following:

<b>VERKBELEG 0000003695 283240 VBPA 1100000003695000010YC LIFNR U 1 0000200346 0000200340</b>

I was expecting the output of the above to tell me that it matched on line 10 and that it was changed from 200340 to 200346.

The application requires that I track every change to every sales order line in certain areas and I need this to be tracked at the line level. I don't know why it's not outputting the line-level change record - can it be done ?

PS - Shortly I would love to publish what I have found out about CDHDR and CDPOS and how they work. There is a LOT more to it than meets the eye and there are "traps" that one can avoid - IF you know about them up front.

6 REPLIES 6
Read only

naimesh_patel
Active Contributor
0 Likes
1,342

Actually, the partners which you have mentioned are only maintained at header level. At the line item, level they have only the reference.

To check this go to table VBPA and enter you order 3695, you will only entries with the POSNR = '000000' which means they were maintained at only header level.

If you have added or changed any partner at line item level than it shold definatly got an entry in the CDHDR and CDPOS.

Regards,

Naimesh Patel

Read only

0 Likes
1,341

Naimesh;

That's the issue - I know I modified the header - what also happened as a side-effect is that lines that matched the old value were also changed and those were the changes that weren't logged.

Read only

0 Likes
1,341

Bruce, that's what I am trying to say ... Because of your change at header level if your item level fields were changed and updated in the database table than you will have link there in CDHDR and CDPOS.

Here in your example, the partners are just referened at the line item level. They were not actually stored in the database table with the reference of the item level.

Hope you understand

Regards,

Naimesh Patel

Read only

0 Likes
1,341

Naimesh;

Thank you - this one is now solved.

I didn't understand what you were saying at first, but I just looked at VBPA with SE16N, and now I understand what you are trying to say.

To help those out in the future, what Naimesh is saying is that the record for line 10 didn't really exist in my first example and thus is "referenced". Here is a better example with 3 lines and their VBPA records for the same order number:

<b>3695 YC 200346 24358 US D</b>

<b>3695 10 YC 200156 24156 US D</b>

<b>3695 30 YC 202617 26691 US D</b>

As one can see, there is no line 20. Thus, when the header changes, it "changes " line 20 in appearance because the screen pulls it from the header because the line-level record does not exist. So, all I have to know is whether the record really exists or not and thus "track" the change. I will have to add some type of indicator to my records to indicate if the record is really there or not.

Read only

bruce_hartley
Active Participant
0 Likes
1,341

I hope this helps other people with trying to track changes with CDPOS for tables that have both header and detail records in the same table, especially VBPA and KONV.

Read only

Former Member
0 Likes
1,341

could you help with some insights into how the cdhdr and cdpos tables are updated. I have a similar requirement to gather all the changes (inserts, updates and deletes) in the sales documents and its related tables (sales document item, schedule line etc) into a separate table.