cancel
Showing results for 
Search instead for 
Did you mean: 

End of file character in flat file

Former Member
0 Kudos

Hello,

We are loading data into BI via a flat file (~ separated .txt). This file is created by a different system. A special character is inserted by the system as the end of file character while creating the flat file. When we are loading the file in BI, the data load fails due to this character. Is there some way we can skip reading this character (something like ignore last row)?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

That charecter comes in the last field in the file as it is the end , so write a code in transformations from PSA to DSO of the last field.

Here i am giving the code that needs to be included in the field routine.

DATA : INT_VAR TYPE /BI0/OIMATERIAL. (give your field insted of material)

DATA : STR_VAR1(20) TYPE C. (give your field type here)

DATA : VAR2 TYPE I.

DATA : VAR3 TYPE I.

DATA : VAR4 TYPE I.

DATA : STR_VAR6(20) TYPE C.

MOVE SOURCE_FIELDS-MATERIAL TO INT_VAR.

TRANSLATE INT_VAR TO UPPER CASE .

IF INT_VAR CN

',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890' .

STR_VAR1 = INT_VAR+0(SY-FDPOS).

VAR2 = STRLEN( INT_VAR ).

VAR3 = SY-FDPOS + 1.

VAR4 = VAR2 - VAR3.

STR_VAR6 = INT_VAR+VAR3(VAR4).

CONCATENATE STR_VAR1 STR_VAR6 INTO RESULT.

ELSE.

RESULT = INT_VAR.

ENDIF.

Hope this works good in your case

Cheers,

Srinath.

Former Member
0 Kudos

Hi,

You can execute a SQL Script or a ABAP program to remove the that invalid char before loading the data.

If you are using a process chain, try to keep this as a step before the data load.

Regards,

Bilapati

Former Member
0 Kudos

This text file is really huge, and it is a daily data load. Reading the file from top to bottom to delete the character will take too much time and will slow the data load process. Is there some other way?

Former Member
0 Kudos

If you get the data in fixed length for the last field,

You can write a simple program to truncate the extra character.

The above program will help you. Dont guess that will give a performance hit.

Check it out.

Cheers,

Srinath

Former Member
0 Kudos

Hi,

Go to RSKC (t.code) and enter the character there. this way, you are permitting that character and you will not find any issue.

check this way.

but still i would suggest you to delete this character using code in the routine.

please let me know if the problem got solved

Cheers,

Srinath.