Quantcast
Channel: SCN: Message List - uploading excel problem....any way out....
Viewing all 10 articles
Browse latest View live

Re: uploading excel problem....any way out....

$
0
0

Gaurav,

 

I believe, TEXT_CONVERT_XLS_TO_SAP has an internal restriction of 255 characters.

Please refer the threads below, which discuss the same issue.

http://scn.sap.com/thread/1360380

http://scn.sap.com/thread/534045

 

I think you must try GUI_UPLOAD, which is quite handy or if you want to use TEXT_CONVERT_* than split your data(which are more than 255 charcs ) into multiple cells in the source excel.

 

Finally in the loop concatenate the text into one before using "SAVE_TEXT".

 

Hope this helps.

 

Cheers!

Abhinab


Re: uploading excel problem....any way out....

$
0
0

Hi Abhinab,

 

     Thanks a lot for the threads.Also would say that AS per my requirement the client is not asking for CSV file way.He is asking for direct upload.I don't know why.My client can't even spend 30 sec to save the excel in csv format and then upload.Previously I did with that way only and everything was working fine.No he wants direct upload from excel into sap. And yes, I used GUI_UPLOAD and loaded the data into it_raw[] and then used 'TEXT_Convert_ ' as when I used GUI_UPLOAD the data which was read from the excel was in symbolic format which I couldn't able to understand whether it read all the characters or not.

I have mentioned my code below please do have a look.

 

Regards

Gaurav Gautam

Re: uploading excel problem....any way out....

$
0
0

Sometimes clients need to understand that the effort required to meet the final 5% of their desires is going to be expensive. Your client might want to load native xls, but it's not in fact a business requirement. How about you tell them that you can do it, but it'll take six weeks more effort - the cost argument over "nice to have" might win then.

 

Now, are you using TEXT_CONVERT_XLS_TO_SAP or TEXT_CONVERT_XLS_INTO_SAP. You keep saying the latter, but that doesn't exist on my system. Accuracy is important.

 

One approach you might try is take a copy of TEXT_CONVERT_XLS_TO_SAP and fix the 255 char limitation. I've had a brief look at that and it is a complicated task - the main point of error is the definition of structure SOI_GENERIC_ITEM as defined in type group SOI. You certainly don't want to change that, so you'd have to do a lot of copying of SAP programs. Even then, the 255 limit may be built into the OLE interface, in which case you're stuck with that route.

 

If the files you're reading are xlsx files (as opposed to the old xls files), then you might like to check out abap2xlsx - http://scn.sap.com/community/abap/blog/2010/07/12/abap2xlsx--generate-your-professional-excel-spreadsheet-from-abap , This is normally used for generating geniune excel files, but it may also read them; I've not looked deeply into it. If it doesn't work, it might be a starting point, since xlsx is merely a cab file of xml, and therefore readily parsable. But as I say, it could take weeks, and so be very expensive.

 

My best advice is flag up the word "expensive" to your manager, and let him/her deal with it. You've hit an important restriction in SAP, to get round it is going to cost money and time.

Re: uploading excel problem....any way out....

$
0
0

Hi Matthew,

 

   I apologize for the mistake and thanks for this.I have used "TEXT_CONVERT_XLS_TO_SAP' Now when I dig in details of this FM I saw there is a table used as I_TAB_CONVERTED_DATA which has a associated type of STANDARD TABLE.Now when I tried to write the complete FM I got stuck with SOI_GENERIC_ITEM as you mentioned.Also when I created SOI_GENERIC_ITEM with value more than 256.It didn't worked so the complete Zfm which I created was worth it.So I gave my best in this but the problem is, it is technically feasible, so I got this crap to do.As when I tried to enter the text in Basic_data_text it took more than 255 characters.It means it works.I also used OLE concept and it worked , it read upto 520 characters but I couldn't able to find the way to update the text in basic_data_text in mm03.

 

And really thanks for those words specially 'expensive' I really think that the best way as what ever be the matter , most important is money matters.... Let me forward this matter in the way you expressed it and hope for the best

 

And thanks for the thread its really a great thread.

Re: uploading excel problem....any way out....

$
0
0

The main problem is TEXT_CONVERT_XLS_INTO_SAP  where output comes in  I_TAB_CONVERTED_DATA which of type STANDARD TABLE , now STANDARD TABLE has the VALUE field as STRING which can incorporate 1027(variable) chars but TEXT_CONVERT_XLS_TO_SAP only passe 255 chars , other logical choice is to use other modules like ALSM_EXCEL_TO_INTERNAL_TABLE for file uploading but  ALSM_EXCEL_TO_INTERNAL_TABLE use table INTERN LIKE ALSMEX_TABLINE in which VALUE coloumn is of 50 length which will be worse then TEXT_CONVERT_XLS_TO_SAP so i will suggest that you either change the format of the file that is coming or use UNIX scripts to convert the data.

Re: uploading excel problem....any way out....

$
0
0

Hi,

 

Why don't you loop on It_raw and SPLIT it into your structure based on TAB or Comma delimiter that way you can have a internal table Itab_upload will have the custom field length more than 255 and you can process accordingly.

 

Cheers,

Arindam

Re: uploading excel problem....any way out....

$
0
0

Can you describe a little more..

 


Thanks and Regards

 

Arpit Gupta

Re: uploading excel problem....any way out....

$
0
0

Hi Arindam Mondal,

 

     Thanks for the idea but the problem is reading of data.Complete data is not read in it_raw which is problem.I hope now you understand this.

 

Regards

Gaurav


Re: uploading excel problem....any way out....

$
0
0

Hi,

 

I really dont kno flow of the program, but the basic algorithm can be like this:

 

1. Do the processing with first set of data that gets selected

2. IMPORT the table to a memory location this kind of saves the table in global location visible to the whole context of execution

3. When you get the next set of data EXPORT the table from memory location and APPEND the next set of lines.

 

Hope it helps.

 

Cheers,

Arindam

Re: uploading excel problem....any way out....

$
0
0

Hi,

 

Check these keywords usage you will get the idea

 

IMPORT.. <dobj> ...

EXPORT <dobj>..

 

They kind of hold on the data in a global memory location

 

Cheers,

Arindam

Viewing all 10 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>