CHANGEDOCUMENT_READ_HEADERS Why can't I read the creator of an entry? - abap

I started using CHANGEDOCUMENT_READ_HEADERS today and I need to find the creator of an entry. I've noticed that when there are no changes after the creation there will occur an error.
So if you just created an entry and try to get its changes via CHANGEDOCUMENT_READ_HEADERS, you'll get the NO_POSITION_FOUND exception. Apperantly, the creation of an entry, although it is visible in the changelog, does not count as a change.
Does anybody know a FM which allows me to find the creator of an entry?
Thanks!

The CHANGEDOCUMENT_READ_HEADERS function module searches the change documents on the table CDHDR and CDPOS, if no changes were made on the document (Purchase order, FI document, etc.) no change document will be created.
To get the creator of an entry, you will need to get it directly from the table that stores the information or BAPI for that document.
For exemple:
The purchase order creator can be found on the table EKKO (Purchasing Document Header) field ERNAM (Created by).

Related

Adding new product with category tree - specific price problems

I installed an add-on for bulk action (called ba_importer v 1.1.24), I upload an Excel file with my data and create a group of products.
I can set the categories' tree or manually add ID of main categories and associated. I tried with no luck to use the tree features (like Home/Products/etc) and so I use all the ID of main category and all the associated. The result is a product with the correct categories set, but with no specific price from the customer group linked to a category.
I tried to edit a single product, remove all categories and set it one by one (set one, save, set one, save etc.) and then the specific price from the group linked to a category appears to the product.
Is there a better solution? I'm thinking about make a personal PHP page that reads an Excel file and sets all the information about the product, but I'm scared to face the same problem with the specific price. 
There is no such thing as "category-related specific price",
if you have specific prices tied to customer groups , these are created as a result of the add/update product action with ps_specific_price DB entries having id_group with your restricted ID.
It is likely that the bulk module acts directly with DB queries to speed up things and bypasses this operation, I've seen this behaviour with those kind of modules in the past.
Since you are talking of a paid add-on, I would definitely seek help from the developer.

Sensenet: Documents Sharing

I'm trying to list the shared files in dashboard through #sensenet/query. But I didn't find any documentation about that. I also tried using the #sensenet/query but I can't find any proper query for that.Please help
SharedWidth is a reference field on every content in sensenet, that contains the list of users with whom the content is shared. So you can search by this field the same as by other reference field is sensenet queries.
For example if you want to search for the documents that are shared with the current user, add the following to the query:
SharedWith:##CurrentUser##

BAPI for adding descriptions to Master Changes?

I have a program that will automatically change or creates the BOM using the BAPI.
When you change, you enter the change number (AEOI-AENNR), but add a description of the change (AEOI-OITXT) there is no possibility. Now I prescribe them manually using transaction CC02. Who knows any function modules or BAPI to automatic change of data in the Master Changes to automatic after I change the specifications could automatically add a description.
EDIT (from OP comment): "The specification used CSAP_BOM_ITEM_MAINTAIN, BAPI_MATERIAL_BOM_GROUP_CREATE. They serve a number of changes, but the description for the field AEOI-OITXT have not seen."
'BAPI_ISMCHANGENUMBER_CREATE' should work to create the change number, validity date, and description.
Then simply assign that number (given in return data) to the BOM bapi call.

Rally Lookback, Snapshot with empty custom field

I am trying to get a snapshot of deleted userstory to get value for a custom field(c_Dep). I get the snapshot but the custom field is empty. It had value in it. Does lookback not save value for cutomer created cutom field?
findConfig: {
_TypeHierarchy: 'HierarchicalRequirement',
"ObjectID": 12345,
"_ValidFrom": {
"$lte": "2017-01-25T19:00:57.475Z"
}
Sarita, It is hard to tell from the information you have given what is going on precisely. However, I can give you some pointers
The Lookback API will store changes in values for custom fields. The selection you have shown is valid from 24thJan to 25thJan. During this period was the custom field set? Probably not, because the array is only one long and I think it is showing the creation event.
Was the custom field updated to contain something after this time period?
The reason for asking is that a common misunderstanding is that the records stored in the lookback database will hold the current value of fields - it doesn't. It holds the changes in fields. If c_Dependencies didn't change during that time period, you may not see an entry returned in the array. The next entry in the database might be the record where the c_Dependencies field was set (changed from null to something) and that might be 'after' your time period filter.
It looks like your query is requesting snapshots earlier than 2017/1/25 ($lte). Since there's only one, it's probably the creation snapshot. If you get all snapshots for the ObjectID by removing the _ValidFrom parameter, you should see the changes made to c_Dep after artifact creation.
As I am not allowed to comment, I have to post a new answer.
I think William Scott meant remove the ValidTo filter. The one you have is the creation change. The update will be afterwards.

Database Design: Line Items & Additional Items

I am looking for a solution or to be told it simply is not possible/good practice.
I currently have a database whereby I can create new orders and select from a lookup table of products that I offer. This works great for the most part but i would also like to be able to add random miscellaneous items to the order. For instance one invoice may read "End of Tenancy Clean" and the listed product but then have also an entry for "2x Lightbulb" or something to that effect.
I have tried creating another lookup table for these items but the problem is i don't want to have to pre-define every conceivable item before I can make orders. I would much prefer to be able to simply type in the Item and price when it is needed.
Is there any database design or workaround that can achieve this? Any help is greatly appreciated. FYI I am using Lightswitch 2012 if that helps.
One option I've seen in the past is a record in your normal items table labeled something like "Additional Service", and the application code will recognize this item and also require you to enter or edit a description to print with the invoice.
In the ERP system which we have at work, there is a flag in the parts table which allows one to change the description of the part in orders; in other words, one lists the part number in the order and then changes the description. This one off description is stored in a special table (called NONSTANDARD) which basically has two fields - an id field and the description. There is a field in the 'orderlines' table which stores the id of the record in the special table. Normally the value of this field will be 0, which means that the normal description of the part be displayed, but if it's greater than 0, then the description is taken from the appropriate row in the nonstandard table.
You mean something like this?
(only key attributes included, for brevity)