‎2008 Jul 01 10:13 AM
Hi Experts,
i am uploading the EXCEL file to SAP using Function Module 'TEXT_CONVERT_XLS_TO _SAP', In that flat file i have one text field around 700 charecters, but from Function Module it is uploading only 256 charcters.
i have tried with both STRING and CHAR
data : var_text type string, and
data : var_text(4096) type c.
But this variables are not storing more than 256 charecters...
please give me UR valuable and HELPFUL suggestion.....
Regards
Prasad.EV
‎2008 Jul 04 8:30 AM
Hi,
I do not think it is a DATA TYPE problem. As far as I understand one cannot export/import more that 256 characters into excel/word for a single field. I think this is more like a constrain.
I had a scenario where I tried replacing a word in WORD doc using a macro and it had a similar issue.
Refer to link http://support.microsoft.com/kb/212543
Regards,
Saurabh
‎2008 Jul 01 11:05 AM
Hi,
Please do try the following function module,"'ALSM_EXCEL_TO_INTERNAL_TABLE'"
which will collect the excell to an internal table from where you can update to DB table.
regards,
Ajith
‎2008 Jul 01 11:07 AM
EV,
just use like that:
DATA: BEGIN OF it_excel OCCURS 0,
belnr(10),
xblnr(16),
bktxt(25),
bldat(10),
zuonr(18),
oac(1),
dmbtr(16),
pszah(15),
wrbtr(16),
kunnr(10),
budat(10),
konto(16),
bukrs(04),
waers(05),
agkon(16),
prctr(10),
wrbtr1(16),
spesw(15),
kostl(10),
sgtxt(50),
END OF it_excel.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = pfile
TABLES
i_tab_converted_data = it_excel[]
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Amit.
‎2008 Jul 01 11:09 AM
Have a look at FM ALSM_EXCEL_TO_INTERNAL_TABLE this is fine until it gets to teh following statement
perform separated_to_intern_convert tables excel_tab intern
using ld_separator.
You should be able to utilise a lot of the code from here.
Regards
J
‎2008 Jul 02 8:19 AM
use function
CALL FUNCTION 'GUI_UPLOAD'
if u r using ecc 5.0/6.0
..
regds
jigar
‎2008 Jul 02 1:33 PM
Hi
You have do the fallowing steps
1) Copy the FM ALSM_EXCEL_TO_INTERNAL_TABLE and make a zFM use this FM.
2) Copy the table ALSMEX_TABLINE make a Ztable using this table.
3) Change the filed(VALUE) in ztable with a 1000 char dataelement.
4) Use this table as table parameter associated type.
then the ZFM
‎2008 Jul 03 11:32 AM
Hi,
The Character Data Type (C) can store upto 255 characters.
If you want to store more than 255 characters then go for
STRING Data Type.
Hope it helps you.
Murthy.
‎2008 Jul 04 8:30 AM
Hi,
I do not think it is a DATA TYPE problem. As far as I understand one cannot export/import more that 256 characters into excel/word for a single field. I think this is more like a constrain.
I had a scenario where I tried replacing a word in WORD doc using a macro and it had a similar issue.
Refer to link http://support.microsoft.com/kb/212543
Regards,
Saurabh
‎2008 Jul 07 2:07 PM
Hii!
Check Out this code
REPORT z_file3.
DATA: fname(40),
w_line TYPE i VALUE 1,
w_file TYPE rlgrap-filename.
DATA:
t_tab LIKE
TABLE OF ALSMEX_TABLINE
WITH HEADER LINE.
DATA: fs_tab LIKE LINE OF t_tab.
w_file = 'C:\Documents and Settings\abc\Desktop\Book1.xls'.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = w_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 10
i_end_row = 100
tables
intern = t_tab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE: 'UPLOAD SUCCESSFUL'.
ENDIF.
fname = '.\zfile.xls'.
OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT t_tab INTO fs_tab.
TRANSFER fs_tab TO fname.
ENDLOOP.
IF sy-subrc EQ 0.
WRITE: / 'FILE OPENED ON APPS SERVER'.
ELSE.
WRITE: / 'FILE COULD NOT BE OPENED'.
ENDIF.
Regards
Abhijeet Kulshreshtha