How to create a maintenance view in SAP with a single key field that is hidden - abap

There is a standard view /SAPAPO/SUBLOCV that looks like this:
The LOCID is hidden so you can maintain the location without the ID showing:
I want to create a custom view but my table only has LOCID as its key field. So my view looks like this:
But the table maintenance doesn't work - it's just an empty screen and you can't do anything. I think this is because the only key field in the view is hidden. Is there a way around this to have a view to maintain LOCNOs without displaying the LOCID without having to use any custom code e.g. in events?

Related

How to design a structure of UIView Controller for dynamic contains

How to design a screen structure with light weight loading and easy to scroll ???
Here is my current design structure.
i am using table structure for set dynamic data. for main table as well as sub table. it working fine but when i am scroll the table it is not smoothly scrolling.
is there any other way to set this type of dynamic data ??
(Note: in Main Table no. of cell is dynamic not fixed , as well as each sub table also have variable no of cell not fixed)

ServiceNow dynamic label change

I am currently building a CMBD in ServiceNow and have come across a problem I cannot seem to figure out. In my database instance table, I would like to be able to add a field to the table that pulls from all of the names of applications I have in my applications table, and then i would like to display both the instance name and the application name in the label for my dependency view like this:
Database Instance, Application Name
or
Database Instance (Application Name)
I have managed to set up the application name field by creating a reference in the database instance table but I cannot figure out how to make the label for the database instance objects to display both the instance and the application name. I know it probably has some scripting behind it but I do not know where to start.
The label shown in the dependency field is the field where "Display" is set to true. On Configuration Items, when no display field is set, it takes the name field by default.
If you want to keep the name field for the Application's name only, you will have to do the following
Create an additional field for the display name, u_display_name for example
Make the field read-only and check it as Display field
Create an onBefore Business Rule that triggers on the change of the Application or Instance name fields
Let the Business Rule set the display field as required
See the below screenshot for an example

Create DataTable child row without showing it?

I am using datatable (v1.10.2 with jquery 1.9.2) because I like the out-of-the-box features (searching/sorting etc). However, now I want the ability to:
1) use animations (sliding) when showing/hiding a row
2) have the hidden row available in the DOM to change (ie, it would exist but have a display:none).
My current code to create the table looks like the following (where formatChild() returns html for a table):
if (row.child.isShown()){
row.child.hide();
tr.removeClass('shown');
} else {
row = row.child(formatChild());
row.show();
tr.addClass('shown');
}
I am using several services to change data in the child row's table via ajax and want to be able to change that data even when the row is hidden. I know I can create a map in memory and use the information in the stored map when I show the child row, but to me it is much cleaner to change the hidden row immediately.
I was hoping I could do a row()child(), modify the row, then call row()child().show() but the row isn't created in the DOM after the row.child().
Regarding the animation, I found an answer here but it involves changing the datatables code :(
I considered just using jquery to add a row to the datatable and hide it, but I couldn't find a good way to "attach" it to the primary row for sorting.
The plan I am currently leaning towards is to add a div to my primary table row that I will show/hide/update rather than using child rows at all.
What is the best practice for managing these hidden areas in a datatable (and showing them with animation)? ty
In case anyone else has the same question, I ended up using a DIV in the row rather than using DataTables' child row. When I add a new row to the datatable, the div is hidden then I hide and show (slideup/slidedown) on a click event. This gives me the nice animations, keeps the sorting simple, and let's me change information in the hidden row. Interestingly, the DIV contains a table and the text that is in that table when I create the new row is searchable; however, the text in the table that my ajax call adds/modifies is not searchable. I'm looking into how I want that to work (and may keep the div out of the search altogether if possible).

SQL, when adding a field to database put in two fields and modify

I have this database setup:
http://sqlfiddle.com/#!12/b2989
I want to add a record called "solrID" under item where I already have "ID".
Is it possible to have SQL setup so whenever an entry gets put into ID I also add the same value into SOLRID, except I start it with the text "app".
Therefore, when I add a record to my "item" table, ID autoincrements to have a value of say "2" then I want SOLRID to automatically have the value "app2".
Is this possible?
Two choices that comes to mind is create a view that creates solrID on the fly, or if you really want to have a column that stores what is basically redundant data you can use a trigger to populate solrID.
For me, knowing only what I know from your message I would consider using a view unless you have a really reason to store solrID in the actual table.

Auto Inserting data into table row behind subform?

I've got a form that's got a subform and THAT subform/child has a subform/grandchild.
When I add a new client to the main form, the subform/child contains data like shipping address, etc etc. The subform/grandchild that one contains data like what we're shipping them.
When I make my initial new entry in the top form, there's data that seems to auto populate into the subform/child (and subsequently the table), however there are things that are always "default" items to ship (third subform/grandchild) that do not do that.
I've got some table constraints for the grandchild table like (ShipPackingSlip type bit) is set to 1, so that the checkbox should always be true. However, this does not occur on the 3rd layer of the form. Even setting the default option value to -1 will "autocheck" the box, but the data behind the forum does not reflect that.
Am I doing something wrong here?
Does that even make sense?
As I understand it (and I could be wrong), you can't use a subform in a subform on a main form without problems. It's better to organize your data and forms so that if you need to view more detailed information on data presented in a subform - it's better to call a new form from a button on the subform, passing a value to it so it pulls the correct record to view.
This would, of course, require you to store this subform of the subform data in a related table - then just relate it back to the main database with a unique identifier. This allows you a bit better means to organize your data, indexing isn't a pain, and you don't repeat information entry as much.