2013 Oct 09 9:58 AM
Hi All,
i am uploading the data using BDC call transaction using excel file, that file looking like following
| CUST | AGR | NAME | SORT | STRT | CITY | CNTRY | LANG | PIN |
| 25162 | 4 | JKIL | hgf | EC | BANGALORE | IN | EN | 123457 |
| 25163 | 4 | NANI | CFR | BELLANDUR | CHENNAI | IN | EN | 234567 |
| 25164 | 4 | NILIMA | GHT | TNAGAR | CHENNAI | IN | EN | 234567 |
IN THAT FILE I DONT WANT TO UPLOAD "FIRST ROW" WHICH HAVING HEADINGS. just I want to update values of those fields?
2013 Oct 09 11:53 AM
Hi,
after reading the data using 'TEXT_CONVERT_XLS_TO_SAP' FM
delete the first record of the internal table
delete t_output where index 1.
if you want to read only from second record then use the FM
ALSM_EXCEL_TO_INTERNAL_TABLE
Thanks ,
Pavan.
2013 Oct 09 10:09 AM
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = space
i_line_header = space
i_tab_raw_data = lt_raw
i_filename = p_path
TABLES
i_tab_converted_data = t_output
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE e002.
LEAVE SCREEN.
ENDIF.
SuDEESH
2013 Oct 09 11:02 AM
using that FM we just convert excel file to internal table. but my question is , i want to skip the headings while uploading the records.
2013 Oct 09 11:09 AM
Yes.. But this FM will ignore the Heading.. Internal Table will have only the Items..
Sorry ignore my previous message.
Constant : c_x Type char01 value 'X'.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = space
i_line_header = c_x
i_tab_raw_data = lt_raw
i_filename = p_path
TABLES
i_tab_converted_data = t_output
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE e002.
LEAVE SCREEN.
ENDIF.
SuDEESH
2013 Oct 09 11:53 AM
Hi,
after reading the data using 'TEXT_CONVERT_XLS_TO_SAP' FM
delete the first record of the internal table
delete t_output where index 1.
if you want to read only from second record then use the FM
ALSM_EXCEL_TO_INTERNAL_TABLE
Thanks ,
Pavan.
2013 Oct 09 11:59 AM
Hi hai vai ,
Just put 'X' in I_LINE_HEADER
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
I_LINE_HEADER = 'X'
i_tab_raw_data = i_text_data
i_filename = p_file
TABLES
i_tab_converted_data = it_final
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.
2013 Oct 09 12:14 PM
Hi,
You have to pass value X for I_LINER_HEADER in function module.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR = 'X'
I_LINE_HEADER = 'X'
I_TAB_RAW_DATA = L_RAWD
I_FILENAME = P_FILE
TABLES
I_TAB_CONVERTED_DATA = G_TAB
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Thanks & Regards,
Vijay
2013 Oct 09 3:36 PM
ok thanks 4 your reply,
and also 1 more doubt,
excel sheet contains 4 records, i want to skip the 3rd record in MODE 'N'
2013 Oct 09 6:03 PM
Hi,
Your internal table will have 4 records.
You can use:
Move the data to another internal table while running in N mode and delete the 3rd record as required.
DELETE G_TAB INDEX 3.
Populate BDCDATA for all other records and run the BDC.
Please let me know if it helped.
Thanks,
Anupam
2013 Oct 10 3:35 AM
Hi hai vai,
Use this Function Module use to select rows you want from excel sheet...
********** Selection Screen
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER: p_file TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETER: p1 TYPE i OBLIGATORY,
p2 TYPE i OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b2.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '001'
i_begin_row = p1 " Select Row From
i_end_col = '008'
i_end_row = p2 " Select Row To
TABLES
intern = it_intern
* 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.
ENDIF.
2013 Oct 09 12:22 PM
Hi Vai,
Ramesh T has provided correct solution please use that code.
Regards.
Vigneshwar.D
2013 Oct 10 5:12 AM
2013 Oct 10 7:41 AM