cancel
Showing results for 
Search instead for 
Did you mean: 

need to validate on header main and header detail.

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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