cancel
Showing results for 
Search instead for 
Did you mean: 

ASMA parameters in receiver SFTP adapter.

Former Member
0 Kudos
479

Hello guys,

I have a Proxy-to-file scenario . I am using an SFTP adapter to write files to the receiver server.

I have used Dynamic configuraiton to populate the file name.My inbound message would containt the header details.

If a file is sent from SAP without any data i.e., only with the header,then I would like my message to fail and nothing should be written to SFTP server. At the moment the file is getting written to the SFTP server with some constant name.

The option of 'Fail if adapter specific message attributes' are missing in SAP PI 7.4.

Thanks,

Shweta.

Accepted Solutions (0)

Answers (4)

Answers (4)

suman_saha
Contributor
0 Kudos

Hi,

Helpful blogs for this approach:

Suman

Former Member
0 Kudos

Thanks Amit and Suman.

I would try these options.

One question though off-topic. In Variable substitution, suppose I have to write the file to a target server in the format :

"Cust_data_%var%_%var1%.txt."

var is : payload:MT_Customer,1,Record,2,VKORG,1  and

var1 is : payload:MT_Customer,1,Record,2,VTWEG,1

If my var and var1 values are not coming in the input payload , will the message fail in XI or will it write to the target server in the default format : Cust_data_%var%_%var1%.txt.

Thanks,

Shweta.

suman_saha
Contributor
0 Kudos

Hi,

I guess if the tag itself is not there in payload,it will throw an error as it will fail to find the XPath.

Suman

suman_saha
Contributor
0 Kudos

Hi,

Use this configuration:

Or use createif function in mapping to decide when to create the target message.

Suman

Former Member
0 Kudos

Hello Suman,Sriram,

My file would contain header information. Thus the size of the file is not 0KB. In this case will the option : Empty File Handlin : Ignore - work?

Hello Hareesh,

My file contains only the header information . The item/data part is not available.

Thanks,

Shweta

former_member184720
Active Contributor
0 Kudos

I think i overlooked your request.

However still the same would apply.

your ITEM -> Exists AND DATA -> exists-> create if your target message.

P.S. May be you might want to consider handling this at sender proxy itself instead of having an error message in PI.

Former Member
0 Kudos

Hello,

Not sure, what do u meant by Header information? You are referring to SOAP header or header which is part of payload?

BTW, u can do a condition check at RD and if data/ite, is present then only route message to SFTP.

Thanks

Amit Srivastava

suman_saha
Contributor
0 Kudos

Hi,

Then you can use content-based routing on XPath expression for the node you are expecting to be non-empty for file to be created.

Suman

former_member184720
Active Contributor
0 Kudos

>>>If a file is sent from SAP without any data i.e., only with the header,then I would like my message to fail and nothing should be written to SFTP server


Why can't you handle that in the mapping? Don't create the target message if the header data is not coming from Proxy?

Former Member
0 Kudos

hi shweta,

pls select the option do not create empty file. Also pls confirm if the SFTP adapter being used is standard one or 3rd party provided. Pls provide more details or screen shots to assist further.

Regards,

Sriram