Best way of transferring Excel to ABAP and vice versa [closed] - excel

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What is the latest way to export and import data to/from Excel from SAP ABAP? I used some old OLE libraries but they have some limitations. One other thing I found was the SOFFICEINTEGRATION package, but that looks like was developed in the early 00's. Are there any new developments or should I just stick with OLE or SOFFICEINTEGRATION?

As far as I know, the official SAP solution is the two you described above. However there is abap2xlsx, as a freeware. This has to be implemented separately in your system (probably someone responsible in your company won't agree, implementing "random" stuff in productive business system). You can read more about it here:
https://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx
(I used it only once, creating an xlsx file and worked very well.)

Share some of my experience about Excel handling in ABAP.
1.Excel download from internal table.
data:
lo_table type ref to cl_salv_table,
lx_xml type xstring.
try.
cl_salv_table=>factory(
importing
r_salv_table = lo_table
changing
t_table = lt_data ). "lt_data is your internal table
catch cx_salv_msg.
endtry.
lx_xml = lo_table->to_xml( xml_type = '10' ). "XLSX
call function 'XML_EXPORT_DIALOG'
exporting
i_xml = lx_xml
i_default_extension = 'XLSX'
i_initial_directory = ''
i_default_file_name = 'export.XLSX'
i_mask = 'Excel (*.XLSX)|*.XLSX'
exceptions
application_not_executable = 1
others = 2.
2.Excel upload to internal table.
Function module ALSM_EXCEL_TO_INTERNAL_TABLE. See the example link here.

Related

VBA Can't Assign to read-only property error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
I am having an vba errror - can't assgin to read-only propery - which is triggered at the finding of this code below by the compile error:
ProductCode = ""
I have gone on performing some isolation test and trying to find out what's actually causingt this error with belo actions:
1 - on a seperate module (new), i created a dummy subroutine with above code only, and then pressed Compile VBA project, the error message is triggered
2 While composing above dummy subroutine, as i typed out the word productcode - it is automatically capitalised as ProductCode - I tried to search (ctrl + F) this word throughout all VBAproject suspecting there might be a already declared term of such and therefore triggering the error - but found no matching of such.
3 in the same dummy subroutine i tried to declare the ProductCode as string, and then pressed Compile to check, no error message !
Could someone please shed some light on this?
I am using Excel 365 corporate edition

Regex version number out of package names [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 months ago.
Improve this question
I have a folder with a bunch of packages, each with their version in their name. Im trying to use regex to create a list with those versions to be used later.
Some examples:
Input:
libpci-dev_3.5.2-1_amd64.deb
libpcre3-dev_8.39-12_amd64.deb
libaprutil1-ldap_1.6.1-4_amd64.deb
nftables_0.9.6-1~bpo10+1_amd64.deb
libkdb5-9_1.17-3+deb10u3_amd64.deb
libc-dev-bin_2.28-10+deb10u1_amd64.deb
libboost-locale1.67.0_1.67.0-13+deb10u1_amd64.deb
I want to delete the front of the package name as well all the amd64 and .deb as well as the _ or - surrounding the versions and then just leave the version of the package in the list
Expected output:
3.5.2-1
8.39-12
1.6.1-4
0.9.6-1~bpo10+1
9_1.17-3+deb10u3
2.28-10+deb10u1
1.67.0_1.67.0-13+deb10u1
I managed to select only the numbers, but im having issues with the last examples, where there is also letters involved
Versions are started after _, so 9_1.17-3+deb10u3 should be 1.17-3+deb10u3, and you can extract those using the following regex.
_(.*)_amd64\.deb
Python Example
import re
packages = """libpci-dev_3.5.2-1_amd64.deb
libpcre3-dev_8.39-12_amd64.deb
libaprutil1-ldap_1.6.1-4_amd64.deb
nftables_0.9.6-1~bpo10+1_amd64.deb
libkdb5-9_1.17-3+deb10u3_amd64.deb
libc-dev-bin_2.28-10+deb10u1_amd64.deb
libboost-locale1.67.0_1.67.0-13+deb10u1_amd64.deb"""
versions = re.findall(r"_(.*)_amd64\.deb", packages)
print(*versions, sep="\n")
OUTPUT
3.5.2-1
8.39-12
1.6.1-4
0.9.6-1~bpo10+1
1.17-3+deb10u3
2.28-10+deb10u1
1.67.0-13+deb10u1

Error while converting a .mat file into csv file [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have used :
load('feature_table.mat');
csvwrite('ft.csv',feature_table);
But it shows following error. How can I solve this?
Check for missing argument or incorrect argument data type in call to
function 'real'.
Error in csvwrite (line 47)
throw(e)
More information about the file: The feature_table is a 3240x26 table
I'm not sure what the problem is, but Matlab recommends to use the "writematrix" function instead. See https://se.mathworks.com/help/matlab/ref/writematrix.html
You could also try saving the table as a .txt file, that is the output the Matlab website uses in their example of the csvwrite function (https://se.mathworks.com/help/matlab/ref/csvwrite.html).

How to export database schema in Oracle to a dump file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a database schema on Oracle server installed on a Linux machine. I need to export the schema related information in a dump file.
How to do this ?
It depends on which version of Oracle? Older versions require exp (export), newer versions use expdp (data pump); exp was deprecated but still works most of the time.
Before starting, note that Data Pump exports to the server-side Oracle "directory", which is an Oracle symbolic location mapped in the database to a physical location. There may be a default directory (DATA_PUMP_DIR), check by querying DBA_DIRECTORIES:
SQL> select * from dba_directories;
... and if not, create one
SQL> create directory DATA_PUMP_DIR as '/oracle/dumps';
SQL> grant all on directory DATA_PUMP_DIR to myuser; -- DBAs dont need this grant
Assuming you can connect as the SYSTEM user, or another DBA, you can export any schema like so, to the default directory:
$ expdp system/manager schemas=user1 dumpfile=user1.dpdmp
Or specifying a specific directory, add directory=<directory name>:
C:\> expdp system/manager schemas=user1 dumpfile=user1.dpdmp directory=DUMPDIR
With older export utility, you can export to your working directory, and even on a client machine that is remote from the server, using:
$ exp system/manager owner=user1 file=user1.dmp
Make sure the export is done in the correct charset. If you haven't setup your environment, the Oracle client charset may not match the DB charset, and Oracle will do charset conversion, which may not be what you want. You'll see a warning, if so, then you'll want to repeat the export after setting NLS_LANG environment variable so the client charset matches the database charset. This will cause Oracle to skip charset conversion.
Example for American UTF8 (UNIX):
$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
Windows uses SET, example using Japanese UTF8:
C:\> set NLS_LANG=Japanese_Japan.AL32UTF8
More info on Data Pump here: http://docs.oracle.com/cd/B28359_01/server.111/b28319/dp_export.htm#g1022624

Accessing Multiple Trac projects with IIS using isapi_wsgi [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm a newbie in the bug tracking system world.
I managed to install Trac 0.12 in Windows Server 2003 and was able to serve the project using IIS through an isapi_wsgi extension using the procedure found here: http://trac.edgewall.org/wiki/TracOnWindowsIisIsapi
I installed the Trac project in c:\Trac\Project1, generated the cgi-bin and htdocs directories and placed them in c:\Trac\Project1\.
Now I want to create other projects at the same level than Project1 (c:\Trac\Project2, c:\Trac\Project3 and so on).
How can I change the trac_wsgi.py and use URLs as follows: "http://localhost/Project1", "http://localhost/Project2", and so on?
I have basic experience with IIS and no experience at all with Python.
Any help would be appreciated.
Thanks
You've chosen what seems like a good installation instruction. If I understand correctly, your answer is already in the example given there:
# Setup the virtual directories - this is a list of directories our
# extension uses - in this case only 1.
So you'll want to register multiple virtual directories by copying the example with a list of directories like so (untested):
vd1 = VirtualDirParameters(Name="Project1",
Description = "ISAPI-WSGI Trac",
ScriptMaps = sm,
ScriptMapUpdate = "replace"
)
vd2 = VirtualDirParameters(Name="Project2",
Description = "ISAPI-WSGI Trac",
ScriptMaps = sm,
ScriptMapUpdate = "replace"
)
...
params.VirtualDirs = [vd1, vd2, ...]
I don't know, if you really want to get rid of the ENV_PARENT_DIR in the path. Would it hurt to have 'http://localhost/trac/Project1' instead of 'http://localhost/Project1'? This is the common and expected layout of a multiple projects Trac installation. Just my 2ct.

Resources