Multiple Header Lines in Flat-File read by FileSenderAdapter
Hello XI and File Sender Adapter Species
We have the following file with fixed file lengths:
#H1 F1
#H2 F1
#H3 F1
#H4 F1
#H5 F1
#H6 F1
#D1 Field1 - Fieldn
#D2 Field1 - Fieldm
#D2 Field1 - Fieldm
#D1 Field1 - Fieldn
#D2 Field1 - Fieldm
#D2 Field1 - Fieldm
#F F1
Concrete example as follows:
#H1 150
#H2 ECH150_20070709_026745152.dat
#H3 20070709_1600
#H4 9.0
#H5 8712423010208
#H6 8712423009202
#MDDTD3 146307732 146202845 871687940006178374E70871687910000219120200707090032B 040235031 Noordkant 28 SINT ANTHONIS 5845EW 8716879000004871242300920287124230091962007070909550113533533 8716948000010501000L
#MDDTD4 59664 E10
#MDDTD4 30180 E11
#MDDTD3 146309776 146202839 871694840030212726E70871694830000000309200707090031B 0411 8 Flierakkers 21 VROOMSHOOP 7681XV 8716948000003871242300920287124230091962007070909590113533515 8716948000010503000L
#MDDTD4 3562 E10
#MDDTD4 2422 E11
#F6
This File Should be read via the File Sender Adapter and afterwards mapped into the following idoc structure:
IDOC-Type
ZUECH_010
Header Segment: H1, H2, H3, H4 , H5 ,H6
Detail1Segment: Field1, Field2
. Fieldn
Detail2Segment: Field1, Field2
. Fieldm
Detail2Segment: Field1, Field2
. Fieldm
Detail1Segment: Field1, Field2
. Fieldn
Detail2Segment: Field1, Field2
. Fieldm
Detail2Segment: Field1, Field2
. Fieldm
FooterSegment: Field1
Now my Questions:
1. As far as I know it is not possible to configure in the filesender adapter 2 different Record sets? We need two record sets, one for the header lines whose occurrences are once per File and one for the detail lines? Does anybody know if this is possible?
2. Any other ideas for a simple solution?
Thanks for a soon answer.
Regards Marlies
Thanks all very much for your answers:
The hint from Praveen was very helpful.
If possible we need a solution with the graphical mapping tool and as far as possible without UDF, because at the moment there is no java developer.
The file adapter now produces the following xml structure:
<ZUECH_0150>
<recordset>
<H1>
<KH1>#H1</KH1>
<H1>150</H1>
</H1>
<H2>
<KH2>#H2</KH2>
<H2>ECH150_20070709_026745152.dat</H2>
</H2>
<H3>
<KH3>#H3</KH3>
<H3>20070709_1600</H3>
</H3>
<H4>
<KH4>#H4</KH4>
<H4>9.0</H4>
</H4>
<H5>
<KH5>#H5</KH5>
<H5>8712423010208</H5>
</H5>
<H6>
<KH6>#H6</KH6>
<H6>8712423009202</H6>
</H6>
<MDDTD3>
<KMDDTD3>#MDDTD3</KMDDTD3>
<MDDTD3>146307732 146202845 </MDDTD3>
</MDDTD3>
<MDDTD4>
<KMDDTD4>#MDDTD4</KMDDTD4>
<MDDTD4>59664 E10</MDDTD4>
</MDDTD4>
<MDDTD4>
<KMDDTD4>#MDDTD4</KMDDTD4>
<MDDTD4>30180 E11</MDDTD4>
</MDDTD4>
</recordset>
</ ZUECH_0150>
I would prefer the following structure, because it fits exactly to the structure of the idoc.
That means the mapping is very simple:
<ZUECH_0150>
<HEADER>
<H1>150</H1>
<H2> ECH150_20070709_026745152.dat</H1>
</HEADER>
<MDDTD3>
<KMDDTD3></KMDDTD3>
<MDDTD3>146307732 146202845</MDDTD3>
<MDDTD4>
<KMDDTD4>#MDDTD4</KMDDTD4>
<MDDTD4>59664 E10</MDDTD4>
</MDDTD4>
<MDDTD4>
<KMDDTD4>#MDDTD4</KMDDTD4>
<MDDTD4>30180 E11</MDDTD4>
</MDDTD4>
</MDDTD3>
</ZUECH_0150>
Now my new questions:
1. Is it possible to configure the file adapter to produce a xml structure which afterwards can be mapped with a simple graphical mapping into the idoc structure?
(I can live with the suggestion from Praveen, that the header information is in each recordset but only has content in the first one.)
2. What about the MDDTD4? It is a substructure from MDDTD3. Is it possible to configure this in the file adapter?
Thanks a lot for your help and a soon answer.
Regards Marlies
Message was edited by:
Marlies Nowotka
Message was edited by:
Marlies Nowotka
Similar Messages
-
Multiple Header line in Receiver File adapter
Hi,
I have an issue in Receiver File adapter with multiple header lines. I am able to get only 1 header lines in the receiver file but not multiple header lines with 'nl' since it is static in file mode
[CommunityTag:Header]
empNo,EmpName,Age
[CommunityTag]
I tried with the below in content conversion one as below with no luck
Root.addHeaderLine=1
Root.headerLine=[CommunityTag:Header] 'nl' empNo,EmpName,Age 'nl' [CommunityTag]
Root.fiedSeparator=,
Root.endSeparator='nl'
I am getting the Header line as same row as static text.
Can you advise this.Hi Gabriel, I suggest to produce the header lines from additional nodes in the message payload. That means you need to modify the data type of the target message in order to generate an extra structure in the payload. Use constants in message mapping to generate the header column names, e.g.
<Header>
<H1>CommunityTag:Header</H1>
<H2>empNo,EmpName,Age</H2>
<H3>CommunityTag</H3>
</Header>
In content conversion you have to convert the Header row with
Header.endSeparator='nl'
You won't need parameter addHeaderLine anymore then.
Regards, Martin -
Hi Guys,
I got an issue , My flat file having multiple header lines
TPS27RPR MOME THRIFT (SAVING) PLAN SYSTEM Page 2
09:54 05 JAN 2014 List of Contributors w/Company Contributions Phase DAY Unit TRE
Company No: xxxxxxxx - xxxxxxxxxxxxx.
Employee/ Employee/
Employee Full Name/ Company Company Allocation
Number ID Number PS PN End Date Contribution Profit Total Balance Percentage
some lines of data and again
TPS27RPR MOME THRIFT (SAVING) PLAN SYSTEM Page 2
09:54 05 JAN 2014 List of Contributors w/Company Contributions Phase DAY Unit TRE
Company No: xxxxxxxx - xxxxxxxxxxxxx.
Employee/ Employee/
Employee Full Name/ Company Company Allocation
Number ID Number PS PN End Date Contribution Profit Total Balance Percentage
in this case how could I separate the header lines from the flat file and update the details to my internal table.
kindly help me on this issue.
Thanks and regards,
M.S.Amirtharajvijay.Hi Amirthraj,
If the flat file is static (if the content within it is same for all) then use the offset concept. First get the contents of the flat file into an internal table and later find the field that has to be in final internal table within the line, calculate the offset for the line and get the value into an workarea. Finally modify/append the work area into an internal table. Also wait for other experts answers for any other hassle free way to achieve the requirement.
With Regards,
Giriesh M -
BAPI_PO_CREATE1 not able to create PO's for multiple rows from the flat fil
Hi
i am uploading PO's from a flat file into SAP using the BAPI_PO_CREATE1. Everything works fine if the flat file hast only one record.
if the flat file has more than one record then while loading the second record the BAPI returns a error message. I am calling the BAPI in a loop.
The strange thing is that if i load the second record individually the program is able to create the PO. So only when i have multiple records in the flat file i am unable to load the PO into SAP. I debugged and checked all the internal tables passed to the BAPI. All seems to have the data correctly but still the BAPI fails.
any idea where i am going wrong?
the code looks something like this.
LOOP AT HEADER_ITAB.
PERFORM FILL_HEADER_RECORDS.
LOOP AT ITEM_ITAB WHERE EBELN eq HEADER_ITAB-EBELN.
PERFORM FILL_ITEM_RECORDS.
ENDLOOP.
PERFORM CERATE_PO_VIA_BAPI.
ENDLOOP.What is the error message. Are you trying something like this:
LOOP AT T_DATA1.
AT NEW LIFNR.
READ TABLE T_DATA1 INDEX SY-TABIX.
PERFORM INIT_TABLES.
PERFORM FILL_DATA.
--Call the BAPI to create PO
PERFORM CREATE_PO.
ENDAT.
ENDLOOP.
FORM CREATE_PO .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = POHEADER
POHEADERX = POHEADERX
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPPURCHASEORDER = EXPPURCHASEORDER
EXPHEADER = EXPHEADER
EXPPOEXPIMPHEADER = EXPPOEXPIMPHEADER
TABLES
RETURN = RETURN
POITEM = POITEM
POITEMX = POITEMX
POADDRDELIVERY =
POSCHEDULE = POSCHEDULE
POSCHEDULEX = POSCHEDULEX
POACCOUNT = POACCOUNT
POACCOUNTPROFITSEGMENT =
POACCOUNTX = POACCOUNTX
POCONDHEADER =
POCONDHEADERX =
POCOND = POCOND
POCONDX = POCONDX
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM = POTEXTITEM
ALLVERSIONS =
POPARTNER = POPARTNER
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RETURN1.
DATA: L_NAME TYPE LFA1-NAME1.
CLEAR L_NAME.
SELECT SINGLE NAME1
FROM LFA1
INTO L_NAME
WHERE LIFNR = POHEADER-VENDOR.
LOOP AT RETURN.
WRITE : / RETURN-TYPE,
RETURN-ID,
RETURN-MESSAGE.
WRITE : '--> For vendor:',
POHEADER-VENDOR,
L_NAME.
ENDLOOP.
ENDFORM. " CREATE_PO -
Check on multiple header line data.
Hi All,
I have one requirement where i need to check the multiple accounting document header line.
Kindly suggest how to check the above requirement.
Thanks in Advance!
Regards,
ChiragHi All,
Sorry for the short description.
Currently i am validating only the one header line data of expense spread sheet file with vendor. but the now requirement has changed and there can be a multiple header line item also.
So i need to check for each header line item whether vendor already exist or not.
I am able to check it for 1 header line item, Kindly suggest how to check it for multiple header line item.
Thankyou.
Chirag -
Dynamic Header Values in Flat File Destination
Hi,
I have to put 'T' or 'P' as part of a header in a flat file destination. The header is sourced via a work table which defines what the header looks like. One of the columns should contain 'T' for test or 'P' for production. When the package is executed in
the test environment, 'T' should appear as part of the header. When the package is executed in the production environment, 'P' should appear as part of the header.
Any ideas on how to achieve this is very much welcome.
Thanks,
AJPackage parameter indicating the environment and a DerivedColumn transform that generates a column with T or P depending on the parameter value.
-
How to upload schedule line from flat files to sap file
dear all,
i want to upload the schedule lines from flat files to sap schedulle lines
but the flat files have 15 schedule lines and the data is as per date
so how to upload that and the fields available in flat files are more than the sap screen
we are having more than 6 items
and 15scedule lines its abt 90data to be upload
for one customer in every 15 day
so how to do this
is there any direct use in functional side
with out the help of any abap
but my user will do it
so he need a permanent solution
with regards
subratHi Subrat ,
u can upload the data either ( Master /Transaction) data with the help of lsmw. for that all u need to do is go through the lsmw and do it. in that u can go Batch input recording/ BAPI/ IDOC any of that. here i am sending the LSMW Notes go through it and do the work.
once u create the LSMW project then u can ask the data from user or u can explain the user about the program and can run the flat file to upload the data.
if u require LSMW material Just send me blank mail from u. my mail id is [email protected]
Reward if Helpful.
Regards,
Praveen Kumar.D -
How to eliminate empty lines in Flat file.
Hi All,
How to delete the empty lines in flat file,i am explaining below with data
Here we have 3 fields with field lengths 30,10,34 i am checking the condition in message mapping if the middle field containing 9999999999 i am deleting the total record but in output file i am getting empty line how to eleminate empy lines in file please suggest me is it possible through Content Convertion.
Thanks,
Sudheer.
0500189175247200000500003141700000142888073108000009640566210000
0500189175247200000500012449050000142889072908000009623017230000
0500189175247200000500000496210000142890073008000009631840760000
0500189175247200000500000162130000142891072808000009613028730000
0500189175247200000500001356750000142892072908000009621443430000
0500189175247200000500012982910000142893072908000009622158440000
0500189175247200000500001380990000142894073008000009631876720000
0500189175247200000500000074560000142895072808000009613904430000
0500189175247200000500003351650000142896072908000009623005030000
0500189175247200000500000061170000142898072808000009613026140000
0500189175247200000500000060590000142900073008000009630862400000
0500189175247200000500000155320000142901072908000009623234640000
0500189175247200000500043425220000142903072808000009612752160000
0500189175247200000500000517450000142904073108000009640911680000
0500189175247200000500006901140000142905073008000009630927540000
0500189175247200000500001565590000142906073008000009630938540000
0500189175247200000500000210440000142907073108000009640765850000
0500189175247200000500000187500000142908072908000009622980650000
0500189175247200000500000069240000142909072908000009622980660000Hi,
I think we could handle this with may be usage of Advanced UDF in Graphical mapping only.
Here as per the condition you are deleting the particular record but unknowingly blank value i.e. " " is getting passed so on target side blank node is created for this record.
You need to just avoid this blank Node.
If you can share the logic you have applied for Middle field as well the source and target structure I will be able to try the UDF code..based on it
Thanks
swarup -
Multiple Header Line In HIERSEQ ALV
Hi Experts,
Please guide me how to get miltile Header lines in the HIERSEQ Alv , My requirment it develop a genledger for customers in which the Address of customer should be in 3 or four lines then followed by its balances. Please suggest me ...
Regards,
PrakashHi,
You need to pass the Row number to the filed catlog in order to display multiple header lines.
For example,
wl_fieldcat-row_pos = 1. " This field will be displayed in first row
wl_fieldcat-col_pos = 1.
wl_fieldcat-fieldname = 'VBELN'.
wl_fieldcat-tabname = 'T_VBAK'.
wl_fieldcat-outputlen = 20.
Append wl_fieldcat to t_fieldcat.
wl_fieldcat-row_pos = 2. " This field will be displayed in Second row
wl_fieldcat-col_pos = 1.
wl_fieldcat-fieldname = 'VBELN'.
wl_fieldcat-tabname = 'T_VBAK'.
wl_fieldcat-outputlen = 20.
Append wl_fieldcat to t_fieldcat.
Regards,
Rajneesh -
Export multiple tables into one flat file
I have data in multiple tables on a processing database that I need to move up to a production database. I want to export the data into a flat file, ftp it to the production server and have another job pick up the file and process it. I am looking for
design suggestions on how to get multiple tables into one flat file using SSIS?
Thank You.Hey,
Without a bit more detail, as per Russels response, its difficult to give an exact recommendation.
Essentially, you would first add a data flow task to your control flow. Create a source per table, then direct the output of each into an union all task. The output from the union all task would then be directed to a flat file destination.
Within the union all task you can map the various input columns into the appropriate outputs.
If the sources are different, it would probably be easiest to add a derived column task in-between the source and the union all, adding columns as appropriate and setting a default value that can be easily identified later (again depending on your requirements).
Hope that helps,
Jamie -
EJB +FLAT FILE READ options
Hi Form
I know it's really Against the policy to read a FLAT File in EJB env,
But On a classic scenireio , When one has to use a 3rd party tool with Flat file Read / Write complications arise How dos one Cope with this manner
With regards
KarthikHi Form
Yes Some day's ago In did post the form , but returned without results,So hence re posting the form
I am working on NLS [ Natural Language Processing ] String sequence and would like to use the same along with EJB's ]
There is a 3rd Party ( JWNL ) Package avaliable on Web which uses the FLATFILE Read capability and Free one in it's env.
For the JWNL to work ,it has to read some FLAT Files for processing
Synonyms,Cordinate terms...
It this is the classic Scenerion to use within the EJB HOW TO HANDLE??
Plz help
With regards
Karthik -
Merge/Concat Multiple Columns in a Flat-File wthin ODI
Hi,
I was wondering if there is a quick way to merge/concat multiple columns in a Flat-File from within ODI, a functionality kinda similar to Essbase load rule files for join/split columns etc.
Please let me know.
ThanksLooks like the CONCAT function works only with Memory Engine. Could someone please confirm this? If this is true, I guess applying the patch is the only resolution.
Thanks -
Script or command line to comment out multiple lines in flat files
I am looking for a way to go through multiple flat files within the same directory for the occurance of a server name and if found to insert a comment (#) at the beginning of the line. Currently, I am grepping for the server name within the directory and then doing a vi on each individual flat file to comment out the line. The server name is separated by the pipe (|) symbol and each line of every file is in this format:
webservers:WEBSERVER|Env Name|servername|application name
So, in the above, I am grepping for the servername part and if found in there, I want to change the line to:
#webservers:WEBSERVER|Env Name|servername|application name
I would think there would be a way of doing this either with command line Perl or with maybe awk or sed. Any suggestions would be greatly appreciated.You could do something like this with a ksh shell script:
#!/usr/bin/ksh
for file in `ls`; do
echo $file
sed 's/^webserver/#webserver/g' $file > $file.parsed; mv $file.parsed $file
doneThis will go through everyfile in the directory and search for "start of line" webserver and replace it with "#webserver". Then the file will get move back to the original file name.
If you just want to change certain files ie. only filenames with the word "server" in it, then change:
for file in `ls`; do to something like
for file in `ls *server*`; doHope this help...
Cheers
pdaemon -
hi gurus.......
could some one get me a real time flat file for BDC line items.
maximum points will be rewarded.hi Rohit
what I mean is , for T codes like XK01 we have a multiple line items for a single vendor.
I need to practice BDC for T codes which has line items (ex ME21) .
It would be more helpfull for me if u provide me with flat file which u have use in real time for BDC , which has multiple line items for a single header.
am I clear? -
Hello experts,
In flat file ' | ' (vertical line) is maintained as seperator.
flat file format: J|1|A|
here
J is data of column-1
1 is data of column-2
A is data of column-3.
'|' is seperator,
I want to upload.
When i tried to upload the file with the same in internal table it gives me like this :
Column1 column2 column3
J | 1
how do i resolve this problem???
any sample code??ok.
i hv added new code that it can be converted into internal table format. ie. it will show with header line.
just check this code it will work definately..
with regards,
Kiran.Gouni
DATA : BEGIN OF itab OCCURS 0,
char(150) TYPE c,
END OF itab.
DATA : name TYPE rlgrap-filename.
DATA : string TYPE string.
DATA : BEGIN OF itab1 OCCURS 0,
no(10) TYPE c,
END OF itab1.
DATA : BEGIN OF itab2 OCCURS 0,
no(10) TYPE c,
no1(10) type c,
no2(10) type c,
no3(10) type c,
NO4(10) TYPE C,
END OF itab2.
PARAMETERS : p_name TYPE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
dynpro_number = syst-dynnr
CHANGING
file_name = p_name
EXCEPTIONS
MASK_TOO_LONG = 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.
START-OF-SELECTION.
MOVE p_name TO string.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = string
FILETYPE = 'ASC'
tables
data_tab = itab
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA : char(10) TYPE c.
DATA : COUNT TYPE I.
LOOP AT itab.
SPLIT itab-char AT '|' INTO TABLE itab1.
COUNT = 0.
loop at itab1.
COUNT = COUNT + 1.
SY-INDEX = COUNT.
if sy-index = 1.
itab2-no = itab1-no.
endif.
if sy-index = 2.
itab2-no1 = itab1-no.
endif.
if sy-index = 3.
itab2-no2 = itab1-no.
endif.
if sy-index = 4.
itab2-no3 = itab1-no.
endif.
IF SY-INDEX = 5.
ITAB2-NO4 = ITAB1-NO.
APPEND ITAB2.
ENDIF.
endloop.
CLEAR ITAB1.
CLEAR ITAB1[].
ENDLOOP.
Maybe you are looking for
-
BEA query is taking long time to run
Hi All, I am using BEA Weblogic 10.2. I am performing seraching in the repository. The query string is: cm_lifeCycleStatus==4&&SERVICE == 'RBT' &©RIGHTTO >= toDate('yyyy-MM-dd', '2010-07-01')&©RIGHTFROM <= toDate('yyyy-MM-dd', '2010-07-01') H
-
How to handle latency due Audio/Video live streams.
Hi everybody reading this, I am using fms3.5 and the scenario that i wish to solve is that: 1) From a flex application client I start publishing a video at x bytes per second. 2) At the receiver's end, I start getting the video very fine at receiver,
-
Wireless Mighty Mouse on Windows PC (one last time). Any luck?
Anyone with any luck trying to pair a wireless Mighty Mouse with a Windows PC? I'm trying to get the wireless Mighty Mouse to work on a PC (not a Mac with Boot Camp). I thought it should have been easy enough since I have other Bluetooth devices that
-
Best configutation for Real Time : What you've experienced...
Hi. I've a Blackmagic/G5 2x2,66 dual Core Xeon/8GB RAM/RAID HDDs, and I'v got a 6/7 fps playback for DVCPro HD footages... I'd like to know the best config you've experienced for approaching real time treatment in DVCproHD format... thanks !
-
Upgrading crystal reports professional 8.5 to crystal reports profess 11
When using sms to install crystal reports professional it has the evaluation copy key in it. I went in the license manager changed to the correct key and registered it and it is coming up with We hope you are enjoying your evaulation copy of Crystal