Application Development and Automation 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: 
Read only

ADDR_COMM_MAINTAIN FM ERROR

4,040

Hi All,

update the email address through EXCEL FILE in ADR6 table based on the LFA1-LIFNR (vendor number) - LFA1-ADRNR (Address number)

(BAPI) use the FM ADDR_COMM_MAINTAIN and FM ADDR_SINGLE_SAVE but this FM doesn't work its through error like parameters_error in sy-subrc = 1.

so anyone's tell how to use these function module for upload the data in the table.

as soon as possible .

Thanks All.

Hi All,

update the email address through EXCEL FILE in ADR6 table based on the LFA1-LIFNR (vendor number) - LFA1-ADRNR (Address number)

(BAPI) use the FM ADDR_COMM_MAINTAIN and FM ADDR_SINGLE_SAVE but this FM doesn't work its through error like parameters_error in sy-subrc = 1.

so anyone's tell how to use these function module for upload the data in the table.

as soon as possible .

Thanks All.

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
3,478

Please provide a minimal reproducible example so that we can tell you where you're wrong.

NB: sy-subrc = 1 is meaningless information, what is important is the exception name (PARAMETERS_ERROR). Often, the exception is sent with a message number (SY-MSGNO, SY-MSGID).

Read only

aoyang
Contributor
3,478

Hi, BAPI_ADDRESSORG_CHANGE worked for me . Please refer to below sample code. After the commit, you should see SMTP_ADDR and SMTP_SRCH in ADR6 have changed.

Otherwise please let me know what you get in the return message of BAPI_ADDRESSORG_CHANGE.

<Post was moderated>

DATA:<br>LT_BAPIADSMTP TYPE TABLE OF BAPIADSMTP,<br>LW_BAPIADSMTP LIKE LINE OF LT_BAPIADSMTP,<br>LT_BAPIADSMT_X TYPE TABLE OF BAPIADSMTX,<br>LW_BAPIADSMT_X LIKE LINE OF LT_BAPIADSMT_X,<br>LV_ADDRNO LIKE BAPI4001_1-ADDR_NO,<br>RETURNS TYPE TABLE OF BAPIRET2.<br><br>LW_BAPIADSMTP-STD_NO = 'X'.<br>LW_BAPIADSMTP-E_MAIL = '[email protected]'.<br>LW_BAPIADSMTP-EMAIL_SRCH = '[email protected]'.<br>APPEND LW_BAPIADSMTP TO LT_BAPIADSMTP.<br><br>LW_BAPIADSMT_X-UPDATEFLAG = 'U'.   "I=Insert, U=Update D=Delete<br>LW_BAPIADSMT_X-E_MAIL     = 'X'.<br>LW_BAPIADSMT_X-EMAIL_SRCH = 'X'.<br>APPEND LW_BAPIADSMT_X TO LT_BAPIADSMT_X.<br><br>CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'<br>  EXPORTING<br>    OBJ_TYPE             = 'LFA1'<br>    OBJ_ID               = 'VE101'  "Your vendor number<br>IMPORTING<br>   ADDRESS_NUMBER       = LV_ADDRNO<br>TABLES<br>   BAPIADSMTP           = LT_BAPIADSMTP<br>   BAPIADSMT_X          = LT_BAPIADSMT_X<br>   RETURN               = RETURNS.<br><br> IF SY-SUBRC <> 0.<br>   ROLLBACK WORK.<br> ELSE.<br>   COMMIT WORK AND WAIT.<br> ENDIF.<br>