cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot see PI receiver(Proxy) adapter - advanced adapter specific message

Former Member
0 Kudos

Hello Friends,

I cannot see adapter specific message attributes in receiver adapter XI (abap proxy) for enabling. I want to use these properties for getting a file name dynamically in a receiver structure.

I had seen a blog by Mr.Michal but that gives details for file to file. Here my target is abap proxy so I cannot see advance tab properties in XI adapter used communication channel.

Clearly my interface is file to ecc (using proxy), where i will have to read a file name which my interface picks and has to update in ecc.

I have enabled the sender side File adapter - ASMessage attributes but am not able to find the attributes in receiver side. Does it make any diffrence if am not enable the attributes at receiver adapter.

Thanks very much.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

At last, with the help of all these experts my requirment is fulfilled. I can see file name in XML tags too.

Thanks much.

Shabarish_Nair
Active Contributor
0 Kudos

Note that there is no ASMA for the receiver XI adapter.

in your case you can use the ASMA at the sender side, get the file name using the code

DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(
    u201Chttp://sap.com/xi/XI/System/Fileu201D,
    u201CFileNameu201D);

String inputFilename = conf.get(key);

and pass the value in the string inputFilename to the proxy structure in the mapping

Former Member
0 Kudos

and pass the value in the string inputFilename to the proxy structure in the mapping

Ok. That's fine. So what I will have to do is to add a field in a target structure and created UDF to be mapped directly to the field.

Or else UDF to be mapped directly to structure.

Also am not doing any modification in code Just created UDF with out argument and pasted the code in it. Do I need to return file name in the code.

return Filename;

Many thanks.

Shabarish_Nair
Active Contributor
0 Kudos

use the return statement and pass the output of the UDF to the target field

some ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

Former Member
0 Kudos

Hello Shabarish,

I am not able to map UDF to file_ name field in the target strucutre. Even I tried to map to the top node still not works.

My structure looks as

Sender Receiver

Record_details Record_details

Field1 FileName

Field2 Field1

Field2

UDF to be mapped to Topnode or second Node or to FileName.

Thanks much.

Former Member
0 Kudos

Hpppss....

Hello Shabarish,

I am not able to map UDF to file_ name field in the target strucutre. Even I tried to map to the top node still not works.

My structure looks as

Sender -


-


Receiver

-


Record_details -


Record_details

-


Field1----


Field1

-


Field2----


Field2

-


FileName ()

UDF to be mapped to Topnode or second Node or to FileName.

Thanks much.

Shabarish_Nair
Active Contributor
0 Kudos

can you explain a bit more?

why is that you are unable to map the udf to any field or node?

have you created a generating UDF i.e a UDF with no input field (remove all arguments while creating the UDF)?

Former Member
0 Kudos

What do you mean by still not works. how you are trying to test it. The results can only be seen at run time.

Are you facing any problem in you mapping? Check you mapping by pressing F7 button.

Regards,

Sarvesh

Former Member
0 Kudos

Yes, I have created UDF with out arguments.

The changes I have not done any changes in the code.

Now If I map the UDF to either of File_name field or Record_details node It says Mapping not sufficient.

Former Member
0 Kudos

Try with this code in your UDF..

try
{ 
 DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String MyFILE = conf.get(key);

return MyFILE; 
}
catch (Exception e)
{
String exception = e.toString();

return exception;
}

Also make sure if you have done mapping for all fields including root nodes.

Former Member
0 Kudos

Yes Survesh.

Having a problem with the mapping. Its not much complex mapping in my scenario. What all I did is -- added a field called Get_file in sub node along with other receiver fields. Trying to map UDF to Get_file. Mapping becomes yellow and when I check it says mapping not sufficient.

Thanks much.

Former Member
0 Kudos

Hi Swarna,

delete the inbound parameter of the UD to have your mapping completely defined.

Regards,

Andrea

Former Member
0 Kudos

I use FCC. In the FCC table parameters do I need to add this File name field? i.e node.fieldNames

Former Member
0 Kudos

Now I am sure that you have not deleted the default argument (a) from your UDF.

What you can do is, open your UDF then press the edit button (pencile icon) then click on the arugment (a) and then clikc then delete icon (red color icon).

Do this and I am sure your mapping will be ok.

Regards,

Sarvesh

Shabarish_Nair
Active Contributor
0 Kudos

check this;

click on the udf -> edit function -> click on the pen symbol below the imports section, check if there is any arguments.

If there are any, click and remove them from the list and then try the mapping

Former Member
0 Kudos

>

> I use FCC. In the FCC table parameters do I need to add this File name field? i.e node.fieldNames

No need to do this because your file name will come from SOAP Header at run time.

Former Member
0 Kudos

> I have enabled the sender side File adapter - ASMessage attributes but am not able to find the attributes in receiver side. Does it make any diffrence if am not enable the attributes at receiver adapter.

No, it does not make any difference untill you are going to write the same file name by using Receiver CC. So if you have done ASMA in Sender CC then it's ok to read the file name in your mapping by using the UDF as given in Michal's blog.

See the similar kind of requirement in this thread (see my last answer)

Regards,

Sarvesh

Former Member
0 Kudos

Swarna,

in your scenario in order to have the file name updated on ecc, you must:

1. Set the ASMA properties on sender channel

2. Read the property in mapping and put the value in a custom field on the proxy structure. Create an UD like this:

-


UD

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String onixdataset = conf.get(key);

--- END UD

3. Manage the filename in the proxy class with your requirements

Regards,

Andrea