on 01-06-2015 2:24 PM
For each record I'm bringing in through AIF, I'm running it through a Value Mapping that will convert a Plant Code to a different value. The problem is that this, right now it is only applicable for 1 certain Plant so I only have 1 entry in my Value Mapping.
For instance, if the plant code is AAAA, I want to overwrite that with BBBB. So, I have created that entry in my Value Mapping table.
The problem is that when my message has a plant code of CCCC, the message errors out because CCCC doesn't exist in the Value Mapping table.
I need the message to retain CCCC since no mapping value was found and continue processing.
What would be the best way to accomplish that?
Thanks,
Robert.
Hi Robert,
if you want to use the normal value mapping maintained in transaction /AIF/VMAP and for all plants that are not included the source value only should be passed thru as CCCC -> CCCC, you can implement a value mapping function module with "value_out = value_in" and add it to the existing value mapping customizing object. The function module will be processed in case that the the normal value mapping (maintained in VMAP) does not find a value. Then you are able add in your function module source code all additional logic you need.
Please note that the error message is looking different. To get the same error message as before have a look into this thread http://scn.sap.com/thread/3629440.
Perhaps this could also help.
Kind regards
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert,
additional information to my comment:
In the AIF documentation (cookbook and F1-Help) there are following information:
1. The function module is always executed. Values derived from internal mapping tables or
select statements can be overwritten.
2. Define Value Mapping Function Module: Importing parameter VALUE_FOUND allows you to evaluate if a previous mapping (selection from database or values entered in transaction /AIF/VMAP) was successful.
My experience shows that the function module is only executed when the previous value mapping does not find a value.
Kind regards
Christoph
Hi Christoph.. getting back to your reply..
In order to preserve the original external value and with the intent to NOT raise an error if a mapped value is not found, I've created a FM where the code states VALUE_OUT = VALUE_IN
When my external value does NOT find a value in /AIF/VMAP it does enter the new FM. However, the IMPORTING parameter VALUE_FOUND = abap_false and cannot be changed.
Consequently, my message still fails & returns an error.
Our goal is to have 100% of the messages to come into our workbench - from there, the users will be able to correct.
Hi Robert,
try to enter your FM ZAIF_MARS_MATNR into your value mapping MARS_TO_SAP_PRODUCT definition instead of into the field mapping definition.
Then VALUE_FOUND can be used:
IF value_found <> abap_true.
value_out = value_in.
ENDIF.
I implemented in case that the source value is initial set value_out on initial. This works.
Kind regards
Christoph
Hi Robert,
I have another solution without ABAP-Coding:
Define in the value mapping a DB table lookup on T001 (select field BUKRS with where condition BUKRS = '$1'), and in addition allow values with "Single" and "Master Data".
Then AIF will first check if the value is an existing company code, and if not, check in the values (maintained in /AIF/VMAP, also allowing wildcards like "1*").
Finally, a value mapping function will be called (if maintained). The function will be called in both cases, when a value was determined before, and also if no value was determined.
You see, there are many ways to implement; maybe this one is the easiest, without ABAP coding and without conditional field mapping.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your use case is that, most plant codes are to be converted into another codes via Value Mapping, but some other plant codes are not to be convered or event to be converted via a different Value Mapping, AND, it is possible to identify those plant codes accordingly a certain logic. For example,
only plant code starting with 1* should not converted, but simply copied from source to target.
In such case, you may consider to use Conditional Field Mapping as another option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try adding a wild card entry in your value mapping table such as * for the external value. But then you'll need some dummy internal value corresponding to those entries that you don't have value mappings for. This will allow you to bypass the error but then you'll always get the dummy value mapped.
But wouldn't you want this since there's no plant value mapping?
Remember that you can make the raw field holding the plant changeable.
So a user can go into transaction /AIF/ERR, note the error and then update the plant accordingly prior to restarting the message etc...
Hope this helps.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.