Custom Pipeline component for Removing Trailer record from .txt file
public Microsoft.BizTalk.Message.Interop.IBaseMessage
Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
IBaseMessagePart bodyPart = inmsg.BodyPart;
Stream originalStrm = bodyPart.GetOriginalDataStream();
StreamReader sReader =
new StreamReader(originalStrm,
System.Text.Encoding.UTF8);
string sRecord = sReader.ReadToEnd();
MemoryStream memStream =
new MemoryStream();
StreamWriter sw =
new StreamWriter(memStream);
inmsg.BodyPart.Data
= memStream;
inmsg.BodyPart.Data.Position
= 0;
//"\r\n" is the delimeter for the the record
string[] separator
= new string[]
{ "\r\n" };
string[] strArray
= sRecord.Split(separator,
StringSplitOptions.None);
//Loop untill the last line (i.e ignore the trailer)
for (int n
= 1; n < strArray.Length; n++)
sw.Write((strArray[n
- 1] +
"\r\n"));
sw.Flush();
memStream.Flush();
memStream.Position
= 0;
inmsg.BodyPart.Data
= memStream;
inmsg.BodyPart.Data.Position
= 0;
return inmsg;
after Deploying and in Gac, when configuring Receive Pipeline, it shows no properties in Decode stage ?
MBH
There is nothing wrong with your code it removes the lastline, if there is no carriage return on it.
If your input file is like:
line1 <cr><lf>
line2 <cr><lf>
line3
The result is:
line1 <cr><lf>
line2 <cr><lf>
But if your input file is like:
line1 <cr><lf>
line2 <cr><lf>
line3 <cr><if>
The result is:
line1<cr><lf>
line2<cr><lf>
<empty line>
So when you have a carriage return on the last line, it results in an empty line, can this be the cause of your problem?
Similar Messages
-
SQL Loader problem while loading records from txt file to database table.
I am getting following error while loading records from flat txt file into database table with the help of 'sqlldr' command. I have executed catldr.sql from RDBMS folder but it is still showing same error. I am setting DIRECT = TRUE while issuing sqlldr command. If I try with DIRECT = FALSE then it works fine. Database is Oracle 8i.
SQL*Loader-951: Error calling once/load initialization
ORA-24329: invalid character set identifier
F1 Please.Hello,
Direct path load, can only be used with SQL*Loader and Database have the same version.
Care to tell the database version and sql*loader version you are using.
-Sri -
How to make this faster?? read millions of record from txt file
Hi there,
I got an issue. There is a txt file contains 2 million records, I also got another file contains over 10000 numbers. Now, I need to compare this 10000 numbers with that 2 million records if any records contains a number which belongs to 10000 number set, i retrieve this record and keep it. later on, when i finish the comparison i'll write all the result records into a txt file.
What kind of data structure shall i use to keep the records and numbers? how to make the comparison quicker? Any idea will do!
Thanks!if i were to do it, i will insert bout the records into the db. then do an sql statement on the two tables to get the results. Then get the rs and output it to another text file.
just my opinion. not sure if this is faster.
Message was edited by:
clarenceloh -
Custom Pipeline Component in BTDF
I have created a separate c# based custom pipeline component, how should I embed this in BTDF ?
Want to make sure this is Gac'd and available when I deploy to all other environments ?
MBHI created a c# code Custom Pipeline component for parsing against my flat file schema.
<PropertyGroup>
<IncludePipelineComponents>true</IncludePipelineComponents>
</PropertyGroup>
<ItemGroup>
<PipelineComponents Include="$(ProjectName).PipelineComponents.dll">
<LocationPath>..\PipelineComponents\bin\$(Configuration)</LocationPath>
</PipelineComponents>
</ItemGroup>
But it doesn't appear when I deploy into other environments ? what am I missing ?
MBH -
BTDF Deployment - Custom Pipeline Component
If I am deploying manually, I am able to deploy, GAC and get output accordingly.
1) But when using BTDF, its not getting deployed properly and not receiving any output. What am I doing wrong ?
2) Before deploying 'RemoveFooter' assembly and adding to PipelineBizTalk Project, how can I add that in tools of Pipeline components to add this 'RemoveFooter' component in Decode stage ?
In BTDF mentioned this :
<PropertyGroup>
<IncludePipelineComponents>true</IncludePipelineComponents>
</PropertyGroup>
<ItemGroup>
<PipelineComponents Include="$(ProjectName).PipelineComponents.dll">
<LocationPath>..\PipelineComponents\bin\$(Configuration)</LocationPath>
</PipelineComponents>
</ItemGroup>
MBHHi
MBH,
The configuration that you mentioned above is totally correct. When you add the custom pipeline component in BTDF it deploys
to “Pipeline Components” folder and at run time BTS refers the dll from this place.
Its working for me with the same configuration and I believe it might be other problem related to the actual project.
JB -
Is it possible to process a 0kb file within a custom pipeline component?
Hi There,
You probably wondering.. what the hell do you need this for?
Well.. we have a third party application that process a file as following
1) Import the original file
2) Export the original file
3) Append the original file (with the data I need)
4) Create a 0 kb file with the original exported filename but added .sem to show me that the export is done.
So my guessing was to with a custom pipeline component (receive) to pickup the .sem file, and use the original exported file to process the data from within the custom pipeline component.
Well, this works perfectly.
But... this only works if I add any data to the .sem file.
Otherwise BizTalk picks up the .sem file, but does not process it, it actually does not enter the pipeline at all, and it also does not appear in the tracking.
Is there a possiblity to accept 0kb files within a custom pipeline component?
Please help, Thanks
DPHi,
Here is an excellent article explaining the behavior of BizTalk for zero Byte files. It can help you achieve your mentioned goal.
If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Custom Pipeline Component stopped changing input filename
Hi
In my project, I have a custom pipeline component to change the input file name. I use it in the receive pipeline decode stage. It was working initially when I had only a receive pipeline and custom pipeline component in my solution. later I introduced
two schemas, an orchestration, map and a send pipeline. The rename is not working anymore. Please help.
receive adapter: FILE
send adapter: FTP
Custom pipeline component: (File Name Setter)
Receive pipeline:
decode: custom pipeline component to rename the filename
disassemble: flatfile disassembler conecting to a document schema
Map:
Schema 1 to Schema 2 (transforms from Windows to Unix format)
Orchestration:
receive message
transform using map above
send message
Exception Handler
Send pipeline:
FlatFile assembler
manibestMay be its not working now, because in the orchestration which you have added,
you’re constructing a new message from the received message and the context properties from the Received message is not copied across to the newly constructed message. So when you use “%SourceFileName%” macro in the send port,
the ReceivedFileName context property is missing in the newly constructed message which is sent out.
So in your Orchestration, while constructing (in MessageAssignment shape) the outbound message from the Received message, copy the context property of the Received message to the newly constructed message. Something like this
//This line copies all the context properties from received message to the outputted message
msgOutputted (*)= msgReceived(*)
//or
//This line just copies the receive file name context property from received message to the outputted message
msgOutputted (FILE.ReceivedFileName)= msgReceived (FILE.ReceivedFileName).
If you’re not using the Orchestration or constructing the new message (even in map), then just add the schemas/orchestration or any pipeline would not affect the ReceiveFileName code. May be in this case, debug the pipeline and also check whether the outputted
message has ReceivedFileName in its context property.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Custom pipeline component creates the folder name to archive messages
Hi
I have an requirement that a BizTalk application is receiving untyped messages and at the receive location the pipeline have to archive the incoming message with the specifications:
suppose I have an xml like
<PurchaseOrder>
<OrderId>1001</OrderId>
<OrderSource>XYZ</OrderSource>
<Code>O01</Code>
</PartyType>
In the pipeline component it has to read this xml and have to use OrderSource value 'XYZ' to create a archival folder and the message have to archive with file name '%MessageId%'
It has to be done by writing custom pipeline component where I am not familiar with c# coding, Can anyone please how to implement mechanism.
Thanks In Advance
Regards
Arun
ArunReddyHi Arun,
Use
BizTalk Server Pipeline Component Wizard to create a decode pipeline component for receive. Install this wizard. This shall help you to create the template project for your pipeline component stage.
Use the following code in the Execute method of the pipeline component code. This code archives the file based with name of the file name received.
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
MemoryStream tmpStream = new MemoryStream();
try
string strReceivedFilename = null;
DateTime d = DateTime.Now;
try
//Get the file name
strReceivedFilename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();
if (strReceivedFilename.Contains("\\"))
strReceivedFilename = strReceivedFilename.Substring(strReceivedFilename.LastIndexOf("\\") + 1, strReceivedFilename.Length - strReceivedFilename.LastIndexOf("\\") - 1);
catch
strReceivedFilename = System.Guid.NewGuid().ToString();
originalStream = inmsg.BodyPart.GetOriginalDataStream();
int readCount;
byte[] buffer = new byte[1024];
// Copy the entire stream into a tmpStream, so that it can be seakable.
while ((readCount = originalStream.Read(buffer, 0, 1024)) > 0)
tmpStream.Write(buffer, 0, readCount);
tmpStream.Seek(0, SeekOrigin.Begin);
//ToDo for you..
//Access the receive message content using standard XPathReader to access values of OrderSource and construct file pathAccess the receive message content using standard XPathReader to acceess values of OrderSource and contruct the file path
string strFilePath = //Hold the value of the file path with the value of OrderSource
string strCurrentTime = d.ToString("HH_mm_ss.ffffff");
strFilePath += "\\" + strReceivedFilename + "_";
FileStream fileStream = null;
try
System.Threading.Thread.Sleep(1);
fileStream = new FileStream(strFilePath + strCurrentTime + ".dat", FileMode.CreateNew);
catch (System.IO.IOException e)
// Handle the exception, it must be 'File already exists error'
// Wait for 10ms, change the file name and try creating the file again
// If the second 'file create' also fails, it must be a genuine error, it'll be thrown to BTS engine
System.Threading.Thread.Sleep(10);
strCurrentTime = d.ToString("HH_mm_ss.ffffff"); // get current time again
string dtcurrentTime = DateTime.Now.ToString("yyyy-MM-ddHH_mm_ss.ffffff");
fileStream = new FileStream(strFilePath + strCurrentTime + ".dat", FileMode.CreateNew);
while ((readCount = tmpStream.Read(buffer, 0, 1024)) > 0)
fileStream.Write(buffer, 0, readCount);
if (fileStream != null)
fileStream.Close();
fileStream.Dispose();
if (originalStream.CanSeek)
originalStream.Seek(0, SeekOrigin.Begin);
else
ReadOnlySeekableStream seekableStream = new ReadOnlySeekableStream(originalStream);
seekableStream.Position = 0;
inmsg.BodyPart.Data = seekableStream;
tmpStream.Dispose();
catch (Exception ex)
System.Diagnostics.EventLog.WriteEntry("Archive Pipeline Error", string.Format("MessageArchiver failed: {0}", ex.Message));
finally
if (tmpStream != null)
tmpStream.Flush();
tmpStream.Close();
if (originalStream.CanSeek)
originalStream.Seek(0, SeekOrigin.Begin);
return inmsg;
In the above code, you have do a section of code which will access the receive message content using standard XPathReader to access values of OrderSource and construct the file path. I have
commented the place where you have to do the same. You can read the XPathReader about here..http://blogs.msdn.com/b/momalek/archive/2011/12/21/streamed-xpath-extraction-using-hidden-biztalk-class-xpathreader.aspx
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
How to Remove a record from PER_ALL_PEOPLE_F
Dear All,
I want to remove a record from per_all_people_f, the employee record exist in the table but not shown on the people screen. Do I need to use any API for that or simple SQL command?
Please help asap.
Regard.Hi,
What responsibility have you logged in as ?
Is the security profile attached to that responsibility properly defined so that all employees can be viewed ?
Does the record in the table show an end-date of 31-dec-4712 ?
If the data in the table is fine, then it has to be an issue with security of the responsibility.
Cheers,
Vignesh -
How to remove duplicates records from output ?
how to remove duplicates records from output ? i used delete adjacent but duplicates records are coming again ..suggest me
hi shruthi,
thanks for ur answer ..but duplicates records coming again
here is my code >> plz check it out
*& Report ZCRM_TROUBLE_TICKET
REPORT zcrm_trouble_ticket.
TYPES : BEGIN OF ty_qmih,
qmnum TYPE qmnum,
equnr TYPE equnr,
iloan TYPE iloan,
ausvn TYPE ausvn,
ausbs TYPE ausbs,
auztv TYPE auztv,
auztb TYPE auztb,
iwerk TYPE iwerk,
END OF ty_qmih,
BEGIN OF ty_qmel,
qmnum TYPE qmnum,
qmtxt TYPE qmtxt,
indtx TYPE indltx,
priok TYPE priok,
strmn TYPE strmn,
strur TYPE strur,
ltrmn TYPE ltrmn,
ltrur TYPE ltrur,
objnr TYPE qmobjnr,
arbpl TYPE lgwid,
vkorg TYPE vkorg,
vtweg TYPE vtweg,
spart TYPE spart,
END OF ty_qmel,
BEGIN OF ty_ihpa,
parnr TYPE i_parnr,
parvw TYPE parvw,
objnr TYPE qmobjnr,
END OF ty_ihpa,
BEGIN OF ty_crhd,
arbpl TYPE arbpl,
objid TYPE cr_objid,
END OF ty_crhd,
BEGIN OF ty_crtx,
ktext TYPE cr_ktext,
objid TYPE cr_objid,
END OF ty_crtx,
BEGIN OF ty_qmfe,
fecod TYPE fecod,
fegrp TYPE fegrp,
qmnum TYPE qmnum,
END OF ty_qmfe,
BEGIN OF ty_qmur,
urcod TYPE urcod,
urgrp TYPE urgrp,
urtxt TYPE urstx,
qmnum TYPE qmnum,
END OF ty_qmur,
BEGIN OF ty_iloa,
tplnr TYPE tplnr,
iloan TYPE iloan,
END OF ty_iloa,
BEGIN OF ty_output,
qmnum TYPE qmnum,
equnr TYPE equnr,
iloan TYPE iloan,
ausvn TYPE ausvn,
ausbs TYPE ausbs,
auztv TYPE auztv,
auztb TYPE auztb,
iwerk TYPE iwerk,
qmtxt TYPE qmtxt,
indtx TYPE indltx,
priok TYPE priok,
strmn TYPE strmn,
strur TYPE strur,
ltrmn TYPE ltrmn,
ltrur TYPE ltrur,
objnr TYPE qmobjnr,
arbpl TYPE lgwid,
vkorg TYPE vkorg,
vtweg TYPE vtweg,
spart TYPE spart,
parnr TYPE i_parnr,
parvw TYPE parvw,
arbpl TYPE arbpl,
objid TYPE cr_objid,
arbpl1 TYPE arbpl,
ktext TYPE cr_ktext,
fecod TYPE fecod,
fegrp TYPE fegrp,
urcod TYPE urcod,
urgrp TYPE urgrp,
urtxt TYPE urstx,
tplnr TYPE tplnr,
END OF ty_output.
DATA : it_qmih TYPE STANDARD TABLE OF ty_qmih,
it_qmel TYPE STANDARD TABLE OF ty_qmel,
it_ihpa TYPE STANDARD TABLE OF ty_ihpa,
it_crhd TYPE STANDARD TABLE OF ty_crhd,
it_crtx TYPE STANDARD TABLE OF ty_crtx,
it_qmfe TYPE STANDARD TABLE OF ty_qmfe,
it_qmur TYPE STANDARD TABLE OF ty_qmur,
it_iloa TYPE STANDARD TABLE OF ty_iloa,
it_output TYPE STANDARD TABLE OF ty_output,
wa_qmih TYPE ty_qmih,
wa_qmel TYPE ty_qmel,
wa_ihpa TYPE ty_ihpa,
wa_crhd TYPE ty_crhd,
wa_crtx TYPE ty_crtx,
wa_qmfe TYPE ty_qmfe,
wa_qmur TYPE ty_qmur,
wa_iloa TYPE ty_iloa,
wa_output TYPE ty_output.
INITIALIZATION.
REFRESH : it_qmih,
it_qmel,
it_ihpa,
it_crhd,
it_crtx,
it_qmfe,
it_qmur,
it_iloa,
it_output.
CLEAR: wa_qmih,
wa_qmel,
wa_ihpa,
wa_crhd,
wa_crtx,
wa_qmfe,
wa_qmur,
wa_iloa,
wa_output.
start-of-selection.
SELECT qmnum
equnr
iloan
ausvn
ausbs
auztv
auztb
iwerk
FROM qmih
INTO TABLE it_qmih.
SORT it_qmih BY qmnum .
DELETE ADJACENT DUPLICATES FROM it_qmih COMPARING qmnum equnr iloan ausvn ausbs auztv auztb iwerk.
SELECT qmnum
qmtxt
indtx
priok
strmn
strur
ltrmn
ltrur
objnr
arbpl
vkorg
vtweg
spart
FROM qmel
INTO TABLE it_qmel
FOR ALL ENTRIES IN it_qmih
WHERE qmnum = it_qmih-qmnum.
SORT it_qmel BY qmnum.
DELETE ADJACENT DUPLICATES FROM it_qmel COMPARING qmnum
qmtxt
indtx
strmn
strur
ltrmn
ltrur
objnr
arbpl
vkorg
vtweg
spart.
IF it_qmel IS NOT INITIAL.
SELECT parnr
parvw
objnr
FROM ihpa
INTO TABLE it_ihpa
FOR ALL ENTRIES IN it_qmel
WHERE objnr = it_qmel-objnr.
ENDIF.
DELETE ADJACENT DUPLICATES FROM it_ihpa COMPARING parnr
parvw
objnr.
IF it_qmel IS NOT INITIAL.
SELECT arbpl
objid
FROM crhd
INTO TABLE it_crhd
FOR ALL ENTRIES IN it_qmel
WHERE objid = it_qmel-arbpl.
ENDIF.
DELETE ADJACENT DUPLICATES FROM it_crhd COMPARING arbpl
objid.
IF it_qmel IS NOT INITIAL.
SELECT ktext
objid
FROM crtx
INTO TABLE it_crtx
FOR ALL ENTRIES IN it_crhd
WHERE objid = it_crhd-objid.
ENDIF.
DELETE ADJACENT DUPLICATES FROM it_crtx COMPARING ktext
objid.
IF it_qmih IS NOT INITIAL.
SELECT fecod
fegrp
qmnum
FROM qmfe
INTO TABLE it_qmfe
FOR ALL ENTRIES IN it_qmih
WHERE qmnum = it_qmih-qmnum.
ENDIF.
SORT it_qmfe BY qmnum.
DELETE ADJACENT DUPLICATES FROM it_qmfe COMPARING fecod
fegrp.
IF it_qmih IS NOT INITIAL.
SELECT urcod
urgrp
urtxt
qmnum
FROM qmur
INTO TABLE it_qmur
FOR ALL ENTRIES IN it_qmih
WHERE qmnum = it_qmih-qmnum.
ENDIF.
SORT it_qmur BY qmnum.
DELETE ADJACENT DUPLICATES FROM it_qmur COMPARING urcod
urgrp
urtxt.
IF it_qmih IS NOT INITIAL.
SELECT tplnr
iloan
FROM iloa
INTO TABLE it_iloa
FOR ALL ENTRIES IN it_qmih
WHERE iloan = it_qmih-iloan.
ENDIF.
DELETE ADJACENT DUPLICATES FROM it_iloa COMPARING tplnr
iloan.
LOOP AT it_qmih INTO wa_qmih.
wa_output-qmnum = wa_qmih-qmnum.
wa_output-equnr = wa_qmih-equnr.
wa_output-iloan = wa_qmih-iloan.
wa_output-ausvn = wa_qmih-ausvn.
wa_output-ausbs = wa_qmih-ausbs.
wa_output-auztv = wa_qmih-auztv.
wa_output-auztb = wa_qmih-auztb.
wa_output-iwerk = wa_qmih-iwerk.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_qmel INTO wa_qmel WITH KEY qmnum = wa_qmih-qmnum.
wa_output-qmtxt = wa_qmel-qmtxt.
wa_output-indtx = wa_qmel-indtx.
wa_output-priok = wa_qmel-priok.
wa_output-strmn = wa_qmel-strmn.
wa_output-strur = wa_qmel-strur.
wa_output-ltrmn = wa_qmel-ltrmn.
wa_output-ltrur = wa_qmel-ltrur.
wa_output-objnr = wa_qmel-objnr.
wa_output-arbpl = wa_qmel-arbpl.
wa_output-vkorg = wa_qmel-vkorg.
wa_output-vtweg = wa_qmel-vtweg.
wa_output-spart = wa_qmel-spart.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_ihpa INTO wa_ihpa WITH KEY objnr = wa_qmel-objnr.
wa_output-parnr = wa_ihpa-parnr.
wa_output-parvw = wa_ihpa-parvw.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_crhd INTO wa_crhd WITH KEY objid = wa_qmel-arbpl.
wa_output-arbpl = wa_crhd-arbpl.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_crtx INTO wa_crtx WITH KEY objid = wa_crhd-objid.
wa_output-ktext = wa_crtx-ktext.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_qmfe INTO wa_qmfe WITH KEY qmnum = wa_qmih-qmnum.
wa_output-fecod = wa_qmfe-fecod.
wa_output-fegrp = wa_qmfe-fegrp.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_qmur INTO wa_qmur WITH KEY qmnum = wa_qmih-qmnum.
wa_output-urcod = wa_qmur-urcod.
wa_output-urgrp = wa_qmur-urgrp.
wa_output-urtxt = wa_qmur-urtxt.
APPEND wa_output TO it_output.
CLEAR wa_output.
READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = wa_qmih-iloan.
wa_output-tplnr = wa_iloa-tplnr.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM it_output COMPARING qmnum
equnr
ausvn
ausbs
auztv
auztb
iwerk
qmtxt
indtx
priok
strmn
strur
ltrmn
ltrur
vkorg
vtweg
spart
parnr
parvw
arbpl
ktext
fecod
fegrp
urcod
urgrp
urtxt
tplnr.
*CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
CLIENT = SY-MANDT
FLG_USER_STAT = ' '
objnr =
ONLY_ACTIVE = 'X'
spras = en
BYPASS_BUFFER = ' '
IMPORTING
ANW_STAT_EXISTING =
E_STSMA =
LINE =
USER_LINE =
STONR =
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2
*IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
*CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id =
language =
name =
object =
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines =
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
*IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
*LOOP AT IT_OUTPUT INTO WA_OUTPUT.
*WRITE : / WA_OUTPUT-qmnum,
WA_OUTPUT-equnr,
WA_OUTPUT-iloan,
WA_OUTPUT-ausvn,
WA_OUTPUT-ausbs,
WA_OUTPUT-auztv,
WA_OUTPUT-auztb,
WA_OUTPUT-qmtxt,
WA_OUTPUT-indtx,
WA_OUTPUT-strmn,
WA_OUTPUT-strur,
WA_OUTPUT-ltrmn,
WA_OUTPUT-ltrur,
WA_OUTPUT-objnr,
WA_OUTPUT-arbpl,
WA_OUTPUT-parnr,
WA_OUTPUT-parvw,
WA_OUTPUT-objid,
WA_OUTPUT-ktext,
WA_OUTPUT-fecod,
WA_OUTPUT-fegrp,
WA_OUTPUT-urcod,
WA_OUTPUT-urgrp,
WA_OUTPUT-urtxt,
WA_OUTPUT-tplnr.
*ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'E:\CRM1.TXT'
FILETYPE = 'ASC'
APPEND = ' '
write_field_separator = '|'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
IMPORTING
FILELENGTH =
TABLES
data_tab = it_output
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Custom Pipeline Component error
I have created a custom pipeline component which references a template file on the local drive e.g. c:\test\template.xlsx. however when I run the application the Send pipeline fails Reason: 'c:\test\template.xlsx' could not be found.
It does exist, everything is spelt correctly and the host account has access to the folder. Why can't the component see it?
----------------<0>----------------
http://redeyedmonster.co.uk
----------------<0>----------------I tried a code as highlighted by Rachit, but I don’t see issue as the referred blog suggest.
Coming to questioners code, I created a quick pipeline component which uses a dll for
Microsoft.Office.Interop.Excel
accessing the excel files and does something with Excel file.
Few things I want to highlight here.
If the questioner (RedEyeMonster) is using the same dll (Microsoft.Office.Interop.Excel)
in the pipeline component as I used, then I am afraid Workbooks.Open’s component doesn’t just take one parameter as shown.
Open method doesn’t have any overloaded methods. It takes few parameter and its worth checking each one on them.Some of the parameter are very important and could cause issues (like
ReadOnly , IgnoreReadOnlyRecommended, Editable etc). As said, the
Workbooks .Open method doesn’t just have template file location parameter. It’s worth reviewing the code again.
Microsoft.Office.Interop.Excel.Application excelApplication = new Microsoft.Office.Interop.Excel.Application();
//When I tried without the following couple of lines, my program waited for long time and crashed
excelApplication.DisplayAlerts = false;
excelApplication.Visible = true;
Microsoft.Office.Interop.Excel.Workbook excelWorkboook = excelApplication.Workbooks.Open(@"C:\MRAshwinPrabhu\TestExcel.xsl", 2, false,
5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "",
false, false, 0, false, true, 0);
While trying the code, I create a excel file as extension *.xls (older version of Excel 97-2003 workbook) and in the code I tried to open the file as “C:\foldername\FileName.xlsx”.
*.xls and *.xlsx are different, though in the folder the excel icon may look similar they are different file extensions. I for the same error as the questioner.
Also issue I faced while trying this is “DisplayAlerts”
property. When I tried without setting this property to false, my program just waited for long time and crached evently. So when you use in a program like pipeline where you don’t have UI, ensure this property is set to false.
Hope the above suggest would help the questioner.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Hi all -
My group is working in BW 3.5 and have loaded an infocube. Is it possible to remove one record from the cube without reloading everything? We need the entire record gone, not just a delta to reverse it. I should mention that this should be an automated process and not a quick manual correction.
Any ideas?
Thanks for your help!
JeffHi Jeff,
To do this from the cube (manually) please see:
http://help.sap.com/saphelp_nw04/helpdata/en/4e/b71038cba6a169e10000009b38f8cf/content.htm
Using the DELETE_FACTS, you can do the same as above, but the system will generate a program. The program can be made a part of the process chain, thus automating this job. But you need to see how 'variable' the selections are and if they can be incorporated into the program...if you need to delete just one record, then I guess you need to be extremely careful and specific with the deletion selections.
Hope this helps... -
Unable to add the Custom Pipeline component in to the Visual Studio Tool Box
I have tried to create the custom Pipeline component to transfer the large message in Receive side,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
using Microsoft.BizTalk.Message.Interop;
using Microsoft.BizTalk.Component.Interop;
namespace Sample.LargeFilesDecoder
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[ComponentCategory(CategoryTypes.CATID_Encoder)]
[System.Runtime.InteropServices.Guid("25984614-BCFD-4c47-82FC-4A2300B76411")]
public class LargeFilesDecoder : IBaseComponent,
IComponentUI,
IComponent,
IPersistPropertyBag
#region IBaseComponent Members
public string Description
get
return "Pipeline component used to receive Larger Files through SFTP Ports";
public string Name
get
return "LargeFilesDecoder";
public string Version
get
return "1.0.0.0";
#endregion
#region IComponentUI Members
public IntPtr Icon
get
return new System.IntPtr();
public System.Collections.IEnumerator Validate(object projectSystem)
return null;
#endregion
#region IPersistPropertyBag Members
private string _largeFileLocation;
private int _thresholdSize;
public string LargeFileLocation
get { return _largeFileLocation; }
set { _largeFileLocation = value; }
public int ThresholdSize
get { return _thresholdSize; }
set { _thresholdSize = value; }
public void GetClassID(out Guid classID)
classID = new Guid("DBA77DFA-5D3E-4B85-8F78-1D6330B6BCA0");
public void InitNew()
public void Load(IPropertyBag propertyBag, int errorLog)
object val1 = null;
object val2 = null;
try
propertyBag.Read("LargeFileLocation", out val1, 0);
propertyBag.Read("ThresholdSize", out val2, 0);
catch (ArgumentException)
catch (Exception ex)
throw new ApplicationException("Error reading PropertyBag: " + ex.Message);
if (val1 != null)
_largeFileLocation = (string)val1;
if (val2 != null)
_thresholdSize = (int)val2;
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)
object val1 = (object)_largeFileLocation;
propertyBag.Write("LargeFileLocation", ref val1);
object val2 = (object)_thresholdSize;
propertyBag.Write("ThresholdSize", ref val2);
#endregion
#region IComponent Member
public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
if (_largeFileLocation == null || _largeFileLocation.Length == 0)
_largeFileLocation = Path.GetTempPath();
if (_thresholdSize == null || _thresholdSize == 0)
_thresholdSize = 4096;
if (pInMsg.BodyPart.GetOriginalDataStream().Length > _thresholdSize)
Stream originalStream = pInMsg.BodyPart.GetOriginalDataStream();
string largeFilePath = _largeFileLocation + pInMsg.MessageID.ToString() + ".msg";
FileStream fs = new FileStream(largeFilePath, FileMode.Create);
// Write message to disk
byte[] buffer = new byte[1];
int bytesRead = originalStream.Read(buffer, 0, buffer.Length);
while (bytesRead != 0)
fs.Flush();
fs.Write(buffer, 0, buffer.Length);
bytesRead = originalStream.Read(buffer, 0, buffer.Length);
fs.Flush();
fs.Close();
// Create a small xml file
string xmlInfo = "<MsgInfo xmlns='http://Sample.LargeFilesDecoder'><LargeFilePath>" + largeFilePath + "</LargeFilePath></MsgInfo>";
byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(xmlInfo);
MemoryStream ms = new MemoryStream(byteArray);
pInMsg.BodyPart.Data = ms;
return pInMsg;
#endregion
I have
Added .dll file in to the Global Assembly Cache (use gacutil)
Copied it the Pipeline Components folder (E:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components)
Everything was successful, when I try to add the component to the Toolbox I get the message like below and cannot find the component in Toolbox.
Tried several times but still getting stuck in the same place. I am using Visual Studio 2013. Any help is greatly appreciated.Do not put the Assembly in the %\Pipeline Components folder. Pipeline Component Assemblies should be in the GAC only.
To correctly deploy a custom Pipeline Component, you can follow the steps in this Wiki Article:
http://social.technet.microsoft.com/wiki/contents/articles/26404.biztalk-deploying-custom-pipeline-components-in-biztalk-server-2006-and-higher.aspx
I have never seen that specific error before. Are you sure you're browsing from the Pipeline Components tab? -
Custom Pipeline Component - Deployment Issue
We have created a custom pipeline component that logs information via ETW. The component was added to a suite of common pipelines that our applications share, as well as to a handful of application specific pipelines that require other custom components
used only by those applications. I made a change to the component and deployed the DLL to our test environment, added it to the GAC and restarted all of the host instances. The common pipelines all seem to work fine with the new DLL, but for some reason those
pipelines that are application specific (which use the same version of the DLL) all started generating the "Object reference not set to an instance of the object" error. So I replaced the new DLL with the original version and all of the pipelines
(common and otherwise) worked okay again. Can anyone tell me what I need to do to get the application specific pipelines to work with the modified DLL?
Thank you.
Thanks, BruceQuite certain. The application specific pipelines call public methods that write string data to a log file - they don't pass any parameters - all of that is contained within the component itself. We only changed the content of the data for the internal parameters,
not the data type, so the signature of the procedures remain the same.
The original author of the code had the component logging every attribute of the pipeline and received message to the log file which was creating very large and non-useful logs. We only replaced the call to the pc.GetProperties() and inmsg.GetProperties()
methods (both return string values) with concise strings containing the data we need logged.
The first version of the pipeline did not contain the GetProperties methods, those were added later and the pipeline was deployed for testing. At that time, all of the application specific pipelines began generating errors that the GetProperties() method
was not recognized, so we ended up having to go back and rebuild and re-deploy all of the application specific pipelines to use the newer version in order to get them to work. We should not have to go through this much effort to replace a shared
library, and am hoping we can find a way to deploy it without having to redeploy all of the other pipelines as well.
We deployed the new pipeline according to Microsoft's recommendations in
BizTalk: Deploying Custom Pipeline Components in BizTalk Server 2006 and Higher so we are left scratching our heads at this point.
Thanks, Bruce -
FM FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE
Hello vikas,
I need to develop a interface program FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE.
Is there ay function module to update or create the condtion records,
if u have any example interface program to update conditions records please send me.
regards
ram.This must be your compiler output.
Basically, it is telling you two things that are wrong - in syntax.
1. On line number 11 of the file RationalCollection1.java, the compiler expects a type identifier - that would be the object or return type such as int, String, boolean, etc.
The reason it is doing this is probably due to your not ending a previous statement - like the "expected ';'" error statement. Check your code, make sure that methods (brackets) are closed correctly and there are no open statements (i.e. missing the semi-colen at the end).
2. On line number 33 of the file RationalCollection1.java, the compiler expected the closing bracket. Thus, you didn't put the bracket where the compiler wants it.
It appears that you have skipped some lines of code. Those lines are the problem, post them - post lines 30-36 and 9-15 so we can see what is happening around those error lines.
Maybe you are looking for
-
System shuts down after connecting to WiFi
My new HP 250 G3 running Windows8.1 shuts down immediately or after sometime whenever i connect it to any of available WiFi networks i.e. in Home or in University. It produces a Blue Screen evrytime producing a new error type such as driver_irql_not
-
my ipod touch is disabled and it say to connect to iTunes.... I connected to itunes and it doesnt change my ipod screen! help me get back into my ipod touch again!
-
I Need to print a portion of a pdf file using a dos command. Can i ?
Hello, I Need to print a portion of each page of a pdf file using a dos command without opening it. Can i do it ? if yes how ? Thanks in Advance for your help.
-
Mouse pointer hand lost on links
There are a number of references to this problem (mouse pointer over a link momentarily turns to a hand before becoming the arrow again) all seem to be answered when the problem goes away. I have this problem and I know that if I close Safari and reo
-
Hi, This is my first time here. I have created my own sales area (1040/ZM/ZM), own cust (146), own material (4919) In IDES and am now trying to create a sales order after confirguring the system.It allows me to save a sales order(sales order no:10002