IF sy-subrc IS INITIAL.
name1 = sadr-name1.
name2 = sadr-name2.
ENDIF.
ADDR_COMM_GET - Get communication data for address number.
Possible TABLE_TYPE:
ADTEL, ADFAX, ADTTX, ADTLX, ADSMTP, ADRML, ADX400, ADRFC, ADPRT, ADSSF, ADURI, ADPAG
ADDRESS_INTO_PRINTFORM - Address format according to Post Office guidelines.
Note. It's enough to import two parameters:
- ADDRESS_TYPE = 1 (Firm or Organization, SAP Address)
- ADDRESS_NUMBER
ADDRESS_SHOW_PRINTFORM - Formats an address for printing.
see tables:
ADRC - Addresses (central address admin.)
BAPI_ADDRESSORG_CHANGE - BAPI to change organization addresses
The organization address is determined from the specified object type and object key, and updated with the specified address and communication data, if required.
This module differs from a standard change BAPI in that not only can existing entries be changed, but address attribute telephone numbers, fax numbers, etc. can also be deleted or inserted.
Reference structures (checkboxes) are used to select entries to be changed.
Code:
* Change an organization address:
* Change, delete and add a telephone number
DATA: objtype LIKE bapi4001_1-objtype,
obj_id LIKE bapi4001_1-objkey,
obj_id_ext LIKE bapi4001_1-extension,
context LIKE bapi4001_1-context,
address_number LIKE adrc-addrnumber,
bapiadtel LIKE bapiadtel OCCURS 0 WITH HEADER LINE,
bapiadtel_x LIKE bapiadtelx OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0.
* Assign the following object type and object key to a main customer
* address
objtype = 'KNA1'.
obj_id = <customer number>.
obj_id_ext = ' '.
context = '0001'.
* Get existing data by calling, e.g. FM 'BAPI_ADDRESSORG_GETDETAIL'
...
* Enter the reference structure data
* The telephone number with serial number '002' is to be deleted and
* the one with serial number '003' updated
* Errors and warnings are in the RETURN table. If successful, the
* organization address and its communication data are now updated
* in the system.
* The adress number is in the ADDRESS_NUMBER field.
BAPI_ADDRESSORG_GETDETAIL - BAPI to read organization addresses
The address data of the organization address for the specified object type and key is returned.
The address number used in the current system is also returned.
Code:
REPORT zprueba.
data: l_objtype like BAPI4001_1-OBJTYPE,
l_objid like BAPI4001_1-OBJKEY,
l_addrno LIKE BAPI4001_1-ADDR_NO,
t_bapiad1vl type standard table of BAPIAD1VL,
w_bapiad1vl type BAPIAD1VL,
t_bapiad1vl_x type standard table of BAPIAD1VLX,
w_bapiad1vl_x type BAPIAD1VLX,
t_bapiret type standard table of BAPIRET2,
w_bapiret type BAPIRET2.
read table t_bapiad1vl index 1 into w_bapiad1vl.
w_bapiad1vl-STR_SUPPL1 = 'CALLE NUMERO 2'.
w_bapiad1vl-STR_SUPPL2 = 'CALLE NUMERO 3'.
w_bapiad1vl-STR_SUPPL3 = 'CALLE NUMERO 4'.
modify t_bapiad1vl from w_bapiad1vl index 1.
check t_bapiret[] is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = w_bapiret.
ADDR_GET_COMPLETE - The function module gets all addresses for an address number or address handle, including all their communication types and notes about the address or communication type.
The currently valid communication types are defined in the table TSAC(T).
Code:
REPORT zlistacli .
data: begin of i_listado occurs 10,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
email(70),
fax like ADFAX-FAX_NUMBER,
end of i_listado.
START-OF-SELECTION.
TABLES: ADDR1_SEL, KNA1.
TYPE-POOLS: SZADR.
DATA: addr1_complete TYPE szadr_addr1_complete.
DATA: adsmtp_line TYPE szadr_adsmtp_line,
addr1_line TYPE szadr_addr1_line,
adtel_line TYPE szadr_adtel_line,
adfax_line TYPE szadr_adfax_line.
DATA: l_address_selection LIKE addr1_sel,
l_lfa1 LIKE lfa1.
IF sy-subrc = 0.
READ TABLE addr1_complete-addr1_tab INDEX 1 INTO addr1_line.
IF sy-subrc = 0.
loop at addr1_complete-adsmtp_tab into adsmtp_line.
i_listado-email = adsmtp_line-ADSMTP-SMTP_ADDR.
exit.
endloop.
loop at addr1_complete-adfax_tab INTO adfax_line.
i_listado-fax = adfax_line-ADFAX-FAX_NUMBER.
exit.
endloop.
ENDIF.
ENDIF.
append i_listado.
ENDSELECT.
ADDR_COMM_GET - Get Address-Independent Communication Data Records
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.