09-13-2010 4:46 PM
Hi all,
I have a problem. I want to read a dataset which looks like that (first three data records):
0.
dmowort_wa-ankettdate = datei_inhalt1+start(laenge).
ENDIF.
...
ENDDO.
Does anybody know what I mean?!? Maybe I described the problem not good enough...
Thank you,
Judith
Edited by: BW4us on Sep 13, 2010 5:48 PM
09-13-2010 4:59 PM
Hi
Define your internal table as below :-
DATA : ITAB TYP TABLE OF STRING.
.
So that ITAB will have string of variable length.
Regards
Abhii
09-13-2010 5:19 PM
Hi,
I don't understand your hint - I can't use an internal table, because I don't always get the same fields. Or did you mean, that in the next step I'll have to search in this internal table!?
-> anyway, I can't read into this itab, failure message when checking the code (can't activate the coding now)
READ DATASET datei1 INTO itab.
IF sy-subrc <> 0.
EXIT.
ENDIF.
Programm ...
"ITAB" darf keine Tabelle sowie keine Referenz sein und diese oder
Strings auch nicht beinhalten.
thx
Judith
Edited by: BW4us on Sep 13, 2010 6:22 PM
09-13-2010 5:35 PM
What I wanted to say was, According to my understanding of your issue, You were getting a string of variable (length) content every time & that you have defined the string length fixed, you were not able to get the desired output. So I suggested the above Internal table declaration so that it will have a string of variable length for each iteration.
Regards
Abhii
09-13-2010 6:20 PM
Hey Judith,
What Abhii is trying to put across is instead of defining your table as:
DATA: BEGIN OF datei_inhalt1,
satz(1200),
END OF datei_inhalt1.
Declare it as :
DATA: BEGIN OF datei_inhalt1,
satz TYPE string,
END OF datei_inhalt1.
Anyway there are many threads in the forum on reading an XML file from app server which you can refer.
BR,
Suhas
09-13-2010 6:49 PM
09-13-2010 9:51 PM
But STRING is not likely to solve whatever your issue is unless you've got some really long records not shown or there aren't any record delimiters in the file. What exactly doesn't work? The '1200' length specification is easily long enough to fit all 3 of those sample records. What error are you encountering???
09-14-2010 9:41 AM
My problem is, that the the records get shifted each time, because they are not 1200 signs long - so the first record comes completely into the workarea (with a bit of next one), the second one is missing a view parts and so on, until I only have fragments of the records I originally wanted to have.
09-14-2010 9:43 AM
Hey Judith,
What Abhii is trying to put across is instead of defining your table as:
DATA: BEGIN OF datei_inhalt1,
satz(1200),
END OF datei_inhalt1.
Declare it as :
DATA: BEGIN OF datei_inhalt1,
satz TYPE string,
END OF datei_inhalt1.
Anyway there are many threads in the forum on reading an XML file from app server which you can refer.
BR,
Suhas
That leads to the same error message: "DATEI_INHALT1" darf keine Tabelle sowie keine Referenz sein und diese
oder Strings auch nicht beinhalten.