Downloading the internal table with header to FTP folder
Hi All,
I have one requirement in downloading the internal table details with the fixed header line to FTP folder. The header line having the fixed text of 425 characters length.
Note: We are not suppose to use WS_DOWNLOAD and GUI_DOWNLOAD function modules.
Thanks in advance for your reply.
Regards
Kamini.
Hi,
I can download the internal table details successfully to FTP folder using the FTP function modules like(FTP_CONNECT, FTP_COMMAND , FTP_R/3_TO_SERVER and FTP_DISCONNECT). Here my problem is I am unable to download the internation table with some header text.
You can see the format (example) of file to be download.
Here I can successfully download the below details without the header. But I am unable to download with header line. Could you please suggest me.
seq_no|record_action|trans_date|sku|description|
1|N|2008-01-03 07:52:31|TTASA5025CBO
2|N|2008-01-03 10:28:33|411014
3|N|2008-01-03 10:01:03|TTASA6030CBO
4|N|2008-01-03 10:01:15|TTASA6630CBO
5|N|2008-01-03 10:01:25|TTASA7035CBO
6|N|2008-01-08 16:57:39|TT6G
Regards
Kamini.
Similar Messages
-
Getting error of Defining an internal table with header line, SELECT-OPTIO
Hi all,
i have a coding for my smart form,In this coding i have define an structure which being used,but when i execute it it give me
error of Defining an internal table with header line, SELECT-OPTIONS, and RANGES is not allowed within a structure.Even tough you can see that in my coding im not using SELECT-OPTION or RANGES,but can't understand why it gives me this error.
Following are the code:
DATA: BEGIN OF traptab OCCURS 50.
INCLUDE STRUCTURE mseg.
DATA: vgart LIKE mkpf-vgart,
blart LIKE mkpf-blart,
blaum LIKE mkpf-blaum,
bldat LIKE mkpf-bldat,
budat LIKE mkpf-budat,
cpudt LIKE mkpf-cpudt,
cputm LIKE mkpf-cputm,
aedat LIKE mkpf-aedat,
usnam LIKE mkpf-usnam,
tcode LIKE mkpf-tcode,
xblnr LIKE mkpf-xblnr,
bktxt LIKE mkpf-bktxt,
frath LIKE mkpf-frath,
frbnr LIKE mkpf-frbnr,
wever LIKE mkpf-wever,
END OF traptab.
Thanks & Regards,
sappk25thanks
-
BADI cant use an internal table with header line
hi,
In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?You can use a type and then create an internal table of that type.
types :
begin of t_<example>
*field list
end of t_<example>
data :
gt_<table> type standard table of t_<example>
pass this to the FM -
Dynamicly creating an internal table with header line
Hi experts,
I am trying to do a read on an internal table using field symbols of type any table. To be able to read more than one row at once, I'd like to read it into another internal table (instead of just one line and instead of looping through them one by one).
So far the following line rendered an error that the target internal table doesn't have a header line
read table <fs_v_tab> WITH KEY (<fs_comp>) = <fs_param>-low INTO <fs_v_tab>.
(also attempted using "<fs_v_tab>->*" & "<fs_v_tab>[]" to be silly)
Based on the following article, I was wondering if it were possible to dynamicly create an internal table with header line.
[http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html|http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html]
Any help or tips on how to dynamicly filter an internal table field-symbol is greatly appreciated!Just read the online help:
This statement reads a row from internal table itab.
Or more exact:
This statement reads one row from internal table itab.
Therefore you can not read multiple lines into another table. The header line is needed to put the result in. And this is not what you intended, the result will be in the header line, not in the table itself.
If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
At least you have to do what you dont wanna do: looping. -
Dynamic Creation of Internal table WITH HEADER LINE
Dear,
Please show me the way of creating Internal table WITH HEADER LINE dynamically..
Thanks,
Nirav<font color='blue'>Hi Parekh,
Have a look at the sample program for Dynamic internal table
This program has been developed to update any table data in the dictionary. We give table name and File name as Input fields.
<pre>
REPORT znpmmm0201.
*Types
TYPES:
BEGIN OF ty_file,
data(4096) TYPE c,
END OF ty_file.
*Type-pools
TYPE-POOLS:
truxs.
*Work areas
DATA:
wa_file TYPE ty_file.
*Internal tables
DATA:
it_file TYPE STANDARD TABLE OF ty_file,
it_data TYPE truxs_t_text_data.
DATA:
gv_dref TYPE REF TO data,
file_name TYPE string.
*FIELD-SYMBOLS
FIELD-SYMBOLS:
<gf_itab> TYPE STANDARD TABLE,
<wa> TYPE ANY.
*& Selection-screen
PARAMETERS:
p_table TYPE rsrd1-tbma_val,
p_file TYPE ibipparms-path.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM f4_for_p_file CHANGING file_name .
*& START-OF-SELECTION
START-OF-SELECTION.
CREATE DATA gv_dref TYPE TABLE OF (p_table).
ASSIGN gv_dref->* TO <gf_itab>.
PERFORM upload_data USING file_name.
MODIFY (p_table) FROM TABLE <gf_itab>.
*& Form UPLOAD_DATA
FORM upload_data USING file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
filetype = 'ASC'
TABLES
data_tab = it_file.
APPEND LINES OF it_file TO it_data.
CLASS cl_abap_char_utilities DEFINITION LOAD.
DATA: l_field_seperator.
l_field_seperator = cl_abap_char_utilities=>horizontal_tab.
REPLACE ALL OCCURRENCES OF '|' IN TABLE it_data WITH l_field_seperator.
CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'
EXPORTING
i_field_seperator = l_field_seperator
i_tab_raw_data = it_data
TABLES
i_tab_converted_data = <gf_itab>.
ENDFORM. " UPLOAD_DATA
*& Form F4_FOR_p_file
FORM f4_for_p_file CHANGING file.
DATA:
l_field_name LIKE dynpread-fieldname VALUE 'P_FILE'.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = l_field_name
IMPORTING
file_name = p_file.
file = p_file.
ENDFORM. " F4_FOR_p_file </pre>
Thanks,
Venkat.O</font> -
Declare the internal table with only one 10 character field and use
Hi,
I want to declare the internal table with only one 10 character field and use.
JayaHi,
Go ahead. U can declare IT with only one field
Example:
data: begin of zcustlist occurs 1000,
custmer(10) type c,
end of zcustlist.
Narendra Reddy.
Edited by: Narendra Reddy C on Aug 8, 2008 11:39 AM -
Problem with downloading the internal table onto the presentation server.
Hey folks,
I have a problem where in i am downloading one year of sales done by the company. I wrote a program to download the file onto the presentation server . The error occurs in the FM GUI_DOWNLOAD where if the file exceeds 105843504 bytes its giving me a dump saying that
When the program was running , it was established that more memory was needed than the operating system is able to safely to provide.
The current program has to be terminted because of the program already requested 105843504 bytes from the operating system with malloc when the operating system reported after further memory request that there was no more memory space available.
Could somebody provide an alternative soltuion for this.
Its really urgent as i can download the file with 70,000,000 bytes
Regards
RockHi Rock,
Please download the files on to Application Server, else as suggested by Ashish download into 2 or 3 files and merge them manually.
Declare same internal tables may be 5 times.
When you fill the internal table check for a counter and when you hit a certain number stop appending to it and start appending to the next.
After you are done so download all the internal tables.
I guess this would be a good way. I am not sure if there are any ther alternative good methods.
Hope this helps.
Shreekant -
Downloading the internal table contents into presentation server
Hi
I have a requirement like i need to download the contetns of my internal table into an excel sheet in the presemtation server and i am using GUI_DOWNLOAD.
I would like to place my header also in the excel sheet can any one suggest me how to do that?
thanksHi,
U can see the following example,
TYPES:
BEGIN OF TYPE_S_FLIGHT,
MANDT(15) TYPE C,
CARRID(15) TYPE C,
CONNID(15) TYPE C,
FLDATE(15) TYPE C,
END OF TYPE_S_FLIGHT.
data:
T_HEADER TYPE TABLE OF TYPE_S_FLIGHT WITH HEADER LINE,
t_sflight type table of SFLIGHT.
T_HEADER-MANDT = 'MANDT'.
T_HEADER-CARRID = 'CARRID'.
T_HEADER-CONNID = 'CONNID'.
T_HEADER-FLDATE = 'FLDATE'.
APPEND T_HEADER.
PERFORM GUI_DOWNLOAD TABLES T_HEADER USING ' '.
select MANDT
CARRID
CONNID
FLDATE
from sflight into CORRESPONDING FIELDS OF table t_sflight.
PERFORM GUI_DOWNLOAD TABLES T_SFLIGHT USING 'X'.
form GUI_DOWNLOAD TABLES P_TABLE USING VALUE(P_APPEND).
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\TEMP1\FLIGHT.XLS'
APPEND = P_APPEND
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = P_TABLE
In this case u have to populate the one table for header. The other one is for data.
Thanks,
Nithya.
Edited by: Nithya Murugesan on Feb 8, 2009 1:00 PM -
Passing an internal table WITH HEADER LINE to abap object
Hi. In another thread, it was explained how to pass an internal table to an abap object method. Is it possible to pass an internal table that has a header line, and RETAIN the header line once the table has been passed?
My problem is, that I can pass the table, update it, but the read buffer is not populated when returning from the object's method. This is the result of being able to pass a STANDARD TABLE type, but not a STANDARD TABLE WITH HEADER LINE.
This means that I have to read the table into a work area instead of doing a READ TABLE LKNA1 within the method, which is what I need to do.
Thanks.Please check this sample program, notice that it is modifing the internal table and passing it back modified as well as passing the "work area" or "header line" back thru the exporting parameter.
report zrich_0001.
* CLASS lcl_app DEFINITION
class lcl_app definition.
public section.
types: t_t001 type table of t001.
class-data: it001 type table of t001.
class-data: xt001 like line of it001.
class-methods: change_table
exporting ex_wt001 type t001
changing im_t001 type t_t001.
endclass.
data: w_t001 type t001.
data: a_t001 type table of t001 with header line.
start-of-selection.
select * into table a_t001 from t001.
call method lcl_app=>change_table
importing
ex_wt001 = w_t001
changing
im_t001 = a_t001[] .
check sy-subrc = 0.
* CLASS lcl_app IMPLEMENTATION
class lcl_app implementation.
method change_table.
loop at im_t001 into xt001.
concatenate xt001-butxt 'Changed'
into xt001-butxt separated by space.
modify im_t001 from xt001.
endloop.
ex_wt001 = xt001.
endmethod.
endclass.
Regards,
Rich Heilman -
Internal table with header line
Hi All,
I want to declare a internal table with headerline as page attribute.
i am having to fields in the internal table ( firstname and lastname ). how to do that?
helpful answers will be rewarded.
Regards,
Azaz Ali.Azaz,
Why do you need a header line?
Header lines are a no-no in an object context and if you need to loop at the table you can always declare a line type or an field symbol to process the table.
If you need an table as a page parameter the best way to do it is to create a table type. This is based of a line type (another name for structure ) and this may well be based off a database (transparent) table.
If you need to do special things to the table I would look at tableview iterators.
Let me dig out a blog reference for that...
... ahh here it is
<a href="/people/thomas.jung3/blog/2004/06/17/bsp-150-a-developer146s-journal-part-i-introduction View Iterator blog</a>
HTH,
N -
Why does my internal table(with header line) ignore 4 of its fields?
Hi Gurus,
I am a newbie to ABAP how has spent far to much of my weekend time trying to solve the following problem;
when trying to insert data from table cdpos into my internal table, I only get the two object* fields, the other 3 are not even part of the internal table according to the debugger.
my select code is:
SELECT fname tabkey changenr objectclas objectid
FROM cdpos
INTO CORRESPONDING FIELDS OF i_cd_index
WHERE tabname = 'XXX'
AND fname = 'XXX'
AND chngind = 'U'
ENDSELECT.
IF sy-subrc <> 0.
ENDIF.
- If I use a wa like line of i_cd_index the other fields will show up.
- I have tried with including 'TABLE' in the INTO statement, same result.
Please help out, getting very frustrated here....
/MikeHi Magdic,
I have completely coded for but i have taken as parameters rather direct values (XXXX). Under stand the code and select statement you will get it. Program which i have shown is working fine.
Do one thing first go the table CDPOS take one entry of Objectid, Tabname, fname and chngind and then enter in the selection and find whether the values are fetched correctly or not.
To my knowledge there might be no data in your table.
Anyhow try the below code.
TABLES: CDPOS.
DATA: ITAB LIKE CDPOS OCCURS 0 WITH HEADER LINE.
parameters: p_CHGID like CDPOS-chngind,
p_TAB like CDPOS-TABNAME,
P_FNAM LIKE CDPOS-FNAME.
SELECT OBJECTID TABNAME FNAME CHNGIND FROM CDPOS INTO CORRESPONDING FIELDS OF ITAB WHERE OBJECTID = P_CHGID
AND TABNAME = P_TAB
AND FNAME = P_FNAM.
APPEND ITAB.
ENDSELECT.
WRITE: ITAB-OBJECTID, ITAB-TABNAME, ITAB-FNAME, ITAB-CHNGIND.
Cheers!!
Balu -
Reg: Downloading the internal table into excel file.
Hi,
My requirement is i am collecting data in the internal table and i have to download the contents in an excel file and i have declared like this.
PARAMETERS : x_test TYPE string
DEFAULT 'C:\temp\file.txt'.
I have given the default file path like this and i am using the function module .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = OUTPUT_PATH
FILETYPE = 'DAT'
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = INT_INPUT
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.
My requirement is i dont want to change my extension as .txt from .exl to my parameter addition and in the function module the file type should be 'dat' only and in the runtime i want to change the file name which i have given in the .
PARAMETERS : x_test TYPE string
DEFAULT 'C:\temp\file.txt' this file.txt into datas.xls.
it would be grateful if some one share some valuable views to wards this query
Thanks and Regards,
KenyHi,
Use this code.
It will ask for the file name...there u can change.
data : l_filename type string,
l_filetype type char10,
l_path type string,
l_fullpath type string.
l_filetype = 'DAT'.
*Get the file name
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
FILE_FILTER = '*.DAT'
INITIAL_DIRECTORY = 'C:\'
CHANGING
FILENAME = l_filename
PATH = l_path
FULLPATH = l_fullpath
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
check l_fullpath is not initial.
*Download file
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
FILENAME = l_fullpath
FILETYPE = l_filetype
CHANGING
DATA_TAB = t_data_sum[]
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
NOT_SUPPORTED_BY_GUI = 22
ERROR_NO_GUI = 23
others = 24.
IF sy-subrc NE 0.
MESSAGE e398(00) WITH sy-subrc ' Error downloading file' '' ''.
ENDIF.
Regards
Sandeep REddy -
Validate the data in the internal table with the date in selection screen
Hi all,
I want to validate the data in the internal table and get only the records with the input date in the selection screen.
The date is in the select options and please let me know how to get the records only if it satisfies the input date in the selection screen.
Regards,
ShalemFor Ex.
SELECT-OPTIONS: S_DATE FOR VBAK-VDATU
If you want to read one INTERNAL TABLE record
READ TABLE it_tab(internal table name) WHERE vdatu(date field name in the internal table) = s_date
If you want to move more then one
LOOP AT it_tab WHERE vdatu = s_date.
Take the field values in another table and append it. then end loop.
you will get the records which only have the date in select option..
If you want detail code give me internal table name and select option name i will write you the code.
regards
Yuvaram -
How to fetch the data to the internal table with out using mandt
Hi all,
Iam giving my code please observer... and give me the reasonable solution.
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT mandt
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
By removing MANDT from select query, it is going to dump.
ex:
SELECT
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
> Now it is going to dump ( here i removed the mandt field ).
Please give me a solution to fetch the data by removing mandt in select statement, with out chaning the internal table structure.
Thanks,
Ravihi Ravi,
i also had to avoid move-corresponding and the following is what i did...its extra work and goes around but it will
do the needed work..............
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT *
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
the above gets you all the fields ...but if you still want to narrow it down to just two fields
*****Declaring structure with 2 fields
data:begin of fs_data.
data:werks type z_mar-werks,
lifnr type z_mar-lifnr ,
data:end of fs_data.
*******internal table of above
data:int_data like fs_data occurs 0 with headerline.
*****moving the only 2 required fields
loop at t_mar.
t_mar-werks = int_data-werks.
t_mar-lifnr = int_data-lifnr.
append int_data.
endloop.
Hope you found it useful...
Regards
Bx -
Function Module in VL10G containing the Internal Table with All SO & PO
Hi,
I have a situation where I need to get all the Sales Orders and POs for the given Shipping Point and Planned GI Date from my custom Report without writing SELECT queries. Now, can somebody give me a Function Module and the Internal Table Name where the actual data with Sales Orders and POs is stored?
Thanks,
Venkat.Hi,
I have a situation where I need to get all the Sales Orders and POs for the given Shipping Point and Planned GI Date from my custom Report without writing SELECT queries. Now, can somebody give me a Function Module and the Internal Table Name where the actual data with Sales Orders and POs is stored?
Thanks,
Venkat.
Maybe you are looking for
-
I am trying to install the latest version of itunes and when the install begins I get the message "There is a problem with this Windows installer package. A program required for this install could not be opened. contact your support personnel or prod
-
Freight Charges In Purchase Order
Hello Friends, I m working on Purchase order.I am using Freight charges which is given in the footer of PO form.I want to know about where this amount get stored and what is object ID of Freight Charges??The same functionality I want t
-
[SOLVED] Xmobar doesn't switch fullscreen windows to tiling
I'm using slightly modified config file i got from here: -- xmonad config used by Vic Fryzel -- Author: Vic Fryzel -- http://github.com/vicfryzel/xmonad-config import System.IO import System.Exit import XMonad import XMonad.Hooks.DynamicLog import XM
-
Rounding the order quantity in different Units of measurement
Hello Experts, We need your suggestion to meet the below mentioned client's requirement. There are around 200 SKUs in the consideration and three units of measure ( case, carton and pallet defined for them).We are looking for way to suggest the orde
-
Pink "shadows" and "color noise" or "apparent interference"
I have a screen now that has pinkiness shadowing the words and frames on my screen.. it's the same if I'm in appleworks or anywhere else. This is the best I can do to describe it It's getting worse as I speak. I have calibrated the colors and check i