cancel
Showing results for 
Search instead for 
Did you mean: 

CALL FUNCTION 'BAPI_BUPA_SEARCH' via Email

Former Member
0 Kudos

Team,

I want to search Business Partners via their emails (from an excel sheet). I am getting error Wrong Data Type. Please let me know what is Data type to be used for Emails to pass to the fm.

Thanks

*******************

DATA: "PARTNER TYPE BU_PARTNER,

EMAIL TYPE BAPIADSMTP OCCURS 1 WITH HEADER LINE,

EMAILX TYPE BAPIADSMTX OCCURS 1 WITH HEADER LINE,

MESSAGES TYPE BAPIRET2 OCCURS 1 WITH HEADER LINE,

excel_email type BAPIBUS1006_COMM-E_MAIL,

dsearchresults type BAPIBUS1006_BP_ADDR occurs 1 with header line.

parameters: partner type bu_partner.

*PARTNER = '12345'.

TABLES: BUT000, BUT020, ADR6.

*search for BP via EMAIL address

excel_email = 'sapinfo@gmail.com'.

CALL FUNCTION 'BAPI_BUPA_SEARCH'

EXPORTING

  • TELEPHONE =

EMAIL = excel_email

  • URL =

  • ADDRESSDATA =

  • CENTRALDATA =

  • BUSINESSPARTNERROLE =

  • COUNTRY_FOR_TELEPHONE =

TABLES

SEARCHRESULT = dsearchresults

  • RETURN =

.

Accepted Solutions (1)

Accepted Solutions (1)

former_member927251
Active Contributor
0 Kudos

Hi SAPna2000,

Here is the working code.


************************************************************************
*                             EMAIL TEST
************************************************************************

DATA: "PARTNER TYPE BU_PARTNER,
      email           TYPE bapiadsmtp OCCURS 1 WITH HEADER LINE,
      emailx          TYPE bapiadsmtx OCCURS 1 WITH HEADER LINE,
      messages        TYPE bapiret2 OCCURS 1   WITH HEADER LINE,
      excel_email     TYPE bapibus1006_comm-e_mail,
      dsearchresults  TYPE bapibus1006_bp_addr
                      OCCURS 1 WITH HEADER LINE,
      lit_return      TYPE TABLE OF bapiret2.

*parameters: partner type bu_partner.
*PARTNER = '12345'.

TABLES: but000, but020, adr6.
*search for BP via EMAIL address

excel_email = 'abc@xyz.com'.

CALL FUNCTION 'BAPI_BUPA_SEARCH'
EXPORTING
* TELEPHONE =
email = excel_email
* URL =
* ADDRESSDATA =
* CENTRALDATA =
* BUSINESSPARTNERROLE =
* COUNTRY_FOR_TELEPHONE =
TABLES
searchresult = dsearchresults
return = lit_return
.

LOOP AT dsearchresults.
  WRITE:/ dsearchresults.
ENDLOOP.

<b>Reward points if it helps.</b>

Answers (1)

Answers (1)

P000636
Active Contributor
0 Kudos

Hi SAPNA2000.

You need a the table return in your function module.

Declarate a data it_return type BAPIRET2_T and assing y in the parameter tables->return.

Regards.

Manuel.