Numbers & Character data are no problem BUT dates are.
In Excel default date is mm/dd/yyyy but is dependent on PC's
international setting which is normally default
To Avoid any 5-March 3-May type mix-up, I have designed the FM so that you need to
enter dates as 'dd.Mon.yyyy i.e. in Characters in "Internet Date Format"
FUNCTION zjnc_get_range.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(RANGENAME) TYPE C
*" REFERENCE(ITABNAME) TYPE C
*" REFERENCE(IRECNAME) TYPE C
*" REFERENCE(SPREADSHEETINTF) TYPE REF TO I_OI_SPREADSHEET
*"----------------------------------------------------------------------
*
*" REFERENCE(SPREADSHEETINTF) TYPE REF TO I_OI_SPREADSHEET
*"----------------------------------------------------------------------
DATA:
stru_ref TYPE REF TO cl_abap_structdescr,
comp_tab TYPE abap_compdescr_tab,
one_comp TYPE abap_compdescr,
one_name TYPE string,
type_ref TYPE REF TO cl_abap_typedescr,
is_ddic TYPE abap_bool,
lt_ddic TYPE dd_x031l_table,
wa_ddic TYPE x031l.
DATA: zjncranges TYPE soi_range_list,
zjnccontents TYPE soi_generic_table,
zjnconerange TYPE soi_range_item,
zjnconeitem TYPE soi_generic_item,
prevrow(4) TYPE n,
nrow(4) TYPE n,
ncolumn(4) TYPE n,
mystring TYPE string,
mydate LIKE sy-datum.
FIELD-SYMBOLS: <fs_type> TYPE ANY,
<fs_table> TYPE STANDARD TABLE,
<fs_line> TYPE ANY.
CONCATENATE '(' sy-cprog ')' itabname INTO mystring.
ASSIGN (mystring) TO <fs_table>.
CONCATENATE '(' sy-cprog ')' irecname INTO mystring.
ASSIGN (mystring) TO <fs_line>.
MOVE 0 TO prevrow.
LOOP AT zjnccontents INTO zjnconeitem.
MOVE zjnconeitem-row TO nrow.
IF nrow <> prevrow.
IF prevrow <> 0.
APPEND <fs_line> TO <fs_table>.
ENDIF.
CLEAR <fs_line>.
MOVE nrow TO prevrow.
ENDIF.
MOVE zjnconeitem-column TO ncolumn.
READ TABLE comp_tab INDEX ncolumn INTO one_comp.
CONCATENATE '(' sy-cprog ')' irecname '-' one_comp-name INTO one_name.
ASSIGN (one_name) TO <fs_type>.
IF one_comp-type_kind <> 'D'.
MOVE zjnconeitem-value TO <fs_type>.
ELSE.
TRANSLATE zjnconeitem-value TO UPPER CASE.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
EXPORTING
input = zjnconeitem-value
IMPORTING
output = mydate.
MOVE mydate TO <fs_type>.
ENDIF.
ENDLOOP.
IF prevrow <> 0.
APPEND <fs_line> TO <fs_table>.
ENDIF.
If you wish to store a Word/Excel/AutoCad or any other document in SAP,
then you can use the Business Document Service (BDS). I did not - as
Cluster Data Directory is a simple beginning ...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.