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

Change Documents

Former Member
0 Likes
596

Dear Experts,

I have a small requirement,

Is there a way that I can findout, what are all the Line items created for a sales order today(or in a particular interval of time).

Scenario.

A sales order XYZ created on Aug 1st with Line items 10 and 20.

The item 20 was changed on Aug 25th

A new Item 30 was created on Aug 27th.

When I run a selection for Aug 20th to Aug 27th,

It should come up saying xyz 30, leaving xyz 20(Which actually is changed but not created newly).

Can some one throw an idea on how to achive this scenario.

Thanks in advance.

-Amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
568

Use CDHDR (change document header),

CDPOS(change document item)

tables to find out changed documents.

and populate the documents that doesnot have entries in above tables.

Regards

sateesh

5 REPLIES 5
Read only

jaideepsharma
Active Contributor
0 Likes
568

Hi,

You can fetch changed documents from CDHDR Table using OBJECTCLAS as 'VERKBELEG' and OBJECTID as your salesorder number. Then go to CDPOS table using information fetched from CDHDR. There you have a field CHNGIND which is an indicator dictating if there was a new entry made in the order or updation was done for an old entry.I think you will have 'I' for item 30 and 'U' for item 20 in your case. I believe TABKEY field in CDPOS is combination of Client,Salesorder Number and Item Number in this case. Let me know in case you have any issues.

KR Jaideep,

Read only

0 Likes
568

Dear experts,

Thanks for your response.

Is there a change document being created when an Item is added to the sales order, and not when an Item is changed, if so do I need to do any kind of configuration changes or any settings.

Thanks in Advance,

-Amit.

Read only

0 Likes
568

Hi Amit, could you please enhance the title of your post, something like "Are change documents created while adding item to sales order" (because this title could be subject to "abuse"). If you can't change it, please ask the moderators.

Read only

Former Member
0 Likes
569

Use CDHDR (change document header),

CDPOS(change document item)

tables to find out changed documents.

and populate the documents that doesnot have entries in above tables.

Regards

sateesh

Read only

Former Member
0 Likes
568

Hi Amit,

If you want to find the sales order/items created on a particular day, you need to fetch data from Sales Document Item(VBAP) table by using Creation Date (ERDAT) in where Condition.

Regards,

Venkat Ramana.