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: 

Partner E-mail saving

Former Member
0 Kudos
532

Hi all,

Do you know if I can use this Function Module to update tables like for example ADR6 (e-mail)?

My requirement is to change the partner dependent address e-mail. I don't want to change the customer e-mail, what I need is to change the partner e-mail belonging to a sales order number.

Could you please tell me any advice for this requirement? Any example?

I have the sales order number, and the partner address number (table VBPA - adrnr --starting by 90000****). I need to update the e-mail for this partner address number in table ADR6. I already tried a lot of functions but any of them worked ok.

Any help it will be very appreciated.

Thanks and kind regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
254

Hi Pati,

Use FM BAPI_BUPA_ADDRESS_CHANGE to change the Email address or any other address details of the partner.

Lokesh

11 REPLIES 11

Former Member
0 Kudos
255

Hi Pati,

Use FM BAPI_BUPA_ADDRESS_CHANGE to change the Email address or any other address details of the partner.

Lokesh

0 Kudos
254

Hi,

Do you have any example in how can i use this FM to update partner e-mail address? I am trying to use it, but I am not sure about which fields do I need to fill and with which values.

In my system this FM has never been used, so I don't have access to one real example.

Thanks

0 Kudos
254

If you need to update only the email address.

Pass the BP Number to Import Parameter BUSINESSPARTNER.

Pass the Email address to E_MAIL field of tables parameter BAPIADSMTP.

Pass 'X' to E_MAIL field of tables parameter to BAPIADSMT_X.

I guess these parameters should be enough to update the email address.

Refer to the FM Documentation for more details.

Lokesh

Edited by: Lokesh Aggarwal on Dec 19, 2007 5:38 PM

0 Kudos
254

Hello,

See my example please:

DATA: email_address LIKE BAPIADSMTP OCCURS 0 WITH HEADER LINE.

DATA: email_address_x LIKE BAPIADSMTX OCCURS 0 WITH HEADER LINE.

DATA: it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

break-point.

MOVE: 'test@test.com' TO email_address-E_MAIL,

'TEST@TEST.COM' TO email_address-EMAIL_SRCH.

MOVE: 'X' TO email_address_x-E_MAIL,

'X' TO email_address_x-EMAIL_SRCH.

CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'

EXPORTING

businesspartner = '9000004478'

TABLES

BAPIADSMTP = email_address

BAPIADSMT_X = email_address_x

return = it_return.

READ TABLE it_return WITH KEY type = 'E'.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

COMMIT WORK.

ENDIF.

This is not working for my requirement because:

I have the sales order number, for that sales order number I have in table VBPA the adrnr for each partner belonging to sales order. The number I am using in businesspartner is the one (vbpa-adrnr) for the partner I want to change the e-mail.

How can I use this?

Thanks for your help and best regards

0 Kudos
254

Hi,

Address number that you are using is not same as the BP number. I think the BP number is available in the VBPA table under the PERNR field, just check if there is a corresponding entry exist in table BP000. If yes, you can use this number for updating the email address.

Be aware that there can be multiple addresses maintained for a BP, you need to update the particular address number.

You will have to pass ADDRESSGUID also in this case.

Get ADDRESS_GUID from table BUT020 passing partner number and address number from VBPA table.

Hope it helps.

Lokesh

0 Kudos
254

Hi,

Thanks for your answer but I think my requirement is different than we are thinking.

I don't have any entry in table BP000 or BUT020. Those tables are empty. I can't use them for my requirement.

Thanks and regards

0 Kudos
254

Hi Pati,

Even I dont have data in my system, hence unable to guide you with the exact inputs.. I am on HR system, so even the VBPA table is empty.

Try FM BUPA_ADDRESS_CHANGE, it has address number as the importing parameter.

Lokesh

0 Kudos
254

Hi,

Thanks again for you answer.

Now I changed to this:

CALL FUNCTION 'BUPA_ADDRESS_CHANGE'

EXPORTING

IV_PARTNER = '0004001294'

IV_ADDRNUMBER = '9000004478'

TABLES

IT_ADSMTP = email_address

IT_ADSMT_X = email_address_x

ET_RETURN = it_return.

First I tried to use only the import parameter IV_ADDRNUMBER, but I got an error saying that I need to insert the business partner. Then I tried to use the (VBPA-KUNNR) but it says that the business partner doesn't exists.

I think this concept of business partner will not work for my requirement

Thanks one more time.

Regards

0 Kudos
254

Hi Pati,

Here is the solution to your problem.

Select on the ADR6 table for the address number.. and get all records with that address number.

Now pass these records with the new EMAIL address to table ADR6_U of FM

ADDR_SAVE_INTERN.

It will work...

Cheers..

Lokesh

Edited by: Lokesh Aggarwal on Dec 20, 2007 4:00 PM

0 Kudos
254

Hi,

I already tried this solution, but I don't know, doesn't work... and this is really strange, because I already debugged standard and the standard uses this function..

What do you think is wrong in here?

ADR6_I-client = '120'.

ADR6_I-addrnumber = '9000004478'.

ADR6_I-date_from = '00010101'.

ADR6_I-consnumber = '001'.

ADR6_I-flgdefault = 'X'.

ADR6_I-home_flag = 'X'.

ADR6_I-smtp_addr = 'teste@teste.com'.

ADR6_I-smtp_srch = 'TESTE@TESTE.COM'.

CALL FUNCTION 'ADDR_SAVE_INTERN' IN UPDATE TASK

TABLES

adrc_d = adrc_d

adrc_u = adrc_u

adrc_i = adrc_i

adrct_d = adrct_d

adrct_u = adrct_u

adrct_i = adrct_i

adrp_d = adrp_d

adrp_u = adrp_u

adrp_i = adrp_i

adcp_d = adcp_d

adcp_u = adcp_u

adcp_i = adcp_i

adrt_d = adrt_d

adrt_u = adrt_u

adrt_i = adrt_i

adr2_d = adr2_d

adr2_u = adr2_u

adr2_i = adr2_i

adr3_d = adr3_d

adr3_u = adr3_u

adr3_i = adr3_i

adr4_d = adr4_d

adr4_u = adr4_u

adr4_i = adr4_i

adr5_d = adr5_d

adr5_u = adr5_u

adr5_i = adr5_i

adr6_d = adr6_d

adr6_u = adr6_u

adr6_i = adr6_i

adr7_d = adr7_d

adr7_u = adr7_u

adr7_i = adr7_i

adr8_d = adr8_d

adr8_u = adr8_u

adr8_i = adr8_i

adr9_d = adr9_d

adr9_u = adr9_u

adr9_i = adr9_i

adr10_d = adr10_d "*178i

adr10_u = adr10_u "*178i

adr10_i = adr10_i "*178i

adr11_d = adr11_d "*178i

adr11_u = adr11_u "*178i

adr11_i = adr11_i "*178i

adr12_d = adr12_d "*178i

adr12_u = adr12_u "*178i

adr12_i = adr12_i "*178i

adr13_d = adr13_d "*178i

adr13_u = adr13_u "*178i

adr13_i = adr13_i "*178i

adrcomc_d = adrcomc_d

adrcomc_u = adrcomc_u

adrcomc_i = adrcomc_i

adrg_d = adrg_d

adrg_u = adrg_u

adrg_i = adrg_i

adrgp_d = adrgp_d

adrgp_u = adrgp_u

adrgp_i = adrgp_i

adrv_d = adrv_d

adrv_u = adrv_u

adrv_i = adrv_i

adrvp_d = adrvp_d

adrvp_u = adrvp_u

adrvp_i = adrvp_i "*981u

adru_d = adru_d "*981i

adru_u = adru_u "*981i

adru_i = adru_i. "*981i

commit work and wait.

Thanks for all your help in this.

Regards

0 Kudos
254

Hi Pati,

First thing is that you need to pass values to table ADR6_U if you are updating the table, ADR6_I should be used if you are creating a new record.

If still it does not work,

change the date format to 01.01.0001.

If still it does not work, check the input parameters.

Put all the key values which you passing to the FM to the table ADR6 directly in SE16 and see if you get a valid entry.

Also, try this in Se37 first and then in your program.

Hope it resolves the issue.

Lokesh