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: 

CDHDR and CDPOS table not updating for customer master changes

Former Member
0 Kudos

Hi Experts

I am modifying the value of  KNA1-KVGR1  ,value is getting modified but the corresponding CDHDR and CDPOS entry is missing .

I have tried function module  Customer_update_sales_area function  (or Modify KNA1 from ITAB also ) module to update the KNA1 table,

in both case field is getting changes but CDHDR and CDPOS table is not getting affected ,please help.

Anoop

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I got  a function module to update the KNVV ,now it is updating KNVV , CDHDR & CDPOS ,

thnx for your valuable inputs

Anoop

8 REPLIES 8

Former Member
0 Kudos

Hi,

I have check KVGR1 field in our system.. the field is in KNVV and not in KNA1..

if you go to se11 and check details for KVGR1.. you can see

Change document indicator is set..

so system has to store changes agaist KNVV table in CDHDR or CDPOS table..

Please check again..

Regards

Tejas

Message was edited by: tejas patil

VXLozano
Active Contributor
0 Kudos

NEVER (and I mean NEVER) perform a manual update to a SAP standard table. Trash all your code about that "Modify KNA1 from ITAB" or you will be risking your company's data integrity.

Once I've been enough clear about it.

How it's supposed you are trying to change CHDHR and CDPOS just by changing KNA1? And which version are you running? In mine, KVGR1 is NOT a field of table KNA1...

Former Member
0 Kudos

Hi Lozano

Thnx for your reply .

Not KNA1-KVGR1 it is KNVV-KVGR1 field

himanshu_gupta13
Employee
Employee
0 Kudos

Dear Anoop,

I don't think so that kna1 table contains the KVGR1 field and it maintains in table of  KNVV (maintains the customer master sales data)

Many Thanks / Himanshu Gutpa

raymond_giuseppi
Active Contributor
0 Kudos

To update standard SAP tables, use allowed tools as BAPI, BDC,Direct Input, LSMW tool.

But never

- use open-sql (or native) statements

- use update task FM (that are just the last part of SAP update process and usually only update database)

Tables CDPOS and CDHDR are updated by SAP in an update task FM, they are triggered in standard transactions as well as allowed tools, but don't confound those "change document" programmatically generated (see SCDO)  with "table change logging" which are generated by open-sql statements without coding.

Also when you call a new FM (here Customer_update_sales_area which is an Update task FM) check its attributes and perform some where-used.

So consider BDC on XK02 or BAPI_CUSTOMER_CHANGEFROMDATA1 or LSMW.

Regards,

Raymond

0 Kudos

Hi Raymond,

can you help me?

To update customer we use the ISM_BAPI_007_CHANGE_INFO_CALC and then the BAPIBUSISM007_CHANGE.

After that to mantain the partner roles we use the function module CUSTOMER_UPDATE like in this thread:

The BP tcode use the same function and write the log on cdhdr and cdpos for knvp.

In our custom program using the same function : CUSTOMER_UPDATE we ha no log in cdhdr and cdpo for KNVP.

But we have log for KNVV and each other table.

This strange, where I'm in wrong?

Regards

Former Member
0 Kudos

I got  a function module to update the KNVV ,now it is updating KNVV , CDHDR & CDPOS ,

thnx for your valuable inputs

Anoop

I hope this FM is not an update task FM (check attributes) else youy just executed an open-sql "in disguise",

Could you write which FM you did use (if standard) so that those who later seek the same solution could benefit.

Regards,

Raymond