2010 Sep 02 1:23 PM
Hi,
I have a text file in the application server containing data corresponding to the fields of table EPROVAL15.I have declared an internal table and work area of the table type .While I am trying to split the file into respective fields it's throwing an error which is "field should be declared of character type".since fields such as 'VAL0000' or 'VAL0015' are of decimal format,so split statement doesnot work for such data type.Can any1 suggest how to split the file so that data from the text file get appended to the internal table?
I thought of declaring a structure containing the same number fields as the table EPROFVAL15 with data type as char,but then that would be time consuming process as the table contains many fields.Can any one provide a solution to it?
I would like to know ,if there is a table containing more than 100 fields and we want to append values from text file to it through an internal table ,then in the split statement do we need to provide every field name (the usual process that we do) ?i feel it's a time consuming process to mention all the field name manually.is there any way out by which the fields can be called dynamically for appending the data from the text file into it?
Hi,
I have a text file in the application server containing data corresponding to the fields of table EPROVAL15.I have declared an internal table and work area of the table type .While I am trying to split the file into respective fields it's throwing an error which is "field should be declared of character type".since fields such as 'VAL0000' or 'VAL0015' are of decimal format,so split statement doesnot work for such data type.Can any1 suggest how to split the file so that data from the text file get appended to the internal table?
I thought of declaring a structure containing the same number fields as the table EPROFVAL15 with data type as char,but then that would be time consuming process as the table contains many fields.Can any one provide a solution to it?
I would like to know ,if there is a table containing more than 100 fields and we want to append values from text file to it through an internal table ,then in the split statement do we need to provide every field name (the usual process that we do) ?i feel it's a time consuming process to mention all the field name manually.is there any way out by which the fields can be called dynamically for appending the data from the text file into it?
2010 Sep 02 2:20 PM
Yes, there are several ways you can do it dynamically but you didn't mention how your file is delimited or whether it's fixed-length. Also, what type of structure are you initially reading the file into? Post some code - although I understand the SPLIT error, it's not clear why SPLIT is being used with a numeric data type.
2010 Sep 02 3:14 PM
Hi Brad,
The text file is delimited by' | '.
following is the sample code .
data: gt_IEPROFVAL15 type IEPROFVAL15,
gwa_IEPROFVAL15 type EPROFVAL15.
split g_temp1 at '|' into gwa_IEPROFVAL15-PROFILE gwa_IEPROFVAL15-VALUEDAY gwa_IEPROFVAL15-VAL0000
gwa_IEPROFVAL15-VAL0015 gwa_IEPROFVAL15-VAL0030 gwa_IEPROFVAL15-VAL0045.
The above split statement contains fields up till VAL2345(presently i have shown fields up till VAL0045).The syntactical error is
' gwa_IEPROFVAL15-VAL0000 must be a character type data object'.
Is there any way by which data conversion can take place explictly ?
If i declare a structure containing the same fields as that of table EPROVAL15(with the data type being char instead of integer) to be used in the split statement then again it's a tedious process.
Hope the problem stated is clear to you.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |