How to fill a table with data from columns & rows from a txt file
I am trying to fill say:
Myname Myclass Mycollege
Mohan MD Stanford
from a txt file into 3 columns of a table. I can easily do it into a textarea component by
clicking a button:
try{
FileReader fr = new FileReader("F:/CreatorProjects1/stan.txt");
BufferedReader br = new BufferedReader(fr);
String s1="";
String s="";
stantxtarea.setValue(s);
while((s=br.readLine())!=null) {
s1 = s1+s;
s1=s1+"\n";
stantxtarea.setValue(s1);
br.close();
fr.close();
} catch(Exception e) {
e.printStackTrace();
return null;
All table components seem to need a database. I do not use any database. I run exe files that give output to txt files. How to solve it?
I appreciate any help in this regard...
dr.mohan rao
there may be another way. This is some thing some thing I can recommend. You can create property type of ObjectListDataProvider in session or application based on the scope you required. Create web bean class with property you want to show in the column (say col1, col2, col2). Initialize the list property like similar below
List dataList = new ArrayList();
ObjectListDataProvider mytableprops = new ObjectListDataProvider();
try {
//start loop read data from your txt file
//create instance of web bean for each line
//add web bean instance into dataList
//end of loop readind data from txt file
oldpins.setList(dataList );
oldpins.setObjectType(NotificationProfileBean.class);
} catch (Exception ee1){;}
return oldpins;
Sri Thuraisamy
Similar Messages
-
How to pass internal table with data in ABAP OO
Hi experts ,
Here is the problem...
I create a screen 100 and use the internal table to get data from database, and then press the button on screen 100 , it will call screen 200.
I use ABAP OO code in screen 200, and i want to keep the internal table with data that i get from the sceen 100 parts, but it seems that it just supports to create a new internal table and get data from database in ABAP OO. That means i need to create a new table to save the data in internal table ? Or there is any other solution something like exporting or memory id ...
ps . the internal table in screen 100 is declared in global area, the beginning of the code.
Please give me some advice, thanks a lot!
Regards ,
ClaireI have already know how to do, here is my code:
METHODS fill_tree importing itab2 like itab1.
CALL METHOD: me->fill_tree exporting itab2 = itab1.
In METHOD fill_tree,
declare
data: itab3 TYPE STANDARD TABLE OF itab,
itab3[] = itab1[].
It is useful to me, thanks a lot. -
How to fill internal table with selection screen field.
Hi all,
i am new to sap . pls tell me how to fill internal table with selection screen field.Hi,
Please see the example below:-
I have used both select-options and parameter on the selection-screen.
Understand the same.
* type declaration
TYPES: BEGIN OF t_matnr,
matnr TYPE matnr,
END OF t_matnr,
BEGIN OF t_vbeln,
vbeln TYPE vbeln,
END OF t_vbeln.
* internal table declaration
DATA : it_mara TYPE STANDARD TABLE OF t_matnr,
it_vbeln TYPE STANDARD TABLE OF t_vbeln.
* workarea declaration
DATA : wa_mara TYPE t_matnr,
wa_vbeln TYPE t_vbeln.
* selection-screen field
SELECTION-SCREEN: BEGIN OF BLOCK b1.
PARAMETERS : p_matnr TYPE matnr.
SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
SELECTION-SCREEN: END OF BLOCK b1.
START-OF-SELECTION.
* I am adding parameter value to my internal table
wa_mara-matnr = p_matnr.
APPEND wa_mara TO it_mara.
* I am adding select-options value to an internal table
LOOP AT s_vbeln.
wa_vbeln-vbeln = s_vbeln-low.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
Regards,
Ankur Parab -
How i can create table with data
How i can create table with data from dev to production?
How i can create table with data
[url=http://en.wikipedia.org/wiki/Black_Beast_of_Aa
aaarrrrrrggghhh]from dev to production?
[url=http://img2.travelblog.org/Photos/3800/14977/t
/64816-Col-Kurtz-0.jpg]The horror, the
horror.lol, you gonna scare somebody here.
Are we helping devil? -
Fill a table with data coming from an RFC
Hello everyone:
I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?"
/people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro
I've called an RFC and created a table with data coming from it (which is also a table). My question is, if in this table there's a field named "UserType" there are two possible values for this field:
"userA"
"userB"
How can I get the table only show me the "userA" registers? The RFC does return all of the users, but when filling the table, can I put an if-else somewhere on my code?
Thanks a lot
AlejandroHi Alejandro,
Referring to the link provided "The logic of the filter process is not implemented in Web Dynpro. The application developer must implement the action to be executed."
We would have to implement the action onFilter in the controller implementation. Ideally, we fill the data retrieved from backend into a List (java.util.List) (this could be done on init of view) and then subset the list after meeting the criteria in the action handler(say
onActionFilterData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent).
Having done this, you may bind the output list back to the node (shown in table)
Regards,
Chaitanya -
How to fill internal table with no data in debugging mode
Hi all,
I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
Thanks,
BalajiHi,
In the debugging do the following..
Click the Table button..
Double click on the internal table name..
Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
Use the APPEND button to insert records to the internal table..
Thanks,
Naren -
In sm30, when save, how to fill the table with the system data in the table
Hi all, in SM30, we have user name and time fields, when we create record, after we click the SAVE button, it will automatically fill the fields with the system data, how can we realize it?
Hi ,
Do like this.
1. Go to SE11 -> give your table name and press on change button .
2.Go to Menu->Utilities-> Table Maintainance Generator , then it will take you another screen .
3.Assign Functin group if already have one , other wise create function group and assign
4.Go to Menu->Environment->Modification->Events , again it will take you to another screen
5.Click on new entries
->Now press F4 in T column . Select<u> "01" - Before saving the data in the database</u> and in form routinue give any name of the routinue like "SAVE_USER_DATA" and press enter then u can see an editor symbol in next column click on that it will take you ABAP editor there type this code .
ztable-username = sy-uname.
ztable-createtime = sy-uziet.
check and activate the code .
With this your job will be complete . Now while entering data just leave columns blank , they will insert corresponding username and time
Don't forget award points if it helps you.
Regards,
Raghav -
How to create a table with data in it?
I need to have a temp table in a PL/SQL procedure for processing which can hold data values from two other tables and a sequence number.
Ex:
Existing tables:
table1 (col1 varchar2(100), col2 date, col3 number20) - Has more 1Lakh rows
table2 (col1 varchar2(100), col2 date) - Has more 900 rows
New table
temp_table (col1 PRY KEY(seq1.number), col2 varchar2(100), col3 date)
Currently i have created the temp_table and inserting all the data from both table1 & table2 (which is poor). Please suggest me a way to have the temp_table created with data(atleast from table1 which has more than 1Lakh rows). Please see i need a sequence number as well.
Thanks in advance.Vel wrote:
I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
I'm using Oracle 10.2.0.4 version.
Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements. -
Filling Standard table with Data
Hi All,
how to configure a table for updating with data.
I am working with Migo Movements & I want those movements data to be updated in MARI Table.
Is it Possible to configure the standard table for updating with data?
Thanks & Regards,
Ravi SHi,
Thanks for Your Reply.
Actually I'm interested to know how the Migo TCode is configured so that MARI Table gets Updated.AS of Now it is Empty & when ever the Next transactions are done in Migo,the Mari Table Needs to be Updated.
Thanks & Regards,
Ravi S -
How to Fill Internal Table with contents of Select-Option
Hi all:
There is a select-option s_matnr on the self-made screen. An internal table t_int is declared in the program. The requirement is that users makes selection with multiple material numbers. I want to put the values of s_matnr into internal table t_int directly. Would you please tell me how?
Thank you very much in advance.
Edited by: dongdong guo on Jun 13, 2008 3:40 AMHi,
Select option works like an internal table only.
For table selection you can use it directly using IN operator in where clause
eg : where matnr IN s_matnr.
Before that you may need to validate the content of the select-option. For that also you need to transfer the content to a new internal table.
u can loop at the select-option.
eq: loop at s_matnr.
if s_matnr-low = 'MAT1'.
condition.
endif.
endloop.
if you just want to check whether any single valid material number exist in your user screen, then u can use a select single option with s_matnr directly.
select single matnr from mara
where matnr in s_matnr.
select-option s_matnr behaves like an internal table with four fields.
sign, option, low, high. -
How to export a table with half a million rows?
I need to export a table that has 535,000 rows. I tried to export to Excel and it exported only 65,535 rows. I tried to export to a text file and it said it was using the clipboard (?) and 65,000 rows was the maximum. Surely there has to be a way to export
the entire table. I've been able to import much bigger csv files than this, millions of rows.What version of Access are you using? Are you attempting to copy and paste records or are you using Access' export functionality from the menu/ribbon? I'm using Access 2010 and just exported a million record table to both a text file and to Excel
(.xlsx format). Excel 2003 (using .xls 97-2003 format) does have a limit of 65,536 rows but the later .xlsx format does not.
-Bruce -
URGENT -- How to duplicate a table with a long column?
I am using a ddl script --
Create table ONE as (select * from TWO);
This gives error saying ONE has long column.
Any ideas.........
DarshanIf you can create the second table, you can populate it through the COPY function.
See the following testcase:
DROP TABLE one
DROP TABLE two
CREATE TABLE one
(n NUMBER
,l LONG)
INSERT INTO one
VALUES
(1
,'123'
CREATE TABLE two
(n NUMBER
,l LONG)
COPY FROM apps/apps@db TO apps/apps@db APPEND two USING SELECT * FROM one
SELECT * FROM one
SELECT * FROM two
null -
How to Capture a Table with large number of Rows in Web UI Test?
HI,
Is there any possibility to capture a DOM Tabe with large number of Rows (say more than 100) in Web UI Test?
Or is there any bug?Hi,
You can try following code to capture the table values.
To store the table values in CSV :
*web.table( xpath_of_table ).exportToCSVFile("D:\exporttable.csv", true);*
TO store the table values in a string:
*String tblValues=web.table( xpath_of_table ).exportToCSVString();*
info(tblValues);
Thanks
-POPS -
How to fill a table with a query?
Hi experts,
J'ai une table que je veux remplir avec ma requête. J'ai aussi un bouton sur lequel je veux cliquer pour exécuter ma requête et afficher le résultat dans le tableau. Quelqu'un peut il m'aider?
Regards.oDBs_Detail1 = oForm.DataSources.DBDataSources.Item("@HIS_OPDINVD")
oDBs_Head = oForm.DataSources.DBDataSources.Item("@HIS_OPDINVH")
Dim oRS As SAPbobsCOM.Recordset
oRS = objMain.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim Str1 As String
Str1 = "Select T3.U_Qty,T3.U_PList,T3.U_TLName,T3.U_TLID, T3.U_TLPrice from [@UPDATE] T0,[@UPDATE4] T3"
Str1 = Str1 & " where T0.DocEntry = T3.DocEntry"
Str1 = Str1 & " and T0.U_PID='" & PID & "' and U_VisitID='" & VisitID & "' and T3.U_TLID IS NOT NULL "
oRS.DoQuery(Str1)
For i As Integer = 1 To oRS.RecordCount
oBillMat.AddRow()
oBillMat.FlushToDataSource()
oDBs_Detail1.Offset = i
Total = oRS.Fields.Item("U_TLPrice").Value
oDBs_Detail1.SetValue("LineID", oDBs_Detail1.Offset, i)
oDBs_Detail1.SetValue("U_SID", oDBs_Detail1.Offset, oRS.Fields.Item("U_TLID").Value)
oDBs_Detail1.SetValue("U_Price", oDBs_Detail1.Offset, oRS.Fields.Item("U_TLPrice").Value)
oDBs_Detail1.SetValue("U_Desc", oDBs_Detail1.Offset, oRS.Fields.Item("U_TLName").Value)
oDBs_Detail1.SetValue("U_PL", oDBs_Detail1.Offset, oRS.Fields.Item("U_PList").Value)
oDBs_Detail1.SetValue("U_TB", oDBs_Detail1.Offset, oRS.Fields.Item("U_TLPrice").Value)
oDBs_Detail1.SetValue("U_Qty", oDBs_Detail1.Offset, oRS.Fields.Item("U_Qty").Value)
oBillMat.SetLineData(i)
oBillMat.FlushToDataSource()
oRS.MoveNext()
Next -
How to join two tables with no similar columns
Hi all,
I have two tables as follows:
Table T1 have Attributes as follows:
GLCODE,
BRANCH,
ITEM_NUMBER,
DEMAND_DATE,
QUANTITY,
SOURCE
Table T2 have Attributes as follows:
FORECAST_DATE
Now in SQL if run the following stattement iam getting out put.
SELECT GLCODE,BRANCH,ITEM_NUMBER,DEMAND_DATE,QUANTITY, SOURCE,(SELECT DISTINCT FORECAST_DATE FROM T2) FROM T1
The above SQL Statement giving correct results for me.
The same SQL Statement how can we implement in mapping level?
Regards,
AvaJaap van,
>
You have to specify an outer join, but how do you do that if there is no join to begin with? I would do the following (which I didn't test yet):
add an extra column (say C_JOIN) to the T2-ingroup of the join operator and fill it with from a constant operator with say value 1. Then use T2.C_JOIN (+) = 1 as the join condition.
If every record in T2 is guaranteed to have the same value, instead of using a deduplicator, which will read all records, sort them and deduplicate them, you can use a filter with filter condition ROWNUM < 2, which only will read one record.
I am facing almost the same problem but not entirely thou and I was wondering if you have an idea how to even start.
Problem:
I got this table:SQL> desc ita.tpis32_job_status
Name Null? Type
JOBID NOT NULL NUMBER
T1_ID NUMBER
QID NUMBER
REQ_TYPE VARCHAR2(10)
SUBMIT_TIME DATE
OWNERID VARCHAR2(30)
DESCRIPTION VARCHAR2(150)
STARTTIME DATE
ENDTIME DATE
STATUS VARCHAR2(50)
ERROR_ID NUMBER
TABLE_NAME VARCHAR2(30)
SERVER_ID VARCHAR2(10)
DATABASE VARCHAR2(20)
PRIORITY NUMBER
NUM_LINES NUMBER
PROCESS_ID NUMBER
QUE_TIME NUMBER
STATUS_CODE NUMBER
ERROR_MSG VARCHAR2(500)
NUM_LINES_TS NUMBER
REMOTE_STATUS NUMBER
This the above table, i am looking for JOBID (a five digit number) like 25875.
What I want to do is add or append this five digit number to a string to find the corresponding table in dba_tables or all_tables. The only way I have try to do this is by writing PLSQL as you see from here:
Re: Use PLSQL to delete tables dynamically
When the select is writing properly, the result of the five digit number from JOBID and the string should look like the below result (job_(five digit_%).
My problem is there is no relationship between ALL_TABLES and the my own table (ita.tpis32_job_status). Any help will be appreciated.
TABLE_NAME
JOB_58871_OUTDATA
JOB_58868_TS
JOB_58868_OUTDATA
JOB_58867_TS
JOB_58867_CMDLBL_2
JOB_58867_OUTDATA
JOB_58866_TS
Maybe you are looking for
-
How many times can you pay the 99 dollar replacement on an ipod 4g?
I had an ipod touch and broke it so we paid the 99 dollars to have it replaced and have a new one and then I broke that one (Im not the most graceful person) after two months I broke that one would i still be able to pay 99 dollars to get another new
-
Error while updating track after migration
Hello Experts, We are trying to update DTR,CBS and runtime system details in CMS after system is migrated to new hardware,but getting following error. Even after changing system details in landscape configuration,system is trying to reach old server
-
I'm trying to create a PDF for my students to take notes on during class but I don't want them to be able to copy and paste the notes. I'm using adobe professional to create the PDF.
-
How do I get text in front of a picture in Pages '09?
I have to put a picture as the background to a document. I've brought down the opacity but now I can't figure out how to get the picture to go behind the text. When I right click it there's an option to bring it forward or backward but it won't let m
-
Strange behaviour of adapter engine
Hi guys, I´m working at a Idoc 2 File Scenario. From the source Idoc there should be created 2 files with special file names including the timeSent of the idoc and different contents. For that I have specified 2 interfaces and interface mappings in i