2008 Jul 07 2:33 PM
Hi All,
I am using FM GUI_UPLOAD, and while upload its not recognising the character, Instead it shows some Junk values in the itab. Can anyone lemme know how can this be corrected.
Many Thanks,
Simin.
Hi All,
I am using FM GUI_UPLOAD, and while upload its not recognising the character, Instead it shows some Junk values in the itab. Can anyone lemme know how can this be corrected.
Many Thanks,
Simin.
2008 Jul 07 2:35 PM
HI
iam not clear with your question
might be you have used the file name parameter type as string instead of that use it as RLGRAP-FILENAME
Try it out
if possible can you just post the code
Regards
Pavan
Edited by: Pavan Bhamidipati on Jul 7, 2008 3:35 PM
2008 Jul 07 2:37 PM
U can use the CODEPAGE parameter of the FM. Pass the valid code page that supports ur character set.
Regards,
Joy.
2008 Jul 07 2:38 PM
Hi Simin,
Which type of file u r uploading. It will work for text file.
If it is excel file then use below code to upload the data.
PARAMETERS: po_file TYPE rlgrap-filename DEFAULT 'E:test.xls'.
TYPES: BEGIN OF t_final,
empno(10) TYPE c,
name(30) TYPE c,
state(25) TYPE c,
END OF t_final.
DATA: i_tab TYPE STANDARD TABLE OF alsmex_tabline,
i_final TYPE STANDARD TABLE OF t_final,
wa_tab TYPE alsmex_tabline,
wa_final TYPE t_final.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR po_file.
PERFORM open_folder.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = po_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65256
TABLES
intern = i_tab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
CHECK NOT i_tab[] IS INITIAL.
LOOP AT i_tab INTO wa_tab.
CASE wa_tab-col.
WHEN 1.
wa_final-empno = wa_tab-value.
WHEN 2.
wa_final-name = wa_tab-value.
WHEN 3.
wa_final-state = wa_tab-value.
ENDCASE.
AT END OF row.
APPEND wa_final TO i_final.
CLEAR wa_final.
ENDAT.
ENDLOOP.
FORM open_folder .
DATA: li_file TYPE TABLE OF sdokpath,
lwa_file TYPE sdokpath.
CLEAR: po_file, lwa_file.
REFRESH li_file[].
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
TABLES
file_table = li_file
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
IF sy-subrc IS INITIAL.
READ TABLE li_file INTO lwa_file INDEX 1.
IF sy-subrc IS INITIAL.
po_file = lwa_file-pathname.
ENDIF.
ENDIF.
If it is text file let me know what data u r uploading. Paste the piece of file data.
Thanks,
Vinod.
2008 Jul 07 2:41 PM
Hi ,
Are you uploading an excel file? if yes then try to upload using FM ALSM_EXCEL_TO_INTERNAL_TABLE....
regards
padma
2008 Jul 07 2:54 PM
hi....
jut check the fil type in the function module You have to give it as 'DAT' or ASC
Alo check the number of fields in the internal table in which you which you are uploading the data and the file fields.the fields should nbe in the same order and same number..just check..may b thats thats the problem.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |