cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in uploading Vendor Email through FK01/FK02

ritesh_dugad2
Active Participant
0 Kudos
322

Hello,

I have to upload vendor master. Everything gets uploaded except the email of the vendor. I have tried several ways: Bapi's, Recording, LSMW etc but nothing seems to be working. Please let me know how to upload the email address of the vendor.

Regards

Ritesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

goto LSMW recording method, when you enter the vendor number in the same screen you have check box like ---> Use central address management once tick this check box then only you find the email field in next screen...

Answers (2)

Answers (2)

ritesh_dugad2
Active Participant
0 Kudos

Dear,

Solved the problem. Below is a sample code.

REPORT z_vendor_email_upload LINE-SIZE 170.

PARAMETERS: obj_id LIKE bapi4001_1-objkey DEFAULT '0000101625'.

PARAMETERS: e_mail LIKE bapiadsmtp-e_mail.

DATA: iad1vl TYPE bapiad1vl OCCURS 0 WITH HEADER LINE.

DATA: iadsmtp TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE.

DATA: ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE.

DATA: adrnr LIKE bapi4001_1-addr_no.

START-OF-SELECTION.

IF e_mail CA '@'.

REFRESH iad1vl. CLEAR iad1vl.

iad1vl-name = 'XYZ'.

iad1vl-name_2 = ABC'.

iad1vl-sort1 = 'XZ'.

iad1vl-country = 'SG'.

iad1vl-langu = 'EN'.

APPEND iad1vl. CLEAR iad1vl.

REFRESH iadsmtp. CLEAR iadsmtp.

iadsmtp-e_mail = e_mail.

APPEND iadsmtp. CLEAR iadsmtp.

REFRESH ret. CLEAR ret.

CALL FUNCTION 'BAPI_ADDRESSORG_SAVEREPLICA'

EXPORTING

obj_type = 'LFA1'

obj_id = obj_id

  • OBJ_ID_EXT = ' '

context = '0001'

  • IV_CHECK_ADDRESS = 'X'

  • IV_TIME_DEPENDENT_COMM_DATA = ' '

IMPORTING

return = ret

address_number = adrnr

TABLES

bapiad1vl = iad1vl

  • BAPIADTEL =

  • BAPIADFAX =

  • BAPIADTTX =

  • BAPIADTLX =

bapiadsmtp = iadsmtp.

  • BAPIADRML =

  • BAPIADX400 =

  • BAPIADRFC =

  • BAPIADPRT =

  • BAPIADSSF =

  • BAPIADURI =

  • BAPIADPAG =

  • BAPIAD_REM =

  • BAPICOMREM =

  • BAPIADUSE =

IF ret-type NE 'E'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

IF sy-subrc = 0.

WRITE: /'Email Updated'.

ENDIF.

ELSE.

WRITE: / ret-type, ret-message, ret-message_v1, ret-message_v2.

ENDIF.

ELSE.

WRITE: /'Check Email Address. It is not correct'.

ENDIF.

Former Member
0 Kudos

Hi,

I tried BDC and CATT, there was no problem.

the mail field has some limits:

1. length 241 (wether your data filled with space?)

2. must be a email format

I guess you should give more detail info so that we can solve it.