‎2007 Sep 27 1:38 PM
Hi, I have program which display data in Excel layout of ALV loaded from internal table..
It means that in sap i received excel sheet with all its functionality.
The problem is that sometimes there are missed some rows with data.
Did someone meet with similar situation?
Regards,
Joanna
‎2007 Sep 27 1:44 PM
HI
DATA: v_file LIKE rlgrap-filename,
v_filename TYPE string.
REFRESH i_matcontrol.
CLEAR i_matcontrol.
TRANSLATE v_exten TO UPPER CASE.
*
IF v_exten = 'XLS'.
v_file = p_p_file.
*
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = ws_rawdata
i_filename = v_file
TABLES
i_tab_converted_data = i_data.
ELSEIF v_exten = 'TXT'.
v_filename = p_p_file.
File upload
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename
filetype = 'ASC'
has_field_separator = 'T'
TABLES
data_tab = i_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
CASE sy-subrc.
WHEN 1.
MESSAGE e001(00) WITH text-001.
STOP.
WHEN 2.
MESSAGE e001(00) WITH text-002.
STOP.
WHEN 0.
IF i_data IS INITIAL.
MESSAGE s001(00) WITH text-008.
ENDIF.
ENDCASE.
ENDIF.
*
DELETE i_data WHERE matnr IS INITIAL AND
werks IS INITIAL.
‎2007 Sep 27 1:48 PM
I have code like this and i need find some mistake, and it work good generaly but sometimes it miss some data:
.
(...)
header_table-p52 = text-052.
header_table-p53 = text-053.
header_table-p54 = text-054.
APPEND header_table.
LOOP AT iall.
MOVE-CORRESPONDING iall TO data_table.
IF iall-datab <> '00000000'.
WRITE iall-datab TO data_table-datab USING EDIT MASK '__.__.____'.
ELSE.
data_table-datab = ''.
ENDIF.
IF iall-datbi <> '00000000'.
WRITE iall-datbi TO data_table-datbi USING EDIT MASK '__.__.____'.
ELSE.
data_table-datbi = ''.
ENDIF.
procenta bonusu
IF data_table-datab = ''.
data_table-kbetr = ''.
ELSE.
CONCATENATE data_table-kbetr '%' INTO data_table-kbetr.
ENDIF.
APPEND data_table.
ENDLOOP.
l_oref_structure ?= cl_abap_typedescr=>describe_by_data(
data_table ).
PERFORM build_field_table TABLES data_fields_table
USING l_oref_structure.
l_oref_structure ?= cl_abap_typedescr=>describe_by_data(
header_table ).
PERFORM build_field_table TABLES header_fields_table
USING l_oref_structure.
DESCRIBE TABLE data_table LINES rows.
CALL SCREEN 9999.
EXIT.
ENDFORM.
‎2007 Sep 27 1:55 PM
hi joanna
check the prog in debug mode means /h and execute
u under stand easily that time u will understand where data missing.
regards
kk.
‎2007 Sep 27 1:59 PM
I check it and for me it work corectly but I received from person who use this program two excel field which were different dispite the data in database were the same. So it is problem check this and I hope that someone has similar problem.