LSMW - Examples
Project: PROJECT00 LSMW examples
Subproject:ACCOUNTING Subproject 1 - Accounting
Object: ADDRESS customer address
Data transfer program: BUS4001 (BAPI)
Data transfer method: - SAVEREPLICA
Source structures
LEGACYDATA_ADDRESS - Address data from legacy system
Target struct.
E1ADRMAS - Header segment
E1BPAD1VL - Address distribution BAPI structure
E1BPAD1VL1 - Address distribution BAPI structure
E1BPADTEL - BAPI structure for telephone numbers (central address mgt)
E1BPADFAX - BAPI structure for fax numbers (central address management)
Structure relations
E1ADRMAS <=== LEGACYDATA_ADDRESS
E1BPAD1VL <=== LEGACYDATA_ADDRESS
E1BPAD1VL1 <=== LEGACYDATA_ADDRESS
E1BPADTEL <=== LEGACYDATA_ADDRESS
E1BPADFAX <=== LEGACYDATA_ADDRESS
Source fields
LEGACYDATA_ADDRESS - Address data from legacy system
RECORDTYPERECORDTYPE Type:C Lgth:001 Position:0001
CUSTOMERNO Number identifying a customer Type:C Lgth:010 Position:0002
NAME Company name Type:C Lgth:040 Position:0003
STREET Street name and house number Type:C Lgth:040 Position:0004
CITY Name of the company´s location Type:C Lgth:040 Position:0005
POSTALCODE Postal code Type:C Lgth:010 Position:0006
COUNTRY Country ID Type:C Lgth:002 Position:0007
LANGUAGE Language Type:C Lgth:002 Position:0008
TELNUMBER Telephone number Type:C Lgth:030 Position:0009
FAXNUMBER Fax machine number Type:C Lgth:030 Position:0010
UIN VAT registration number Type:C Lgth:015 Position:0011
Target fields
E1ADRMAS - Header segment
OBJ_TYPE Address owner object type Type: CHAR Lgth: 010
OBJ_ID Address owner object ID Type: CHAR Lgth: 070
OBJ_ID_EXT Object key Type: CHAR Lgth: 070
CONTEXT Semantic description of an object address Type: NUMC Lgth: 004
E1BPAD1VL - Address distribution BAPI structure
ADDR_VERS International address version ID Type: CHAR Lgth: 001
FROM_DATE Date valid from Type: DATS Lgth: 008
TO_DATE Valid-to date Type: DATS Lgth: 008
TITLE Title key Type: CHAR Lgth: 004
NAME Name 1 Type: CHAR Lgth: 040
NAME_2 Name 2 Type: CHAR Lgth: 040
NAME_3 Name 3 Type: CHAR Lgth: 040
NAME_4 Name 4 Type: CHAR Lgth: 040
CONV_NAME Converted name field (with form of address) Type: CHAR Lgth: 050
C_O_NAME c/o name Type: CHAR Lgth: 040
CITY City Type: CHAR Lgth: 040
DISTRICT District Type: CHAR Lgth: 040
CITY_NO City code for city/street file Type: CHAR Lgth: 012
DISTRCT_NO District code for City and Street file Type: CHAR Lgth: 008
CHCKSTATUS City file test status Type: CHAR Lgth: 001
REGIOGROUP Regional structure grouping Type: CHAR Lgth: 008
POSTL_COD1 City postal code Type: CHAR Lgth: 010
POSTL_COD2 PO Box postal code Type: CHAR Lgth: 010
POSTL_COD3 Company postal code (for large customers) Type: CHAR Lgth: 010
PCODE1_EXT City postal code extension, Type: CHAR Lgth: 010
PCODE2_EXT PO Box postal code extension, Type: CHAR Lgth: 010
PCODE3_EXT Major cust. postal code ext., Type: CHAR Lgth: 010
PO_BOX PO Box Type: CHAR Lgth: 010
PO_W_O_NO Flag: PO Box without number Type: CHAR Lgth: 001
PO_BOX_CIT PO Box city Type: CHAR Lgth: 040
PBOXCIT_NO City PO box code (City file) Type: CHAR Lgth: 012
PO_BOX_REG Region for PO Box (Country, State, ...) Type: CHAR Lgth: 003
POBOX_CTRY PO box country Type: CHAR Lgth: 003
PO_CTRYISO Country ISO code Type: CHAR Lgth: 002
DELIV_DIS Post delivery district Type: CHAR Lgth: 015
TRANSPZONE Transportation zone Type: CHAR Lgth: 010
STREET Street Type: CHAR Lgth: 060
STREET_NO Street code for city/street file Type: CHAR Lgth: 012
STR_ABBR Abbreviation of street name (e.g in Spain) Type: CHAR Lgth: 002
HOUSE_NO House number Type: CHAR Lgth: 010
HOUSE_NO2 House number supplement Type: CHAR Lgth: 010
HOUSE_NO3 House number range Type: CHAR Lgth: 010
STR_SUPPL1 Street 2 Type: CHAR Lgth: 040
STR_SUPPL2 Street 3 Type: CHAR Lgth: 040
STR_SUPPL3 Street 4 Type: CHAR Lgth: 040
LOCATION Street 5 Type: CHAR Lgth: 040
BUILDING Building (number or code) Type: CHAR Lgth: 020
FLOOR Floor in building Type: CHAR Lgth: 010
ROOM_NO Room or appartment number Type: CHAR Lgth: 010
COUNTRY Country key Type: CHAR Lgth: 003
COUNTRYISO Country ISO code Type: CHAR Lgth: 002
LANGU Language Key Type: LANG Lgth: 001
LANGU_ISO Language according to ISO 639 Type: CHAR Lgth: 002
REGION Region (State, Province, County) Type: CHAR Lgth: 003
SORT1 Search term 1 Type: CHAR Lgth: 020
SORT2 Search term 2 Type: CHAR Lgth: 020
EXTENS_1 Extension (only for data conversion) Type: CHAR Lgth: 040
EXTENS_2 Extension (only for data conversion) Type: CHAR Lgth: 040
TIME_ZONE Address time zone Type: CHAR Lgth: 006
TAXJURCODE Tax jurisdiction code Type: CHAR Lgth: 015
E1BPAD1VL1 - Address distribution BAPI structure
ADDRESS_ID Physical address ID Type: CHAR Lgth: 010
LANGU_CR Address record creation original language Type: LANG Lgth: 001
LANGUCRISO Language according to ISO 639 Type: CHAR Lgth: 002
COMM_TYPE Communication type (key) Type: CHAR Lgth: 003
ADDR_GROUP Address group (key) Type: CHAR Lgth: 004
HOME_CITY City (different from postal city) Type: CHAR Lgth: 040
HOMECITYNO Different city for city/street file Type: CHAR Lgth: 012
E1BPADTEL - BAPI structure for telephone numbers (central address mgt)
COUNTRY Country for telephone/fax number Type: CHAR Lgth: 003
COUNTRYISO Country ISO code Type: CHAR Lgth: 002
STD_NO Flag: this number is the default number Type: CHAR Lgth: 001
TELEPHONE Telephone no.: dialling code+number Type: CHAR Lgth: 030
EXTENSION Telephone no.: Extension Type: CHAR Lgth: 010
TEL_NO Complete number: code+number+extension Type: CHAR Lgth: 030
CALLER_NO Telephone number for determining caller Type: CHAR Lgth: 030
STD_RECIP Flag: Recipient is standard recipient Type: CHAR Lgth: 001
R_3_USER Flag: connected to R/3 Type: CHAR Lgth: 001
HOME_FLAG Flag: home address Type: CHAR Lgth: 001
CONSNUMBER Sequence number Type: NUMC Lgth: 003
E1BPADFAX - BAPI structure for fax numbers (central address management)
COUNTRY Country for telephone/fax number Type: CHAR Lgth: 003
COUNTRYISO Country ISO code Type: CHAR Lgth: 002
STD_NO Flag: this number is the default number Type: CHAR Lgth: 001
FAX Fax number: dialling code+number Type: CHAR Lgth: 030
EXTENSION Fax no.: Extension Type: CHAR Lgth: 010
FAX_NO Complete number: code+number+extension Type: CHAR Lgth: 030
SENDER_NO Fax number for finding sender Type: CHAR Lgth: 030
FAX_GROUP Fax group (G3, G4, ...) Type: CHAR Lgth: 001
STD_RECIP Flag: standard recipient for this number Type: CHAR Lgth: 001
R_3_USER Flag: connected to R/3 Type: CHAR Lgth: 001
HOME_FLAG Flag: home address Type: CHAR Lgth: 001
CONSNUMBER Sequence number Type: NUMC Lgth: 003
Fieldmapping
All fields not listed of the R/3 structures keep their initial values.
Struct.: E1ADRMAS
__BEGIN_OF_RECORD__
g_edidd_segnam = 'E2ADRMAS000'.
g_edidd_segnum = '0001'.
g_edidd_psgnum = '000000'.
g_edidd_hlevel = '01'.
clear E1ADRMAS.
E1ADRMAS-OBJ_TYPE
Rule type: Constant
E1ADRMAS-OBJ_TYPE = 'KNA1'.
E1ADRMAS-OBJ_ID_EXT
Rule type: Constant
E1ADRMAS-OBJ_ID_EXT = '1'.
E1ADRMAS-CONTEXT
Rule type: Constant
E1ADRMAS-CONTEXT = '1'.
__END_OF_RECORD__
transfer_record.
Struct.: E1BPAD1VL
__BEGIN_OF_RECORD__
g_edidd_segnam = 'E2BPAD1VL000'.
g_edidd_segnum = '0002'.
g_edidd_psgnum = '000001'.
g_edidd_hlevel = '02'.
clear E1BPAD1VL.
E1BPAD1VL-FROM_DATE
Rule type: ABAP Coding
E1BPAD1VL-FROM_DATE = syst-cdate.
E1BPAD1VL-TO_DATE
Rule type: Constant
E1BPAD1VL-TO_DATE = '31129999'.
E1BPAD1VL-NAME <=== LEGACYDATA_ADDRESS-NAME
Rule type: Transfer (MOVE)
E1BPAD1VL-NAME = LEGACYDATA_ADDRESS-NAME.
E1BPAD1VL-CITY <=== LEGACYDATA_ADDRESS-CITY
Rule type: Transfer (MOVE)
E1BPAD1VL-CITY = LEGACYDATA_ADDRESS-CITY.
E1BPAD1VL-POSTL_COD1 <=== LEGACYDATA_ADDRESS-POSTALCODE
Rule type: Transfer (MOVE)
E1BPAD1VL-POSTL_COD1 = LEGACYDATA_ADDRESS-POSTALCODE.
E1BPAD1VL-STREET <=== LEGACYDATA_ADDRESS-STREET
Rule type: Transfer (MOVE)
E1BPAD1VL-STREET = LEGACYDATA_ADDRESS-STREET.
E1BPAD1VL-STREET_NO <=== LEGACYDATA_ADDRESS-STREET
Rule type: Transfer (MOVE)
E1BPAD1VL-STREET_NO = LEGACYDATA_ADDRESS-STREET.
* Attention: Source field is longer than target field!
E1BPAD1VL-HOUSE_NO <=== LEGACYDATA_ADDRESS-STREET
Rule type: Transfer (MOVE)
E1BPAD1VL-HOUSE_NO = LEGACYDATA_ADDRESS-STREET.
* Attention: Source field is longer than target field!
E1BPAD1VL-COUNTRY <=== LEGACYDATA_ADDRESS-COUNTRY
Rule type: Transfer (MOVE)
E1BPAD1VL-COUNTRY = LEGACYDATA_ADDRESS-COUNTRY.
E1BPAD1VL-COUNTRYISO <=== LEGACYDATA_ADDRESS-COUNTRY
Rule type: Transfer (MOVE)
E1BPAD1VL-COUNTRYISO = LEGACYDATA_ADDRESS-COUNTRY.
E1BPAD1VL-LANGU <=== LEGACYDATA_ADDRESS-LANGUAGE
Rule type: Transfer (MOVE)
E1BPAD1VL-LANGU = LEGACYDATA_ADDRESS-LANGUAGE.
* Attention: Source field is longer than target field!
E1BPAD1VL-TAXJURCODE <=== LEGACYDATA_ADDRESS-UIN
Rule type: Transfer (MOVE)
E1BPAD1VL-TAXJURCODE = LEGACYDATA_ADDRESS-UIN.
__END_OF_RECORD__
transfer_record.
Struct.: E1BPAD1VL1
__BEGIN_OF_RECORD__
g_edidd_segnam = 'E2BPAD1VL1001'.
g_edidd_segnum = '0003'.
g_edidd_psgnum = '000002'.
g_edidd_hlevel = '03'.
clear E1BPAD1VL1.
E1BPAD1VL1-ADDR_GROUP
Rule type: Constant
E1BPAD1VL1-ADDR_GROUP = 'BP'.
__END_OF_RECORD__
transfer_record.
Struct.: E1BPADTEL
__BEGIN_OF_RECORD__
g_edidd_segnam = 'E2BPADTEL001'.
g_edidd_segnum = '0004'.
g_edidd_psgnum = '000001'.
g_edidd_hlevel = '02'.
clear E1BPADTEL.
E1BPADTEL-COUNTRYISO <=== LEGACYDATA_ADDRESS-COUNTRY
Rule type: Transfer (MOVE)
E1BPADTEL-COUNTRYISO = LEGACYDATA_ADDRESS-COUNTRY.
E1BPADTEL-TELEPHONE <=== LEGACYDATA_ADDRESS-TELNUMBER
Rule type: Transfer (MOVE)
E1BPADTEL-TELEPHONE = LEGACYDATA_ADDRESS-TELNUMBER.
E1BPADTEL-EXTENSION <=== LEGACYDATA_ADDRESS-TELNUMBER
Rule type: Transfer (MOVE)
E1BPADTEL-EXTENSION = LEGACYDATA_ADDRESS-TELNUMBER.
* Attention: Source field is longer than target field!
E1BPADTEL-TEL_NO <=== LEGACYDATA_ADDRESS-TELNUMBER
Rule type: Transfer (MOVE)
E1BPADTEL-TEL_NO = LEGACYDATA_ADDRESS-TELNUMBER.
__END_OF_RECORD__
transfer_record.
Struct.: E1BPADFAX
__BEGIN_OF_RECORD__
g_edidd_segnam = 'E2BPADFAX001'.
g_edidd_segnum = '0005'.
g_edidd_psgnum = '000001'.
g_edidd_hlevel = '02'.
clear E1BPADFAX.
E1BPADFAX-FAX <=== LEGACYDATA_ADDRESS-FAXNUMBER
Rule type: Transfer (MOVE)
E1BPADFAX-FAX = LEGACYDATA_ADDRESS-FAXNUMBER.
E1BPADFAX-EXTENSION <=== LEGACYDATA_ADDRESS-FAXNUMBER
Rule type: Transfer (MOVE)
E1BPADFAX-EXTENSION = LEGACYDATA_ADDRESS-FAXNUMBER.
* Attention: Source field is longer than target field!
__END_OF_RECORD__
transfer_record.
__END_OF_TRANSACTION__
transfer_transaction.
PM.11.jj - 1 -