cancel
Showing results for 
Search instead for 
Did you mean: 

uploading file , validating the file and generate a output file

Former Member
0 Kudos

I have a file, I need to read from unix and need to validate on header data, first header and update the ztable.

Can anyone suggest me?

Accepted Solutions (0)

Answers (2)

Answers (2)

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?

Former Member
0 Kudos

Hi Madhu,

For this issue you have to take the help of ABAP. Following are the steps :

1) In ABAP program uplaod the file in internal tables.

2) Identify the fields in the header table on which you want to apply validation and then apply the validation.

3) Then subsequently cleanse the data in the required format.

4) Go for your final functionality by using BDC, IDOc or BAPI.

Thanks.

Lalit