Download data entered via web to a text file.
Hello,
I'm developing a very simple BSP aplication in which the user enters via web some data in some fields. This data is store in an internal table. This table is an attribute in the application class. In this class there is a method to save the data to a file in presentation server. I've tried using WS_DOWNLOAD and GUI_DOWNLOAD but these function modules don't work. I would like to know if there some function modules or methods to download data to a file and that can be used in a BSP aplication.
Thank you very much,
Carlos
Details:
1-Layout
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
Carga ficheros
generar_fichero
exporting nombre_fichero = fichero.
3- Method generar_fichero
method GENERAR_FICHERO .
***Opción 1: emplear una instancia de una clase y llamar a su método
data: file type ref to CL_GUI_FRONTEND_SERVICES.
create object file.
data l_filelength type i.
call method file->gui_download
exporting filename = nombre_fichero
importing filelength = l_filelength
changing data_tab = m_tabladatos
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 ne 0.
raise error_fichero.
*else.
**borrar cookie
*endif.
***Opción 2: llamada directa a la función ws_download_wan "FALLA:
***********************************************"no deja rastro del fallo
data l_filename(128).
write nombre_fichero to l_filename.
*CALL FUNCTION 'WS_DOWNLOAD_WAN'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = l_filename
FILETYPE = 'ASC'
MODE = 'A'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = m_tabladatos
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8
*IF SY-SUBRC <> 0.
raise error_fichero.
*else.
Hallo Carlos,
Welcome to the forum. As with all things new in life, one does not know where to start immediately. I would like to recommend the <a href="/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">Getting Help</a> guide as first interesting article to read.
Specifically you are interested in the section for searching this forum. Use keywords such as download or GUI_DOWNLOAD. Also consider to look at keyword Excel. Although not exactly on topic, the Excel discussions does address this partly. All of this has been discussed many time before.
Finally, consider to read <a href="/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents">BSP Programming: Handling Of Non-HTML Documents</a>. This will really show you some different techniques to download files onto the computer.
brian
Similar Messages
-
How to show only date in BO webi 3.1 text box
how to show only date in BO webi 3.1 text box for e.g:-
01/01/2005 (no time only date)hi,
just check by which format your date is coming
just create a one variable and check =UserResponse("Transaction Date From (mm/dd/yy)")
if your output is in format of("mm/dd/yyyy hh:mm:ss a")
then some format we have to write in todate syntax
then your final formula for date would be
=FormatDate(ToDate(UserResponse("Transaction Date From (mm/dd/yy)");"mm/dd/yyyy hh:mm:ss A");"dd/mm/yyyy") -
How to download data in multiple sheets of one excel file
Hello,
I want to download data in multiple sheets of one excel file ..through ole2_object.
i have created program but it is not it is not giving the desird op.
here is the code..
create object excel 'EXCEL.APPLICATION'.
call method of excel 'WORKBOOKS' = books.
call method of books 'ADD' = book1.
*****************" Here we r creating the first sheet.
if flag1 = 'X'.
call method of book1 'WORKSHEETS' = SHEET
EXPORTING
#1 = 1. " here 1 indicating the position of sheet means first position.
call method of sheet 'Activate'.
set property of sheet 'Name' = 'Developments_Summary_Report'.
perform excel_fill.
endif.
*****************" Here we r creating the second sheet.
if flag2 = 'X'.
call method of book1 'WORKSHEETS' = SHEET
EXPORTING
#1 = 2. " here 2 indicating the position of sheet means second position.
call method of sheet 'Activate'.
set property of sheet 'Name' = 'BDC_Developments_Report'.
perform excel_fill.
endif.
set property of excel 'VISIBLE' = 1. " due to this property excel window is visible.
call method of excel 'QUIT'.
but it is generating the two different excel file ..
Thanks in advance,
Paresh.Hi,
Copy and paste this code in your SAP
*& Report ZETA_EXCEL_DOWNLOAD_CLIPBOARD *
report zeta_excel_download_clipboard .
include ole2incl.
data: w_cell1 type ole2_object,
w_cell2 type ole2_object.
*--- Ole data Declarations
data: h_excel type ole2_object, " Excel object
h_mapl type ole2_object, " list of workbooks
h_map type ole2_object, " workbook
h_zl type ole2_object, " cell
h_f type ole2_object, " font
gs_interior type ole2_object, " Pattern
worksheet type ole2_object,
h_cell type ole2_object,
h_cell1 type ole2_object,
range type ole2_object,
h_sheet2 type ole2_object,
h_sheet3 type ole2_object,
gs_font type ole2_object,
flg_stop(1) type c.
** Internal table Declaration
data: begin of t_excel occurs 0,
vkorg(20) type c, "Sales Org
vbtyp(20) type c, "Document Category
auart(20) type c, "Document Type
ernam(20) type c, "Created By
vbeln(20) type c, "Document Number
posnr(20) type c, "Item Number
erdat(20) type c, "Created Date
vdatu(20) type c, "Header Requested Delivery Date
reqdat(20) type c, "Request date
condat(20) type c, "Confirm date
lifsk(20) type c, "Header Block
txt30(30) type c, "Order User Status Description
lifsp(20) type c, "Line Block
dispo(20) type c, "MRP Controller
dsnam(20) type c, "MRP Controller Description
vmsta(20) type c, "Material Sales Status
kunnr(20) type c, "Sold To
cname(35) type c, "Sold To Name
regio(20) type c, "State
cufd(10) type c, "CUD
bstnk(20) type c, "PO#
bsark(20) type c, "Ordering Method
matnr(20) type c, "Material
maktx(35) type c, "Material Description
t200(20) type c, "T200
vtext(20) type c, "T200 Description
matkl(20) type c, "Material Group
zzbomind(7) type c, "BOM Indicator
ostat(20) type c, "Order Status
cmgst(20) type c, "CRD
inco1(20) type c, "Incoterms
oqty(20) type c, "Order Quantity
pqty(20) type c, "Open Quantity
unit(20) type c, "UOM
onet(20) type c, "Order Value
pnet(20) type c, "Open Value
curr(20) type c, "Currency key
so_bezei like tvkbt-bezei,"Sales Office
sg_bezei like tvgrt-bezei,"Sales Group
bname(20) type c, "Ordering Party
contact(20) type c, "Contact Name
telf1(20) type c, "Contact telf1
reqqty(20) type c, "Item Request qty
reqval(20) type c, "Item Request value
conqty(20) type c, "Item Confirm qty
conval(20) type c, "Item Confirm value
zzrev(02) type c, "Revenue recognition acceptance
bezei(20) type c, "Revenue recognition text
vgbel(20) type c, "Reference Order for RETURNS
0008text(255) type c, "Internal Order Comment Text
end of t_excel.
data: t_excel_bckord like t_excel occurs 0 with header line,
t_excel_bcklog like t_excel occurs 0 with header line,
t_excel_blkord like t_excel occurs 0 with header line.
types: data1(1500) type c,
ty type table of data1.
data: it type ty with header line,
it_2 type ty with header line,
it_3 type ty with header line,
rec type sy-tfill,
deli(1) type c,
l_amt(18) type c.
data: begin of hex,
tab type x,
end of hex.
field-symbols: <fs> .
constants cns_09(2) type n value 09.
assign deli to <fs> type 'X'.
hex-tab = cns_09.
<fs> = hex-tab.
data gv_sheet_name(20) type c .
* M A C R O Declaration
define ole_check_error.
if &1 ne 0.
message e001(zz) with &1.
exit.
endif.
end-of-definition.
t_excel_bckord-vkorg = 'ABC'.
t_excel_bckord-vbtyp = 'DEF'.
t_excel_bckord-auart = 'GHI'.
t_excel_bckord-ernam = 'JKL'.
t_excel_bckord-vbeln = 'MNO'.
t_excel_bckord-0008text = 'XYZ'.
append t_excel_bckord.
t_excel_bckord-vkorg = 'ABC1'.
t_excel_bckord-vbtyp = 'DEF1'.
t_excel_bckord-auart = 'GHI1'.
t_excel_bckord-ernam = 'JKL1'.
t_excel_bckord-vbeln = 'MNO1'.
t_excel_bckord-0008text = 'XYZ1'.
append t_excel_bckord.
t_excel_bckord-vkorg = 'ABC2'.
t_excel_bckord-vbtyp = 'DEF2'.
t_excel_bckord-auart = 'GHI2'.
t_excel_bckord-ernam = 'JKL2'.
t_excel_bckord-vbeln = 'MNO2'.
t_excel_bckord-0008text = 'XYZ2'.
append t_excel_bckord.
t_excel_bcklog-vkorg = 'ABC'.
t_excel_bcklog-vbtyp = 'DEF'.
t_excel_bcklog-auart = 'GHI'.
t_excel_bcklog-ernam = 'JKL'.
t_excel_bcklog-vbeln = 'MNO'.
t_excel_bcklog-0008text = 'XYZ'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC1'.
t_excel_bcklog-vbtyp = 'DEF1'.
t_excel_bcklog-auart = 'GHI1'.
t_excel_bcklog-ernam = 'JKL1'.
t_excel_bcklog-vbeln = 'MNO1'.
t_excel_bcklog-0008text = 'XYZ1'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC2'.
t_excel_bcklog-vbtyp = 'DEF2'.
t_excel_bcklog-auart = 'GHI2'.
t_excel_bcklog-ernam = 'JKL2'.
t_excel_bcklog-vbeln = 'MNO2'.
t_excel_bcklog-0008text = 'XYZ2'.
append t_excel_bcklog.
t_excel_bcklog-vkorg = 'ABC3'.
t_excel_bcklog-vbtyp = 'DEF3'..
t_excel_bcklog-auart = 'GHI3'.
t_excel_bcklog-ernam = 'JKL3'.
t_excel_bcklog-vbeln = 'MNO3'.
t_excel_bcklog-0008text = 'XYZ3'.
append t_excel_bcklog.
t_excel_blkord-vkorg = 'ABC'.
t_excel_blkord-vbtyp = 'DEF'.
t_excel_blkord-auart = 'GHI'.
t_excel_blkord-ernam = 'JKL'.
t_excel_blkord-vbeln = 'MNO'.
t_excel_blkord-0008text = 'XYZ'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC1'.
t_excel_blkord-vbtyp = 'DEF1'.
t_excel_blkord-auart = 'GHI1'.
t_excel_blkord-ernam = 'JKL1'.
t_excel_blkord-vbeln = 'MNO1'.
t_excel_blkord-0008text = 'XYZ1'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC2'.
t_excel_blkord-vbtyp = 'DEF2'.
t_excel_blkord-auart = 'GHI2'.
t_excel_blkord-ernam = 'JKL2'.
t_excel_blkord-vbeln = 'MNO2'.
t_excel_blkord-0008text = 'XYZ2'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC3'.
t_excel_blkord-vbtyp = 'DEF3'..
t_excel_blkord-auart = 'GHI3'.
t_excel_blkord-ernam = 'JKL3'.
t_excel_blkord-vbeln = 'MNO3'.
t_excel_blkord-0008text = 'XYZ3'.
append t_excel_blkord.
t_excel_blkord-vkorg = 'ABC4'.
t_excel_blkord-vbtyp = 'DEF4'..
t_excel_blkord-auart = 'GHI4'.
t_excel_blkord-ernam = 'JKL4'.
t_excel_blkord-vbeln = 'MNO4'.
t_excel_blkord-0008text = 'XYZ4'.
append t_excel_blkord.
loop at t_excel_bckord.
concatenate
t_excel_bckord-vkorg
t_excel_bckord-vbtyp
t_excel_bckord-auart
t_excel_bckord-ernam
t_excel_bckord-vbeln
t_excel_bckord-posnr
t_excel_bckord-erdat
t_excel_bckord-vdatu
t_excel_bckord-reqdat
t_excel_bckord-condat
t_excel_bckord-lifsk
t_excel_bckord-txt30
t_excel_bckord-lifsp
t_excel_bckord-dispo
t_excel_bckord-dsnam
t_excel_bckord-vmsta
t_excel_bckord-kunnr
t_excel_bckord-cname
t_excel_bckord-regio
t_excel_bckord-cufd
t_excel_bckord-bstnk
t_excel_bckord-bsark
t_excel_bckord-matnr
t_excel_bckord-maktx
t_excel_bckord-t200
t_excel_bckord-vtext
t_excel_bckord-matkl
t_excel_bckord-zzbomind
t_excel_bckord-ostat
t_excel_bckord-cmgst
t_excel_bckord-inco1
t_excel_bckord-oqty
t_excel_bckord-pqty
t_excel_bckord-unit
t_excel_bckord-onet
t_excel_bckord-pnet
t_excel_bckord-curr
t_excel_bckord-so_bezei
t_excel_bckord-sg_bezei
t_excel_bckord-bname
t_excel_bckord-contact
t_excel_bckord-telf1
t_excel_bckord-reqqty
t_excel_bckord-reqval
t_excel_bckord-conqty
t_excel_bckord-conval
t_excel_bckord-zzrev
t_excel_bckord-bezei
t_excel_bckord-vgbel
t_excel_bckord-0008text
into it
separated by deli.
append it.
clear it.
endloop.
loop at t_excel_bcklog.
concatenate
t_excel_bcklog-vkorg
t_excel_bcklog-vbtyp
t_excel_bcklog-auart
t_excel_bcklog-ernam
t_excel_bcklog-vbeln
t_excel_bcklog-posnr
t_excel_bcklog-erdat
t_excel_bcklog-vdatu
t_excel_bcklog-reqdat
t_excel_bcklog-condat
t_excel_bcklog-lifsk
t_excel_bcklog-txt30
t_excel_bcklog-lifsp
t_excel_bcklog-dispo
t_excel_bcklog-dsnam
t_excel_bcklog-vmsta
t_excel_bcklog-kunnr
t_excel_bcklog-cname
t_excel_bcklog-regio
t_excel_bcklog-cufd
t_excel_bcklog-bstnk
t_excel_bcklog-bsark
t_excel_bcklog-matnr
t_excel_bcklog-maktx
t_excel_bcklog-t200
t_excel_bcklog-vtext
t_excel_bcklog-matkl
t_excel_bcklog-zzbomind
t_excel_bcklog-ostat
t_excel_bcklog-cmgst
t_excel_bcklog-inco1
t_excel_bcklog-oqty
t_excel_bcklog-pqty
t_excel_bcklog-unit
t_excel_bcklog-onet
t_excel_bcklog-pnet
t_excel_bcklog-curr
t_excel_bcklog-so_bezei
t_excel_bcklog-sg_bezei
t_excel_bcklog-bname
t_excel_bcklog-contact
t_excel_bcklog-telf1
t_excel_bcklog-reqqty
t_excel_bcklog-reqval
t_excel_bcklog-conqty
t_excel_bcklog-conval
t_excel_bcklog-zzrev
t_excel_bcklog-bezei
t_excel_bcklog-vgbel
t_excel_bcklog-0008text
into it_2
separated by deli.
append it_2.
clear it_2.
endloop.
loop at t_excel_blkord.
concatenate
t_excel_blkord-vkorg
t_excel_blkord-vbtyp
t_excel_blkord-auart
t_excel_blkord-ernam
t_excel_blkord-vbeln
t_excel_blkord-posnr
t_excel_blkord-erdat
t_excel_blkord-vdatu
t_excel_blkord-reqdat
t_excel_blkord-condat
t_excel_blkord-lifsk
t_excel_blkord-txt30
t_excel_blkord-lifsp
t_excel_blkord-dispo
t_excel_blkord-dsnam
t_excel_blkord-vmsta
t_excel_blkord-kunnr
t_excel_blkord-cname
t_excel_blkord-regio
t_excel_blkord-cufd
t_excel_blkord-bstnk
t_excel_blkord-bsark
t_excel_blkord-matnr
t_excel_blkord-maktx
t_excel_blkord-t200
t_excel_blkord-vtext
t_excel_blkord-matkl
t_excel_blkord-zzbomind
t_excel_blkord-ostat
t_excel_blkord-cmgst
t_excel_blkord-inco1
t_excel_blkord-oqty
t_excel_blkord-pqty
t_excel_blkord-unit
t_excel_blkord-onet
t_excel_blkord-pnet
t_excel_blkord-curr
t_excel_blkord-so_bezei
t_excel_blkord-sg_bezei
t_excel_blkord-bname
t_excel_blkord-contact
t_excel_blkord-telf1
t_excel_blkord-reqqty
t_excel_blkord-reqval
t_excel_blkord-conqty
t_excel_blkord-conval
t_excel_blkord-zzrev
t_excel_blkord-bezei
t_excel_blkord-vgbel
t_excel_blkord-0008text
into it_3
separated by deli.
append it_3.
clear it_3.
endloop.
if h_excel-header = space or h_excel-handle = -1.
* start Excel
create object h_excel 'EXCEL.APPLICATION'.
endif.
* PERFORM err_hdl.
*--- get list of workbooks, initially empty
call method of h_excel 'Workbooks' = h_mapl.
* PERFORM err_hdl.
set property of h_excel 'Visible' = 1.
* add a new workbook
call method of h_mapl 'Add' = h_map.
* PERFORM err_hdl.
*GV_SHEET_NAME = '1st SHEET'.
gv_sheet_name = 'Back Orders'.
get property of h_excel 'ACTIVESHEET' = worksheet.
set property of worksheet 'Name' = gv_sheet_name .
*--Formatting the area of additional data 1 and doing the BOLD
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 50.
call method of h_excel 'Range' = h_cell
exporting
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
get property of h_cell 'Font' = gs_font .
set property of gs_font 'Bold' = 1 .
data l_rc type i.
call method cl_gui_frontend_services=>clipboard_export
importing
data = it[]
changing
rc = l_rc
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4.
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 1.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
* PERFORM err_hdl.
* CALL METHOD OF h_excel 'QUIT'.
*GV_SHEET_NAME = '2ND SHEET'.
gv_sheet_name = 'Backlog'.
get property of h_excel 'Sheets' = h_sheet2 .
call method of h_sheet2 'Add' = h_map.
set property of h_map 'Name' = gv_sheet_name .
get property of h_excel 'ACTIVESHEET' = worksheet.
*--Formatting the area of additional data 1 and doing the BOLD
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 50.
call method of h_excel 'Range' = h_cell
exporting
#1 = w_cell1
#2 = w_cell2.
get property of h_cell 'Font' = gs_font .
set property of gs_font 'Bold' = 1 .
call method cl_gui_frontend_services=>clipboard_export
importing
data = it_2[]
changing
rc = l_rc
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4.
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 1.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
*GV_SHEET_NAME = '3rd SHEET'.
gv_sheet_name = 'Blocked Orders'.
get property of h_excel 'Sheets' = h_sheet3 .
call method of h_sheet3 'Add' = h_map.
set property of h_map 'Name' = gv_sheet_name .
get property of h_excel 'ACTIVESHEET' = worksheet.
*--Formatting the area of additional data 1 and doing the BOLD
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 50.
call method of h_excel 'Range' = h_cell
exporting
#1 = w_cell1
#2 = w_cell2.
get property of h_cell 'Font' = gs_font .
set property of gs_font 'Bold' = 1 .
call method cl_gui_frontend_services=>clipboard_export
importing
data = it_3[]
changing
rc = l_rc
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4.
call method of h_excel 'Cells' = w_cell1
exporting
#1 = 1
#2 = 1.
call method of h_excel 'Cells' = w_cell2
exporting
#1 = 1
#2 = 1.
* PERFORM err_hdl.
call method of h_excel 'Range' = range
exporting
#1 = w_cell1
#2 = w_cell2.
call method of range 'Select'.
* PERFORM err_hdl.
call method of worksheet 'Paste'.
*--- disconnect from Excel
free object h_zl.
free object h_mapl.
free object h_map.
free object h_excel.
Regards
Sudheer -
Data from transactional cube to a text file in directories
hi all
i have 2 transactional planning cubes in BW. the data in these cubes in bw needs to be uploaded monthly in to a single text file so that APO system can access the data for some purpose.
my question is how to upload the data from transactional cubes to the text file, which is more detailed. is that use ful to construct a ODS or CUBE(basic) on top of the transactional cubes.
if i keep the file in BW directory whethere APO can access that.?..
please help me out
praveen.Hello PraVeeN,
How r u ?
Is this not possible with InfoSpokes ???
Best Regards....
Sankar Kumar
+91 98403 47141 -
Calendar entry times entered via web browser change to 2 hours later on my Iphone
Why do the event times entered via my web browser into iCalendar change to 2 hours later when viewed on my iPhone?
The settings for date, time and time zone are correct on my Windows 8 laptop and on my iPhone.Some things to check:
Go to icloud.com, sign into your iCloud account, click your name at the top and choose Account Settings, click Time Zone and be sure it shows the correct time zone and that you have selected a city near you. Then open your calendar on icloud.com, click the gear-shaped icon on the bottom left and choose Preferences, click the Advanced tab and make sure you have not checked time zone support at the top.
On your iOS devices, go to Settings>Mail,Contacts,Calendars>Time Zone Support (in the Calendars section) and make sure this is set to Off. On your Mac, open the Calendar app and to to Mail>Preferences>Advances and uncheck “Turn on time zone support”. -
How to input data into an arraylist from a text file?
I am trying to take data from a text file and put that data into an arraylist. First here is the text file:
[item1, 10, 125.0, item2, 10, 12.0, item3, 20, 158.0]
3
4530.0
[item5, 65, 555.5, item4, 29, 689.0]
2
56088.5
[item7, 84, 34.5, item6, 103, 0.5, item8, 85, 1.36]
3
3065.1The text between the [ ] is the output from my arraylists. I have three arraylists. The first [ ] belongs to arraylist A, the second to arraylist B, and the third to arraylist C. The format of the arraylists is this:
<item name>,<# in stock>,<value of one item>
The first number below the arraylists in the text file represents the number of items in the list. The second number below the arraylists represents the total value of the items in the arraylists.
Here is the class file I have (yes, it does everything):
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;
public class Inventory extends Object
public int toAdd = 0;
private boolean done = false; //Are we done yet?
public String strItemName; //The name of the item type.
public int intNumInStock; //The number in stock of that type.
public double dblValueOfOneItem; //The value of one item.
public String strNumberInStock;
public double dblTotalValueA; //The total value of warehouse A.
public double dblTotalValueB; //The total value of warehouse B.
public double dblTotalValueC; //The total value of warehouse C.
public int intWarehouseAItemCount; //Counter for items in warehouse A.
public int intWarehouseBItemCount; //Counter for items in warehouse B.
public int intWarehouseCItemCount; //Counter for items in warehouse C.
ArrayList warehouseAList = new ArrayList(); //Create the Warehouse A ArrayList.
ArrayList warehouseBList = new ArrayList(); //Create the Warehouse B arrayList.
ArrayList warehouseCList = new ArrayList(); //Create the Warehouse C arrayList.
/** Construct a new Inventory object. */
public Inventory()
super();
/**Add items to the Warehouse A ArrayList.*/
private void createWareHouseA()
System.out.println("!" + toAdd + " item types will be added to warehouse A.");
//Cast
String strNumInStock = Integer.toString(intNumInStock);
String strValueOfOneItem = Double.toString(dblValueOfOneItem);
this.strNumberInStock = strNumInStock;
System.out.println("!Initial size of warehouseAList : " +
warehouseAList.size());
//Add items to the array List
warehouseAList.add(this.strItemName);
warehouseAList.add(this.strNumberInStock);
warehouseAList.add(this.dblValueOfOneItem);
System.out.println("!size of arrayList after additions " + warehouseAList.size());
/**Add items to the Warehouse B ArrayList.*/
private void createWareHouseB()
System.out.println("!" + toAdd + " item types will be added to warehouse B.");
//Cast
String strNumInStock = Integer.toString(intNumInStock);
String strValueOfOneItem = Double.toString(dblValueOfOneItem);
this.strNumberInStock = strNumInStock;
System.out.println("!Initial size of warehouseBList : " +
warehouseBList.size());
//Add items to the array List
warehouseBList.add(this.strItemName);
warehouseBList.add(this.strNumberInStock);
warehouseBList.add(this.dblValueOfOneItem);
System.out.println("!size of arrayList after additions " + warehouseBList.size());
/**Add items to the Warehouse C ArrayList.*/
private void createWareHouseC()
System.out.println("!" + toAdd + " item types will be added to warehouse C.");
//Cast
String strNumInStock = Integer.toString(intNumInStock);
String strValueOfOneItem = Double.toString(dblValueOfOneItem);
this.strNumberInStock = strNumInStock;
System.out.println("!Initial size of warehouseCList : " +
warehouseCList.size());
//Add items to the array List
warehouseCList.add(this.strItemName);
warehouseCList.add(this.strNumberInStock);
warehouseCList.add(this.dblValueOfOneItem);
System.out.println("!size of arrayList after additions " + warehouseCList.size());
/**Interpret the commands entered by the user.*/
public void cmdInterpreter()
this.displayHelp();
Scanner cin = new Scanner(System.in);
while (!this.done)
System.out.print(">");
//"line" equals the next line of input.
String line = cin.nextLine();
this.executeCmd(line);
/**Execute one line entered by the user.
* @param cmdLN; The command entered by the user to execute. */
private void executeCmd(String cmdLN)
Scanner line = new Scanner(cmdLN);
if (line.hasNext())
String cmd = line.next();
//What to do when users enter the various commands below.
if (cmd.equals("help"))
this.displayHelp();
else if (cmd.equals("Q!"))
this.done = true;
else if (cmd.equals("F") && line.hasNext())
this.inputFromFile(line.next());
else if (cmd.equals("K") && line.hasNext())
int numItemsToAdd = Integer.valueOf( line.next() ).intValue();
this.toAdd = numItemsToAdd;
this.inputFromKeyboard(numItemsToAdd);
/**What to do if input comes from a file.
* @param inputFile; The name of the input file to process.*/
private void inputFromFile(String inputFile)
Scanner cin = new Scanner(System.in);
System.out.println("!Using input file " + inputFile + ".");
System.out.print("!Enter the name of the output file: ");
String outputFile = cin.next();
System.out.println("!Using output file " + outputFile + ".");
try
BufferedReader in = new BufferedReader(new FileReader(inputFile));
//Scanner in = new Scanner(new File(inputFile));
//Initialize the String variables.
String line1 = null;
String line2 = null;
String line3 = null;
String line4 = null;
String line5 = null;
String line6 = null;
String line7 = null;
String line8 = null;
String line9 = null;
System.out.println(in.equals(",") + " see?");
//System.out.println((char)(char)in.read() + " experiment");
/**This loop assigns values to the string variables based on the
* values on each line in the input file. */
while(in.readLine() != null)
line1 = in.readLine();
line2 = in.readLine();
line3 = in.readLine();
line4 = in.readLine();
line5 = in.readLine();
line6 = in.readLine();
line7 = in.readLine();
line8 = in.readLine();
line9 = in.readLine();
//Print the contents of each line in the input file.
System.out.println("!value of line 1: " + line1);
System.out.println("!value of line 2: " + line2);
System.out.println("!value of line 3: " + line3);
System.out.println("!value of line 4: " + line4);
System.out.println("!value of line 5: " + line5);
System.out.println("!value of line 6: " + line6);
System.out.println("!value of line 7: " + line7);
System.out.println("!value of line 8: " + line8);
System.out.println("!value of line 9: " + line9);
/**Add items to the warehouses.*/
warehouseAList.add(line1);
warehouseBList.add(line4);
warehouseCList.add(line7);
/**Add the item count and total value for warehouse A.*/
int intLine2 = Integer.valueOf(line2).intValue();
this.intWarehouseAItemCount = intLine2;
double dblLine3 = Double.valueOf(line3).doubleValue();
this.dblTotalValueA = dblLine3;
/**Add the item count and total value for warehouse B.*/
int intLine5 = Integer.valueOf(line5).intValue();
this.intWarehouseBItemCount = intLine5;
double dblLine6 = Double.valueOf(line6).doubleValue();
this.dblTotalValueB = dblLine6;
/**Add the item count and total value for warehouse C.*/
int intLine8 = Integer.valueOf(line8).intValue();
this.intWarehouseCItemCount = intLine8;
double dblLine9 = Double.valueOf(line9).doubleValue();
this.dblTotalValueC = dblLine9;
/**Ask the user how many items to add or delete from inventory.*/
System.out.print("Enter the number to add to inventory for " +
warehouseAList.get(0) + ":");
String toAddOrDel = cin.next();
/**Print the contents of all the warehouses. */
System.out.println(" ");
//Print the contents of warehouse A.
System.out.println("!--------------------------------");
System.out.println("!----------Warehouse A:----------");
System.out.println("!--------------------------------");
//Print the item list for warehouse A.
System.out.println(warehouseAList);
//Print the total amount of items in warehouse A.
System.out.println("Total items: " + this.intWarehouseAItemCount);
//Print the total value of the items in warehouse A.
System.out.println("Total value: " + this.dblTotalValueA);
System.out.println("!--------------------------------");
System.out.println("!----------Warehouse B:----------");
System.out.println("!--------------------------------");
//Print the item list for warehouse B.
System.out.println("!warehouseB: " + warehouseBList);
//Print the total amount of items in warehouse B.
System.out.println("Total items: " + this.intWarehouseBItemCount);
//Print the total value of the items in warehouse B.
System.out.println("Total value: " + this.dblTotalValueB);
System.out.println("!--------------------------------");
System.out.println("!----------Warehouse C:----------");
System.out.println("!--------------------------------");
//Print the item list for warehouse C.
System.out.println("!warehouseC: " + warehouseCList);
//Print the total amount of items in warehouse C.
System.out.println("Total items: " + this.intWarehouseCItemCount);
//Print the total value of the items in warehouse C.
System.out.println("Total value: " + this.dblTotalValueC);
in.close();
catch (FileNotFoundException e)
System.out.println("!Error: Unable to open file for reading.");
catch (EOFException e)
System.out.println("!Error: EOF encountered, file may be corrupted.");
catch (IOException e)
System.out.println("!Error: Cannot read from file.");
/**What to do if input comes from the keyboard.
* @param numItems; The total number of items that will be added to the
* Warehouse(s). */
public void inputFromKeyboard(int numItems)
System.out.println("!You will be adding " + numItems + " items to " +
"inventory from the keyboard. ");
this.toAdd = numItems;
Scanner cin = new Scanner(System.in);
//Prompt user for name of output file.
System.out.print("!Enter the name of the output file: ");
String outputFile = cin.next();
/**This loop asks the user for information about the item(s) and inputs
*them into the appropriate array.*/
int count = 0;
while (numItems > count)
//Item name.
System.out.print("!Item name: ");
String addItemName = cin.next();
//Number in stock.
System.out.print("!Number in stock: ");
String addNumInStock = cin.next();
//Initial warehouse.
System.out.print("!Initial warehouse(A,B,C): ");
String addInitWarehouse = cin.next();
//Value of one item.
System.out.print("!Value of one item: ");
String addValueOfOneItem = cin.next();
//Add or delete from inventory
System.out.print("!Enter amount to add or delete from inventory: ");
String strAddOrDelete = cin.next();
System.out.println("!Amount to add or delete: " + strAddOrDelete);
//Cast
int intAddNumInStock = Integer.valueOf(addNumInStock).intValue();
double doubleAddValueOfOneItem = Double.valueOf(addValueOfOneItem).doubleValue();
int intAddOrDelete = Integer.valueOf(strAddOrDelete).intValue();
/**Add intAddNumInStock with intAddOrDelete to determine the amount
* to add or delete from inventory (If a user wishes to remove items
* from inventory simply add negative values). */
intAddNumInStock = intAddNumInStock + intAddOrDelete;
System.out.println("!Inventory after modifications: " + strAddOrDelete);
this.strItemName = addItemName;
this.intNumInStock = intAddNumInStock;
this.dblValueOfOneItem = doubleAddValueOfOneItem;
//Put items into warehouse A if appropriate.
if (intAddNumInStock < 25)
//Increment the warehouse A item count.
this.intWarehouseAItemCount = this.intWarehouseAItemCount + 1;
//Calculate the total value of warehouse A.
this.dblTotalValueA = this.dblTotalValueA + intAddNumInStock * doubleAddValueOfOneItem;
//Create the warehouse A array list.
this.createWareHouseA();
//Put items into warehouse B if appropriate.
if (intAddNumInStock >= 25)
if (intAddNumInStock < 75)
//Increment the warehouse B item count.
this.intWarehouseBItemCount = this.intWarehouseBItemCount + 1;
//Calculate the total value of warehouse B.
this.dblTotalValueB = this.dblTotalValueB + intAddNumInStock * doubleAddValueOfOneItem;
//Create the warehouse B array list.
this.createWareHouseB();
//Put items into warehouse C if appropriate.
if (intAddNumInStock >= 75)
//Increment the warehouse C item count.
this.intWarehouseCItemCount = this.intWarehouseCItemCount + 1;
//Calculate the total value of warehouse C.
this.dblTotalValueC = this.dblTotalValueC + intAddNumInStock * doubleAddValueOfOneItem;
//Create the warehouse C array list.
this.createWareHouseC();
//display helpful information.
System.out.println("!--------------------------------");
System.out.println("!" + addItemName + " is the item name.");
System.out.println("!" + addNumInStock + " is the number in stock.");
System.out.println("!" + addInitWarehouse + " is the initial warehouse.");
System.out.println("!" + addValueOfOneItem + " is the value of one item.");
System.out.println("!--------------------------------------------------");
//Increment the counters.
count++;
/**Create and write to the output file. */
try
//Use the output file specified by the user.
PrintWriter out = new PrintWriter(outputFile);
/**Write warehouse A details.*/
//Blank the first line.
out.println(" ");
//Write the array list for warehouse A.
out.println(warehouseAList);
//Write the amount of items in warehouse A.
out.println(intWarehouseAItemCount);
//Write the total value for warehouse A.
out.println(dblTotalValueA);
/**Write warehosue B details.*/
//Write the array list for warehouse B.
out.println(warehouseBList);
//Write the amount of items in warehouse B.
out.println(intWarehouseBItemCount);
//Write the total value for warehouse B.
out.println(dblTotalValueB);
/**Write warehouse C details.*/
//Write the array list for warehouse C.
out.println(warehouseCList);
//Write the amount of items in warehouse C.
out.println(intWarehouseCItemCount);
//Write the total value for warehouse C.
out.println(dblTotalValueC);
//Close the output file.
out.close();
catch (FileNotFoundException e)
System.out.println("Error: Unable to open file for reading.");
catch (IOException e)
System.out.println("Error: Cannot read from file.");
/**View the contents and the value of each warehouse.*/
System.out.println("!---------------Inventory Summary------------------");
System.out.println("!--------------------------------------------------");
System.out.println("!--------------------LEGEND:-----------------------");
System.out.println("!<item type>, <amount in stock>,<value of one item>");
System.out.println("!--------------------------------------------------");
System.out.println("!------------------Warehouse A:--------------------");
System.out.println("!--------------------------------------------------");
//Display Items in warehouse A.
System.out.println(warehouseAList);
//Total items in warehouse A.
System.out.println("Total items: " + intWarehouseAItemCount);
//Display total value of warehouse A.
System.out.println("Total value: " + "$" + dblTotalValueA);
System.out.println("!--------------------------------------------------");
System.out.println("!------------------Warehouse B:--------------------");
System.out.println("!--------------------------------------------------");
//Display Items in warehouse B.
System.out.println(warehouseBList);
//Total items in warehouse B.
System.out.println("Total items: " + intWarehouseBItemCount);
//Display total value of warehouse B.
System.out.println("Total value: " + "$" + dblTotalValueB);
System.out.println("!--------------------------------------------------");
System.out.println("!------------------Warehouse C:--------------------");
System.out.println("!--------------------------------------------------");
//Display Items in warehouse C.
System.out.println(warehouseCList);
//Total items in warehouse C.
System.out.println("Total items: " + intWarehouseCItemCount);
//Display total value of warehouse C.
System.out.println("Total value: " + "$" + dblTotalValueC);
/**Display a help message.*/
private void displayHelp()
System.out.println("!--------------------------------");
System.out.println("! General Help:");
System.out.println("!--------------------------------");
System.out.println("! ");
System.out.println("!'help' display this help message.");
System.out.println("!'Q!' quit this program.");
System.out.println("!--------------------------------");
System.out.println("! Input File Specific Commands:");
System.out.println("!--------------------------------");
System.out.println("! ");
System.out.println("!'F' <name> type F followed by the name of the " +
"file to be used for input.");
System.out.println("!---------------------------------------");
System.out.println("! Input From Keyboard Specific Commands:");
System.out.println("!---------------------------------------");
System.out.println("! ");
System.out.println("!'K' <number> type K followed by the number of " +
"items that will be added. ");
System.out.println("! ");
}Program file:
public class InventoryProg
public static void main(String[] args)
//Create a new Inventory object.
Inventory test = new Inventory();
//Execute the command interpreter.
test.cmdInterpreter();
}Right now I am stuck on this and I cannot progress any further until I figure out how to input the data in the text file back into a arraylist.
Thanks in advance.Thanks but I figured it out. Heres a sample of the code i used to solve my problem:
try
//Warehouse A BufferedReader.
BufferedReader inA = new BufferedReader(new FileReader(inputFileWarehouseA));
//Warehouse B BufferedReader.
BufferedReader inB = new BufferedReader(new FileReader(inputFileWarehouseB));
//Warehouse C BufferedReader.
BufferedReader inC = new BufferedReader(new FileReader(inputFileWarehouseC));
//Warehouse details BufferedReader.
BufferedReader inDetails = new BufferedReader(new FileReader(inputFileDetails));
//Will hold values in warehouse arraylists.
String lineA = null;
String lineB = null;
String lineC = null;
//Will hold the details of each warehouse.
String line1 = null;
String line2 = null;
String line3 = null;
String line4 = null;
String line5 = null;
String line6 = null;
//Get the item count and total value for each warehouse.
while(inDetails.readLine() != null)
line1 = inDetails.readLine();
line2 = inDetails.readLine();
line3 = inDetails.readLine();
line4 = inDetails.readLine();
line5 = inDetails.readLine();
line6 = inDetails.readLine();
/**Assign the item count and total value to warehouse A.*/
//Cast.
int intLine1 = Integer.valueOf(line1).intValue();
double dblLine2 = Double.valueOf(line2).doubleValue();
//Assign the values.
this.intWarehouseAItemCount = intLine1;
this.dblTotalValueA = dblLine2;
/**Assign the item count and total value to warehouse B.*/
//Cast.
int intLine3 = Integer.valueOf(line3).intValue();
double dblLine4 = Double.valueOf(line4).doubleValue();
//Assign the values.
this.intWarehouseBItemCount = intLine3;
this.dblTotalValueB = dblLine4;
/**Assign the item count and total value to warehouse C.*/
//Cast.
int intLine5 = Integer.valueOf(line5).intValue();
double dblLine6 = Double.valueOf(line6).doubleValue();
//Assign the values.
this.intWarehouseCItemCount = intLine5;
this.dblTotalValueC = dblLine6;
/**Put the items back into the warehouses arraylists. */
//Add items to warehouse A.
while((lineA = inA.readLine()) != null)
warehouseAList.add(lineA);
//Add items to warehouse B.
while((lineB = inB.readLine()) != null)
warehouseBList.add(lineB);
//Add items to warehouse C.
while((lineC = inC.readLine()) != null)
warehouseCList.add(lineC);
}(this isn't the whole try statement its pretty long) -
DOWNLOADING A REPORT PROGRAM CODE IN TO TEXT FILE
I HAVE ONE SIMPLE REPORT PROGRAM SAY,
*& Report ZTEST25
REPORT ZTEST25.
DATA : A(8) TYPE C.
A = 'ANDHRA'.
WRITE A.
THE ABOVE MENTIONED REPORT PROGRAM SHOULD BE DOWNLOADED TO A TEXT FILE USING ANOTHER REPORT PROGRAM BY USING PARAMETER.
THE OUTPUT IN THE FLAT FILE SHOULD BE:
REPORT ZTEST25.
DATA : A(8) TYPE C.
A = 'ANDHRA'.
WRITE A.here is complete code for that
report z11dpk_assign1
no standard page heading
message-id z11dpk
line-size 200 "page width
line-count 65(0). "page length.
T A B L E S D E C L A R A T I O N *
tables: trdir, " System Table TRDIR
trdirt. " Title texts for programs in
D A T A D E C L A R A T I O N *
Types
Structure declaration for system table
types: begin of struct_sys,
name(40) type c, " ABAP program name
clas(4) type c, " Program class
subc(1) type c, " Program type
cnam(12) type c, " Author
cdat type dats, " Created on
rstat(1) type c, " status
text type repti, " Report title
c_box(1) type c, " for check box
end of struct_sys.
Structure for internal table for report data
types: begin of struct_report,
line(500),
end of struct_report.
C O N S T A N T S D E C L A R A T I O N S
data : c_name(50) type c, " Program Name
c_filename like ibipparms-path, " File name
c_filename1 type string, " File name
c_ext(5) value '.TXT', " File extension
c_textline(150) type c, " downloading status
c_count type c, " no of pgm downlded
c_count_text(100) type c. " Text pgm downlded
The CONSTANTS statement defines global and local constants.
By using constants, you can read statically declared data objects,
constants: c_const(8) value 'UNTITLED'.
I N T E R N A L T A B L E D E C L A R A T I O N
data: it_sys type standard table of struct_sys, " Itab for sys data
it_report type standard table of struct_report with
non-unique default key initial size 1000. " Itab for rep data
W O R K A R E D E C L A R A T I O N S
data: wa_sys type struct_sys, " Work area for sys data
wa_report type struct_report. " Work area for report data
I N I T I A L I Z T I O N
initialization.
clear : wa_sys.
refresh: it_sys,
it_report.
c_count = 0.
S E L E C T I O N - S C R E E N
selection-screen : begin of block blk3 with frame title text-015.
selection-screen : begin of block blk1 with frame title text-001.
select-options : s_name for trdir-name. " Program name
selection-screen : end of block blk1.
selection-screen : begin of block blk2 with frame title text-002.
parameters : p_file type rlgrap-filename. " Path for loc folder
selection-screen : end of block blk2.
selection-screen : end of block blk3.
A T S E L E C T I O N - S C R E E N
*The possible entries pushbutton for F4 appears beside the appropriate
*fld (p_file) When the user activates this pushbutton or presses F4 for
*the fld, the event is executed You can thus implement a self-programmed
*possible entries routine for the input/output fields of the selection
*screen
at selection-screen on value-request for p_file.
Value of Local file for upload/download is obtained by using this FM
call function 'F4_FILENAME'
importing
file_name = p_file.
S T A R T - O F - S E L E C T I O N
start-of-selection.
CONCATENATE p_name '%' INTO z_name.
select name
clas
subc
cnam
cdat
rstat into table it_sys
from trdir
*Sorts the selected records in ascending order by the specified column
*references f1 ... fn (name)
where name in s_name order by name.
WHERE name LIKE 'Z11%'.
if sy-subrc = 0.
sort it_sys by name.
clear wa_sys.
loop at it_sys into wa_sys.
select single text
into wa_sys-text
from trdirt
where name = wa_sys-name and
sprsl = sy-langu.
modify it_sys from wa_sys index sy-tabix.
clear wa_sys.
endloop.
endif.
set pf-status 'MENU_ASSIGN1'.
uline.
write:/ sy-vline ,
8 sy-vline, text-009 color 4, " Name of the Program
55 sy-vline, text-003 color 4, " Class
62 sy-vline, text-004 color 4, " Type
68 sy-vline, text-005 color 4, " Created By
80 sy-vline, text-006 color 4, " Created On
92 sy-vline, text-007 color 4, " Status
100 sy-vline, text-008 color 4, " Program text
180 sy-vline.
clear wa_sys.
loop at it_sys into wa_sys.
uline.
write:/ sy-vline,
5 wa_sys-c_box as checkbox,
8 sy-vline, wa_sys-name,
55 sy-vline, wa_sys-clas,
62 sy-vline, wa_sys-subc,
68 sy-vline, wa_sys-cnam,
80 sy-vline, wa_sys-cdat,
92 sy-vline, wa_sys-rstat,
100 sy-vline, wa_sys-text,
180 sy-vline.
endloop.
at user-command.
case sy-ucomm.
when 'BACK'.
leave screen.
when 'EXIT'.
leave program.
when 'DOWN'.
clear wa_sys.
do.
clear wa_sys.
read line sy-index field value wa_sys-c_box wa_sys-name.
if sy-subrc <> 0.
exit.
endif.
*if check box is selected.....
if wa_sys-c_box = 'X'.
clear c_textline.
*Assigns the contents of the source field to the target field as a new
*value
write text-010 to c_textline. " Downloading
write wa_sys-name to c_textline+12.
write text-011 to c_textline+53. "to
write c_filename1 to c_textline+56. " file name
FM returns the Text to be displayed on screen
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
text = c_textline.
c_count = c_count + 1.
Reads the program prog from the database into the internal table itab.
The line length of table itab should be at least 72 characters
read report wa_sys-name into it_report.
if sy-subrc <> 0.
exit.
endif.
*p_file contains the character string untitiled
This comparison is not case sensitive
if p_file cs c_const. " Untitled
the string ''(space) replaces the untitled occurrence of the search
ignore case is used as this search is case sensitive
replace c_const in p_file with '' ignoring case.
endif.
Places the fields f1 to fn (n >= 2) after g (target field).
concatenate p_file wa_sys-name c_ext into c_filename1.
*Data transmission of an internal table from the server to a file on the
PC is done by this FM.
call function 'GUI_DOWNLOAD'
exporting
filename = c_filename1
filetype = 'ASC'
tables
data_tab = it_report.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
enddo.
clear c_count_text.
write c_count to c_count_text+1.
write text-030 to c_count_text+4.
Nos Of Pgms downlded successfully
message i205 with c_count_text.
endcase.
T O P - O F - P A G E
top-of-page.
uline.
write:/ sy-vline,
10 text-020 color 2, " Fujitsu India Limited
70 text-021 color 2. " List of ABAP Programs
write:/ sy-vline,
10 text-022 color 3, sy-datum color 3, " Date
70 text-023 color 3, sy-pagno color 3. " Page No
plz reward if helpful
vivek -
I tried to download but my mac keeps giving me .text file
okay, i tried to download http://www.the-n.com/ntv/shows/downloads.php?id=531
the screensaver for mac version. but after i download it, the computer keeps giving me
the .text file. i dont get it. could anybody help me??Control-Click on the file and save it to your downloads folder. It should be in there as a ,jpg.
-Bmer
Mac Owners Support Group - Join us @ MacOSG.com
Mac611 Mobile Mac Support - about.Mac611.com
iTunes:MacOSG Podcast | YouTube.MacOSG.com
An Apple User Group
Have an iPhone or iPod touch? Enter Mac611.com in Safari on it for 'mobile Mac support.' -
Exporting data from a jsp to a text file...
Hi all.
I have a jsp which displays a set of results in a tablular form....my clients now want me to include a button in this jsp page on clicking which i will be abl�e to export the entire data from the displayed page to a text file
can anyone suggest me as to how to go about it...
thanksServer side code(lets say servlet named exportServlet) behind the button can retreive the data in the same fashion as done for displaying on the JSP.
But then, exportServlet writes data back on the HTTP response using the mime type application/octet-stream.
See Javadoc for javax.servlet.ServletResponse.setContentType() -
I have just upgraded to Firefox 8.0.1 on may MacBook (10.6.8) and now all files I download from my Outlook Web app labeled attachment.ashx, not as they were originally sent (.docx, .pdf, etc). How do I change this back?
I'm going to back up to Firefox 7 next. I'm getting the drift that 8.0.1 and/or flash on 8.0.1 are unstable.
I'll let you know if that solves this problem.
NOPE. This had no effect. -
How to send data coming from modem to a text file
hi frnds
I have a modem program in which i can receive sms and call details.What i want is i want to store those msgs to a text file.
The String variable to which that data is going is in readData() method of some Receiver.java file.
I tried like this
FileOutputStream file = new FileOutputStream(new File("modem.txt"));
Receiver rcvr = new Receiver(); // here i am getting error " the constructor Receiver() is undefined
String data = rcvr.readData(str);// here error is str cannot be resolved.
file.write(data); // here i am getting error "Syntax error on token "data", VariableDeclaratorId expected after this token"
can anyone help me ???You need to go and read some Javadoc for all the methods you are trying to call. While you're there have a look in java.io for methods that can write a String.
-
Download all metada + document names to a text-file
Hallo,
we want to to download all the names of all documents and the values of the document-metadata from a special folder or repository into a text-file. I think we can realize /develop this by using existing apis . Is there any documentation or sample-code available?
Thanks
AndreasHi,
Yes you can develop it. Use this link:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/knowledge management and collaboration developers guide.html
Patricio. -
How to put data into a hashtable from a text file
I need some help to put the words in a text file to a hashtable.The text file
consist of words and the following set of punctuation marks {, . ; : } and spaces.
thanks in advance.Navy_Coder wrote:
6 zebras.But you must marry his eldest daughter as well, for that dowry. -
We are using 11.1.2.1 on windows 2008 R2 servers.
Is there in HFM anything that limits the file size when you're doing a metadata or data export? Maybe not a file size limitation, but may a time limitation or something? I know when I tried to do an export of the application via the HFM client, I got the entire file. When I did it via the web, I could tell I got about half of the file (based on the file size) and I think it gave me the last half of the file since it didn't start with the correct file tags. I typically don't do any of my extracts via the web (I do them through the client), but many of our users do. If there is some kind of limitation within Hyperion do you think we could increase it? We have a user who didn't get a complete file via the web.Not sure if this is your problem or not, but when we upgraded to 11.1.2.1.103 I had a similar issue where I would only get 1/2 my metadata extract. Maybe try this and see if it helps:
Metadata/Data Exports
You will need to set the AspResponseBufferLimit by performing the following steps.
By default, the value for the ASPBufferLimit property in IIS 6 and for the bufferLimit property in IIS 7 is 4,194,304 bytes (4 MB).
The recommendation is to set the value to 1073741824 (1 GB).
To increase the buffering limit in IIS 6, follow these steps:
1. Click Start, click Run, type cmd, and then click OK.
2. Type the following command, and then press ENTER:
cd /d %systemdrive%\inetpub\adminscripts
3. Type the following command, and then press ENTER:
cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit LimitSize
Note: LimitSize represents the buffering limit size in bytes. For example, the number 1073741824 sets the buffering limit size to 1 GB.
To increase the buffering limit in IIS 7, follow these steps:
1. Click Start, click Run, type inetmgr, and then click OK.
2. In the left hand panel, expand the computer name by clicking the plus sign next to it.
3. Expand the “Sites”.
4. Expand “Default Web Site”
5. Select the HFM web site in the expanded list.
6. In the middle panel “Features View”, in the IIS section, double click the ASP icon.
7. Expand “Limits Properties”.
8. Change “Response Buffering Limit” to 1073741824.
9. In the right hand panel, select “Apply”.
10. Restart IIS. -
Meta-data creation via web forms?
Hi,
I know this question would turn out to be more of a would-be-nice to have request for Hyperion Planning. Nonetheless, I would like to confirm that it is not already available in version 11.
Does the new version provide the capability to create meta-data (members or properties) via Hyperion web forms fro Hyperion Planning?
Ofcourse I am fully aware of the downside of the above, just want to make sure.
I know only Dodeca provides such a feature via Excel which I think is pretty cool.
Thanks for your responses..Hi,
The quick answer is no, you have to remember that planning has to push any metadata changes down to essbase, I am not sure how many would want users constantly changing hierarchies and refreshing planning.
There is always EPMA to manage the metadata.
There is the ability in 11.1.2 to do adhoc analysis on forms and then save them as personalized views
Cheers
John
http://john-goodwin.blogspot.com/
Maybe you are looking for
-
Removing null values from a chart
Hello, I have a chart embedded in a Crystal report. (v.11.5). The data set essentially is a value per date, but because of the way the stored procedure is written, I have null values returned. Is there anyway to have the chart ignore null values?
-
I'm stumped but it might be something simple I film in 16:9 Edit in iMovie.....share......it comes out 4:3 But When I do get it at 16:9 (using expert settings) it plays in 4:3 in iDVD preview. Any ideas? I'm wasting hours here!! Thanks in advance Pet
-
Distinct not working in OBI 11.1.1.6.2
Hello Experts - We have recently upgraded our OBIEE environment from 11.1.1.5 to 11.1.1.6.2 and we are facing a strange issue. The ditinct which the OBIEE uses internally is not getting applied. We are getting duplicates even for the column which is
-
Compliance Policy Center - Document Deletion Policies option is not yet enabled
Hello, I have configured Compliance Policy Center for my Online tenant. Created a policy and assigned it to a Site Collection. I am trying to view policy assigned to Site Collection from Site Settings > Document Deletion Policies (as mentioned in htt
-
Dear frds, In import procedure we done MIRO for all the duties which are putted in PO - Sec ECESS on CVD IN Basic customs IN Special customs IN CVD ECESS on CVD Sec ECESS on Customs ECESS on Customs But when we done MIGO against commercial invoice on