File with header
hi,
i have to upload file which has header in the first line.
and from second line the actual data will be there which is to be uploaded.
now the problem is hove to move this file data to internal table with header,
can any one has code plz send me.
hi,
try this Fm...
DATA l_count TYPE sy-tabix.
CONSTANTS: lc_begin_col TYPE i VALUE '1',
lc_begin_row TYPE i VALUE '2',
lc_end_col TYPE i VALUE '2',
lc_end_row TYPE i VALUE '3000'.
* Begin of CALK912848 - Carlos Werberich - 16Sep08
CLEAR p_i_excel_data. REFRESH p_i_excel_data.
* End of CALK912848 - Carlos Werberich - 16Sep08
* Function module to read excel file and convert it into internal table
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_p_file
i_begin_col = lc_begin_col
i_begin_row = lc_begin_row
i_end_col = lc_end_col
i_end_row = lc_end_row
TABLES
intern = i_data
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
* Error in file upload
IF sy-subrc NE 0 .
MESSAGE text-006 TYPE 'E'.
EXIT.
ENDIF.
IF i_data[] IS INITIAL .
MESSAGE text-007 TYPE 'E'.
EXIT.
ELSE.
SORT i_data BY row col .
* Loop to fill data in Internal Table
LOOP AT i_data .
MOVE i_data-col TO l_count .
ASSIGN COMPONENT l_count OF STRUCTURE p_i_excel_data TO .
AT END OF row .
* Append data into internal table
APPEND p_i_excel_data.
CLEAR p_i_excel_data.
ENDAT .
ENDLOOP .
ENDIF
Similar Messages
-
Hi all,
We have requirement to send data to FTP server,
am able to send data to FTP server, but the problem is am not able to send file with Header,
Eg:
oreder numer netvalue discount Grossamount
90000909 2323.34 343.33 4545.000
90000909 2323.34 343.33 4545.000
90000909 2323.34 343.33 4545.000
i have to send the file in the above format.
plz guide me hoe to create file with above format?
REgards,
DS kumarHi,
Use the following code to create header.
DEFINE add_field_header.
clear &1.
&1-field = &2.
append &1.
END-OF-DEFINITION.
add_field_header heading 'oreder numer'.
add_field_header heading 'netvalue'.
add_field_header heading 'discount'.
add_field_header heading 'Grossamount'.
In GUI_DOWNLOAD pass heading to Fieldnames parameter.
Regards,
Ni3 -
Generate target/out file with header record as Record Count ?
Hi Kareem, Please try the below approach. Pipeline 1: Load actual data(without header with record count) from source to target. Let say your file name is intermediate1.dat Pipeline 2: Take the target from pipeline 1 as source and create the header with count of source file using an aggregator. The filename of target for pipeline 2 will be your final file(header and detail data). Pipeline 3: Take the target of pipeline 1 again and do 1-to-1 load to the target file of second pipeline. In session properties, dont forget to tick the check box append if exists for the third pipeline target. There may be other simple approaches also. If you have no time in hand try the above approach. Let me know if you find any issues. Thanks,Deeshan.
Generate target/out file with header record as Record Count ? Out file:---------------------------Record Count :2000 Coulmn1, Column2...Data, data........
-
How to handle text files with Header lines
Hi,
Eventhough the number of header lines is specified, when I do Reverse to get columns, its considering only header line.
I have file format like
ffserver started.
192.168.11.30 - - [Fri Apr 20 19:28:01 2007] "GET /robots.txt HTTP/1.1" 404 150
192.168.11.30 - - [Fri Apr 20 19:28:02 2007] "GET /V23WASTINGPETROL HTTP/1.1" 200 310
first line is header line and there are spaces within a field value, and the field separator also is space.
regards,
Vivekin this scenario of urs ,ur file has multiple delimiters like -- and spaces.
in this case u need to convert the file in a file with single delimiter .
this can be done by writing a code in java in ODI procedures.
once you have the same delimiter all over the file.
u can extract multiple headers using typical Procedure -
How do I import binary data files (with header info) into DIAdem?
We have lots of data acquired by nCode datagate. Files are binary data with header info. How do I import this into DIAdem? Typical (short) file attached. Also of interest, can I stream data from Sony PC208/SIR1000 recorders?
Attachments:
Propshft.dac 4 KBI have successfully imported your file into DIAdem using the nCode file filter included with DIAdem. You might have to make that file filter known to DIAdem by following these steps (this assumes you have version 8 of DIAdem):
1. Go to the 'Window' menu in DIAdem and select 'Close all'
2. Go to the 'Settings' menu and select 'GPI-DLL Registration'
3. Click the 'Add' button in the window and select the 'GfSnCode' DLL in the 'DIAdem/AddInfo' directory
4. The program will prompt you to restart.
5. After you have restarted DIAdem, go to the DATA icon, select 'File - Open' from the DATA menu and in the dialog that appears, choose 'nSoft Data File Format' in the 'Files of type:' field.
6. Select your data file and load
That's it.
With regards to your Sony reco
rder data, I would need to get my hands on an actual data file to try it out. In general, DIAdem can import ANY binary file format by creating a header in the 'File - Import via header' section in DATA. If you have lots of data files from the SONY recorder, a DLL can be created for that specific file format with the free DLL toolkit included with DIAdem.
Leave me a message here if you have any additional questions.
Otmar
Otmar D. Foehner
Business Development Manager
DIAdem and Test Data Management
National Instruments
Austin, TX - USA
"For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary." -
Show rtf file with header and footer in Editor
hi
I want to open an rtf file which contains header and footer.The file i got is opened but the header and footer are not there.these all done with Editor.Please kindly go thru this and give me a solution.Hello,
when you do yourEditorPane.getStyledDocument().dump(System.out), if you don't see and footer or header, you must write your own RTFEditorKit, but you must know how an RTF file is coded (but i don't know this coding...) -
How can I create a RAWpic-file with header(cluster of 8elements) and 2D Array?
I have created a cluster with 8 "I32"elements (Header). I also got picture information into a 2D array (i converted information from a ROI into a 2Darray("Image pixels(I16)")
Now I want to create a RAW picture file (first the header information followed by the picture information.)
I think I have to convert the Header-cluster into an array with "cluster to array". But even this is not possible(Info:"you cannot combine 2 different clusters"). Then I have to combine the 2 arrays with "insert into array"??? But the header array would be a 1Darray if the "cluster to array conversation" works and the picture information is 2D.
Can anyone help me please?I think this is actually pretty straightforward, barring any byte-order issues. Attached is an image that demonstrates what I think jotthape wants to do.
The key is to let multiple Write File nodes do the work for you. There's no need to combine all the data into a single structure for the write, and avoiding that makes things easier in this case, because you don't have to worry about some of the data being I32 and the rest being I16.
Give this a shot,
John
P.S. It does seem likely that you will run into byte-order problems if you want to read your custom RAW file in using some other piece of Windows software. You can check the forum and the NI site for info on byte order, then ask a new question if you're still having a problem.
Attachments:
writeRaw.png 8 KB -
hi,
i want to read a binary file in Diadem, which i saved it with Labview. But i didnot get it.
Could you please help me?
my header files looks like:
1 bit double,
128 bit U8,
1 bit unsigned word,
1 bit dbl
16 bit U8
64 bit U8
1 bit u32
1 bit i32
and 100 bit Data.(i16)
Thanks.
Attachments:
CH1_07_09_2007_13-31-14.csv 1 KBHi Hakan,
There were several issues with your VI, and the VI bore very little resemblance to the list of binary header items you included in your first post. I decided to follow the VI instead of the earlier binary header property list. In the VI, I changed the data type of your channel name property zero-padding from I32 to U8. I changed the byte order of your binary header to match the byte order of the bulk data (Big Endian). I also changed the file creation function to "create or replace" so that I culd run the VI multiple times and overwrite the same data file. The DBL that you are writing from the LabVIEW date/time wire is a geography-specific number of seconds since January 1st 1904 (in Greenwich England). I added a routine to the DataPlugin to decode this into a DIAdem geography-independent date/time property based on my current location in the Central time zone. You could instead save a geography-independent DBL in the VI, which would probably be a more robust approach.
I assigned all the header properties to the Channel level, though you probably want to copy them to the Group and/or the File level as well. I suspect that the 3 DBL properties have something to do with the I16 channel vertical scaling or else the time scaling (aquisition rate). We could add that to the DataPlugin as well.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Attachments:
Hakan_S.zip 19 KB -
Down loading data to flat file with header descritpions
Hi,
am using Function Module "GUI_DOWNLOAD"
am passing internal table which contains all header descriptions to Fieldnames in TABLES.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = g_file
filetype = 'ASC'
write_field_separator = 'X'
header = '00'
TABLES
data_tab = g_t_extract_fin
fieldnames = l_t_header.
My question is the above code is works in all SAP versions or it's works in 4.6C only
Regards
SureshHai,
The Type of Header data may not be same as Data In it.
Therfore <b>use Two GUI_UPLOAD</b> one for header and another for data.
But <b>Second time use the option</b> APPEND to previous dat in tha FM GUI_UPLOAD.
<b>Reward Points if it helps you.</b>
Regds,
Rama.Pammi -
Urgent ! XML Output with header, body, trailer
Gurus,
I am trying to use Report to output an xml file with header, body and trailer regions. However, I find that the tool does not allow me to create a header region with info like <report_date>, <report_name>, <report_desc> etc.
Moreover, the tool is not flexible that in the group level, it always automatically fills in the outer tag for me even if I intentionally leave it blank.
So, except using the XML file output function, is there any other way outputing XML file using the tool? Otherwise, I may need to hard code a program to do so!
Thanks for your advice!
ShoshiHi
Reports XML file is driven by your queries and groups therein. This means that the groups (and break groups) are represented in XML form.
It is not driven by the layout. So your header region does not appear.
What I suggest is that you need to create a report level formula column in the Data Model. The formula returns date, name and description etc. Since this is a part of Data Model now, it will appear in the XML output.
Regards
Sripathy -
Hi Experts,
This is File to IDOC scenario. The source file is a csv file with header and item records.
The file comes with column headings and now problem is how to remove the column headings using my content conversion.
Any help would be appericiated
Regards,
VijayHi Prakash,
Yes you are right but now my problem is the file will not have the header all the time. Actually the source files are generated from different legacy systems so some may have column headings and some may not have.. but the structure remains the same.
Regards,
Vijay
Message was edited by: Vijay Kuruvila
Message was edited by: Vijay Kuruvila -
BizTalk FlatFile schema with header/Multiple Body/Trailer
Hi,
Can you please help to create a flat file schema for the below structure.?
I have a flat file with Header , multiple Body, Trailer. I am receiving XML as input and generate output as FlatFile.
My FlatFile looks like below, from Batch Header to Batch Trailer are repeated multiple times.
FileHeadercol1col2...
BatchHeadercol1col2..
BatchDetailCol1Col2..
BacthTaxCol2Col..
BatchDiscountCol1Col2..
BatchHeadercol1col2..
BatchDetailCol1Col2..
BacthTaxCol2Col..
BatchDiscountCol1Col2..
FileTrailerCol1Col2..
I have created a schema which is working fine if body occurs only once. but if we have more than once , I am getting error like unexpected error...
I have tried with few options and also verified in some references. still no luck.
Please Assist
Thanks,
VinothGive us the delimiter rules.
Is "BatchHeader" is the tag for
the header? Or how the headers are identified?
How "col1col2" col1 and col2 are
delimited? Are they delimited by position i.e. first 4 characters after the header tag "BatchHeader"
is col1 and next four character after the col1 is col2?
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. -
Create xml file with nested internla table or with header & item tables
Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
I tried with using nested internal tables also but now luck.
can anybody please suggest how can we create xml for header and item detials.
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl"
xmlns:asx="http://www.sap.com/abapxml"
exclude-result-prefixes="asx"
>
<xsl:template match="/">
<OrbisomRequest>
<xsl:attribute name="Version">
<xsl:value-of select="11.1"/>
</xsl:attribute>
<xsl:attribute name="IssuerID">
<xsl:value-of select="1"/>
</xsl:attribute>
<xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
<CreateApprovedPurchaseRequest
RerquestID="{VBLNR}"
CommonName="User1"
Amount="{WRBTR}"
Comment="TestComment"
CurrencyCode="978"
PurchaseType="All"
SupplierName="All"
VCardAlias="PurchaseCard"
ValidFrom="1M"
CurrencyType="B">
<CDFs>
<Invoice> <xsl:value-of select="BELNR"/> </Invoice>
<Amount> <xsl:value-of select="WRBTR"/> </Amount>
</CDFs>
</CreateApprovedPurchaseRequest>
</xsl:for-each>
</OrbisomRequest>
</xsl:template>
</xsl:transform>
here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
Regards,
Ranganadh.Looks like you have already created the transformation "Z_ID"
Take a look at the following thread, it answers many of the questions you have asked:
[ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
Che -
How to include header files with different extensions
Hi,
When i include a header file with extension .ch (myincludefile.ch), the compiler gives error messages but when i change the extension to .h, the problem disappears.
Can anyone help me getting rid of this problem?
For example, for the line below, I get a warning such as, "attempt to redefine MY_CONST without #undef". Remember when i change the extension to .h, the problem disappears.
#define MY_CONST 500 /* Constant */
Thank you very muchI don't see how the name of the file could cause or prevent error messages, except when template declarations are involved. So let's assume for now that the file has a template declaration.
The Templates chapter of the C++ Users Guide explains about including or separating template declarations and their definitions.
If you have only a template declaration in a file and the compiler needs the definition, it will look for another file with the same base name and include it automatically. For example, if you have files foo.h and foo.cc, and foo.h has a template declaration, the compiler will include foo.cc automatically, even if you didn't intend for that to happen. You can wind up with multiple delcaration errors that way.
When looking for a file containing template definitions, the compile will not include a .h file, so as not to create recursive inclusion. If changing the file name to .h causes your problem to disappear, it seems like an unwanted automatic inclusion is the problem.
You can try two things to find out:
1. Compile with the -H option. The compiler will output an indented list of all included files. See if you are getting a file you didn't intend, or the same file twice.
2. Compile with option -template=no%extdef. It disables the automatic search for template definitions.
If you find an unintended included file this way, you will probably have to change the names or organizaiton of some of the files. Our implementation of the C++ standard library depends on NOT using the -template=no%extdef option, which might mean you can't use that option. -
Receiver file Content Conversion with Header line
Hi,
Here I am doing receiver file content conversion with header line.
I am able to get the output file correct, when I open the file in notepad the header line and data appearing in the same line (not accepted).
But when I tried to open the name file in internet explorer I can see the header line and data in two different lines (accepted).
What should I do I want to see the same output in the notepad?
Please help me out.
Thanks in advance,
Srikanth.You can use NameA.addHeaderLine.
Specify whether the text file will have a header line with column names. The following values are permitted:
0 u2013 No header line
1 u2013 Header line with column names from the XML document
2 u2013 As for 1, followed by a blank line
3 u2013 Header line is stored as NameA.headerLine in the configuration and is applied
4 u2013 As for 3, followed by a blank line
The below weblinks will help you to know the other paramters.
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
Maybe you are looking for
-
Assigning the value to VARCHAR variable with special characters
Hi Gurus, In declare section I have sql_text VARCHAR2(500); in procedure body I have to assign the variable sql_text =' SELECT TO_CHAR (MAX (A.START_DATE_TIME), 'MMYY') FROM JTF_IH_ACTIVITIES A, JTF_IH_INTERACTIONS B WHERE A.INTERACTION_ID = B.INTERA
-
Filtering-find tasks that include a particular resource in subtasks? MicrosoftProject 2010
Hello everyone, I'm actualy working on a project on MicrosoftProject 2010. I met a problem when I would use the filter. I will try to explain: My project is built as below: Task A sub task A/resource Bert sub task A/resource ERNIE sub task A/resource
-
A blinking cursor appears on every web pages.
It's a blinking cursor that appears on every web pages in different sizes when I click anywhere on the web pages. Look at following pictures please: http://samansh.persiangig.com/2011/cursor4.jpg http://samansh.persiangig.com/2010/cursor.jpg http://s
-
Bin / Area in Photoshop to place Frequently Used Files?
Hello! I am looking for an area in Photoshop to place & view frequently-used files, and open those files on a quick single-click. This would replace "Command-O & navigating through network drives to locate files every time. Also looking for a visu
-
How can I watch videos in landscape view?
How can I watch videos or look at pictures in landscape view?