cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi to create customer Master

madhu_vadlamani
Active Contributor
0 Kudos

Dear all,

As far i know there is no standard bapi to create a customer. There i s standard fm used her is SD_CUSTOMER_MAINTAIN_ALL. I tried to create customer master using this and making the function module as remote enabled. i tried to created a zbapi and use this fm inside of this. Please tell me if any idea on this.If any body knows please help me in this.

Regards,

Madhu.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Don't use SD_CUSTOMER_MAINTAIN_ALL or any of the BAPI that have the same look and feel.

You may use class CMD_EI_AIP with one of the maintain methods.

This you may enclose within a Function Module RFC enabled.

Otherwise, look at [note 384462|https://service.sap.com/sap/support/notes/384462]

Hope this helped

BR

Alain

madhu_vadlamani
Active Contributor
0 Kudos

Dear Alain,

I tried this post a long back . I did not get a good solution from any body . Finally you replied. I found another solution with the help of venkat and keshav . I tried this class but i am not able to finish it . If you have any sample code with this please pass to me . Thank you for reply .

Regards,

Madhu.

Edited by: madhurao123 on Mar 29, 2010 7:48 PM

Former Member
0 Kudos

Hi,

I don't have code that uses it for test purpose.

But you can:

  • look at its usage: ERP BP synchronisation => ERP Customer master. This calls CMD_EI_API-MAINTAIN

  • Start a fairly small report with mainly 2 calls:

  • CMD_EI_API_EXTRACT-GET_DATA ==> To read a customer

  • update the complex structure with the data you plan to modify

  • CMD_EI_API-MAINTAIN

  • COMMIT

Good luck

Alain

madhu_vadlamani
Active Contributor
0 Kudos

Dear Alain

Once again thanks for your reply. I passed customer no to extract data of a customer . But it is not extracting any data .

I am thinking to fill all the fields of the table by seeing hoe it is extracting the data . can you give me some idea on this .

DATA: ls_i_main TYPE cmds_ei_main,

ls_e_main TYPE cmds_ei_main,

lt_custs TYPE cmds_ei_extern_t,

ls_cust TYPE cmds_ei_extern,

ls_head TYPE cmds_ei_header,

ls_instance TYPE cmds_ei_instance.

CONSTANTS: lc_obj_task TYPE cmd_ei_object_task VALUE 'M'.

----


ls_instance-kunnr = '0000100001'.

ls_head-object_instance = ls_instance.

ls_head-object_task = lc_obj_task.

ls_cust-header = ls_head.

APPEND ls_cust TO lt_custs.

ls_e_main-customers = lt_custs.

CALL METHOD cmd_ei_api_extract=>get_data

EXPORTING

is_master_data = ls_e_main

IMPORTING

es_master_data = ls_i_main.

"es_error = pe_error.

Regards,

madhu.

Edited by: madhurao123 on Mar 31, 2010 1:17 PM

Former Member
0 Kudos

Hi madhu,

yes this is exactly what I was suggesting.

Either use the GET_DATA to retrieve the data and just update the structure with the changed fields.

Either use the GET_DATA as a learning tool and then do your own implementation for direct changes.

Briefly reading, the code extract looks fully correct. Does it work or do you still have difficulties to extract data ?

BR

Alain

madhu_vadlamani
Active Contributor
0 Kudos

Dear Alain,

You are correct . I want to create customer from external system . I can not go for any method except bapi . As you suggested i tried with that class . Before creating customer with that class i tried by fetching the data with an existing customer . Here i am not able to get customer details . In the above i posted my code also . Please see that and give me a good idea.

Regards,

madhu.

Former Member
0 Kudos

Hi,

I've tried your code extract, just to make sure I did not mis-read it .

It works really fine.

If the customer provided do exists, it is completely returned in table LS_I_MAIN.

Then you will only have to update table LS_I_MAIN with your own changes.

Don't forget the corresponding DATAX fields then call CMD_EI_API-MAINTAIN.

BR

Alain

madhu_vadlamani
Active Contributor
0 Kudos

Dear Alain,

Thank you for your reply. I tried with this. Even in debug mode also i am not able to see the customer . can you give me some idea on this .

Regards,

Madhu.

kesavadas_thekkillath
Active Contributor
0 Kudos

Please read the documentation of the program.

kesavadas_thekkillath
Active Contributor
0 Kudos

YOu can also check the class-interface VMD_EI_API in se24.

In consists of methods to update customer details

madhu_vadlamani
Active Contributor
0 Kudos

Hi Kesahv,

Thank you for your reply. This class is used for create vendor.

Regards,

Madhu.

kesavadas_thekkillath
Active Contributor
0 Kudos

There are mthods available for customer also, hit the find button and search for customer.

madhu_vadlamani
Active Contributor
0 Kudos

Hi Keshav,

Thank you for your reply. I did not get you what you said. please give some details.

Regards,

Madhu.

Former Member
0 Kudos

HI Madhu,

Try the following programs.

1. RFBIDE00 for customer master

2. BUS4001 for updating the Customer address.

Regards,

Vikram.M

kesavadas_thekkillath
Active Contributor
0 Kudos

Check program RFBIDE00

Former Member
0 Kudos

I believe it must be run remotely.

Rob

madhu_vadlamani
Active Contributor
0 Kudos

HI Keshav,

Thank you for your reply. You given a nice program for customer creation. Can you say how to work with it from external system . . I executed the program RFBIDE00 given by you. After executing that i am not getting anything. Give me some idea on this.

Regards,

Madhu.

former_member206377
Active Contributor
0 Kudos

Hi Madhu,

Have you tried BAPI_CUSTOMER_CREATE and BAPI_Customer_CreateFromData

madhu_vadlamani
Active Contributor
0 Kudos

Hi vasu,

Thank you for u r reply. i have to do this from ex system. I tried with this. but it will open xdo1 tcode. i Dont want like this.

Regards,

madhu.

Former Member
0 Kudos

See if BAPI_CUSTOMER_CREATEFROMDATA1 is what you want.

Rob

madhu_vadlamani
Active Contributor
0 Kudos

Hi Rob,

Thank you for your reply. This bapi is not enough for my requirement. I already tested the bapi what you said. There is a lot of fields are not present in it. I have to add more fields to it. Give me a goos idea how to work with it.

Regards,

Madhu.

Former Member
0 Kudos

>

> I already tested the bapi what you said.

That would have been helpful to know at the beginning.

Rob

madhu_vadlamani
Active Contributor
0 Kudos

HI Rob,

Thank you for your reply.

Regards,

Madhu.