cancel
Showing results for 
Search instead for 
Did you mean: 

Help - Function in BP.

former_member187400
Active Contributor
0 Kudos

Dear All.

Hi.. my name is Daniel N.

Right now, i'm making a program(external) that is able to update BP in CRM.

And i'm going to make a report that contain the information about what field (such as: name_org1/name_org2/addr1/etc) of BP that i've changed/updated.

The question is:

Does anyone of u know the function/method to get the information about what field of BP that i've changed/updated?

Thq so much.. for ur attention..

Your guidance is needed so much..

Best Regards.

Daniel N.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

You can write a simple SELECT from tables CDHDR and CDPOS to get all the changes made to a BP.

1. Pass OBJECTCLAS = BUPA_BUP

OBJECTID = BP Number with leading zeros

USERNAME or UDATE to table CDHDR

2. Pass OBJECTCLAS = BUPA_BUP

OBJECTID = BP Number with leading zeros

TABNAME = BUT000

FNAME = NAME_ORG1 or any other field

to table CDPOS

Join these 2 tables to get the required data. Hope this helps.

Thanks.

Ajay Kiran

former_member187400
Active Contributor
0 Kudos

Hi Ajay..

Thq so much for ur information.

Btw, i'm still wondering how could i get the BP Number in table CDPOS if the objectclass is ADRESSE?

Thq.. so much Ajay.

Still need ur guidance.

Btw, i've given u points as my way for expressing thanx.

Former Member
0 Kudos

Hi Daniel,

When OBJECTCLAS is ADRESSE you do not find BP Number directly in CDPOS. The value in the field OBJECTID refers to BP Number indirectly. You may see values for OBJECTID like 'BP 0000010432'. Here 0000010432 is the Address Number for your BP which is found in table BUT020. The relationship bewteen your BP Number (PARTENR) and Address Number (ADDRNUMBER) can be found in table BUT020. Hope this helps to solve your problem.

Thanks.

Ajay Kiran

former_member187400
Active Contributor
0 Kudos

Hi.. Ajay..

I really thq.. for ur solution u gave to me. It really help me to make out my job.

I also wanna say thq to karthik.

Big thx to both of u.

Best Regards

Daniel N.

btw, i've given also u points again expressing thq to u.

former_member187400
Active Contributor
0 Kudos

Hi.. Ajay..

I wanna ask u once again as for getting a log from updating BP (TCODE: BP).

Somehow, after i update BP, there is no information about the log of BP in those tables (CDHDR&CDPOS).

I use this functions to update BP:

1. BUP_BUPA_UPDATE:

I use it to update: Name_Org1,Name_Org2,Name_Org3, and Name_Org4.

2. ADDR_SAVE_INTERN:

I use it to update: name1, sort1, mc_name1, street, city1, post_code1, country, tel_number, fax_number, mc_street, tel_number, telnr_long, telnr_call.

3. BUPA_IDENTIFICATION_ADD:

I use it to update registration number.

4. CALL FUNCTION 'BAPI_BUPA_FRG0040_CREATE'

EXPORTING

BUSINESSPARTNER = lv_bpnumber

DATA = ls_DATA

TABLES

RETURN = lt_return.

READ TABLE lt_return WITH KEY TYPE = 'E'.

IF SY-SUBRC = 0. "if found means there is error create, try update then

CALL FUNCTION 'BAPI_BUPA_FRG0040_CHANGE'

EXPORTING

BUSINESSPARTNER = lv_bpnumber

DATA = ls_DATA

DATAX = ls_DATAX

TABLES

RETURN = lt_return.

I use these logic to update the type of bp itself whether the BP is customer/prospect/competitor..

Is there any wrong..? But those function can be run well for updating. I mean when i run it, the data can be updated, but the problems is i still can't catch for the log in CDHDR & CDPOS..

Thx u so much Ajay..

Ur guidance is so needed by me..

Best Regards.

Daniel N.

Former Member
0 Kudos

Hi Niel,

I have just checked out the scenario of updating BP through FM BUP_BUPA_UPDATE. If you see the code in this FM, entries are updated in the table BUT000 etc directly using UPDATE statement. Update is not through a transaction code, BP, in this case. I think that is the reason we do not find the relevant change log in CDHDR/CDPOS.

Thanks.

Ajay Kiran

former_member187400
Active Contributor
0 Kudos

Hi Ajay..

Thq so much for ur effort to check out it .

I have a little questions for u :

1. Do u have any ideas what other functions that i've to use to update the record in table CDHDR/CDPOS?

2. Do u have another way (function/method/badi/bapi) how to update BP where it also use TCODE -> BP (like ur explanation b4) / this function/way has 2 purposes:

a. Update BP

b. Update table CDHDR/CDPOS.

Thq so much Ajay..

Still need ur guidance.

Best Regards.

Daniel N.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Daniel,

There is a standard report as well to display the change history for a BP. Execute report RSSCD200 and see if this meets your requirement.

Enter OBJECTCLAS = BUPA_BUP and

OBJECTID = BP Number with leading zeros and execute the report. Hope this helps.

Thanks.

Ajay Kiran

Former Member
0 Kudos

Hi Daniel,

You can use the Function module CHANGEDOCUMENT_READ which will return the change history like changed date, the fields that had been changed and also the old value of that field.

Thanks & Regards,

Karthik.