2022 Dec 29 2:55 AM
Hi, experts.
As two picture below. I want to insert some empty rows in the same format as row "14", and then I can Insert inner table data to the rows. When I insert the empty rows, other rows like "Rma Discount" and "TOTAL" are down Automatically.
How can I do that using DOI?
pic 1.
pic 2.
2022 Dec 29 8:32 AM
DOI is limited to simple operations like reading values and formats, writing values and formats, not inserting rows, etc. If you want to do special operations, you need to use direct OLE, either by extracting the OLE "object" used by DOI and executing OLE from ABAP, or by using the Script Collection in DOI which is based on VBScript and the Excel object model, both OLE and VBScript will work with the same methods and properties. In all cases, you know which methods and properties are to be used, by using the Excel macro recorder (and then you'll translate in either ABAP OLE or VBScript).
NB: DOI is slow, limited, can run only in foreground, needs Excel to be installed on user's laptop, prefer using abap2xlsx (community API used for more than 10 years) whenever possible.
2022 Dec 29 8:32 AM
DOI is limited to simple operations like reading values and formats, writing values and formats, not inserting rows, etc. If you want to do special operations, you need to use direct OLE, either by extracting the OLE "object" used by DOI and executing OLE from ABAP, or by using the Script Collection in DOI which is based on VBScript and the Excel object model, both OLE and VBScript will work with the same methods and properties. In all cases, you know which methods and properties are to be used, by using the Excel macro recorder (and then you'll translate in either ABAP OLE or VBScript).
NB: DOI is slow, limited, can run only in foreground, needs Excel to be installed on user's laptop, prefer using abap2xlsx (community API used for more than 10 years) whenever possible.
2022 Dec 29 9:29 AM
2022 Dec 29 9:37 AM
2022 Dec 29 3:06 PM
There's no direct feature in abap2xlsx to insert a row by duplicating another row, but you have the Template feature which does it for you:
Best way to generate Microsoft Excel xlsx from template in ABAP | SAP Blogs
It was developed by Anton in a cloned repository, which he later merged into standard abap2xlsx.