cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop empty payload getting generated( idoc to file) scenario

Former Member
0 Kudos

Hi

The sender idoc structure is ADRMAS. When there is custemer master data in the sender side then only the mapping is genrating the payload with business content and when there is no customer master data at the sourse side an empty payload (valid xml)is geting generated as shown below

xml version="1.0" encoding="UTF-8"?> <ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>

can any one help how to stop

I found a note related to this (note 821267 Question NO 31). Please go through it and let me know your suggestion

Q: I configure the receiver channel with File content conversion mode and I set the 'Empty Message Handling' option to ignore. Input payload to the receiver channel is generated out of mapping and it does not have any record sets. However, this payload has a root element. Why does file receiver create empty output file with zero byte size in the target directory? Example of such a payload generated from mapping is as follows: <?xml version="1.0" encoding="UTF-8"?> <ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>

A: If the message payload is empty (i.e., zero bytes in size), then File adapter's empty message handling feature does NOT write files into the target directory. On the other hand, if the payload is a valid XML document (as shown in example) that is generated from mapping with just a root element in it, the File Adapter does not treat it as an empty message and accordingly it writes to the target directory. To achieve your objective of not writing files (that have just a single root element) into the target directory, following could be done: - Either modify your mapping so that empty message payload without a root element is generated. This could be done only by creating a Java mapping and implement the logic to convert from root element to an empty text. This can not be done using Message Mapping tool. - or, use a module based approach, e.g., using the StrictXml2PlainBean, where such a valid XML payload is converted to an empty payload before the file receiver channel is invoked.

thanks and regards

sandeep

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi all

why i am asking this is i can use StrictXml2Plain bean but the problem i had configured the communication channel to pick the field date which is in the reciever structure and substituting in the file name of the created file in in reciever folder ( using variable substitution) and it is showing the error below

*************************************************************************

File processing failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during

variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload

: date_processing

**************************************************************************

as of now the business is not getting effected as the business scenario's requirement is to get only the customer master data

and when there is no customer master data it do not require any file getting generated But the communicatin channel is failin when there is an empty pay load because it is configured to pick the date as of it is only an internal issue is there any solution to solve the both empty files getting genereated (ie not effecting the business )as well as communication cahnnel getting failed

any coments on this will be highly apreciated

thanks and regards

sandeep