cancel
Showing results for 
Search instead for 
Did you mean: 

Filename from payload - FTP receiver adapter

Former Member
0 Kudos

Hello everyone!

I have a scenario wherein I need to get the value from a field coming from an IDOC and then give that value as the "filename" of the file that is saved in the FTP folder.

IDOC > XI > FILE

For example, if /ORDERS05/IDOC/E1EDK02/BELNR = 620000123

then I want the name of the file to be saved in the FTP folder to be 620000123.xml

I understand you may use the 'variable substitution' property in the FTP receiver adapter, but subsequent attempts at trying to configure that property have resulted in errors. Can anyone help me out?

Warm regards,

Glenn

Accepted Solutions (0)

Answers (3)

Answers (3)

nisarkhan_n
Active Contributor
0 Kudos

Send the file reciver strucutre and the variale subtuition value you have used...with this we can figure out what went wrong.

Former Member
0 Kudos

in addition, I gave "num" as my variable name, and %num%.xml as the File Name Scheme

nisarkhan_n
Active Contributor
0 Kudos

Please send the variable substution value you are using for variable %num%, there variable should always refer to the field in the file strucutre not the IDOC one.

paste the value & file struture.

ORDERS05/IDOC/E1EDK02/BELNR if you this it will thorw error saying variable not found in payload.....on the refiver side the variable substution should alwasys refer to the file strucutre which is holding the data from the IDOC field BELNR.

so if you give the srtuctre of reciver and value your prbs would be solved sooner.

Edited by: Nisar Khan on Feb 28, 2008 2:41 PM

Former Member
0 Kudos

Hello Nisar,

The receiver structure is /order/number where "number" is the fieldname that contains the PO number from BELNR.

You are right, I now remember that that was the error I received yesterday!

What exactly should I put in the variable substitution?

Many thanks!

Glenn

nisarkhan_n
Active Contributor
0 Kudos

give te complete strutre till order/number from the Message type root node.....

from ROOT node till number filed give the structure

Former Member
0 Kudos

Hi Nisar,

Would this be it?

/ns1:MS_MT/order/number/

Glenn

nisarkhan_n
Active Contributor
0 Kudos

do u have recordset name (root message)

For Ex: If you want to refer to the field which is bold

below is your variable substuition:

payload:root,1,e1,1,e2,2

<?xml version="1.0" encoding="UTF-8" ?>

<root>

<dummy>

<e1>

<e2>Data_1</e2>

<f/>

<g attr="abc">text</g>

<e2>Data_2</e2>

</e1>

</dummy>

<e1>

<e2>illegal/value</e2>

<f/>

<g attr="abc">text</g>

<e2 attr="fghij">Example Value</e2>

</e1>

</root>

Similarly

for your strucutre:

<MS_MT>

<order>

<number>

the variable substuition would be

payload:MS_MT,1,order,1,number,1

you have to give complete XML to arrive to this value.

Former Member
0 Kudos

Hi,

The best way to read the payload is Variable Substitution.

What are the issues you face here,.

As far as i know, this is a very stable concept

regards

Abhishek

Former Member
0 Kudos

Hi Abhishek!

I understand that I can use "payload:" as the 'Reference' value in the Variable substitution; however, I don't know how to define the element I want to refer to. Would this be correct, payload:/ORDERS05/IDOC/E1EDK02/BELNR unfortunately, it gave me an error when I tried it in the office yesterday.

Would you know the correct format for "payload:"?

Hi NV,

Thanks for the file. It seems a little more complicated than variable substitution but I'll give you feedback once I get back to the office.

Thanks!

Glenn

Former Member
0 Kudos

Hi,

As a general rule it should be

payload: namea,na,nameb,nb

namea is the name of the element

and na is occurence

Try this way it should work.

Reward points if useful

Former Member
0 Kudos

you should try to navigate to the field in the structure where the field value is

just navgate from the

root, occurence of root and so on....till you reach the payload

Always on the receiver structure.

Check the generic rule as in my previous post

Hope this helps you.

Reward points if helpful

Regards

Abhishek

Former Member
0 Kudos

Hi,

I have sent you a Step by step Doc, check it,

Regards

Seshagiri