Professional Documents
Culture Documents
Bas ics Bas ics S tructure Definitions S tructure Definitions Field Mapping and Rules Field Mapping and Rules Reading and Trans ferring Data to R/3 Reading and Trans ferring Data to R/3
S AP AG 1999
Read data
C onvert data
Import data
Note:
Using the LSMW, you can read data from presentation servers (PC) or application servers. To read these files, you must define the structure of the file (source structure). The file contents are then read into an internal LSMW format and stored as an LSMW file. The next step is to define structure relationships and field assignments. These specify the mapping of the source structure fields to the target structure fields. In addition, you must define a conversion rule for every source field that maps to a field in the target structure. To do this, you specify how the value of the source structure field is to be transferred to the field in the target structure. Using these definitions, the contents of the LSMW file are converted to the target structure and can then be transferred using the specified transfer method. The LSMW generates two executable ABAP programs from the structure definitions and conversion rules.
L S MW organized by:
Project S ubproject Object
P roject S ubproject Object
You mus t s pecify a name and s hort des cription for eac h of thes e.
S AP AG 1999
Project Overview
All Objects
My Objects
S AP AG 1999
Define object attributes Define s ource s tructures and s ource fields Define s tructure relations hips Define field mapping and convers ion rules Read data Convert data Import data
S AP AG 1999
L S MW - Subs teps
LS M Workbench
E dit
...
E xtras
...
...
Utilities S ystem
P ersonal Menu The available LS MW s ubs teps can be activated via the Pers onal Menu
Maintain source attributes Maintain source structures Maintain source fields Maintain structure relationships F ixed values, maintain conversions and own routines S pecfiy files Generate import program Display import program Import data Display imported data Generate conversion program Display conversion program C onvert data Display converted data ...
S AP AG 1999
Attributes Object Owner Data transfer BC420_ D R OBE R TS once E xample J essica R oberts periodic
S AP AG 1999
...
Object Overview
S ource s tructures S ource fields S tructure relations hips Target s tructures Target fields Field mapping
S AP AG 1999
E XCE L Lis t
S AP Fields
Field S TY P E TC ODE KUNNR B UKR S Des cription R ecord type Transaction code C ustomer number C ompany code Type C HAR C HAR C HAR C HAR Length Field 1 20 10 4
Non-SAP Fields
Length Convers ion .........
a3ktn2
10
S AP AG 1999
L S MW Structure Definitions
Bas ics Bas ics S tructure Definitions S tructure Definitions Field Mapping and Rules Field Mapping and Rules Reading and Trans ferring Data to R/3 Reading and Trans ferring Data to R/3
S AP AG 1999
S tructure A
Definition contains :
S AP AG 1999
Field 4
Definition contains :
S AP AG 1999
Field 2 Field 3
Field 4
Definition contains :
S AP AG 1999
S AP AG 1999
Source Fields HEAD SET1 REF_NO C(001) Record ID C(009) Reference number
:
POSI SET2 DATE C(001) Record ID DDMY(010) Posting date
:
S AP AG 1999
Field Types
Fields with alphanumeric contents (C field) Fields with numeric contents (N field) Date in date format (DDMY, DMDY, DYMD) => internal ABAP format YYYYMMDD Amount fields (AMT1, AMT2, AMT3, AMT4) => internal ABAP format with period as decimal point Fields with packed contents (PAC0 ......PAC5)
S AP AG 1999
B C S tructure relation
A Y
B Z C
Available fields
X Y Z
A A ^ B A ^ B ^ C
S AP AG 1999
Bas ics Bas ics S tructure Definitions S tructure Definitions Field Mapping and Rules Field Mapping and Rules Reading and Trans ferring Data to R/3 Reading and Trans ferring Data to R/3
S AP AG 1999
Field Information and convers ion rules Documentation Valid values Navigation in the ABAP Dictionary
Field mapping and rules BGR00 Fields BBKPF Fields BLDAT BUKRS Date Company code
S AP AG 1999
F ield Mapping
E dit
...
E xtras
...
...
Utilities S ystem
S AP E as y Acc es s
Determine Display Variant Other parameters , s uch as the LS MW Technic al fields can be dis played from the dis play variant. Technical fields Initial fields Code Global data definitions Proces s ing times Form routines (ABAP s ubprograms )
S AP AG 1999
After s elec ting the c hec kbox , the tec hnical fields of s truc ture BGR00 (s es s ion header record) are vis ible
Field Mapping and Assignment BGR00 Fields STYPE Coding: GROUP Coding: MANDT Coding: USNAM ... Coding: Record type for BI interface BGR00-STYPE = 0. Name of BI session BGR00-GROUP = g_groupname. Client BGR00-MANDT = SY_MANDT. Queue Userid / historically determined BGR00-USNAM = g_userid.
S AP AG 2001
Rule levels Domain level Data element level Field (name) level
Project
S ys tem propos al
S equence
1. As s ignment of s ource field to target field 2. Definition of convers ion rule
2.
1.
S AP AG 1999
Attribute
Company code
0001 0001
S AP AG 1999
Attribute
S MITH
S MITH
E xceptions :
As o Ver f L S MW s io n 1.7
S AP AG 1999
Attribute
BUKRS
0001
F ixed value
Fixed Value
Attributes
Attributes
S AP AG 1999
S ource field / target field Control 1:1 trans lation values Interval trans lation values
BS CHL = ???
Double-click
S AP AG 1999
BS CHL = ???
Variants
Variant
1:1 translation Interval translation Initial value C onstant Transfer (MOVE ) User-defined routine No action
Other
New Value 40 50
OK
S AP AG 1999
New value 40 50
OK
S AP AG 1999
Rule: Prefix
Attribute
S tring operation
10 + ... =
Prefix
10
10 + 1104
101104
S uffix
00
1104
+ 00
110400
Rule: C oncatenation
Attribute
... + ... =
Plant
+ A_ 2311
+ .....
Plant A_ 2311
Important: All s ource fields involved in the concatenation mus t be previous ly as s igned to the s ame target field.
S AP AG 1999
Information E xample:
Information
S AP AG 1999
Attribute
ABAP
1234400
221555
S AP AG 1999
Attribute
Include s ubprograms
GS BE R
ENDFORM.
S AP AG 2001
Reusable rules BC420-TEST Training data transfer BC420 Fixed values BLART Conversions BLART BSCHL User-defined routines
S AP AG 1999
Bas ics Bas ics S tructure Definitions S tructure Definitions Field Mapping and Rules Field Mapping and Rules Reading and Trans ferring Data to R/3 Reading and Trans ferring Data to R/3
S AP AG 1999
S pecifying Files
Work S teps
S pecify files
File name
S AP AG 1999
File
S AP AG 1999
Determine path and file name for objects that only have a phys ical path/file name.
File BC420_ 46_ D_ CT_ 01.ls mw.conv
S AP AG 2001
doc_ *.leg
S AP AG 1999
As s igning Files
Work S teps
Object attributes
HEAD POSI
Source structures and files HEAD documents source data BC420_DOC_HEAD_POS.LEG POSI position source data BC420_DOC_HEAD_POS.LEG
S AP AG 1999
Importing Data
Work S teps
Import data
S pecify which data is to be imported
Amount fields -> 1234.56 Date values -> YYYYMMDD
Amount fields Amount fields are converted into the internal ABAP format (with decimal point), if checkbox is selected
Date values Date fields are converted into the internal ABAP format (Y Y Y Y MMDD), if checkbox is selected
S AP AG 1999
1 DOCUMENTS HEAD 1POSI HEAD 2 DOCUMENTS POSI 3 2POSI POSI 4 3POSI POSI 5 4DOCUMENTS HEAD HEAD DOCUMENTS 6 5POSI POSI 7 6POSI POSI 8 7POSI 8 POSI
HBC100000119990730 07 07 31.07.199930.07.1999DM HBC100000119990730 3107199930071999DM HBC100000119990730 07 07 31.07.199930.07.1999DM 1 HBC100000119990730 P0004S100000 3410.50 3107199930071999DM 1740.89 Info P0004S100000 3410.50 1740.89 Info P0005H113100 3005.50 1536.41 Info 2 1 P0005H113100 3005.50 1536.41 Info P0005S110000 405 204.48 Info 3 2 P0005S110000 405 204.48 Info 3 HBC100000219990730 07 07 31.07.199930.07.1999$ HBC100000219990730 3107199930071999$ HBC100000219990730 07 07 31.07.199930.07.1999$ 1 HBC100000219990730 P0004S100000 3420.50 3107199930071999$ 3206.89 Info P0004S100000 3420.50 3206.89 Info P0005H113100name 3010.50 text 2830.77 Field value 2 1 Info Field Field P0005H113100 2830.77 Field Info 3 2 Info Field Field value P0005S110000 name 3010.50 text 376.12 410 Record indicator SET1 H P0005S110000 410 Record indicator 376.12 Info 3 SET1 H REF_NO Reference number BC1000001 REF_NO Reference BC1000001 DOC_DATE Doc. date number 30071999 DOC_DATE Doc. 30071999 TYPE TYPE date 07 TYPE TYPE 07 CURR_KEY document currency DM CURR_KEY document currency DM
S AP AG 1999
C onverting Data
Work S teps
Note:
Amount fields (AMT1...) for s tandard trans fer programs are formatted according to us er-defined s ettings . Date fields are NOT formatted in the LS MW vers ion < 1.7 they are always dis played in format YYYYMMDD
Convert data
Field as s ignment
S AP AG 1999
Work S teps
By record By field
0KNA1_A 1FB01 2BBSEG 2BBSEG 2BBSEG 1FB01 2BBSEG 2BBSEG 2BBSEG 100ROBERTS / 30071999SA0001/ / DEM 40/ // 50/ // 50/ // 30071999SA0001/ / USD 40/ // Field 50/ Field text // STYPE 50/ Record type // TCODE Transaction code BLDAT Date BLART Document type BUKRS Company code BUDAT Date WAERS Currency key
1 2 3 4 5 6 7 8 9
S AP AG 1999
Project
E xport / Import
S AP AG 1999
Authorizations
S AP AG 1999
Direct Input
Batch Input
12
99
E DI
BAPI 11 12
10
Principles of Standard Data Tans fer DX Workbench
5 11
6 8 10 11 13
LS M Workbench
7 2 1
S AP AG 1999
14
TA Recorder
Notes:
An alternative to the batch input method is the direct input (DI) method. DI is more efficient than the other methods making it especially useful for transferring large datasets. Unlike batch input, no sessions are created the data is updated directly. No screens are involved in this procedure. The data is entered directly into database tables by calling function modules that carry out the necessary checks. If case errors occur during the data transfer, direct input has a restart mechanism. To enable restart, direct input programs must be processed as background jobs run under the direct input monitor (program RBMVSHOW or transaction BMV0). If you are working with test data, you can start direct input in foreground. Make sure that neither error logs are created nor that the possibility of a restart exists in error situations. SAP strongly recommends that you use transaction BMV0 for the actual data transfer.
Notes:
Direct input run: First create a variant for the transfer program. Define a job with this variant. Schedule the time of the job (start: immediately, date, time, by job, by event, etc). Analyze the job log after the job run. If the job is terminated, it can be reset. Note: The restart mechanism will not work if the file contains formal errors (i.e. if the records are not in the SAP Record Layout). Use the check file function to ensure that no formal errors exist before processing the file using direct input.
J ob Analys is
J ob administration Applications
Technical information
S ys tem mes s ages are lis ted chronologically Long text can be dis played
S AP AG 1999