Escolar Documentos
Profissional Documentos
Cultura Documentos
doc
SECOND DOCUMENT ITEM (input on the next screen) Posting key: 40 Account: 33300 Press Enter Amount: Press Save 12
LSMW Set up
Start the LSMW (Transaction LSMW) Create Project LSMW-xx - Description LSMW Demo Create SubProject SUBxx - Description First Subproject Create Object CTxx - Description FI Documents Call Transaction Maintain Object Attributes Standard Batch / Direct Input Object 100 Financial Documents Maintain Source Structures Create the structures GLHEADER and GLITEMS (below GLHEADER) Maintain Source Fields GLHEADER Name Description Length Type ID Record Type 1 C REF Reference Number 9 C DATE Document Date 10 DDMY TYPE Document Type 4 C CUR Currency Code 2 C
Value H
98011546.doc
GLITEMS Name Description ID Record Type KEY Posting Key ACCOUNT G/L Account Number AMOUNT Amount in Document Currency TEXT Item Text
Length 1 4 10 15 6
Type C C C AMT1 C
Value P
MAPPING
There are a large number of fields in the object definition! To save time, the following is the list of fields for which we need data. DOCUMENT HEADER Field Meaning Length BLART Document Type 2 BUKRS Company Code 4 BLDAT Document Date 8 WAERS Currency Code 5 BKTXT Document Text 25 DOCUMENT ITEM Field Meaning NEWBS Posting Key WRBTR Amount NEWKO G/L Account SGTXT Document Text Length 2 16 17 50
QUESTIONS What values did we use in the manual data of the transaction for these fields? Which source fields map to which target fields? Look at the source data which fields will need translating? What field(s) are not supplied in the source?
Structure Relations
Assign BGR00 and BBKPF to the Document Header Assign BBSEG to the Document Item
FIELD MAPPING
TARGET STRUCTURE BBKPF BBKPF BBKPF BBKPF BBKPF BBSEG BBSEG BBSEG BBSEG TARGET FIELD BLDAT BLART BUKRS WAERS BKTXT NEWBS WRBTR NEWKO SGTXT SOURCE STRUCTURE GLHEADER GLHEADER GLHEADER GLHEADER GLITEMS GLITEMS GLITEMS GLITEMS SOURCE FIELD DATE TYPE CUR REF KEY AMOUNT ACCOUNT TEXT REMARKS Assign the field as DDMMYYYY Translation needed Constant Value UKCC Translation needed
Translation needed
98011546.doc
ERROR HANDLING
There are at least 3 errors. A missing currency code in the translation table. A document with financial postings out of balance. JPY data being incorrectly formatted. These will all be fixed by setting up ABAP code in the Mapping Step Make the Processing Points and Global Data Definitions visible by choosing the menu option Extras > Display Variant and pick the correct options. MISSING CURRENCY CODE Following the translation of the currency code, test whether this has been successful by testing the value of the converted code. If this is still set to the No Data value (BGR00-NODATA usually /), then it has failed. Use skip_transaction to omit this data and write out a message. DOCUMENT OUT OF BALANCE Define a variable LIKE g_amount in _GLOBAL_DATA to be the net total of the document. For each document item, maintain the running net total from the amount. Test the converted posting key , if it is 50, then increment, otherwise decrement. At the processing point _END_OF_TRANSACTION, test the net total. If is not zero, use skip_transaction to omit this data and write out a message. This processing must be put before transfer_transaction. Dont forget to reset the net value for the next record! Note: SAVE the object following any global data definitions, otherwise the code blocks you write may not syntax check. CURRENCY FORMATTING Look at the code created to fill BBSEG-WRBTR. It will not work for currency codes such as JPY which have no decimal places. Can you think of a way to make this processing work for any (valid) currency code? Hint use the WRITE TO format with an addition. Having implemented and checked the code, rerun the LSMW from the convert step and confirm that the documents all post successfully.
98011546.doc
Then GO TO > RECORDINGS Create a recording name PHONE01 You will be recording transaction XD02 PLEASE NOTE THAT THE TRANSACTION LOOKS DIFFERENT THAN WHEN YOU RAN IT DIRECTLY THIS IS QUITE A COMMON FEATURE. Enter the customer number as above and check the Contact Persons Box Enter the surname of a contact in the Name box and press Enter, then select the top line, which will be your contact, press Partner Details to process the data, change the phone number and Save. You will have created the script of all the screens and fields that this transaction needs. The next stage is to assign field names to fields where you will be supplying data. Do this by positioning the cursor on the field and double clicking Field Suggested Name RF02D-KUNNR KUNNR Customer Number *KNVK-NAME1 SURNAME Surname KNVK-TELF1 PHONE New phone number Do not assign a field name to RF02D-D0360 this is the Customer Contact Check Box and will be the same for all records.
98011546.doc Step 2 Maintain Source Structures Create a structure suggested name PHONE_DATA Step 3 Maintain Source Fields Set up the structure all fields type C Field Length KUNNR 10 CUSTNAME 35 Customer Name this is for reference PARTNR 10 Partner Number this is for reference FIRST_NAME 35 Partner First Name this is for reference SUR_NAME 35 PHONE 16 Step 4 Maintain Structure Relations This is done for you, but SAVE. Step 5 Maintain Field Mapping and Conversion Rules Make the necessary mappings source to target. Step 6 Maintain Fixed Values Not necessary in this case because of the simplicity of the mapping Step 7 Specify Files Legacy Data On the PC Name : C:\TEMP\PHONES.TXT Tab delimited. Step 8 Assign Files This is done for you, but SAVE. Then work through the remaining steps, verifying the layout and mapping, process the batch input session.