Thanks for the excellent video. I am having a requirement to wrap an alv field content when it is more than 128 length. Could you please suggest me a way to display the field (wrap the data when the length is more than 128) in alv report?
With an Excel Upload you can only maintain the records in ABAP but not record for record in a transaction like MIRO. What is your usecase? or what would you like to achive? 🤗
Excellent. Nicely explained. Although I am able to copy your code and import data from excel into internal table, I am not able to understand your coding. Expressions like =>, ->, NEW, ->* etc. I am unable to comprehend. Please tell me where I can learn all these steps in detail? Thank you
Thank you for your feedback! 🤗 To your questions: => you call a Method of a class -> Method chaining, means the result of method 1 is the input of method 2 NEW a new operator released with Release 7.40 the same as Create Object ->* This operator is used for dereferencing while using dynamic types. You can practise examples with the new operators and syntax after Release 7.40 I have created some videos with, in my opinion, useful functions and operators. Hope that helps! 🤗
Hi and thank you for your feedback! 🤗 Sound quality should be better now. I have improved some microphone filters, have a look to my newer videos! Regarding the font size: It is for me current a mixture of size and overview. With this option you see more code at once. It is easier to read if you use methodchaining for exmple. The videos are good viewable with 720p. I have to balance overview and font size, but I will test some different settings. 😀
I am processing the internal table using loop statement as shown below - LOOP AT ASSIGNING FIELD-SYMBOL(). -A = lwa_mgo-consumer. But this statement giving me error showing "The data object "" does not have a structure and therefore does not have a component "A". I want to copy this internal table to user define internal table. Can you please help me with this.
Great video, thanks for the upload. I have a couple of questions!! Q: What to do if we want to limit the input of the .xlsx file? -> Let's say the file has 30K line items and I want to process 20K first then the remaining once i.e. 10K. -> How to split? and then how to process the remaining line items? [I know manually we can split the files and then process but I want to automate this process]
I would have to try that myself. I would start here from line 60. In the field-symbol are all entries of the file. Here you have to split them and process them as you like. 🤗
Hi great video but I dont understand why are you always try-catch generic cx_root? Is this some kind of best practice? Do you know where can I find some more info what and where shoud I catch?
I my examples I only want to prevent a dump. Thats the reason why I use it. If you know what exceptions could be raised then you should use specific Exception Classes. Depends on your need. 🤗
Thanks a lot for this, it is very helpful ! But I have a question for you. Let's say that I have an excel that I would like to convert into a txt file with a specific column delimitation (which have some differences from my excel) How can I achieve that ? My Idea was to loop the field symbol, not sure how, or try to move the content of the excel in an internal table and from there loop in a work area to put the fields as I need it, but then, how can I convert that in a TXT file that the user can download ? VIELEN VIELEN DANK !!!!
The approach is good, maybe this video will help you: th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html This is an extension in which I write the data from Excel into a database table. You would have to write the rows to a file instead of the database. 🤗
Normally in SAP you only need the simple data and no formatting options. The class cannot handle this. Is there a use case where you need the formatting from Excel in SAP? 🤔
@@CustAndCodeI notice if cell content example "Hard Rubber" is in bold then text is read fine but if its mixing of style example "Hard Rubber CX80" with CX80 as bold and Hard Rubber as normal then content is read blank. One more issue is white character (special) that look like space.This breaks stream in between and read incomplete content.To resolve this i copy cell content first to notepad and from notepad back to excel cell.
@@adityasharma-lf2zt The formatting options in Excel are the problem here. Maybe there is also an option in Excel to remove all formatting then you save the copying into the notepad. 🤗
After line 60 the data is assigned to the filed symbol . After that, you can copy and modify the data to an internal table. I make a video about this. Maybe in the next few days. 🤗
Here is the link to a video in which this is described. ► th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html The code from this video will be extended to do this. 🤗
Have a look at this video: th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html In this video I extend this code to insert the excel in a database table. For this I loop over the field symbol. Here you can check and change the column names. 🤗
I get FILE_OPEN_ERROR dump when trying to upload a file, error occurs at gui_upload, what could be wrong? the file i am trying to upload is an .xslx file.
Importing Data from an Excel to SAP unfortunately involves a few steps. I have given these step by step. 🤔 You can use the code in every SAP System ore you can put the code in a class or function module. 🤗
@@CustAndCodethanks for reply , at 20.01 alphabetical column(A,B,C,D,E,....) i don't want that row at the top because after converting the data (internal table to excel )first row is coming blank.
Hello, I'm new to ABAP Can somebody tell what o_worksheet_itab type is? cl_abap_typedescr says that the type is "type =%_t0000450000000000000023888" What does it mean? Why we can't directly pass o_worksheet_itab to cl_salv_table=>factory ( ... ) method instead of fieldsymbol? Thanks in advance!
Hi Max, o_worksheet_itab is only the referenced object, you can see this in the debugger. To work with the data or to display it you need to assign it. 🤗
This solution is not the best for a huge mount of data. Hava you tried this video? ➡th-cam.com/video/r2CQWvLRHco/w-d-xo.html In this video I show how to import csv files 🤗
@@CustAndCode thanks. I found a solution using a SAP FM. I'm able to upload a csv file with 50k+ records with ease. I'll check the other video and check which one is better
@@CustAndCode Its catching an exception: cx_fdt_excel_core..could it be related to the file I am uploading? I also saw somewhere that this class is recommended only for BRF+ framework adhering files and produces unpredictable behavior for normal excel files..
Excellent work! Thanks a lot , it is working at background as well.
Thank you! Yes should work, read the file from a share on the application server 🤗
Thanks for the excellent video. I am having a requirement to wrap an alv field content when it is more than 128 length. Could you please suggest me a way to display the field (wrap the data when the length is more than 128) in alv report?
I think thats not possible because of the limitation of the ALV grid. 🤔 You can split it? I don't know an other solution. yet. 🤔
Hi, can you make a video where you show how to upload excel data to use it in a transaction like MIRO or posting acconting documents.
With an Excel Upload you can only maintain the records in ABAP but not record for record in a transaction like MIRO. What is your usecase? or what would you like to achive? 🤗
Thank you great tutorial
Thank you and sorry for the bad audio 🙄, my microphone filters are much better now 😀
Great job...it will helpful.
Thank you! 😀🤗
Excellent. Nicely explained. Although I am able to copy your code and import data from excel into internal table, I am not able to understand your coding. Expressions like =>, ->, NEW, ->* etc. I am unable to comprehend. Please tell me where I can learn all these steps in detail? Thank you
Thank you for your feedback! 🤗 To your questions:
=> you call a Method of a class
-> Method chaining, means the result of method 1 is the input of method 2
NEW a new operator released with Release 7.40 the same as Create Object
->* This operator is used for dereferencing while using dynamic types.
You can practise examples with the new operators and syntax after Release 7.40 I have created some videos with, in my opinion, useful functions and operators.
Hope that helps! 🤗
Thank you for your detailed response. May you be rewarded for that.
@@muhammadfahim2627 Thank you! 🤗🤗🤗🤩
Great work, very clean code, please keep it up also, please improve sound quality and increase font size
Hi and thank you for your feedback! 🤗
Sound quality should be better now. I have improved some microphone filters, have a look to my newer videos!
Regarding the font size: It is for me current a mixture of size and overview. With this option you see more code at once. It is easier to read if you use methodchaining for exmple.
The videos are good viewable with 720p. I have to balance overview and font size, but I will test some different settings. 😀
I am processing the internal table using loop statement as shown below -
LOOP AT ASSIGNING FIELD-SYMBOL(). -A = lwa_mgo-consumer.
But this statement giving me error showing "The data object "" does not have a structure and therefore does not have a component "A".
I want to copy this internal table to user define internal table. Can you please help me with this.
Try it like in this video: th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html 🤗 Here I had to declare the explicit: FIELD-SYMBOLS: TYPE ANY TABLE.
@@CustAndCode Thank You for your response. Really appreciated.
@@rakeshpatil4457 🤗🤗🤗
Great video, thanks for the upload.
I have a couple of questions!!
Q: What to do if we want to limit the input of the .xlsx file?
-> Let's say the file has 30K line items and I want to process 20K first then the remaining once i.e. 10K.
-> How to split? and then how to process the remaining line items?
[I know manually we can split the files and then process but I want to automate this process]
I would have to try that myself. I would start here from line 60. In the field-symbol are all entries of the file. Here you have to split them and process them as you like. 🤗
thank you very much!
Amazing! Thnks a lot!
Thank you 🤗
Excellent code I helped me so much. Thanks.
Thank you very much! Great feedback! 😀🤗
@@CustAndCode How can I move data from to itab??
@@christianarmandorivasroble604 You can use as an internal table. Do you have a special requirement?
@@CustAndCode yes you right, but the type of is generic, I-ve never used that but I found a way. Thanks.
@@christianarmandorivasroble604 If you want you can post your solution here 🤗😀
Hi great video but I dont understand why are you always try-catch generic cx_root? Is this some kind of best practice? Do you know where can I find some more info what and where shoud I catch?
I my examples I only want to prevent a dump. Thats the reason why I use it. If you know what exceptions could be raised then you should use specific Exception Classes. Depends on your need. 🤗
Thanks a lot for this, it is very helpful ! But I have a question for you. Let's say that I have an excel that I would like to convert into a txt file with a specific column delimitation (which have some differences from my excel) How can I achieve that ? My Idea was to loop the field symbol, not sure how, or try to move the content of the excel in an internal table and from there loop in a work area to put the fields as I need it, but then, how can I convert that in a TXT file that the user can download ? VIELEN VIELEN DANK !!!!
The approach is good, maybe this video will help you: th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html
This is an extension in which I write the data from Excel into a database table. You would have to write the rows to a file instead of the database. 🤗
Generally works but as checked if i make partial text of row bold then it is picked as blank and also with special characters file stream breaks
Normally in SAP you only need the simple data and no formatting options. The class cannot handle this. Is there a use case where you need the formatting from Excel in SAP? 🤔
@@CustAndCodeI notice if cell content example "Hard Rubber" is in bold then text is read fine but if its mixing of style example "Hard Rubber CX80" with CX80 as bold and Hard Rubber as normal then content is read blank.
One more issue is white character (special) that look like space.This breaks stream in between and read incomplete content.To resolve this i copy cell content first to notepad and from notepad back to excel cell.
@@adityasharma-lf2zt The formatting options in Excel are the problem here. Maybe there is also an option in Excel to remove all formatting then you save the copying into the notepad. 🤗
I have a little question ; what should I do if I wanted to pass the data into a internal table to manipulate?
After line 60 the data is assigned to the filed symbol . After that, you can copy and modify the data to an internal table. I make a video about this. Maybe in the next few days. 🤗
@@CustAndCode I just did it, was lacking a little vision hahahahah thank you again.
@@ben11ur congrats! 🤗
@@ben11ur can u provide me a code, please?
Here is the link to a video in which this is described.
► th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html
The code from this video will be extended to do this. 🤗
I have a little question, How would I go about changing the column names?
Have a look at this video: th-cam.com/video/RGYoJRP2Nqc/w-d-xo.html
In this video I extend this code to insert the excel in a database table. For this I loop over the field symbol.
Here you can check and change the column names. 🤗
I get FILE_OPEN_ERROR dump when trying to upload a file, error occurs at gui_upload, what could be wrong? the file i am trying to upload is an .xslx file.
All the information is in the dump. Have you analyzed it? Look at the code part in the dump. Which line and so on. 🤗 We need an error message 😀
Please reply the code lines to populate the data into internal table.
* solix -> xstring
DATA(lv_bin_data) = cl_bcs_convert=>solix_to_xstring( it_solix = it_bin_data ).
* create spreadsheet ref object
DATA(o_excel) = NEW cl_fdt_xl_spreadsheet( document_name = CONV #( it_files[ 1 ]-filename )
xdocument = lv_bin_data ).
* get first worksheet name
DATA: it_worksheet_names TYPE if_fdt_doc_spreadsheet=>t_worksheet_names.
o_excel->if_fdt_doc_spreadsheet~get_worksheet_names( IMPORTING worksheet_names = it_worksheet_names ).
IF lines( it_worksheet_names ) > 0.
* first worksheet ref to itab
DATA(o_worksheet_itab) = o_excel->if_fdt_doc_spreadsheet~get_itab_from_worksheet( it_worksheet_names[ 1 ] ).
* ref to generic field symbol (excel data)
ASSIGN o_worksheet_itab->* TO FIELD-SYMBOL().
Hi Mr please I have a lot of worries about this tutorial, is there a methodology to better manage this import step by step?
Importing Data from an Excel to SAP unfortunately involves a few steps. I have given these step by step. 🤔 You can use the code in every SAP System ore you can put the code in a class or function module. 🤗
Can you Do a video on a File from Application Server (.xlsx) to internal table.
I look at this. 😊
@@CustAndCode is that possible without these F.M's ALSMX_EXCEL_TO_INTERNAL_TABLE or TEXT_CONVERT_XLS_TO_SAP. any other method.
Is this working in web gui ?
Yes it should! WebGui is just another way to present data from backend. The code should work for WebGui as well! 😀
hey i have one little Q ,at the output A, B, C, D showing on upper side(header),how to remove this
You want to remove the headerline in the excel? the columnnames? 🤔
@@CustAndCodethanks for reply , at 20.01 alphabetical column(A,B,C,D,E,....) i don't want that row at the top because after converting the data (internal table to excel )first row is coming blank.
Hello, I'm new to ABAP
Can somebody tell what o_worksheet_itab type is?
cl_abap_typedescr says that the type is "type =%_t0000450000000000000023888"
What does it mean?
Why we can't directly pass o_worksheet_itab to cl_salv_table=>factory ( ... ) method instead of fieldsymbol?
Thanks in advance!
Hi Max,
o_worksheet_itab is only the referenced object, you can see this in the debugger. To work with the data or to display it you need to assign it. 🤗
Can I use this using csv format? I need to solve issue with csv file having a huge data. I'm thinking to convert csv to xstring to internal table.
This solution is not the best for a huge mount of data. Hava you tried this video?
➡th-cam.com/video/r2CQWvLRHco/w-d-xo.html
In this video I show how to import csv files 🤗
@@CustAndCode thanks. I found a solution using a SAP FM. I'm able to upload a csv file with 50k+ records with ease. I'll check the other video and check which one is better
cl_fdt_xl_spreadsheet class produces an error for me. Any alternatives?
But the class is available in your system? Which error do you get? Almost any error can be fixed 🤗
@@CustAndCode Its catching an exception: cx_fdt_excel_core..could it be related to the file I am uploading? I also saw somewhere that this class is recommended only for BRF+ framework adhering files and produces unpredictable behavior for normal excel files..
@@nisargmehta796 Could be 🤔 Maybe check your code with a simple excel file. Maybe there are some invalid values in the file itself? 🤔
Thanks a lot, I work with some SAP packages but some of them are missing some functionality. 🥲🥲🥲
Yes that is possible. The functions and classes depend on the SAP modules installed on the system. 🤗
thank you very much!
Thank you! 🤗