Visit
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
and
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
You need some basic idea of range object in excel.
You need to create XLS with named ranges or create ranges dynamically.
This could be a neat way to upload XLS the OO way!
The function Module zjnc_get_range reads 1 range into any Internal
table.
DATA: BEGIN OF it_test OCCURS 0,
vpd LIKE mseg-menge,
vas LIKE mkpf-budat,
vkm LIKE mseg-matnr,
END OF it_test.
CALL FUNCTION 'ZJNC_GET_RANGE'
EXPORTING
rangename = 'test'
itabname = 'IT_TEST[]'
irecname = 'it_test'
spreadsheetintf = spreadsheetintf.
=Work!$A$14:$C$16 is range "test"
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:TYPE ANY,
TYPE STANDARD TABLE,
TYPE ANY.
CONCATENATE '(' sy-cprog ')' itabname INTO mystring.
ASSIGN (mystring) TO.
CONCATENATE '(' sy-cprog ')' irecname INTO mystring.
ASSIGN (mystring) TO.
stru_ref ?= cl_abap_structdescr=>describe_by_data().
comp_tab = stru_ref->components.
REFRESH zjncranges.
MOVE rangename TO zjnconerange-name.
APPEND zjnconerange TO zjncranges.
CALL METHOD spreadsheetintf->get_ranges_data
IMPORTING
contents = zjnccontents
error = zjncerror
retcode = zjncretcode
CHANGING
ranges = zjncranges.
MOVE 0 TO prevrow.
LOOP AT zjnccontents INTO zjnconeitem.
MOVE zjnconeitem-row TO nrow.
IF nrow <> prevrow.
IF prevrow <> 0.
APPENDTO .
ENDIF.
CLEAR.
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.
IF one_comp-type_kind <> 'D'.
MOVE zjnconeitem-value TO.
ELSE.
TRANSLATE zjnconeitem-value TO UPPER CASE.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
EXPORTING
input = zjnconeitem-value
IMPORTING
output = mydate.
MOVE mydate TO.
ENDIF.
ENDLOOP.
IF prevrow <> 0.
APPENDTO .
ENDIF.
ENDFUNCTION.
--------------------------------------------------------------------------------
SAP has a facility called BDS.
Read
http://www.intelligententerprise.com/channels/applications/feature/archive/schulze.jhtml
Read http://www.sappro.com/download03.cfm?session=
There is ready code of BDS+DOI -- uses CL_BDS_DOCUMENT_SET global class.
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 ...
Friday, November 23, 2007
sap abap program for Uploading multiple multitab Excel sheets or Ranges from Front end to SAP
Labels:
MS Office programming
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(952)
-
▼
November
(716)
- SAP Paper Documents
- SAP Repository
- SAP R/3 Implementation and Maintenance Tips
- ABAP/4 programming language overview
- The interactive eLearning system for ABAP™
- Helpful System Administration ABAPS
- free download abap programmin pdf book
- examples of real time objects in sap abap(1)
- examples of real time objects in sap abap
- work flow example2
- Workflow tips
- Miscellaneous sap abap faq
- BDC , LSMW, Conversions faq in abap
- Sap Scripts & Smart forms faqs in abap
- performance tuning in abap faqs
- Real Time BDC & LSMW faqs
- Real Time ABAP Internal Tables faqs
- Real Time ABAP Reports faqs
- Real Time questions ..in sap ABAP
- SAP ABAP FAQ (Technical)
- ABAP and Unicode
- ABAP and JavaScript
- ABAP Objects
- ABAP Database Access
- Running ABAP Programs
- ABAP User Dialogs
- The ABAP Programming Language
- Creating and Changing ABAP Programs
- Overview of the Components of Application Programs
- Introduction to ABAP
- ABAP Programming Documentation
- FREE DOWNLOAD ALE, EDI & IDOCS
- Conversion of IDOCs to XML.pdf
- FREE DOWNLOAD IDOC Interface Technology
- FREE DOWNLOAD EDI, IDOC Interface
- FREE DOWNLOAD IDOC BOOK
- FREE DOWNLOAD LSMW - Idoc Inbound Processing
- FREE DOWNLOAD SAP ABAP Idoc Interface
- FREE DOWNLOAD Java for SAP
- FREE DOWNLOAD Java for ABAP Programmers
- FREE DOWNLOAD Java and BAPI technology for EP
- free download Building Web Services with Java and ...
- free download Enable SAP with the power of Javascript
- FREE DOWNLOAD ABAP Training Simulator
- FREE DOWNLOAD SAP Accounting Training Simulators
- free download SAPScripts Made Easy
- CONDENSE
- CONSTANTS
- ABAP Quick Viewer
- sap abap XXL (EXtended Export of Lists)
- Some ABAP/4 Query header line variable
- Understanding SAP Query
- ABAP/4 Query
- ABAP/4 Query Hints and Tips
- SAP Website Links Exchange for ABAP, Basis or Cons...
- sap abap Program for Generate IDoc
- sap abap program for Reads an existing Idoc and di...
- List of ABAP Function modules
- sap abap FTP programming
- sap abap program for Issuing an Unix Command from ...
- sap abap program for RFC call to get Server List
- sap abap program for A SAP Pop-out Calculator
- sap ABAP program for Timers and Auto-refresh
- sap abap program for WS_EXECUTE to called External...
- sap abap programming Execute DOS Command from ABAP...
- To execute a dos command from ABAP
- sap abap program for Make your SAPGUI Disappear an...
- sap abap program for Using Function Modules F4_FIL...
- abp program for How to Restrict the Select Options
- sap abap program for Take Values from Selection-Sc...
- sap abap program for Change Text Into Password
- sap abap program for Function Module for Encryptio...
- sap abap program for FM VRM_SET_VALUE To List Box
- sap abap program for Value Request For Parameter
- sap abap program for Pop a Message to specific SAP...
- ABAP Pop-out box for user confirmation
- sap ABAP program for POP-UP Window
- sap abap program Sample XML Source Code For SAP
- sap abap XML file to word document through SAP
- sap abap program for How to Write Web Reports in SAP
- sap abap conversion Program to Test Line Selection...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for Convert SAP Spool List to HTML
- sap program for Convert Month to Word in ABAP
- ABAP function to convert Number to Words
- sap abap program for How to Create Tree Control
- sap abap A sample Tree Programming
-
▼
November
(716)
No comments:
Post a Comment