2009 Feb 05 7:10 AM
Hi all,
I am uploading a tab delimited text file from application server. After reading in display read data character '#' is appearing at the end of each recod in the last filed of source structure.
obiviously the same is getting passed in convert and appears in display convert data too.
When i do the same by uploading file from local desktop instaed of apps server, i dont have any such proble and evrything works fine.
I have done all the settings as suggested by SAP;
http://help.sap.com/saphelp_nw04/helpdata/en/10/6400c0ee3711d1b406006094b944c8/frameset.htm
Please suggest your suggestions.
2009 Feb 05 7:17 AM
check your application server file in tcode AL11 is there any # in the file
or
use tcode CG3Y download the firl from application server to your system and check the file has contains # or not..
in lsmw SPECIFY files step click the file path its dispaly the one more window here in the last of the screen you find the CODE PAGE here Replacement char. there you can put # or any other character and check.
Hi all,
I am uploading a tab delimited text file from application server. After reading in display read data character '#' is appearing at the end of each recod in the last filed of source structure.
obiviously the same is getting passed in convert and appears in display convert data too.
When i do the same by uploading file from local desktop instaed of apps server, i dont have any such proble and evrything works fine.
I have done all the settings as suggested by SAP;
http://help.sap.com/saphelp_nw04/helpdata/en/10/6400c0ee3711d1b406006094b944c8/frameset.htm
Please suggest your suggestions.
2009 Feb 05 7:13 AM
Hi,
There is an extra return character in the file after each record which is being displayed. Remove that character & it would work fine.
Regards,
Kritesh Shah
2009 Feb 05 7:17 AM
check your application server file in tcode AL11 is there any # in the file
or
use tcode CG3Y download the firl from application server to your system and check the file has contains # or not..
in lsmw SPECIFY files step click the file path its dispaly the one more window here in the last of the screen you find the CODE PAGE here Replacement char. there you can put # or any other character and check.
2009 Feb 05 7:39 AM
No, file does not cintain any # at end of each record.
i checked at application server and evn as i told you , same file works fine when loaded from frontend.
2009 Feb 05 12:32 PM
Hi
Other than tab delimiter use other delimiters like comma or pipe and then test. Hope your problem will be solved.
Regards
sree
2009 Feb 05 1:58 PM
Hi santosh,
Refer this sample code
*"Table declarations...................................................
TABLES:
bkpf.
*"Selection screen elements............................................
SELECT-OPTIONS:
p_bukrs FOR bkpf-bukrs, " Company Code
p_bldat FOR bkpf-bldat. " Date
PARAMETERS:
w_char TYPE c. " Delimiter
DATA:
BEGIN OF fs_bkpf,
bukrs LIKE bkpf-bukrs, " Company Code
gjahr LIKE bkpf-gjahr, " Document Date in Document
blart LIKE bkpf-blart, " Document type
bldat LIKE bkpf-bldat, " Date
budat LIKE bkpf-budat, " Posting Date in the Document
monat LIKE bkpf-monat, " Fiscal Period
cpudt LIKE bkpf-cpudt, " Accounting Document Entry Date
END OF fs_bkpf.
DATA:
t_bkpf LIKE
STANDARD TABLE
OF fs_bkpf.
*"--------------------------------------------------------------------*
* Work Variables *
*"--------------------------------------------------------------------*
DATA:
f_name TYPE string, " File name
w_lines TYPE i, " No. of records
w_data TYPE string, " Temporary Variable
w_data1 TYPE string, " Temporary Variable
w_index TYPE i, " Index Variable
file_path TYPE ibipparms-path, " File Path
file_path1 TYPE string. " File Path
*"--------------------------------------------------------------------*
* START-OF-SELECTION EVENT *
*"--------------------------------------------------------------------*
START-OF-SELECTION.
SELECT bukrs " Company Code
gjahr " Document Date in Document
blart " Document type
bldat " Date
budat " Posting Date in the Document
monat " Fiscal Period
cpudt " Accounting Document Entry Date
FROM bkpf
INTO TABLE t_bkpf
WHERE bukrs IN p_bukrs
AND bldat IN p_bldat.
************************************************************************
******************Writing into Application Server***********************
************************************************************************
f_name = '.\my_bkpf.txt'.
OPEN DATASET f_name FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
DESCRIBE TABLE t_bkpf LINES w_lines.
DO w_lines TIMES.
READ TABLE t_bkpf INTO fs_bkpf INDEX w_index.
CONCATENATE fs_bkpf-bukrs
fs_bkpf-gjahr
fs_bkpf-blart
fs_bkpf-bldat
fs_bkpf-budat
fs_bkpf-monat
fs_bkpf-cpudt
INTO w_data
SEPARATED BY w_char.
TRANSFER w_data TO f_name.
ADD 1 TO w_index.
ENDDO. " DO w_lines TIMES.
CLOSE DATASET f_name.
CLEAR t_bkpf.
OPEN DATASET f_name FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET f_name INTO w_data1.
IF sy-subrc NE 0.
EXIT.
ENDIF. " IF sy-subrc NE 0.
SPLIT w_data1 AT w_char INTO fs_bkpf-bukrs
fs_bkpf-gjahr
fs_bkpf-blart
fs_bkpf-bldat
fs_bkpf-budat
fs_bkpf-monat
fs_bkpf-cpudt.
APPEND fs_bkpf TO t_bkpf.
ENDDO. " DO.
CLOSE DATASET f_name.Regards,
Sravanthi
2009 Feb 05 2:16 PM
Please do not post irrelevent answers like Srawanti. please read the question carefully and then post.
This question is about reading file from apps server using LSMW.
2009 Feb 06 10:12 AM
2010 Apr 29 9:03 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |