on 09-15-2008 9:33 PM
File is in application server. i read the file from it by:
OPEN DATASET p_file FOR INPUT IN TEXT MODE.
IF sy-subrc NE 0.
MESSAGE e999(za) WITH 'Error opening file' p_file.
ENDIF.
DO.
*Reads each line of file individually
READ DATASET p_file INTO v_file.
if sy-subrc = 0.
append v_file.
clear v_file.
else.
exit.
ENDDO.
close dataset p_file.
and the file format is:
Header main
Header detail
detail rec 1
detail rec 2
detail rec 3
detail rec 4
.........
Header detail1
detail rec 1
detail rec 2
detail rec 3
detail rec 4
................
Header detail2
detail rec 1
detail rec 2
detail rec 3
detail rec 4
................
I need to validate on header main and header detail.
can anyone suggest?
Hi,
I think it is better if there is another field at start of each row to indicate whether the row is header main, header detail, or detail. Using it as a flag, the code can determine which validation need to be executed.
Regards,
Teddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.