cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc to File Scenario(SFTP) with special requirement

nidhi_srivastava22
Active Contributor
0 Kudos


Hi experts,

We have a scenario Idoc-->File(SFTP), in which one field which is having multi-line and we want that field as structured below.

Expected Output-

--------------------------

<?xml version="1.0" encoding="UTF-"> <ggol_xml_payment><cust_payment_header><sender_id>SGCI</sender_id><receiver_id>RBOSNL2A</receiver_id>

<file_creation_date>140314</file_creation_date><file_creation_time>105426</file_creation_time><transaction_count>0</transaction_count>

<file_ref_nu>510703</file_ref_nu><format>PEXR</format></cust_payment_header>

<payment>EDI_DC40_U0040000000113461553701
3014
E2EDP02001                   
0040000000113461557000021000013030105100001110                                                                                                             

E2IDLU5                      
00400000001134615570000220000000200240000            
JPY                                                                                    

E2IDLU5                      
0040000000113461557000023000000020030                 JPY   

</payment></ggol_xml_payment>

As you can see in the expected output, the payment node is itself a flat file king of structure. And it should be as its shown above.

Can this be done with any custom module or ABAP code? Please suggest over the scenario.

Thanks a lot!

Regards,

Nidhi Srivastava

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you elaborate more on which IDOC source fields need to be mapped to payment node?

It can be achieved by UDF also.

---Divyesh

nidhi_srivastava22
Active Contributor
0 Kudos

There are 10-15 fields in the idoc maped to this particular field. The mapping can be done with concat function, but the line gaps and spaces used seems to be a bit tricky in case of output.

Mapping requirement is bit unclear as of now, checking over the same will update once clear.

Thanks for your valuable advices!

Regards,

Nidhi

Answers (8)

Answers (8)

nidhi_srivastava22
Active Contributor
0 Kudos

Hi All,

The issue solved.

Receiver determination I have selected operation specific, due to which it was failing. Now its working fine.

Thanks for all your help and advices.

Regards,

Nidhi

nidhi_srivastava22
Active Contributor
0 Kudos

Java mapping working fine now, the test through Operational mapping is fine and working with FLAT File also...

But when doing end to end testing, its showing error that Root Tag cannot be found.

Since the same mapping is working in ESR testing so seems java code is fine. Is something wrong with configuration part?

Is some settings need to be done in configuration part?? As its showing receiver determination error, but i checked everything seems to be fine.

Please suggest.

Thanks!

Regards,

Nidhi

former_member184720
Active Contributor
0 Kudos

Hi Nidhi - Do you have any routing conditions in your Interface determination or receiver determination?

nidhi_srivastava22
Active Contributor
0 Kudos

Hi All,

Thanks for your suggestions.

I need to know about the jar file availability? Can anyone tell me where can i download the jar file for AbstractTransformation class which is being used in the java mapping.

(com.sap.aii.mapping.api)


I cannot find the file on server level, can you please suggest where i can get this file involved in java mapping.

Thanks!

Regards,

Nidhi

engswee
Active Contributor
0 Kudos

Hi Nidhi

If they are providing you the flat file with the contents to be mapped to the payment node of the output XML, you can consider the following solution.

1) Sender interface picks up flat file and use FCC to convert to generic line records

Data type:

FCC:

2) Your source XML format would then look like this


<Line><Text>EDI_DC40_U0040000000113461553701</Text></Line>

<Line><Text>3014</Text></Line>

<Line><Text>E2EDP02001           </Text></Line>      

<Line><Text>0040000000113461557000021000013030105100001110            </Text>/Line>                                                              

<Line><Text>               </Text></Line>             

<Line><Text>E2IDLU5                       </Text></Line>
<Line><Text>00400000001134615570000220000000200240000   </Text></Line>

3) From there, you can map the generic line records to your target payment node using Concat

Rgds

Eng Swee

nidhi_srivastava22
Active Contributor
0 Kudos

Hi Experts,

Using Java mapping to achieve the solution but its not working with flat file. When I am giving XML file as input its working fine, but in case of flat file as input its resulting in error.

I am using StreamTransformation class which is deprecated, may this be the reason for the same?

Tried using AbstractTransformation, but not able to find the jar file related to the same, so not able to move further.

Please suggest where I am missing the things.

Thanks!

Regards,

Nidhi

Muniyappan
Active Contributor
0 Kudos

Hi Nidhi,

if you could provide the sender idoc xml it will make things easier for others to suggest if it can be done with std functions,UDF,java mapping etc.

Regards,

Muni.

nidhi_srivastava22
Active Contributor
0 Kudos

Thanks for your replies.

I know the requirement is bit unclear. Now, the client gave a second option.

They are telling if the file say xyz.txt(flat file content- mapped to payment node) is there in unix directory and PI picks the file there. Now, the XMLtags needs to be added to this picked file as shown in the above structure.

xyz.txt

-----------

EDI_DC40_U0040000000113461553701

3014

E2EDP02001                   

0040000000113461557000021000013030105100001110                                                                                                             

E2IDLU5                      
00400000001134615570000220000000200240000            
JPY                                                                                    

E2IDLU5                      
0040000000113461557000023000000020030                 JPY   

Expected Output-

--------------------------

<?xml version="1.0" encoding="UTF-"> <ggol_xml_payment><cust_payment_header><sender_id>SGCI</sender_id><receiver_id>RBOSNL2A</receiver_id>

<file_creation_date>140314</file_creation_date><file_creation_time>105426</file_creation_time><transaction_count>0</transaction_count>

<file_ref_nu>510703</file_ref_nu><format>PEXR</format></cust_payment_header>

<payment>EDI_DC40_U0040000000113461553701
3014
E2EDP02001                   
0040000000113461557000021000013030105100001110                                                                                                             

E2IDLU5                      
00400000001134615570000220000000200240000            
JPY                                                                                    

E2IDLU5                      
0040000000113461557000023000000020030                 JPY   

</payment></ggol_xml_payment>

Is this possible anyways? I am not sure if we can write adapter module for adding the tags.

Please suggest if we can achieve this by any means?

Thanks!

Regards,

Nidhi

Former Member
0 Kudos

So now, IDOC data as well as this flat file data both required right?

You can use java maping for both req - maping IDOC data and reading flat file as well.

Check this doc:

http://scn.sap.com/docs/DOC-45677

I am not sure if we can use any FileInputStream or any classses in UDF to read files placed on XI file system..

--Divyesh

nidhi_srivastava22
Active Contributor
0 Kudos

Yes both are required.

I will try with this document and let you know if it works fine.

Thanks,

Nidhi


anand_shankar10
Active Participant
0 Kudos

Although your requirement is not pretty clear but did you tried with sub-string or else you can achieve this using udf for trimming the string with definite lengths.

Thanks

Anand