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: 

Customer Create and Change using SD_CUSTOMER_MAINTAIN_ALL

Former Member
0 Kudos

Hi all,

We have to create and change customers from an Input File. After looking at BDC and BAPI_CUSTOMER_CREATEFROMDATA1, we have decided against it and are thinking of going with the FM SD_CUSTOMER_MAINTAIN_ALL

I need help on two issues regarding the FM SD_CUSTOMER_MAINTAIN_ALL.

<u>Issue One:</u>

While creating a customer, I have to enter two e-mail addresses for each customer. I was only able to find one place holder for entering the e-mail address in BAPIADDR1(e_mail field). Please let me know how we can enter two e-mail addresses.

<u>Issue Two</u>

I need help (preferably some code snippet) on how to change the customer master using this Function Module. I could not find much of documentation on this FM. It would be great, if you could point me to which of the parameters/tables are relevant for CHANGE and which all are relevant for CREATE.

Please provide your inputs and experiences on using this Function Module. Help would be greatly appreciated and rewarded with points.

Thanks,

Ani

1 ACCEPTED SOLUTION

tamra_walstrom
Explorer

Hi Ani,

I have used SD_CUSTOMER_MAINTAIN_ALL for both creating and changing customer information and it is working well.

When changing the data, you do need to make sure the parameter i_maintain_address_by_kna1 is set to 'X'. We also had to set pi_cam_changed to 'X'. That changed the data as we required. For create mode, we did not need to use those parameters.

I didn't have a problem with two email addresses but had a similar problem with phone numbers. For that, I used BAPI_ADDRESSORG_GETDETAIL to get the current information after the customer code had been created. I passed the obj_type = 'KNA1', the obj_id = kunnr, context = 1 and iv_current_comm_data = 'X'.

This bapi will return the address number of the customer you want to maintain. In our case we were looking for telephone information so we filled table bapiadtel. Sound like you will want to use bapiadsmtp for your emails.

I then used BAPI_ADDRESSORG_CHANGE to change/insert the phone numbers.

The bapis contain good documentation that may be more relevant to your needs.

Hope this helps.

1 REPLY 1

tamra_walstrom
Explorer

Hi Ani,

I have used SD_CUSTOMER_MAINTAIN_ALL for both creating and changing customer information and it is working well.

When changing the data, you do need to make sure the parameter i_maintain_address_by_kna1 is set to 'X'. We also had to set pi_cam_changed to 'X'. That changed the data as we required. For create mode, we did not need to use those parameters.

I didn't have a problem with two email addresses but had a similar problem with phone numbers. For that, I used BAPI_ADDRESSORG_GETDETAIL to get the current information after the customer code had been created. I passed the obj_type = 'KNA1', the obj_id = kunnr, context = 1 and iv_current_comm_data = 'X'.

This bapi will return the address number of the customer you want to maintain. In our case we were looking for telephone information so we filled table bapiadtel. Sound like you will want to use bapiadsmtp for your emails.

I then used BAPI_ADDRESSORG_CHANGE to change/insert the phone numbers.

The bapis contain good documentation that may be more relevant to your needs.

Hope this helps.