on 04-13-2007 7:09 AM
Hi experts!!.
I am new in abap mapping, but I can do one abap mapping succesfully, but my problem is:
I need to do a variable substitution in my file receiver adapter:
Target directory = %cliente&/out
File Name Scheme = TC%Fecha%.EFI
¿Using abap mapping is this possible? How I can do it?.
Please is very urgent.
Thanks in advance, and best regarts.
Hi,
If the target filename and directory are going to be in the target message then it does not matter what filename and direcytory you use.
You can use the variable nakme substitution.
payload: and the path of the payload where the varibale will contain value.
SAP help describes it pretty well,
http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Regards
bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bhavesh!
Your answer is perfect, but my problem is that value of "Cliente" and "Fecha" are both inside input file message.
If i use a normal message mapping problem solved, but for n reasons, i don´t do it, and then appears
Abap Mapping
, i do all steps but if I want mount file name using variable substitution, but how i can do it?Can you help me?
hmm..So are these fields not a part of the output file then?
if yes, then there is another solution. Do not use Variable Substitution. Use Adapter Specific Identifiers and In your interface mapping have 2 mappings.
1.The first will be a graphical mapping that will use the same source and target message type ( ie. the source will be the target message also) . This will be a straight mapping and you can have the FileName set dynamically using the Adapter Specific Identifiers.
2. The next mapping will be you ABAP mapping and this will do the mapping functionality for you.
Wouldnt this do the trick?
Regards
Bhavesh
umm... not this fields are in Source file, but i don´t need in target file..so, i used an Abap Mapping. I need these fields only to create a Target file name into file adapter...
Is so difficult?¿ Perhaps i need to do an Abap mapping that the result are a XML message with the same structure that MT_OUPUT (message type output), and then I can use a variable substitution..... but i don´t know...
Sorry, if i don´t explain well...
Thanks in advance..
Hi,
The solution I have exmplain is pretty simple.
You are just introducing a dummy graphical mapping that will set the filename inside a UDF dynamically ( 3 lines of code ). And then you are calling your ABAP mapping as per requirement.
Let me know if you have not got the exact flow yet.
regards
Bhavesh
Sure do have it .
It is on sap help itself.
Look at the code in this link, its as simple as that.
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Regards
Bhavesh
Yes you can,.
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
FileName);
will become
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
Directory);
In the receive file adapter all you would need to do is select Adapter Specifc Attributes --> File Name and Directory and givce some dummy values for the filename and directroy. In the runtime values will be taken from the SOAP header which you set in the mapping.
Regards
Bhavesh
Hey there,
For ABAP Mapping, check out IF_MAPPING_DYNAMIC_CONFIGURATION interface.
As posted by Michal in some post, your abap mapping would be something like:
METHOD if_mapping~execute.
DATA l_record type mpp_dynamic.
* copy payload
result = source.
* add an adapter specific attribute
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'FileName'.
l_record-value = 'test.xml'.
dynamic_configuration->add_record( l_record ).
ENDMETHOD.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Henrique!
Please can you help me?
I need to do two message mapping un my Idoc->Flat file scenario. One normal "message mapping" and the other and abap mapping.
The question is, in abap mapping i can put in result variable, XML source variable?
The abap mapping I only need to search a field in a R/3 table, and chage Filaname, and Directory, and then I need put to the Result variable , Input source variable
Its possible?
Thanks best Regards.
Julian,
I did not follow the entire requirement, but if i got you correct you need to add 2 mappings in the interface mapping.
One a Graphical mapping and this followed by the abap mapping.
The basic point when you have 2 mapping programs in the interafce mapping is that the source message is the input to the 1st mappping and the output of this is the input to the second mapping and the output of the second mapping is the final output of the interface mapping.
Regards
Bhavesh
Hey Julian,
check out the sample code I gave. It already copies the payload from input into output.
* copy payload
result = source.
But see, are you using ABAP mapping for dynamic configuration just because you need to read some value from RFC?
I'm not sure about your scenario, but since you already have message mapping, maybe it'd be much better if you did dynamic configuration in message mapping itself, and to get the necessary field, you could use RFC Lookup. It'd have a much better performance.
Regards,
Henrique.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.