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: 

BAPI for Customer Master Change

Former Member
0 Kudos

Hi gurus,

Business has requested that we develop a program to "correct" some fields of the customer master in a nightly run.  I can gather all the impacted customer master numbers and necessary field changes through my program, but I have questions about how to apply the changes.  Is there a friendly BAPI available for editing customer master such as SD_SALESDOCUMENT_CHANGE for sales order?  If not, is there a popular method to achieve this within SAP?

Regards,

Kelby

11 REPLIES 11

prkash_s
Participant
0 Kudos

Hi,

Check out this FM

Directly change the Customer Masters

BAPI_CUSTOMER_EDIT

Or

To Change Customer Number For a SaleOrder then you have to use the above Or

Try for BDC

Regards,

Prakash Sivagnanam

Former Member
0 Kudos

Hi Prakash,

My research of this FM is that it is specific for changing customer data through web view, not live SAP.  Is that incorrect?

Regards,

Kelby

colin_cheong
Contributor
0 Kudos

Hi,

if it is a one-off event, try TCODE XD99.

However, if it is a nighty run, I really like to know the reason behind it. It's rather unusual.

bye

0 Kudos

Hi Siew,

Our implementation utilizes some additional fields on the customer master that are derived based on other standard fields specified within the customer master.  This program will derive the additional fields and apply them based on some table-rules (for example: if customer = Canada AND shipping condition = LC additional field 2 = 'X').  The program would run nightly to apply the additional fields to new customers.

Regards,

Kelby

0 Kudos

Hi,

Would it not be better to have the custom fields updated as part of some user-exit programming, when the customer master is created/edited?  Then you don't have the hassle of a nightly job to correct data that should be right first time around.

Cheers,

G.

0 Kudos

Hi Gareth,

This was a consideration at the front of the project, but the requirement to provide a detailed job log showing the customers/edited fields swayed us to think a job-approach would be a better fit. 

Regards,

Kelby

0 Kudos

Although, we could accomplish this with a z-table and purge method after an exit.  In case we decide to take that approach, could you provide any guidance as to which exits would allow me to submit field modifications prior to save? 

Preliminary research shows EXIT_SAPMF02D_001 as the popular one, but when I set a break-point within that exit and submit a value change to I_KNA1 (only existing structure at that point) it appears to not actually change after the save commit.

Regards,

Kelby

0 Kudos

You could use the exit to make the changes and then get the log using change documents.

Rob

vamsixk
Active Participant
0 Kudos

Have you tried using idocs?

DEBMAS

you can use the MSGFN field for modification using the appropriate value

                               004 Change

regarding the idoc mentioned by Prakash, i think you can use that.

if that is not meeting you r requirements please try "BAPI_CUSTOMER_CHANGEFROMDATA"

Regards,

Vamsi

vamsixk
Active Participant
0 Kudos

If all else fails, try BDC/LSMW.

Regards,

Vamsi

gabmarian
Active Contributor
0 Kudos

Hi Kelby,

I don't believe that there is a universal BAPI for changing customers.

I'd recomment to take a look at method MAINTAIN of class CMD_EI_API.