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 details like in IDoc DEBMAS

Former Member
0 Kudos

Hi,

I'm stuck with a problem concerning the customer data. I need to write a function that returns all information about a customer (from tables kna1, knb1, .. wrf3). Basicly everything that can be found in the IDoc DEBMAS06. So far I couldn't find a BAPI/function that does that. There are only BAPIs like BAPI_CUSTOMER_GETDETAIL which return only a very limited amount of information about a customer.

Does anyone know a function that does that or can help in any other way?

Thx

Stephan

PS: I don't want to query the database tables myself as I don't know the relations between them and don't want to select wrong data.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Stephan,

there is no BAPI to do what you want.

If I understood properly you need only a function that returns accurate data for a customer.

If you are working with ECC 2005 (6.00 and above), you can look to class CMD_EI_API_EXTRACT and method GET_DATA.

This is part of the synchronisation functionality which has been delivered with ECC 2005.

Hope this will help.

Best regards

Alain

7 REPLIES 7

Former Member
0 Kudos

Hello,

I am not sure if you will get any FM or BAPI that will return all details of a customer.

Instead of that you can use these below BAPIs to get the details of a customer.

BAPI_CUSTOMER_GETDETAIL

BAPI_CUSTOMER_GETDETAIL1

BAPI_CUSTOMER_GETDETAIL2

PS: You can also refer report RBDSEDEB .

Regards

Arindam

0 Kudos

if requirement is really to read whole data then you can trigger IDOC and read DEBMAS06 data..

0 Kudos

Hi Madan,

yes, I tried that, too. But I'm not really happy with this solution because it creates an 'unnecessary' IDoc. Plus, as the IDoc creation is done asynchronously I have to take care of parallel processing which I would like to avoid.

Regards

Stephan

Former Member
0 Kudos

Hi Stephan,

there is no BAPI to do what you want.

If I understood properly you need only a function that returns accurate data for a customer.

If you are working with ECC 2005 (6.00 and above), you can look to class CMD_EI_API_EXTRACT and method GET_DATA.

This is part of the synchronisation functionality which has been delivered with ECC 2005.

Hope this will help.

Best regards

Alain

0 Kudos

Hi Alain,

this is an excellent solution. Thank you very much. I'm going to rewrite my implementation using this method.

Regards

Stephan

0 Kudos

Hi Stephen,

I am working on the same scenario, can you please provide me with the code of the same.

Regards,

Nilesh

0 Kudos

Sure, here you go ...

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 = [customer xyz].

  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

Stephan