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: 

Not Able to Update Vendor master Communication Details

former_member196331
Active Contributor
0 Kudos

hi,

I need to update vendor master Details By using vmd_ei_api=>maintain_bapi, .

Able to update Address But  communication, i am not able to update,fields  Like Land line and Mobiles.

Email Data also not able to update.


Please Find the Attached Notepad.Any information please Update me.



1 ACCEPTED SOLUTION

0 Kudos

Hi,

The class vmd_ei_api=>maintain_bapi , which you are using is good enough to update communication details,please make sure that you are passing data to deep structures properly with proper flags for fields TASK and CURRENT_STATE .


Thanks.

25 REPLIES 25

former_member184158
Active Contributor
0 Kudos

Hello,

I have searched, but there is one bapi to change vendor master, what you can do,

Batch-Input,

I have tried it out., and it works with me.

if you face any problem with batch input, let me to know,

you can do it by SM35, and then start to record the transaction ( xk02 )
after saving, you can create a program or FM to do this process,

it works with me without any error or problem.

good luck .

0 Kudos

ok. I can do Recording or Bdc, Final thing is i need to give it to the 4 End users, like purchase department, they has to update the Vendor master, Uploading From Excel file.

Right now they don't have access xk02. If they want to  Update through the bdc definitely they need xk02. If i give xk02 they might be update other fields like Account and terms of payment,

But they has to update only address And communications.

Hope you understood, Once user login ,if the user is having authorization (zxk02)(bdc program)

they have access to xk02. other wise they can not proceed.

Hope you understood.

former_member194965
Active Participant
0 Kudos

Hi,

Try this BAPI_ADDRESSORG_CHANGE. By using this BAPI you can update vendor details.

I already used this bapi for vendor Emails updation

Regards,

E.Ananthachari.

0 Kudos

hi,

Thanks for your reply.Please have a look on below post.

0 Kudos

Hi,

The class vmd_ei_api=>maintain_bapi , which you are using is good enough to update communication details,please make sure that you are passing data to deep structures properly with proper flags for fields TASK and CURRENT_STATE .


Thanks.

0 Kudos

May i know have you found any thing wrong in my code.

Current_State is empty should i pass any thing else.

0 Kudos

Hi,

Current_State should be 'X'      and in task specify I or U  depends upon your requirement.As I am in office network unable to open for zip file.


Thanks.

0 Kudos

Task is updating As U, In Debugging i made it X for both mail and phone.

but no updating.

When ever you free please Check it. i will also check it one more time. Right now try to solve it by busing BDC(i dont have any choice)

0 Kudos

Hi ,

Please find the code to update E-Mail Address of vendor in the below attachment

,just now I developed it for you and tested and its working fine.

Like wise ,you can update remaining fields.

Thanks.

0 Kudos

I will check it Give me some time, I will update to you.

0 Kudos

HI,

Thanks for your reply.

Nee some help.Your code is helped a Lot, No doubt, But i am facing small problem under Communication, Mobile number i am not able to Update it.

Blindly I am not asking , i was Tried, i was added Fax number and Telephone number, in Phone part if i try to update the Cellear no, Not able to update it. Please Find the Attached file and run the code In your system, you will get the updated code,

mobile number not able to update it, If you find Any field name or Any other way please inform me.

In Case if you does not download the file.

DATA : is_master_data TYPE vmds_ei_main,

       lt_vmds_ei_extern_t TYPE vmds_ei_extern_t,

       lwa_vmds_ei_extern TYPE vmds_ei_extern,

       lwa_vmds_ei_header TYPE vmds_ei_header,

       lwa_cvis_ei_smtp TYPE cvis_ei_smtp,

       lwa_cvis_ei_smtp_str TYPE cvis_ei_smtp_str,

       lt_cvis_ei_smtp_t TYPE cvis_ei_smtp_t,

       lwa_cvis_ei_cvi_smtp TYPE cvis_ei_cvi_smtp,

       lwa_cvis_ei_cvi_communication TYPE cvis_ei_cvi_communication,

       lwa_cvis_ei_address1 TYPE cvis_ei_address1,

       lwa_vmds_ei_central_data TYPE vmds_ei_central_data,

       es_master_data_correct TYPE vmds_ei_main,

       es_message_correct TYPE cvis_message,

       es_master_data_defective  TYPE vmds_ei_main,

       es_message_defective TYPE cvis_message,

       lwa_return TYPE bapiret2.

"New Data.

DATA:lwa_cvis_ei_phone  TYPE cvis_ei_phone,

     lwa_cvis_ei_phone_str TYPE cvis_ei_phone_str,

     lwa_cvis_ei_phone_t TYPE cvis_ei_phone_t,

     lwa_cvis_ei_cvi_phone TYPE cvis_ei_cvi_phone.

"new

DATA: lwa_cvis_ei_fax TYPE cvis_ei_fax,

     lwa_cvis_ei_fax_str TYPE cvis_ei_fax_str,

     lwa_cvis_ei_fax_t TYPE cvis_ei_fax_t,

     lwa_cvis_ei_cvi_fax TYPE cvis_ei_cvi_fax.

lwa_vmds_ei_header-object_instance-lifnr = 'VEM01'.".your vendor acc. no goes here.

lwa_vmds_ei_header-object_task = 'U'.

lwa_vmds_ei_extern-header = lwa_vmds_ei_header.

"Fax code"

lwa_cvis_ei_fax-data-fax = '123040'.

lwa_cvis_ei_fax-datax-fax = 'X'.

lwa_cvis_ei_fax_str-contact = lwa_cvis_ei_fax.

APPEND lwa_cvis_ei_fax_str TO lwa_cvis_ei_fax_t.

lwa_cvis_ei_cvi_fax-fax = lwa_cvis_ei_fax_t.

lwa_cvis_ei_cvi_fax-current_state = 'X'.

lwa_cvis_ei_cvi_communication-fax = lwa_cvis_ei_cvi_fax.

"contact Details

**lwa_cvis_ei_phone-task = 'U'.

**lwa_cvis_ei_phone-data-telephone = '515125'.

**lwa_cvis_ei_phone-datax-telephone = 'X'.

**"CALLER_NO

**lwa_cvis_ei_phone-data-caller_no = '885270482'.

**lwa_cvis_ei_phone-datax-caller_no = 'X'.

"Telephone and Mobile"

lwa_cvis_ei_phone-task = 'U'.

lwa_cvis_ei_phone-data-telephone = '69795'. "Telephone

lwa_cvis_ei_phone-data-caller_no  = '69793'.  "Mobile"

lwa_cvis_ei_phone-data-tel_no = '2525'.

lwa_cvis_ei_phone-datax-telephone = 'X'.

lwa_cvis_ei_phone-datax-caller_no  = 'X'.

lwa_cvis_ei_phone-datax-tel_no = 'X'.

lwa_cvis_ei_phone_str-contact = lwa_cvis_ei_phone.

APPEND lwa_cvis_ei_phone_str TO lwa_cvis_ei_phone_t.

lwa_cvis_ei_cvi_phone-phone = lwa_cvis_ei_phone_t.

lwa_cvis_ei_cvi_phone-current_state = 'X'.

lwa_cvis_ei_cvi_communication-phone = lwa_cvis_ei_cvi_phone.

"MailDetails

lwa_cvis_ei_smtp-task = 'U'.

lwa_cvis_ei_smtp-data-e_mail = 'pavan4@gmail.com'.

lwa_cvis_ei_smtp-datax-e_mail = 'X'.

lwa_cvis_ei_smtp_str-contact = lwa_cvis_ei_smtp.

APPEND lwa_cvis_ei_smtp_str TO lt_cvis_ei_smtp_t.

lwa_cvis_ei_cvi_smtp-smtp = lt_cvis_ei_smtp_t.

lwa_cvis_ei_cvi_smtp-current_state = 'X'.

lwa_cvis_ei_cvi_communication-smtp = lwa_cvis_ei_cvi_smtp.

lwa_cvis_ei_address1-communication = lwa_cvis_ei_cvi_communication.

lwa_cvis_ei_address1-task = 'U'.

lwa_vmds_ei_central_data-address = lwa_cvis_ei_address1.

lwa_vmds_ei_extern-central_data = lwa_vmds_ei_central_data.

APPEND lwa_vmds_ei_extern TO lt_vmds_ei_extern_t.

is_master_data-vendors = lt_vmds_ei_extern_t.

CALL METHOD vmd_ei_api=>maintain_bapi

  EXPORTING

    iv_test_run              = space

    iv_collect_messages      = 'X'

    is_master_data           = is_master_data

  IMPORTING

    es_master_data_correct   = es_master_data_correct

    es_message_correct       = es_message_correct

    es_master_data_defective = es_master_data_defective

    es_message_defective     = es_message_defective.

IF es_message_correct IS INITIAL AND es_message_defective IS INITIAL.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

      wait   = 'X'

    IMPORTING

      return = lwa_return.

ENDIF.

0 Kudos

Any information please inform me.

0 Kudos

Hi ,

Please don't change any task indicators , I mentioned 'I' and you changed it to 'U' that's why you are facing issue.I developed code for Email as well as Telephone , don't change anything in the code ,use the code as it is and try to pass the required business data .

let me know still you are facing any issues. PFA.

Screen shot for your reference.

Likewise , you can update other fields.

Thanks.

0 Kudos

I need to update Mobile phone. Which field i am not able to update it. Telephone,

Fax and Email Working Address to working but Mobile number which field i am not able to guess.

I tried

lwa_cvis_ei_phone-data-caller_no  = '69793'.  "Mobile"

lwa_cvis_ei_phone-data-tel_no = '2525'.

But not working.Code is working no problem but mobile number problem

hope you understood.

0 Kudos

Hi,

use R_3_USER field to update mobile phone field (CVIS_EI_PHONE-DATA-R_3_USER) , check domain fixed values for understanding.

Thanks.

0 Kudos

Ok I will check it.

0 Kudos

Hi ,

Please find below code snippet to update mobile phone.

****Telephone.

lwa_cvis_ei_phone-task = 'I'.

lwa_cvis_ei_phone-data-telephone = '0123456789'.

lwa_cvis_ei_phone-data-r_3_user = '3'.

lwa_cvis_ei_phone-datax-telephone = 'X'.

lwa_cvis_ei_phone-datax-r_3_user = 'X'.

lwa_cvis_ei_phone_str-contact = lwa_cvis_ei_phone.

0 Kudos

But i need both,

Telephone number and Mobile number i am trying like below. Not updating both Mobile number updating.

lwa_cvis_ei_phone-task = 'I'.

lwa_cvis_ei_phone-data-telephone = '040-23252'. "Telephone

lwa_cvis_ei_phone-data-caller_no  = '8988270482'"Mobile"

*lwa_cvis_ei_phone-data-tel_no = '3131'.

lwa_cvis_ei_phone-data-r_3_user = '2'.

"lwa_cvis_ei_phone-

lwa_cvis_ei_phone-datax-telephone = 'X'.

lwa_cvis_ei_phone-datax-caller_no  = 'X'.

*lwa_cvis_ei_phone-datax-tel_no = 'X'.

lwa_cvis_ei_phone-datax-r_3_user = 'X'.


0 Kudos

Hi,

Use below code.

****Telephone.

lwa_cvis_ei_phone-task = 'I'.

lwa_cvis_ei_phone-data-telephone = '0123456789'.

lwa_cvis_ei_phone-datax-telephone = 'X'.

lwa_cvis_ei_phone_str-contact = lwa_cvis_ei_phone.

APPEND lwa_cvis_ei_phone_str TO lt_cvis_ei_phone_t .

CLEAR : lwa_cvis_ei_phone_str,lwa_cvis_ei_phone.

****Mobile

lwa_cvis_ei_phone-task = 'I'.

lwa_cvis_ei_phone-data-telephone = '9999999999'.

lwa_cvis_ei_phone-data-r_3_user = '3'.

lwa_cvis_ei_phone-datax-telephone = 'X'.

lwa_cvis_ei_phone-datax-r_3_user = 'X'.

lwa_cvis_ei_phone_str-contact = lwa_cvis_ei_phone.

APPEND lwa_cvis_ei_phone_str TO lt_cvis_ei_phone_t .

0 Kudos

I will check it.

0 Kudos

Hi ,

If your question has been answered , mark the same.So that It will be helpful for others who are facing the same problem.

BR

Pavan.

0 Kudos

Definitely, I will close the post, No doubt, give me some time.

0 Kudos

Small question .

I was thought mobile no as  either Caller_no or Tel_no Field in the Structure, so  i never cared about

Telephone no

I always imagined

Telephone = Telehpone

mobileno   = Callter_no or Tele_no

lwa_cvis_ei_phone-data-caller_no  = '8988270482'. "Mobile"

*lwa_cvis_ei_phone-data-tel_no = '3131'.



How did you imagine  Telephone as mobile number

lwa_cvis_ei_phone-data-telephone = '0123456789'.


Hope you understood my question.

0 Kudos

Hi ,

you should go through all the related fields and their description properly ,read

the description of the field R_3_USER (Indicator: Telephone is a Mobile Telephone),hope you got your answer .

0 Kudos

Ok, Thank you Closing the post.