Need help in processing an excel into SAP
Hi All..
Im uploading an excel file from presentation server to SAP...
Now the problem is hw to know how many records are there in the excel file..
Have coded like below...
w_max = '65536'.
w_counter_lo = '2'. "Start on row 1 because of header row
w_increment = '9999'. "Increment by 9999 each loop
w_counter_hi = w_counter_lo + w_increment.
WHILE w_counter_hi <= w_max AND w_counter_lo <= w_max.
" Clear the work area and the internal table to prevent duplicate rows
CLEAR it_import_table.
CALL FUNCTION 'ZPM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = w_counter_lo "we have a header row
i_end_col = '5'
i_end_row = w_counter_hi
TABLES
intern = it_import_table
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
"Increment our range
w_counter_lo = w_counter_hi + 1.
w_counter_hi = w_counter_lo + w_increment.
"We SHOULD NOT scan any more than our max, so set our top end of the range
"to the total number of rows to scan if the w_Counter_hi exceeds the max.
IF w_counter_hi > w_max.
w_counter_hi = w_max.
ENDIF.
ENDWHILE.
Considering the excel file would contain not more than 65536 records have coded like above...
But the problem is sometimes the file may contain lesser records say 10000 records even then also the while ..endwhile executes to check the last record( until 65536 records)..
pls help me to handle this..
Thanks,
Priya
w_max = '65536'.
w_counter_lo = '2'. "Start on row 1 because of header row
w_increment = '9999'. "Increment by 9999 each loop
w_counter_hi = w_counter_lo + w_increment.
before reading your file you want to know how many rows are there in excel file. put this code here.
TYPES:
truxs_t_text_data(4096) TYPE c OCCURS 0.
DATA:
lv_var TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
i_tab_raw_data = lv_var
i_filename = p_file * path of file
TABLES
i_tab_converted_data = t_record
EXCEPTIONS
conversion_failed = 1
OTHERS = 2 .
here you will get all records in t_record internal table.
IF sy-subrc <> 0.
MESSAGE 'Error in Uploading the specified file.' TYPE 'I'.
ELSE.
DESCRIBE TABLE t_record LINES w_counter_hi
ENDIF.
refresh t_record.
So, now you have no of lines in w_counter_hi variable.
WHILE w_counter_hi <= w_max AND w_counter_lo <= w_max.
" Clear the work area and the internal table to prevent duplicate rows
CLEAR it_import_table.
CALL FUNCTION 'ZPM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = w_counter_lo "we have a header row
i_end_col = '5'
i_end_row = w_counter_hi
TABLES
intern = it_import_table
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
"Increment our range
w_counter_lo = w_counter_hi + 1.
w_counter_hi = w_counter_lo + w_increment.
"We SHOULD NOT scan any more than our max, so set our top end of the range
"to the total number of rows to scan if the w_Counter_hi exceeds the max.
IF w_counter_hi > w_max.
w_counter_hi = w_max.
ENDIF.
ENDWHILE.
Regards,
PD
Similar Messages
-
Upload data from Excel into SAP CRM using webservices
Hi,
I want to upload the data from EXCEL into SAP CRM using a web service, can anyone say me the process and also how to map the excel and the source code structures.
Thanks,
Sanju.Try the following :
Class: CL_GUI_FRONTEND_SERVICES
Method: GUI_UPLOAD
Thanks
<b>Allot points if this helps!</b> -
Need help On Triggers/Change pointers in SAP
Hi Experts,
I Need help On Triggers/Change pointers in SAP.
I have a requirement as soon as an entry is created in one of the Standard SAP table it should check against my Ztable and update and create the corresponding entry in another Ztable.
Can some one help me out on this with the syntax and how to do itHi,
Check whether you have any enhancement option (BADI, user exit, Customer enhancement etc) in the program which is used to save the data in the SAP standard table. If so, then try to write your code in that appropriate enhancement. -
Need help estimating processing power required to support new process
Hi,
I am putting up a new server spec for a new project. I need help estimating processor power I need.
Here are, in short, the steps of the main process:
- Load the data:
Incoming file contains 160 mln rows. The SIZE of this file is 250 GB. The file has about 60 columns, out of that I upload 50 into my table.
Record length is 1500 bytes, in the table.
- Validation/calculations:
After the upload I validate EACH row in this table against 20 rules that are defined in the RULES table.
It is all math, like this column plus that column must be equal to this number, and validate the third column against this number.
- Output stage:
Records that pass validation go to one table, those that didn't go to the other table.
Then the first table (with good records) is extracted to a file. Those from the "wrong" table are also get inserted into "review" table
This whole process should take about 5-6 hrs.
This file contains 6 month of data.
Some times, I will run validation against 2 year worth of data, means validate two "annual" tables, each one is 500 GB in size. According to the requirements, this process should take no more than 1 day.
For this process I write hardware spec for a new server.
I have a hard time figuring out how much processor power I need for this process? to validate this much data in that much time.
Is there any formula or a guideline to tell what processor I need? I was looking at this one, but I wish I could estimate before I buy and try (and possibly fail, and have a biiiiig problems)
Intel Xeon E5-2640 (6 core, 2.50 GHz, 15MB, 95W)
Number of processors: 2
RAM: 16GB
Any help is very appreciated.
Thanks in advance
Edited by: 933238 on Jun 13, 2012 12:25 PM
Edited by: 933238 on Jun 13, 2012 12:28 PMHello Ajay,
Please have a look to these blogs (the second one should be particularly interesting regarding your request) :
/people/kamran.ellahi2/blog/2006/01/13/setting-up-sap-service-desk-123-and-go
/people/dolores.correa/blog/2007/10/06/service-desk-support-team-determination
Hope this helps.
BR.
Stéphane. -
Data upload from excel into SAP
Hi Gurus
Could anyone please guide me how to upload excel data into SAP?
I need to update existing Gross weight and Net weight data. Got new data in excel format.So need to upload excel file straight into SAP and update the data.
Step by step procedure will be much appreciated.
Rgds
Utpaltry with bdc .....
below coding is move the data from excel to internal table ....
TYPES: BEGIN OF s_ovro,
VKORG LIKE V_TVSFK-VKORG,
VTWEG LIKE V_TVSFK-VTWEG,
SPART LIKE V_TVSFK-SPART,
STGKU LIKE V_TVSFK-STGKU,
STGAK LIKE V_TVSFK-STGAK,
STAFO LIKE V_TVSFK-STAFO,
END OF s_ovro.
DATA: I_OVRO TYPE TABLE OF s_ovro,
w_ovro type s_ovro.
data : request(15) type c,
i type c.
DATA : IT_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE.
FIELD-SYMBOLS: <FS1> TYPE ANY.
include bdcrecx1.
SELECTION-SCREEN BEGIN OF BLOCK DATA WITH FRAME.
PARAMETERS: P_FILE TYPE RLGRAP-FILENAME DEFAULT 'C:\Documents and Settings\itfactory\Desktop\sd1.xls' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK DATA.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 24
I_END_ROW = 60000
TABLES
INTERN = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
LOOP AT IT_EXCEL.
ASSIGN COMPONENT IT_EXCEL-COL OF STRUCTURE
W_ovro TO <FS1>.
<FS1> = IT_EXCEL-VALUE.
AT END OF ROW.
MOVE-CORRESPONDING: Wib TO Iib.
APPEND w_ovro to I_ovro.
CLEAR W_ovro.
ENDAT.
ENDLOOP.
through bdc program update the data from internal table to bdc... -
Need help importing canon xf files into final cut X
Hello everyone, I am new to this site and am really appreciative of all the great information I have been able to obtain through everyones posts. I do realize this thred has been beat to death and apologize in advance for being slow. I am in the same situation as I have an xf 300 and 100 and for the life of me cant get all my files into final cut X. It's about to drive me crazy! I have taken the steps to download PikaFoto's workflow tool for the xf files but I am still having problems understanding how to use the program. Thankyou for providing this program as I am grasping for anything I can to get through this problem. Can I take the files directly into this workflow tool or do I need to go through my xf utiliy program? I just need a basic process to go from my camera to final cut X. A few of you guys have aparently been able to make this work with the same problem so I know it has to be something my tiny brain has not been able to process yet. Any help would really be great. Thanks
fredhil123 wrote:
.. when I place these files into the package contents of either of my libraries, Final Cut Pro X doesn't recognise them.
what a surprise...
FCPX is - besides many other features - a highly complex data-base application.- Just dragging some content just somewhere isn't the workflow how a data-base.app can manage its data. I dare to say, your experiments distructed your file-structure irreversible.
You should revert to some back-up BEFORE installing a beta.OS (!!) on a productive system.
quote https://appleseed.apple.com/sp/betaprogram/faq?locale=en
What if I have problems running the pre-release software?
Always back up your computer before installing pre-release software.
speaking of Yosemite: You signed an NDA on download NOT to discuss any issues with this public beta....... -
Need help in process chain *need help immdtly*
I need help in creating one process chain.
1. i have to load one infopackage to a PSA.
2. then have to do load for one infocube from two different infocubes one after the other.
for all these loads one restriction of fiscal year period to be common value.
this value may either be allowed to user to select or loaded automatically taking the previous fiscal year value .. any of these two options are fine.
it would be helpful if anyone can help me out.Here is the code for Z program...you can create Tcode thr SE93 where user can enter value .
parameters: fsper type /BI0/OIFISCPER DEFALUT 2010008.
data: wa_tvarvc type tvarvc.
wa_tvarvc-NAME = 'FISCPER'
wa_tvarvc-TYPE = 'P'.
wa_tvarvc-NUMB = '
wa_tvarvc-SIGN = 'I'.
wa_tvarvc-OPTI = 'EQ'.
wa_tvarvc-LOW = FSPER
INSERT TVARVC FROM wa_tvarvc.
Code for DTP's in Field Level.
data: wa_tvarvc type tvarvc.
select single from tvarvc into wa_tvarvc where NAME = 'FISCPER'.
L_T_RANGE-low = wa_tvarvc-LOW
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'EQ'.
APPEND L_T_RANGE -
Need help for use crm fields into EJB2
hello i need help.
i have one db table (table_1):
id_1
field_1
nad the second table that depends from the tale 1:
id_2
fields
id_1
id_1 is the field that join the table 2 with the table 1.
can anybody helps me to implemet this relationship into the xml files and into the java class?
into the java class for the second table i have:
public abstract long getId_1();
public abstract void setId_1(long Id_1);
public abstract long getId_2();
public abstract void setId_2(long Id_2);
public abstract String getField();
public abstract void setField(String field);
how must i reference the relation into the bean and into the confdiguration xml files (i use Weblogic 8 and EJB 2.1)
ThanksSRM doesn't use kind of "cockpit" LO-like in ECC.
Overall picture:
http://help.sap.com/saphelp_srm40/helpdata/en/b3/cb7b401c976d1de10000000a1550b0/content.htm
If you setup data flows accordign Business Content of SRM:
http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/7aeb3cad744026e10000000a11405a/frameset.htm
Then just perform an init load and schedule the deltas. -
I need help putting Classical Music CDs into iTunes
I need help - this question has lots of subquestions, sorry.
I have found just a few discussions that deal with this but I am still confused. Forgive me if I get wordy and misuse technical terms - I am trying to learn this thing...
I'm an iPod newbie and haven't a clue on the best way to organize my many, many classical CDs that I'd like to put onto my iPod Classic 160G. I'd also like to do this with as little fussing around as possible since there are lots of CDs I've got to deal with.
If each CD is a separate entry [album?] in the playlist and titled with composer name first [ex Bach, Brandenburg Concertos, Titov conductor] I'll have several playlist entries with the same titles, but different contents. No problem really.
But, should I separate it further, by having each concerto [say] be a separate entry in the playlist - without having to download the CD again. [I've just practiced on a few CDs but I imagine it being a problem if I had to download each CD several times - once for each work] Does it make sense to leave gaps between movements? [I'm not finding a way to remove gaps, though I have seen that suggested somewhere]
And when I come to play the pieces, if I start playing a work in a playlist, will the iPod keep going from one movement to the next as it makes its way through the playlist - or will it stop at each movement and wait for me to tell it what to do next?
Advanced Settings - are these the best? I'll be listening to music on an airplane using noise cancelling headphones and at destination attaching iPod to portable speakers to listen to music in hotel rooms.
General: Keep iTunes Music folder organized - unchecked? [not sure what this means or does or doesn't do]
Copy files to iTunes Music folder when adding to library - checked?
Importing: AAC encoder? High quality -128 kbps?
Thanks for all your help - I know this is a multiple set of questions and perhaps should have been broken up...
Mrs H
Message was edited by: Mrs H to fix typos
Message was edited by: Mrs HThank you so much for your help. You have sorted out a lot of problems for me. I've tried to go through what you wrote, add some more info and I have asked a few more questions below-
I re-ripped at 256. I too have the 160GB classic so it's good to know that it will take 10,000 tracks as lossless - now I have to re-rip again! I actually hadn't anticipated using the iPod with anything other than our high quality noise canceling airplane headphones, our cheap, portable travel speakers for hotel rooms and our Cambridge sound speakers for our cabin. It's that last set of speakers that makes me think I should follow you advice and go with lossless.
QUESTION #1 - When I re-rip and do an automatic sync, will the tracks at 256 automatically be replaced by the bigger lossless ones with the same name or should I delete everything from the iPod and begin anew?
"I create a playlist for each work, using a systematic naming convention..." What I did on my test was create a playlist for each composer breaking it down - ex- Bach:concertos, Bach:sonatas, etc. I have the Album column highlighted and it appears as if the movements stay together in the correct order. I fear that the task might be too large to create a playlist for each work, though that certainly is appealing.
QUESTION #2 If the Album column is highlighted and the movements are in the correct order in iTunes in the playlist, will they stay that way in the iPod?
"I tend to use just surnames for composers for example, or at least "surname, firstname"." I finally found in settings on the iPod the way to change sort by composer to last name, first name. In iTunes, the composer column which is imported from the internet search for info on the CDs gives composer with first name first and I can't find a place in iTunes to reverse this. Typing it or erasing the first name will be a huge chore.
QUESTION #3 Is there a place in iTunes to change the order of the composers' name in the composer column?
"For compilations etc I still create one for the whole CD or box set"
I figured this out on my own before you corroborated my idea - I think I'm getting the hang of this...
"The option iTunes has to "organise your music" is a good one"
QUESTION #4 - are you referring to the preferences > advanced check box "Keep iTunes Music Folder Organized" ? If not, what are you referring to?
"I have my library in its own dedicated disk. Wherever you put it, its important to then never change it or doing anything else with it: leave it for iTunes."
QUESTION #5 "dedicated disk"? as in hard drive? I have been using SuperDuper to back up my Mac to an external HD; I plan to put a copy of the iTunes folder onto yet another HD where I keep copies of all our photos as well.
"never change it"? I noticed a misspelling "Haendel" from the on-line CD/track info - no problem in fixing that - right? Since you later say you do change info, what is it you are never changing?
QUESTION #6 - "Disk N of M capability" - what? Where do I find this option? And when you say "for multiple CD albums, don't include the cd number in the album name." Where? when you put the CD into a playlist entry? or just in the list of music in the album column - do you change the listing?
ONE FINAL QUESTION - when I turn on the iPod when it's not attached to headphones or speakers, and I'm just looking at the screen to see settings or how the syncing worked, the iPod appears to begin playing something as soon as I turn it on. THIS IS A STUPID QUESTION, but I can't find the answer, how to I get it to stop playing without turning the iPod itself off???
"I hope that helps a little. " A little?? It helps a lot - and I'll award those points as soon as I get it all resolved.
Thanks again,
Mrs H -
New to sap - need help in configure backup strategy for SAP XI server.
hi gurus
being a netweaver guy, recently i have been given the responsibility of few basis activities.like database backup.
can any one tell me clear procedure to take both daily online and weekend full offline backup of oracle in to disk first and then to tape. i have seen in the internet material few discussing about brbackup and few about sap DB13. i am totally confused which one to use, and which is good. please help
akhilHi,
welcome on board as SAP Netweaver guy,
don't be confused both DB13 and BRtools are the same both of them will call brbackup.
to configure the brtools you have to change in your brtools profiles located at %ORACLE_HOME%/dbs
please before changing any thing take backup from that folder.
- to take the backup to disk then to tape you will need extra backup software, because using the SAP slandered tools you have to select either Disk or Tape.
Thanks
Sherif -
Need help in developing mobile app using SAP
Hi
I have a team of Android, iOS and Windows developers and we are planning to start developing mobile using SAP and SAP Fiori. Need help in getting started with SAP mobile development like i need plugins and development kits that i need to use.
Thanks
RamHi,
What help needed ?
For SAP Fiori Use this link : http://scn.sap.com/docs/DOC-41598
For SAP Fiori Installation and Configuration Steps: http://scn.sap.com/community/mobile/blog/2014/06/10/fiori-technical-installation-and-configuration-of-one-app-from-a--z
Which Software you will use to develop Mobile Apps in SAP Platform ?So that i will suggest what to do ..
Regards
Lokesh -
Need help restoring iPhoto 08 Library into iPhoto 11
Ok, I have spent hours trying to figure this out on my own. I'm not being lazy but I need help! I have a black macbook (2009) that had Leopard (not Snow) and iPhoto 08. It crashed. I had a time machine backup on external drive. I got a new hard drive installed and they upgraded me to Lion and iPhoto 11. I messed up and started the system without hooking up to time machine. I tried to use migration assistant. It imported only imported 400 pics of my many thousand pics.
I did several things: I tried to rebuild the library, look for orphans, etc. I deleted the ProjectDBVersion.plist, Projects.db, Projects.db-journal files as someone suggested. I deleted the new iphoto 11 library. i dragged the my old iphoto library from time machine. I held down option and tried to build it again from the old library. I still get the same 400 pics. I even tried the free version of Photo Library Manager. It created the same library with 400 pics. (not sure if I know how to use this app right).
If I open the new iphoto 11 library, I can see my pics in the "Masters" file. I was able to drag these to my desktop and then put in iphoto but does this method save my edits? Should I drag the "Modified" pics into iphoto instead? I don't care much about keywords, I just want my edits. I also don't want old deleted photos put back into iphoto.
another question, time machine (TM) is not turned on yet with new hard drive and OS. it doesn't recognize my external drive as TM. It asks if I want to designate it as TM. If I do this, will it delete my old backup (with all my important data) and start a new backup of my new hard drive which doesn't have all the pics yet.
I don't have a copy of Lion so if I do a complete restore, I will have to buy it and add all info again. Is this my best option? Would it really make a difference?
Terrance, you out there?
Thanks for any help!It might start backing up your new drive but will not erase what's on it as long as there is sufficient space. Also you can turn on TM and exclude your entire HD via the TM Options pane.
Then go to your Pictures folder and enter Time Machine. Go back to the appropriate date, select the library and use the Restore button.
OT
NOTE: if you have trouble entering TM's backups go to the Lion forum and ask your question there. Also do a search there for Time Machine so see if there are any similar topics there already. -
Need help in stroring CLOB data into a table
Hi All,
I have a CLOB data. Which contains delimited data.
Example:
"111#|#ABC#|#asfsdffgh $|$222#|#XYZ#|#jdsfgdskdsf $|$"
#|# - is column delimiter.
$|$ - is row delimiter
I want to extract and store the above data into a table which has 3 columns. Need help.
I have Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
Thanks in advance,
Girish GHi Girish,
Please go through the below url's...It will give you fair idea and solution. HOpe you know the sql *loader utility. or external table.
http://www.oracle-base.com/articles/10g/LoadLobDataUsingSqlLoader.php
http://www.oracle-base.com/articles/10g/ExternalTablesContainingLobData.php
KPR. -
I need help to process photos.
I need help processing photos
You really need to provide a lot more information. Also, it would be better to ask in the appropriate Photoshop forum.
-
How to upload the data from two sheets in one excel into SAP
Hi experts,
My requirement is to upload the data from two sheets in an excel into an internal table.How can this be achieved.Is some OLE application has to be used?
Thanks
AbhishekHi
see this program will upload excel file to application.
*& Report ZSD_EXCEL2
REPORT ZSD_EXCEL2.
types: begin of ttab ,
fld1(30) type c,
fld2(30) type c,
fld3(30) type c,
fld4(30) type c,
fld5(30) type c,
end of ttab.
data: itab type table of ttab with header line.
selection-screen skip 1.
parameters: p_file type localfile default
'C:\test.xls'.
selection-screen skip 1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
clear itab. refresh itab.
perform upload_data.
loop at itab.
write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
endloop.
* Upload_Data
form upload_data.
data: file type rlgrap-filename.
data: xcel type table of alsmex_tabline with header line.
file = p_file.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '200'
i_end_row = '5000'
tables
intern = xcel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
loop at xcel.
case xcel-col.
when '0001'.
itab-fld1 = xcel-value.
when '0002'.
itab-fld2 = xcel-value.
when '0003'.
itab-fld3 = xcel-value.
when '0004'.
itab-fld4 = xcel-value.
when '0005'.
itab-fld5 = xcel-value.
endcase.
at end of row.
append itab.
clear itab.
endat.
endloop.
endform.
Maybe you are looking for
-
Map (just started) of iChat Contacts.
Hi All, I have just started a Frappr Map of the contacts I have had. I have asked some of the regular people and some contacts in the last few days to add to the map Hopefully some will say what Application they were using as well as where they are.
-
FCP not making new clip on timecode break
I want FCP to make a new clip every time I start/stop recording... I have "make new clip" set on timecode break in the User Prefs... Why is it not making new clips?
-
Screen Sharing.app fails through ssh tunnel with "You cannot control your own screen"
I need to control a remote Mac mini running 10.7 through an ssh tunnel. I've set up ssh with -L for the appropriate ports, and bound my local ports 5900 and 5800 through this. When I connect to 127.0.0.1 with Screen Sharing.app on my macbook pro whi
-
Highlight All Matching Variables (mark occurrences)
I just downloaded the latest CFB to try out. I have had the ability to have all matching variables highlighted in Eclipse for as long as I can remember. It works in CFEclipse, but I cannot figure out how to double click on text and have all matching
-
Create Index Series for France
Hi all I have to create the Index Series for France (S_ALR_87009182 - Maintain Index Series / T-code OAV5), but I don't know how to handle. My French colleague only sent information from "Cabinet Roux: Coefficients des Revalorisation des Estimations