cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Business Connector: how to write a file with LF

Former Member
0 Kudos

Hi,

Need to write to a file from SAP business connector.The file is a unix script file and therefore must have LF after each line. I have my data in a string and was thinking to have a separator-character where I want my linebreaks, I would then replace with UNIX LF hex value '0A'. But how to get the hexvalue '0A' into the 'replaceString' parameter of the 'replace transformer' without doing copypaste of the value... in other words how to work with hexvalues in SAPBC?

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

closing this one down

Former Member
0 Kudos

Hi all, have you ever used the function module DX_WRITE_FILE yet? I use it to write data from an internal table to a file, but it did not work. The error is: the Type conflict.

Do you have some experience about using this function, pls help me, i have to finish this program in a few next days.

Thanks in advance.

Thien Duong.

Former Member
0 Kudos

Hi Bowie,

I don't rememeber if replaceString has a parameter "regular expression". LF in regular expression is \n.

Another way is create a function similar like this :

// * begin

IDataCursor idcPipeline = pipeline.getCursor();

String vData[] = IDataUtil.getStringArray(idcPipeline,"Data"); //Where Data means input parameter

if(vData == null) {

idcPipeline.insertAfter("message","Data is empty");

return;

} // It is not necessary

String sBuf = vData[0]; // alert, could have more than one vData (0,1,2,3...), it depends on the pipeline

String sBufSai = sBuf.replaceAll(";","\n"); // Where ";" means lines separater and "\n" LF

idcPipeline.insertAfter("Data",vBufSai); // Return in the same pipeline

idcPipeline.destroy()

//End

[]s

Renato.