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

Urgent

Former Member
0 Likes
845

Hi,

KNA1- General Data in Customer Master

KNB1- Customer Master (Company Code)

KNVV- Customer Master Sales Data

CDPOS - Change document items

CDHDR - Change document header

Using the above mention tables, I want to display customer History Information

How to map the above mention table.

Award Points for helpful answer

Thanks & Regards

SEK

Hi,

KNA1- General Data in Customer Master

KNB1- Customer Master (Company Code)

KNVV- Customer Master Sales Data

CDPOS - Change document items

CDHDR - Change document header

Using the above mention tables, I want to display customer History Information

How to map the above mention table.

Award Points for helpful answer

Thanks & Regards

SEK

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
728

Well, the first 3 can be joined using the KUNNR field.

Regards,

RIch Heilman

Read only

0 Likes
728

And here is an example, of how to hit the change tables for custom master.(at least this is one way that a developer did it in my system).. Really not sure if there are other Object classes.



FORM READ_CDHDR.
* Get most current 'update' date
  CLEAR CDHDR.
  SELECT CHANGENR UDATE INTO (CDHDR-CHANGENR, CDHDR-UDATE) FROM CDHDR
      WHERE OBJECTCLAS EQ 'DEBI'
            AND
            OBJECTID EQ KNA1-KUNNR
            AND
            TCODE EQ 'XD02'
        ORDER BY CHANGENR DESCENDING.
    EXIT.
  ENDSELECT.
ENDFORM.  

Regards,

Rich Heilman

Read only

0 Likes
728

Hi,

Thank you for your reply

How to map the (KNA1, KNB1, KNVV) first three with CDPOS and CDHDR

I look forward to your reply

Thanks & Regards

SEK

Read only

0 Likes
728

You can even use fm <b>CHANGEDOCUMENT_READ</b> with the object class <b>DEBI</b>.

Read only

Former Member
0 Likes
728

hi,

you can retrieve customer numbers who has changes in given data and in given customer number by this select condition.

SELECT OBJECTID " Object ID

FROM CDHDR

INTO TABLE T_CUSTOMER_TEMP

WHERE OBJECTID IN S_KUNNR

AND OBJECTCLAS EQ 'DEBI'

AND UDATE IN S_UDATE.

the below is used to retrieve Customers Acording to Accountgroup

and sales orgnization

SELECT KNA1~KUNNR " Customer

FROM KNA1 AS KNA1 INNER JOIN KNVV AS KNVV

ON KNA1KUNNR EQ KNVVKUNNR

INTO TABLE T_CUSTOMER

FOR ALL ENTRIES IN T_CUSTOMER_TEMP

WHERE KNA1~KUNNR EQ T_CUSTOMER_TEMP-KUNNR

AND KNA1~KTOKD IN S_KTOKD

AND KNVV~VKORG IN S_VKORG.

This select statement is used to retrieve the required Customer data

SELECT KNA1VV~MANDT " Client

KNA1VV~KUNNR " Customer

KNVP~PARVW " Account Group

KNA1VV~NAME1 " Customer Name1

KNA1VV~NAME2 " Customer Name2

KNA1VV~INCO1 " Inco terms

KNA1VV~ZTERM " Payment terms

KNA1VV~LAND1 " Country

KNA1VV~REGIO " State/ Region

KNA1VV~CITYC " City

KNA1VV~PSTLZ " Zip-code

KNA1VV~TELF1 " Primary Telephone

KNA1VV~LOEVM " Deletion Flag

FROM KNA1VV INNER JOIN KNVP ON KNA1VVKUNNR EQ KNVPKUNNR

INTO CORRESPONDING FIELDS OF TABLE T_OUTPUT

FOR ALL ENTRIES IN T_CUSTOMER

WHERE KNA1VV~KUNNR EQ T_CUSTOMER-KUNNR

AND ( KNVP~PARVW EQ C_SOLDTO "Required sold to customer

OR KNVP~PARVW EQ C_SHIPTO ). "Required sold to customer

from this you will get all the customer data who ha changes in given date

with regards

Jay