Skip to Content
0
Oct 26, 2012 at 01:10 PM

Help needed on text (tab delimited)

24 Views

Hi,

I have successfully uploaded a text tab delimited flat file and updated email ids for vendors. Now I was trying to validate the email id using the following code (I've mentioned only the validation code, not the entire BDC)

LOOP AT T_itab INTO W_ITAB.

e1 = W_itab-f2. "e1 is a char type field.

SPLIT e1 AT '@' INTO s1 s2. "s1 and s2 are string type fields.

IF s1 CA space.

write : /05 'The following records contain spaces :',

/05 w_itab-f1,

/15 w_itab-f2.

Else.

<BDC subroutine>

Endif.

CALL TRANSACTION 'XK02' USING bdcdata MODE 'N'.

Endloop.

Here T_itab is the internal table I've used to place my data from text (teb delimited) file. I've debugged and observed values in the work area, but after the records are uploaded, the execution continues for a long time and every time I have to terminate the debugging. Even while execution when I don't have errors with my flat file., the records get updated successfully after a long wait but at the end, the first write statement ('The following records contain spaces :',) keeps displaying for more than some 100 times. I suppose I have to keep some "ending" or "separation" for the text file which would be recognized by the loop and it will stop looping the write statement.

Please let me know if we have any separator or ender of text (tab delimited) file to avoid unnecessary looping of this write statement even after the records have been updated.

The following is a sample of the tab delimited flat file I've used.

1300053 anilnschoudhary@yahoo.com 1300058 avaniferroalloy@yahoo.co.in 1300059 avaniferroalloy@yahoo.co.in 1300063 br_inst@rediffmail.com 1300064 bagga.machinery@yahoo.com

Thanks in advance.