Reply from jacobvv on Apr 17 at 10:20 PM LSMW not reading entire lines Scenario: The problem manifests itself already during the 'Read Data' phase, showing that some of your last columns of data are not read and don't appear in the file for the Imported Data. This problem can occur in the following circumstances: - In your file specification for you input files ('Specify Files' section) you have ticked the option 'Field Names at Start of Files' and you have not ticked the option 'Field Order Matches Source Structure Definition', and ... - Your input file contains extra columns with fieldnames that are to be ignored, and those columns are sitting in between the fieldnames that are to be used. This is not an unusual scenario: The first options allow you to keep the field names at the start of the input files (header row) and allow you change the sequence of the columns, without having to worry to match it exactly with the source file definition. The second bit occurs when you have extra data in your source file that you don't want to upload, but like to keep in the file for information. Typically these could be fields for comments or status management, or any other legacy data you have picked up, but don't want to upload. Cause The problem is caused by the program that generates the actual LSMW source code from the sections you have specified (Function '/SAPDMC/LSM_READPROG_GENERATE'), in combination with the length of your input file. The ABAP generator creates the definition of the input file, and to determine the length of the input records, it adds up the total length of all the input fields, plus adds the number of fields, plus an extra 10 as a buffer. Example: 12 input fields of 10 characters long each. Total file length is: 12 * 10 + 12 + 10 = 142 characters. If the actual lengths of the fieldnames are longer than the field lengths (in case you are using a lot of very small input fields) it uses that total instead, and still adds the number of fields plus 10. This is the size of the input file LSMW expects and reads. So if your input file contains a lot of extra columns in between the fields to be uploaded, chances are that the last fields are no longer read, simply because they don't fit in the input file definition. Solution You can easily circumvent this problem, now that you know the cause of the issue. You have 2 main options: - Move the columns that you don't want to upload to the end of the file, so the actual fields to be used are read properly and only the 'extra' fields are ignored during the reading, or... - Add a dummy field in your source file specification with a long length (200 char or so), which is not mapped to anything, but which substantially increases your generated file length, and can cope with your extra columns. Jacob
| | | ---------------Original Message--------------- From: Rob Catlin Sent: Tuesday, June 07, 2011 3:34 PM Subject: LSMW Not reading entire line in file I've been writing and using LSMW to do conversions for YEARS but at my current client I keep running into this issue: When I go to READ DATA, only part of each line comes in. So say I have 15 fields of 30 char apiece. Tab delimited. When I go to read data, I maybe get the first 9 fields and the rest are blank. Anyone know of a reason this may be happening? I've never seen it before. Thanks, -=Rob=- | | Reply to this email to post your response. __.____._ | _.____.__ |
No comments:
Post a Comment