04-20-2015 8:41 PM
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
04-21-2015 1:24 AM
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
04-21-2015 1:02 PM
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
04-21-2015 3:37 AM
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
04-21-2015 1:04 PM
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
04-21-2015 3:23 PM
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.
04-21-2015 6:48 PM
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
04-21-2015 7:17 PM
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
04-21-2015 7:17 PM
You could use the exit to make the changes and then get the log using change documents.
Rob
04-21-2015 1:28 PM
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
04-21-2015 1:29 PM
04-21-2015 2:28 PM
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.