Is there a public link between SAP ERP data tables (EKPO, MARA, ...) and SAP ERP Transactions (ME3M, ...) - sap-erp

I want to automate SAP Exports in my Company and query Data from transactions directly from our Datalake. The only problem is that the query results differ from the exported Data directly from SAP ERP. It seems like the wrong attributes/tables are used. Is there a simple way to find a link between SAP ERP transactions and the underlying SAP ERP data tables? Like to reproduce transaction ME3M you need following attributes from tables ekpo, mara and so on.
I've read about transaction ST05 (SQL trace) but sadly this transaction is restricted (I work in a really big company were approval processes are very slow). Is there an alternate way to find out which SAP ERP tables are referenced when calling a transaction?

Related

Google Data Studio report using Cloud SQL MySQL allows only one table

I'm using Data Studio to generate a financial report dashboard and I'm connecting it to CloudSQL MySQL, but my problem here is that it only requires me one table to use as a data source, and one table wouldn't help me at all to generate a financial report at all.
Here's the image of the process of selecting a Data Source:
I tried selecting Custom Query, which according to this: https://support.google.com/datastudio/answer/7088031?hl=en
Select the CUSTOM QUERY option to provide a SQL query instead of connecting to a single table. Google Data Studio uses this custom SQL as an inner select statement for each generated query to the database.
But I don't know what query should I write to have all my database tables as data sources in Google Data Studio.
Regarding Custom Queries: Had a look online, and didn't seem to find a sample CUSTOM QUERY specific to Google Data Studio and Google Cloud SQL for MySQL, however, on StackOverflow, there are a couple of posts on BigQuery Custom Queries that involve joins, that may be useful:
Data Studio query error when using Big Query view that joins tables
BigQuery Data Studio Custom Query
An alternative is to create individual Data Sources each linked to a single table and then link multiple Data Sources through the use of Data Blending, where a common Join Key links all the respective Tables.
In addition, if you could elaborate on your exact scenario, it would perhaps help users familiar with SQL to provide a more precise solution:
How are the tables structured?
How are the tables linked?
What code have you currently tried?
I also had quite a few issues with the Custom Query using the Cloud MySQL Connector by Google for Data Studio.
The resolution for me was to not run SELECT * but rather SELECT each column by name. Not sure why it doesn't like SELECT * but hopefully this helps someone else.
Example of a successful query.
Example of successful query with join.

Querying data from 2 MySQL Databases to a new MySQL database

I want to query data from two different MySQL databases to a new MySQL database.
I have two databases with a lot of irrelevant data and I want to create what can be seen as a data warehouse where only relevent data should be present coming from the two databases.
As of now all data gets sent to the two old databases, however I would like to have scheduled updating so the new database is up to speed. There is a key between the two databases so in best case I would like all data to be present in one table however this is not crucial.
I have done similar work with Logstash and ES, however I do not know how to do it when it comes to MySQL.
Best way to do that is create a ETL process with Pentaho Data Integrator or any ETL tool. Where your source will be two different databases, in the transformation part you can remove or add any business logic then load those data into new database.
If you create this ETL you can schedule it once a day so that your database will be up to date.
If you want to do this without an ETL than your database must be in same host. Than you can just add database name just before table name in query. like SELECT * FROM database.table_name

"Copying" third party databases into central mySQL and keeping mySQL up to date

I have a question which is what I believe to be quite complicated and would like to see what experts like yourselves think about my solution.
Problem:
I am collecting data from a number of third parties into a central mySQL database. The third parties can have any database product (mySQL, Oracle, postgreSQL, etc). I will need to perform two tasks, which are the following:
On first start, replicate the full database onto the central mySQL database
Incrementally update the central mySQL database as changes are done to the third party database
Proposed solution:
I intend on creating database crawlers in C# per third party database. So say for example one of the third parties has an oracle database. I intend on creating a class which will query an oracle database for its definition and data and programmatically create sql queries to be executed by the central mySQL database.
ex: create table XYZ (id1 int, id2 int), Insert into XYZ values(1,2), etc.
Here is the problem which is giving me the greatest grief. Id like to know if anyone has ever queried a database to effectively ask it "what are your latest changes", or what are your changes since dd-mm-yyyy hh:MM:ss. By changes I mean both data changes and data definition changes. ex: add new column, update a [row][column] value, insert new row, etc.
if you have access onto the database writer program, couldn't you just inject a code which generates / writes the data to the central database (aka a LOGGER)?
I mean that you could make your central database as a "LOGGING Database".
If for some reason the third part database needs database rollback, you could just take the command from current timestamp to timestamp-rollback_days and change from INSERT to DELETE, DELETE to INSERT, etc.
That way, your database won't be suffering much because you replicate whole DB :)

Creating new record in form when 3 tables are involved

I have created a form which shows details of users, the data has been split into three tables (table1, table2, table3)
table1 has foriegn keys to link to data in the other tables
The default previous, next and new record selectors worked fine when only table1 was inserted. However after inserting the other two tables the form is unable to create a new record.
I believe its because table2 and table3 are trying to link to the foriegn key in table1.
When pressing "new record" it returns a "You cant go to the specified record."
As one user already pointed out, stored procedures, if available, are definitely the preferred way of making multi-table entries and edits. It's basically a transaction and transactions usually allow you to roll back when an error is encounter.
Access 2010 has stored procedure capabilities built into the database engine but prior versions of Access do not. Other popular database servers such as SQL Server and MySQL also have stored procedure capabilities. To run/call a stored procedure in one of these databases you must either use a Pass Through Query or else use ADO.
Access does have an option on the form level to change your Recordset Type to Dynaset Inconsistent Updates. This allows the form to ignore the relationships in the query that underlies your recordset but any relationships defined in your relationships window will still be honored. You can see a discussion on that here: http://www.utteraccess.com/forum/Dynaset-Inconsistent-Upd-t1664392.html
As pointed out in that discussion, I also design my data entry forms so that they are built on only a single table even if I'm using a query. I then use subforms for data that is in related tables. I think this is pretty much standard design practice in MS Access. Software designed in environments such as .NET can easier violate this because usually the developer is having to write code for all CRUD operations anyway. This gives the developer greater flexibility.
I am not sure what controls you are using, but nevertheless I recomend writing stored procedures for crud operations. This is a good way to update multiple tables

Creating report by switching between data sources and data sets

I am in a process of generating reports using SSRS. I have multiple servers with multiple oracle databases on each server. I am wondering if I can create multiple shared data sources, and shared data sets, and create one reports by switching data sets and data sources.
Otherwise I will have to create multiple reports for each data source, which can run into 100's of reports.
Any suggestion help would be highly appreciated..
Thanks
Nirmal
Almost everything in Reporting Services is an expression, including the SQL Statement of the dataset. This means it can be altered on the fly. Assuming the datasource credentials you use can access the databases you want to get to, then you just supply the database as a parameter and you're good to go. Of course, for databases on other servers you will need to use linked servers so the server you connect to can link across to the other server to access the database.
We have a table with a nice user readable name for the database such as "End of Financial Year 2009" which holds the database name for that data. Create a dataset to use this as a parameter - display the nice name as the label and get the server+databasename connection string from the value.
Then your dataset just looks like:
="SELECT * FROM " & Parameters!Database.Value & "TableName"
This assumes the databases have the same structures as far as the report's needs are concerned.
You have to set the fields manually but it gives you flexibility.