Manually generate PMR in ABAP - sap-erp

We have the need to create an EWM-PMR (by staging from ERP) with an ABAP function, because we need to change the PSA and the required quantity before creating the PMR. Also only selected Materials should be requested at a time not all components from a production order. Is there any one who has resolved this topic.

Related

How to make mysql insert data automatically

recently I've been introduced into the database world so I am initiating with MySQL, but the problem comes when I am requested to create a database for an art event where adults and children have different entrance costs but like I'm not working with other applications, I have to do everything with SQL instructions so as this language has not -if- instructions I would like you to guide me how to do to assign automatically the cost of an entrance when I register an adult or a child inside a column called "entrance cost"
I have thinking to create an entity called "rate" where I place the maximum age with lower cost (for children) and otherwise assign the cost for adults, but I don't know how to make to compare this data when I register an entrance and assign the cost to the user variable "entrance"
I'm really confused with this exercise so I hope you can get it and help me with that.
Thanks in advance.
I think you need to create one master table to configure rates. and eventually, when you add user entrance data, you can map this with rates from master table.
Let's say we have RateMaster Table(RateId, MinAge, MaxAge, Rate).
You add multiple rate records here with MinAge, MaxAge.
UserEntrance Data will have age mentioned for user and you can refer their rates from RateMaster table.
Let me know if this helped.
In a nutshell, you need to work with another language. You can't do a dinamic application using only SQL.
I'd recommend you to use Spring Boot (http://spring.io/projects/spring-boot) with Java or Kotlin. It's a very straightforward framework that will help you a lot, even if you're a starter.

Storing unconfirmed and confirmed data to a database

I am creating a web application using Strongloop using a MySQL database connector.
I want it to be possible, that a user can modify data in the application - but that this data will not be 'saved' until a user expressly chooses to save the data.
On the other hand, this is a web application and I don't want to keep the data in the user's session or local storage - I want this data to be immediately persisted so it can be recovered easily if the user loses their session.
To implement it I am thinking of doing the following, but I'm not sure if this is a good idea, or if there is a better way to be doing this.
This is one was I can implement it without doing too much customization on an existing relation:
add an new generated index as the primary key for the table
add a new generated index that represents the item in the row
this would be generated for new items, or set to an old item for edits
add a boolean attribute 'saved'
Data will be written as 'saved=false'. To 'save' the data, the row is marked saved and the old row is deleted. The old row can be looked up by it's key, the second attribute in the row.
The way I was thinking of implementing it is to create a base entity called Saveable. Then every Database entity that extends Saveable will also have the 'Saveable' property.
Saveable has:
A generated id number
A generated non id number - the key for the real object
A 'saved' attribute
I would then put a method in Savable.js to perform the save operation and expose it via the API, and a method to intercept new writes and store them as unsaved.
My question is - is this a reasonable way to achieve what I want?

How do I change the default behaviour to store the information for each entity in a different table

I want to configure Orion and Cygnus to store all data in a single table.
I know that I should configure the names of databe and table based in HTTP headers like so:
dbName=<fiware-service-header>
tableName=<fiware-servicePath-header>_<entityId>_<entityType>
I was told in this post to ask another question.
Cygnus uses the notified fiware-service and fiware-servicePath headers to compose the names of the different backend elements. Specifically:
MySQL
databases are called as <fiware-service>
table names are called as <fiware-servicePath>_<destination>
HDFS
HDFS paths are created as /user/<your_user>/<fiware-service>/<fiware-servicePath>/<destination>/<destination>.txt
CKAN
organizations are called as <fiware-service>
packages/datasets are called as <fiware-servicePath>
resources are called as <destination>
By default, <destination> is equals to <entityId>_<entityType>. This may lead, as described in the question, to the creation of a MySQL table/HDFS folder/CKAN resource per each notified entity.
Such a default destination generation may be changed by using an advanced feature of Cygnus, the pattern-based grouping; as the name suggests, the feature is based on finding (configured) patterns in the data, in order to group the context data showing the pattern. This feature allows, for instance, all the entities of a certain type are stored within a single MySQL table; or certain entities starting by a prefix are stored together in a HDFS file.
In order to activate this feature, edit the /usr/cygnus/conf/matching_table.conf file and add as many matching rules as you need; matching rules syntax is described here. Basically, the rules say "once the pattern-based matching is confirmed, use this new <destination> and this new <fiware-servicePath>":
<rule_id>|<list_of_fields_to_be_compared>|<regular_expresion>|<new_destination>|<new_fiware-servicePath>
Thus, a "store all the data in a MySQL table called 'my_unique_table'" rule would look like:
<any_unique_number>|<entityId>|.*|unique_table|my_
or:
<any_unique_number>|<entityId>|.*|_table|my_unique
Both rules are valid since MySQL table names are created, as already said, by concatenating <fiware-servicePath> and <destination>; in this case table name is equals to "my_"+_+"unique_table" or "my_unique"+"_table".

Type 3 Slowly Changing Dimension for a Variable Number of Alternate Realities

I'm designing a custom BI application using SSAS with write back operations. Basically users want to analyze the current state of their sale reps and territories, tweak territory boundaries and assignments in a "what if" scenario, then commit the changes if they like the way that scenario looks. Each user can have a number of different scenarios to show his/her boss and when a scenario is approved then that becomes the new current state of the sales organization. I'll be making heavy use of some combination of ROLAP and HOLAP to achieve this.
My boss and I are at odds on how to implement the scenario feature. He has the executive level summary of how SSAS works and is leveraging his years of experience building database applications while I have been experimenting with SSAS for weeks and read the Kimball bible but I'm still relatively new to multidimensional modeling. I just need some one who knows what their doing to approve, reject or tweak my idea which is as follows.
I have a number of Type 2 SCD tables that look roughly like this:
Create Table SlowlyChangingDimension
(
SurrogateId Int Identity(1,1) Not Null,
NaturalId NVarChar(50) Not Null,
BeginDate DateTime Not Null,
EndDate DateTime Not Null,
IsCurrent Bit Not Null,
IsCommitted Bit Not Null,
-- Data columns
Constraint PK_SlowlyChangingDimension Primary Key Clustered (SurrogateId),
Constraint Ck_SlowlyChangingDimension_DateRange Check (EndDate > BeginDate)
)
I maintain historical data through appropriate use of the BeginDate, EndDate and IsCurrent columns. When new data comes in, I end the current version of the object and create a new current version.
Now to handle scenarios, I want to add a scenario table that I will use to tag specific versions of objects in the SCD. When a new scenario is created, I will tag the committed versions of each object in the SCD with the scenario. Since the committed version can exist in multiple scenarios in this way, the M2M link will be facilitated by a bridge table.
Now that the scenario has been created and it's initial state is identical to the committed state, the user can start making changes. Changes will be stored in the SCD table as additional current rows where IsCommitted = False. When a change is made, the scenario bridge table will be updated such that it drops the link to the committed version of the object and is now linked to the new alternate version of the object. When a scenario is committed, the old committed version is ended, the alternate current version is committed and the scenario and all it's links to rows in the SCD table are deleted.
To me, this sounds reasonable. My boss however, wants to create additional schema elements at runtime when a new scenario is created such that scenario data is stored in separate tables and viewed through a separate cube. This rubs me the wrong way because I'm pretty sure altering schema at runtime is an anti-pattern.
Although it's theoretically possible to programmatically regenerate the schema of an Analysis Services cube at runtime, you still have to wait for processing to occur - which could be very quick for small datasets or very long for lots of data. In practice, however, Analysis Services, is intended to have a relatively static schema. You can handle additional scenarios by adding data and reprocessing the cube - even through incremental updates to make it fast. Budget and forecasting applications typically take this later approach--adding new scenarios through data changes, not schema changes.

SQL - adding fields to query to sorty by

I'm working with a third party software package that is on it's own database. We are using it for the user management back bone on our application. We have an API to retrieve data and access info.
Due to the nature of information changing daily, we can only use the user_id as a pseudo FK in our application, not storing info like their username or name. The user information can change (like person name...don't ask).
What I need to do is sort and filter (paging results) one of my queries by the person's name, not the user_id we have. I'm able to get an array of the user info before hand. Would my best bet be creating a temporary table that adds an additional field, and then sorts by that?
Using MySQL for the database.
You could adapt the stored procedure on this page here to suit your needs the stored procedure is a multi purpose one and is very dynamic, but you could alter it to suit your needs for filtering the person table.
http://weblogs.asp.net/pwilson/archive/2003/10/10/31456.aspx
You could combine the data into an array of objects, then sort the array.
Yes, but you should consider specifically where you will make the temporary table. If you do it in your web application then your web server is stuck allocating memory for your entire table, which may be horrible for performance. On the other hand, it may be easier to just load all your objects and sort them as suggested by eschneider.
If you have the user_id as a parameter, you can create a user defined function which retrieves the username for you within the stored procedure.
Database is on different servers. For all purposes, we access it via an API and the data is then turned into an array.
For now, I've implemented the solution using LINQ to filter and out the array of objects.
Thanks for the tips and helping me go in the right direction.