cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP Sender - content conversion to read Header & detail and control record

Former Member
0 Kudos

Hi Experts,

    I'm just beginner in SAP PI. Just would like to know possibility for below requirement for my further reseach

Soure file format fix length  with 3 different format(H,D,T)

As example

H001TestHeader1

D001001TestDetail11

D001002TestDetail21

T2

H002TestHeader2

D002001TestDetail21

T2

The requirement detail :

1. There are multiple set of H,D,T per files

2.  T line is the record count of total D line per each H set.  for example as green font we have 2 D line, So T show T2

3.  If number in T line is not match with actual D line, then only these set should be filter out and write to error file and send email alert. for example as red font we have 1 D line, but T show T2

4.  If number in T line is match with actual D line, then these set will be write to result file.

As I know that content  conversion may be support this requirement for separate records set for H/D/T but I don't have idea how to handle requirement no.3 and 4, Is it need ccBPM? Please help to provide some overview guideline for my further research. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi

Even without splitting the message based on recordset, you should still be able to achieve your requirement using multimapping.

With the MessageTransformBean on your SFTP sender channel, you can generate 1 source message with multiple recordsets. Your structure should be as follows (field elements under H, D and T are not shown for simplicity)

documentName (max occurence 1)

--> recordset (max occurence unbounded)

--> --> H (max occurence 1)

--> --> D (max occurence unbounded)

--> --> T (max occurence 1)

When the content conversion is performed, your source message would be something like this:-

<documentName>

<recordset>

   <H> ..... </H>

   <D> ..... </D>

   <D> ..... </D>

   <T> ..... </T>

  </recordset>

<recordset>

   <H> ..... </H>

   <D> ..... </D>

   <T> ..... </T>

  </recordset>

</documentName>

With multi-mapping, you can set two target interfaces - one for the message that contains good recordsets, and another for the message that contains erroneous recordsets.

In the message mapping, you can build a logic to compare the count of the D segments against the value in the T segment for each recordset, to determine if that recordset should be in target message 1 or 2.

For more details on MessageTransformBean configuration or multi-mapping, you can easily search for it on SCN.

Rgds

Eng Swee

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your help, let me try to research more detail base on your provided guidance. will be back to update soon.

former_member184720
Active Contributor
0 Kudos

As I know that content  conversion may be support this requirement for separate records set for H/D/T


>>> For the  FCC, you might be using Message Transformation bean and unfortunately MTB doesn't provide the option to split the message i.e. " Records set per message".


If you go for two step approach i.e.  then you can use this option to split the records.

1) pass through interface -> SFTP -> NFS

2) NFS(Standard FCC) -> Your target system

I don't have idea how to handle requirement no.3 and 4, Is it need ccBPM? Please help to provide some overview guideline for my further research. Thank you.


>>> If you can split the file for each recordset i.e.  one set of H/D/T then you can handle the validation part in message mapping.

If T has valid number of records then execute the mapping set the filename  and directory to "result file" locations using dynamic configuration.

If T has invalid number of records then execute the mapping set the filename  and directory to "error file" location.

To trigger the email from the message mapping refer to the below blogs -

Mail without email adapter? Part - I - Process Integration - SCN Wiki

Former Member
0 Kudos

Hi Hareesh,

Thank you very much for your guidance

So you mean Message transformation(SFTP Adaptor) bean have limitation for split "recordset per message" so you recommend to use 2 scenario for SFTP -> NFS and NFS -> Target, this purpose for use standard File content conversion in file sender adaptor right?

As I checked with my system team, there is no NFS in my project scope - they allowed only files interface via SFTP. Is there any other solution for this requirement? thank you