SAP PI: Graphical mapping: Map with default function not working - mapping

Scenario:
Address node has 6-7 fields which has customer details. In default we have 4 partner functions that is coming in IDOC that we map it to target fields. In some scenario, there are additional partner functions will be present in IDOC, where the address for them is fetched from separate node YLKNA1M. So our mapping for address1 & address 2 is:
If YLKNA1M node is there, then it is treated as additional partner function and under that node STRAS_HOUSN field is passed to it, otherwise STRAS_HOUSN in YLF_CIN node (default partner function) is passed.
Issue:
When the STRAS_HOUSN field is not available in YLKNA1M, the address1 field is disappearing. Not showing in output XML.
I want an empty tag in that place if value not present in IDOC. I tried placing map with defualt at various places in that mapping. Still address1 is not showing with empty field (it should show like ).
What can be done for this ?

Related

Recursive Fetching in Grails self-relationship

I have the following grails domain class, containing a self-relationship.
class Message {
static hasMany = [replies: Message]
Message isReplyTo
User author
String title
String text
Date createdAt
Date lastUpdated
}
I want to write a query that can do two things
If a message is a parent, i.e it is not a reply to any other message, retrieve a list of messages that build a conversation starting with that message.
Message 1
---- Reply 1
---- Reply 2
-------- SubReply 1
Given a message that is a reply, to another message, also build a list same as above, including that parent that the given message (reply) falls under.
I have thought about this but can't quite think of a possible way of doing this, since there is no Conversations domain class that ties message belonging to the same conversation together. So I am hoping that there is some sort recursive query that would help me achieve this.
There are couple ways to handle this type of structure and there's no shortage of examples on the web about this type of tree based relationship.
In the simplest approach; you could have a Parent Child structure where a null parent would signal the top of the tree and a 'null' child would signal the end of that branch. This is a simple and effective structure but, it can be difficult to capture metrics because you'll always have to recursively search the entire thread.
Message{
...
Message parent
Message child
}
This post shows a good recursion in GSP example:
Another pattern for this is materialized path. It's a little trickery to implement but, easy to work once it's in place. Materialized paths are also much easier to collect metrics for like count of reply's and doing breadcrumbs are much easier too.
Message{
...
Message parent
String path //would like something like this: 1/2/3/4
}
For an example search of Materialized path check out google or this post.

Archer to Archer Data Feed in RSA Archer

Need to create Archer to Archer Data Feed that should set value of two fields as NULL in a cross referenced application, if the value of a field is Approved in first field. I am not getting how can I send a NULL value to the fields through data feed??
Archer doesn't have "NULL" value, but you still can get it done like this:
Step 1. Calculation. Open your data feed configuration and go to the source definition tab. Add a new field to the end of the list and make it calculated.Add formula to check value of 1st field that present in the data source and if it is equal to "Approved" then return empty string.
Something like this
=IF([field field] = VALUEOF([first field],[Approved]), "","SOMETHING ELSE")
The key here is to have this calculation return an empty string when you need it - "".
I suggest you to test your calculation in the calculated field in the application before you put it in the calculated data source field.
Step 2. Data feed mapping. Now you need to map new calculated field in your data feed to the field you want to remove value from. Go to the mapping tab in your data feed configuration and map the field. Make sure to selection options "Replace value" and "Empty Values" - this way existing value will be replaced even with empty values.
Similar approach works for me in multiple data feeds.
Good luck!
You can use novalue() function in the calculation
I don't believe there is a concept of NULL in Archer. The closest you're probably going to get is blank/empty. To do that, in the Data Map tab of your data feed, click the edit icon under Actions column. Check the box that Empty Values should be populated rather than ignored.
Assumption is that what is in the question is the only task required by the data feed.
Create report with the filter set as First Field = Approved
Fields to display should contain tracking id (tracking ID which is configured to System ID) of the Target app along with the Tracking ID of the Cross-Reference App.
In Source Definition add new source and give it an adequate name as clear or Null if you want
Where it says Raw Data Field in the drop-down, update this to static. Leave the source as not configured or unconfigured.
Map this newsource to the 2 fields that you are trying to clear. In Options set to Replace and uncheck add unknown and set to populate empty values.
Map the Tracking ID of the Target app and map the Tracking ID of the cross-reference.
Set key field definition for both apps to the tracking id
Set data feed to update only. Remove checkmark for create
If your are doing more than just clearing the 2 fields, then
Stan Utevski answer is mostly correct except you must have the field you are evaluating for "Approve" in the fields to display of your report. Otherwise the calculation will not validate.

How to update value in angular ui typeahead directive if no matching option is found

I've an array of objects containing title and salary which is used in typeahead directive.
I display department name and get entire object as value.
If none of the options match, I want user entered string to be converted to object still. Is there any way to update that?
This answer is pretty late, but I would just use ng-blur (to trap the end of the users input) along with a variable bound to typeahead-no-results. Then test if the variable is true in the method bound to ng-blur, and, if so, make an object out of the String supplied by the user and push it to your data source. Simple example found here.

Blackberry AutoCompleteField with first and last name

I'm trying to create an autocomplete field in a blackberry app that uses both the first name and the last name of a record to check for prefix matches. My BasicFilteredList is an array of record objects, each having a first name and a last name. I considered adding two instances of the same object array, with mapping String arrays of first and last names like so:
filterList.addDataSet(1, firstNames, recordsArray, "records2", BasicFilteredList.COMPARISON_IGNORE_CASE);
filterList.addDataSet(2, lastNames, recordsArray, "records2", BasicFilteredList.COMPARISON_IGNORE_CASE);
This however retrieves the same object twice. if the person's first and last name begin with the same user-entered prefix in the autocomplete field. In short, I am trying to mimic the existing blackberry contacts autocomplete functionality, but with my own custom records. Any help would be much appreciated. Thank you.

jquery UI autocomplete - extended data?

I would like to use Jquery's UI autocomplete but with some additional functions: after user selects suggested item, I would also like to display additional data related with that item (for example if database of contacts are being searched, then I'd like to display contact's email, addres...) in some html element.
Is there a way to accomplish this?
Thanks in advance,
Ile
EDIT:
I'd like to provide more detail description of what I actually need:
When user starts searching contacts, as a result from database I would like to return contact's ID and Full Name. After user selects certain contact, then ajax function is called and it retrieves all details from selected contact using it's ID. But I don't know how to do following:
As a result from database return the ID and Full Name of contact as a JSON result (probably I would find the solution to get the right format, but I don't know how it needs to be passed to Autocomplete script)
How to handle the result data so that I display only full name and ID is used only when certain contact is selected, so that I can retrieve full details of certain contact
Have a look at its events: You can add a handler for the select event and display all your informations once it fires.
You can specify extra data in formatMatch function. The parameter must be some delimiter separated string. Later in .result function , which takes 3 arguments [event, data, formatted], you can retrieve it by splitting the formatted by the delimiter use and populate the required values.

Resources