cancel
Showing results for 
Search instead for 
Did you mean: 

read file content inside custom action block

Former Member
0 Kudos

Hello,

I'm trying to read a file content within a custom action block. The custom action has an input parameter "path". The file I want to load is in the workbench (web:// ... ). How do I have to provide the path for a file load inside the custom action?

web://tmp/filename.txt ?

/XMII/CM/tmp/filename.txt ?

absolute path on the mii server (Linux)?

Thank you for your input.

Matthias

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The 'web://' and 'db://' represent paths on the virtual file system which I beleive is contained in the xMII application db. Maybe someone from SAP can post an example to the wiki of how the built in MII file actions resolve these types of paths? You might have to establish your own connection to the Netweaver db.

I would think you could just use the built in file actions to load your content and pass this onto your action. I think you can use the image reader action if you need to maintain the binary structure of your file.

Regards,

Christian

Former Member
0 Kudos

Hi Christian,

thank you for your input. The reason I want to do the loading myself and not with existing actions is the following: I receive csv files from another system in an ANSI encoding. These Files contain German Umlaute ä,ö,ü. The existing read file action blocks are not able to load these characters correctly, hence I tried to do the reading and converting inside a custom action block.

Reading the binary data with an image reader action sounds interesting, maybe I can pass the binary data into a custom action block and do some conversion from ANSI encoding to UTF-8 encoding?

Best Regards,

Matthias

0 Kudos

Matthias,

I agree that this should be supported within the standard SAP MII File action set but since it's not if the content resides within the SAP MII WEB content or any HTTP accessible path; then you can use the WEB -> POST action to retrieve it with the proper encoding set.

Can you please explain your scenario in more detail, is this a push of the content to the file system and then a read by a scheduled MII transaction or are you requesting the ANSI file from the system synchronously?

Regards,

Sam

Former Member
0 Kudos

Hello,

initially I saved the imported file on the file system of the MII server, but it is no problem to save it in the web part of the MII workbench. I have tested the HTTP Post action block with an example file containing Umlaute. HTTP Post works fine for me when I choose the ASCII encoding.

Thank you,

Matthias

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

if the file is inside the project name/WEB , you must use path like web://project name/WEB/filename.ext

If file is in MII server C drive : path is like C:/folder/.../filename.ext

Edited by: cml_bzl on Dec 25, 2009 10:31 PM

Former Member
0 Kudos

Hi,

If you want to load the particular file xml,text etc then use below one:

WEB://<Project>/<Project_FoldeName>/<ScenarioFolder(If you have)>/<someting.xml>

-Suresh