NULL COLUMN ON DATABASE TABLE
HELLO AGAIN TO EVERYONE AND TO EVERY ONE WHO IS BEEN REPLYING MY MESSAGES,
I AM STIL HAVING PROBLE WITH MY JSP AND FORM(HTML).
THE PROBLEM IS , THE NAMECOLUMN OF MY DATABASE REMAINS NULL WHEN I QUERY IT AFTER ENTERING DATA THROUGH THE FORM.COLUMN TYPE IS A VARCHAR . THE DATA ENTERED IS BEEN ENTEREDTHROUG THE request.getParameter() method OF THE JSP I DONT SEEM TO FIND ANY ERROR WITH MY CODE.
THE CODE ARE PROVIDED BELOW.CAN ANYONE TELL ME WHAT IS HAPPENING BEHIND THE SCENE ON THE NAME COLUMN .I AM NEW TO JSP.
jsp code
try{
Class.forName("com.mysql.jdbc.Driver");
conn= DriverManager.getConnection("jdbc:mysql://localhost/school","barth","barth");
// stat = conn.createStatement();
// String name1 = request.getParameter( "name ");
//int idnum = Integer.parseInt( request.getParameter("id") );
//int age2 = Integer.parseInt( request.getParameter("age") );
PreparedStatement stat = conn.prepareStatement(" INSERT INTO student " +
" VALUES( ?, ? ,?)");
stat.setInt(1,Integer.parseInt( request.getParameter("id") ));
stat.setString(2, request.getParameter( "name "));
stat.setInt(3,Integer.parseInt( request.getParameter("age") ));
stat.executeUpdate();
conn.close();
catch(Exception e)
{e.printStackTrace();}
sample of database table column.
*******************************************************************************mysql> select * from student;
| id | name | age |
| 10 | NULL | 76 |
| 10 | NULL | 76 |
| 9 | NULL | 34 |
| 11 | NULL | 45 |
| 12 | NULL | 23 |
14 rows in set (0.13 sec)
mysql>
First of all, don't use all CAPS when typing, it gets difficult to follow your text! Also try putting your code in [ code ] -tags in the future, it's so much easier to follow code that way.
Looking at your database it appears as if name isn't holding a value when you use it in your database call.
Verify that it *IS holding a value, you can do that by printing it to the console, i.e.
System.out.println( request.getParameter("name") );
Similar Messages
-
How to find out the NULL columns in the table?
Hi,
Please provide the query to find the null columns in the table. Here, all rows in the table have same column as null. It won't change.
Table
c1 c2 c3 c4
X C 10
T D 20
I wanna find out as C2 is the nullable column.
Thanks in advance !!
Regards,
Vissu....Below code might be solution for finding NULL valued in columns in a table and if it is solution .kindly give me points for the same.
declare
cursor col_cur is
select column_name
from user_tab_cols -- all_tables can also be used in case the table is present in own schema
where table_name = 'TABLE_NAME'; --provide the TABLE_NAME
stmt varchar2(1000):= '';
v_count number;
count_null number;
begin
execute immediate 'select count(*) from TABLE_NAME' into v_count; --provide the TABLE_NAME
for rec in col_cur loop
execute immediate 'select count(*) from TABLE_NAME' where --provide the TABLE_NAME
'||rec.column_name||' IS NULL' into count_null;
if count_null = v_count then
stmt :=stmt|| rec.column_name ||chr(13);
end if;
end loop;
dbms_output.put_line(stmt);
end ; -
Script to add not null columns to all tables in database
Hello,
I need to add 5 not null columns to my existing database (all tables).
The problem is that i do not want to loose the current data.
I need a script so that i need not do this manually for each table.
Can u suggest?
VishalHello,
I need to add 5 not null columns to my existing database (all tables).
The problem is that i do not want to loose the current data.
I need a script so that i need not do this manually for each table.
Can u suggest?
Vishal I always follow this step
1) Alter table <<tablename>> add(<<columnname>> <<datatype>>)
2) Update <<tablename>> set <<columnname>>=<<anyvalue>>
3) Alter table <<tablename>> modify(<<columnname>> <<datatype>> not null)
else
1) rename <<tablename>> to <<tablenamebk>>
2) drop table <<tablename>>
3) Alter table <<tablenamebk>> add(<<columnname>> <<datatype>>)
4) update <<tablenamebk>> set <<columnname>>=<<anyvalue>>
5) create table <<tablename>> (with additional columns with not null)
6) insert into <<tablename>> select * from <<tablenamebk>> -
How to insert message style text columns in database tables
Hi All,
i have two pages.
in first page segment1 lov is their.once u select the segment1 and click on the create button its navigate to next page.
and display the releted segment1 details(these columns are message text input fields but read only columns).
plz help me those columns are insert into database tables.
its very urgent
Thanks
Latha.Hi Anil,
plz help me still i am faceing the problem
so plz help me because i dont know java.
i wrote below code and i got the below error.
if(pageContext.getParameter("Submit")!=null)
String projnumber=pageContext.getParameter("ProjectNO");
//String projectnumber=pageContext.getParameter("Projectnumber");
String oldoperationid=pageContext.getParameter("EmployeeNumber");
String newManagerName=pageContext.getParameter("NewManagerName");
String ProjectID=pageContext.getParameter("ProjectID");
String OldOperationName=pageContext.getParameter("OperationsManager");
String OldOperationID=pageContext.getParameter("OldOperationID");
OAMessageTextInputBean projnumberbean =webBean.findIndexedChildRecursive("ProjectNO");
String projnumber=null;
if(bean!=null)
projnumber = (String)projnumberbean.getValue(pageContext);
Serializable[] params = {projnumber,oldoperationid,newManagerName,ProjectID,OldOperationName,OldOperationID};
am.invokeMethod("xxinsertpagelogic",params);
and i wrote import also.
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
my errors are
Error(64,78): incompatible types; found: oracle.apps.fnd.framework.webui.beans.OAWebBean, required: oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean
Error(65,13): duplicate definition of variable projnumber in method processFormRequest(oracle.apps.fnd.framework.webui.OAPageContext, oracle.apps.fnd.framework.webui.beans.OAWebBean)
Error(66,9): variable bean not found in class wnsgs.oracle.apps.pa.projectinfo.webui.ProjectInfoCreateCO
plz help me.
its very urgent
Thanks
Edited by: Latha on Jan 4, 2012 9:57 PM
Edited by: Latha on Jan 4, 2012 10:00 PM -
Dynamic creation of column in database table
Can I create columns in a database table dynamically?
Let's say I have two columns in a table. Users requested to have dynamic columns in the table. They wanted to create any no. of fields in the table dynamically. We can't alter the table every now and then. Is there any solution for this. Please let me.
Your early response is highly appreciated.
ThanksI can't use "Alter" statement every time. User may need to insert any no.of columns dynamically. There is no fixed columns. Right now there are two columns which are static. Somebody said it is durable through XML. Can you please let me know in detail. I haven't not done anything using XML.
Thanks for the response. -
Change Date Column in database table format from mm/dd/yyyy to dd/mm/yyyy
Hi I use Jdeveloper 11G with an Oracle Database.
My table is empty currently but I am importing some excel columns into it and the dates in them are throwing errors because you have some dates like 14/09/2012 which would mean the month is out of range even though its not.
This seems like a simple thing to do but I was unable to find how online.
Please HelpI'm not sure I understand COlumn Type is DATE
There is no Simple Date type. This is DATABASE, has nothing to do with Entities and Views etc. This is straigh in the Database Table.
Edited by: Dino2dy on Nov 6, 2012 5:47 AM -
Check which column in database table is updated without hard code
Hi ,
I have a requirement to detect if there is a particular column in the database table is updated , and this column name is found in mapping table ( business logic ) , it will do an insertion to another special table.
My idea is to introduce a trigger before update or delete on this table
However , i would like to make it as dynamic as possible
i dont want to use things as below in trigger if possible
1. if ( old.name <> new.name ) then {
if( 'name' is inside the mapping table ) {
// do some insertion
I want things like
2. if ( there is a column updated on this table ){
1. select column name and updated value that is updated
2. if the column name that is updated is inside the mapping table {
// do some insertion
I am not really sure if the pseudo code listed in no 2 is achieveable in oracle using simple pl/sql or sql ?
if possible , how to do it ?
ThanksHi,
Check the link given below
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg13trg.htm
and search for
IF UPDATING THEN*009* -
Hi All,
Am using OPENROWSET to load the file data into table, here the problem is i need to map same input value to two different columns of table, As format file doesn't allow the duplicate numbers am unable to insert same value to two columns, please help me to
find a solution for this.
i can use only OPENROWSET because i need to insert some default values also which come based on file. only the problem is how to map same input value to two different columns of table. please give me the suggestions.
Thanks,
SudhakarFrom what you say:
INSERT tbl(col1, col2)
SELECT col1, col1
FROM OPENROWSET(....)
But I guess it is more difficult. You need to give more details. What sort of data source do you have? What does your query look like? The target table?
Erland Sommarskog, SQL Server MVP, [email protected]
Hi Erland,
Thanks for your response
my source file is text file with | symbol separate for ex:
1002|eTab |V101|eTablet|V100|Logic|LT-7|Laptops|SCM
Database table have columns like
column1,column2,column3...etc, now i need to insert same value from input file into two columns for ex:
the eTab value from text file has to be insert into column2 and column3 of
table
we cannot change format file like below one
for the above situation how can we insert eTab into column2 and column3
Thanks,
Sudhakar. -
Dropping unused columns from database table
I have an existing table called TUSER. I have mapped some fields, but not
all fields, as some are inserted by other applications and for reporting
purposes.
I am using JDK 1.3.1_02, Windows 2000, SQL Server 2000 database, Kodo
JDOEE 2.2.6 and JBoss 3.0.0.
When I refresh the datastore it drops all columns that are not mapped
(note that these colums can contain null values):
[java] [ connection: 2961925; statement: 2766626; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER ADD Job_Title_ID VARCHAR(255)
[java] [ connection: 2961925; statement: 1582473; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MAILUSERID
[java] [ connection: 2961925; statement: 5237832; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PHONENUMBERS
[java] [ connection: 2961925; statement: 2191491; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN EMPLOYEENO
[java] [ connection: 2961925; statement: 894443; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MDATE
[java] [ connection: 2961925; statement: 531758; time: Thu Jul 04
15:33:22 JST 2002 ] ALTER TABLE TUSER DROP COLUMN STATUSCHANGETIME
[java] [ connection: 2961925; statement: 5899013; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN FINISHDATE
[java] [ connection: 2961925; statement: 8146001; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN LASTLOGGEDMBOARD
[java] [ connection: 2961925; statement: 7756310; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN DEL_FLG
[java] [ connection: 2961925; statement: 6817858; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PERMIT_CD
[java] [ connection: 2961925; statement: 7754670; time: Thu Jul 04
15:33:23 JST 2002 ] ALTER TABLE TUSER DROP COLUMN LASTLOGGEDREQUESTER
[java] [ connection: 2961925; statement: 7332084; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MSG_SERVER
[java] [ connection: 2961925; statement: 1691809; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN AUTORUN
[java] [ connection: 2961925; statement: 5253969; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN REG_DATE
[java] [ connection: 2961925; statement: 4977422; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN PERMIT_LST
[java] [ connection: 2961925; statement: 4343712; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN ALLOWREPL
[java] [ connection: 2961925; statement: 7104150; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN EMAIL
[java] [ connection: 2961925; statement: 4395840; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MANAGERSTATUS
[java] [ connection: 2961925; statement: 2417379; time: Thu Jul 04
15:33:24 JST 2002 ] ALTER TABLE TUSER DROP COLUMN MD5_DIGEST
[java] [ connection: 2961925; statement: 2865120; time: Thu Jul 04
15:33:25 JST 2002 ] ALTER TABLE TUSER DROP COLUMN SMTPADDRESS
15:33:25 JST 2002 ] INSERT INTO JDO_SCHEMA_METADATAX(CLASSNAMEX) VALUES
('com.gulfnet.g
roupcast.data.User')
Is this meant to happen? I am guessing not. Is there a way to tell the
schematool to not remove existing columns?
Thanks in advance.
KamYou can in fact tell the schematool not to drop columns it doesn't know about. When you run the schematool, use the "add" action rather than "refresh". Then it will only add columns, never drop them. See the documentation for details:
http://www.solarmetric.com/Software/Documentation/2.2.5/manual.html#schema_manipulation -
Auto Increment column in database table
Hello experts, I am using oracle 11g database at windows 7.I have to create a sequence object and a table with an auto increment ID column.For this I have created a trigger before insert to select next sequence from a sequence object. It works well but Now I have the current sequence is 7 and there are 6 records inserted in table. Now I delete two records.Thus I have only 5 records in table but my current sequence is still 7.So if I put it in id column then a new record will be inserted in table with 7 ID number after 5th ID number.I want this record should be inserted with 6 Id number. For this I tried to not use sequence object.I tried a pl/sql trigger before insert, which will count the all records in table and after increment i put it in ID column to insertion....Is this a professional way..? thank You regards aaditya
979801 wrote:
Hello experts, I am using oracle 11g database at windows 7.I have to create a sequence object and a table with an auto increment ID column.For this I have created a trigger before insert to select next sequence from a sequence object. It works well but Now I have the current sequence is 7 and there are 6 records inserted in table. Now I delete two records.Thus I have only 5 records in table but my current sequence is still 7.So if I put it in id column then a new record will be inserted in table with 7 ID number after 5th ID number.I want this record should be inserted with 6 Id number. For this I tried to not use sequence object.I tried a pl/sql trigger before insert, which will count the all records in table and after increment i put it in ID column to insertion....Is this a professional way..? thank You regards aaditya
Sequences only guarantee unique numbers. You cannot (and should not) attempt to create gapless sesquences. That's not how oracle works and will not scale to a multi user application.
Imagine two people try to insert records at the same time (and have yet to commit), the trigger you create will count the number of records and determine there are 5 records, so assign the next number of 6, for both people who are inserting records. The first person to commit will get their data saved, and assuming you have a unique constriaint on that id, the second person will raise a duplicate key on insert or suchlike error.
Gapless sequential numbers are not appropriate to multi-user environments. Such requirements are often given by managers or business people who do not understand the technology.
Think of it in terms of a real world office, but with people using a paper system instead of a computer. The only way you can try to guarantee people get the next number and also re-use numbers that have been deleted is to have a single place where each person in the office goes to, to fetch the next number, and they have to queue up behind each other to get the next one off the list. But if someone has removed an old record, they've got to wait in the same queue to go and put that number back in the pot for someone else to use. It just doesn't work, even in a manual system. Yes, people can guarantee that they're only getting unique numbers that nobody else is using, but they cannot guarantee that they are reusing and filling gaps etc. It's an unrealistic expectation. -
Hi Team,
Am using BULK INSERT Format file option to load data into table from .txt file here am facing an issue i.e ibased on input file i need to insert default values to some columns of table so we can not declare it on table level, Can we give default values in
format file ? if we can give how it is ? or Any alternate possibilities to this scenario instead of BULK INSERT ?
Thanks,
SudhakarThanks for your response, here i don't have any rights to change table structure the table is created by different team, my work is to load data from file to table. Is there any chance to supply default values by*XML* format file instead of *.fmt* file
please let me know the possibility.
Again, no. If you want to supply default values that are not present in DEFAULT constraints in the table definition, you will need to write your own code. There are plentyfull of options, and I have mentioned some already.
Here are some more:
* Table-valued parameters, see here for examples:
http://www.sommarskog.se/arrays-in-sql-2008.html
* Use BULK INSERT to load data to a staging table, and then apply the default values when you copy from staging to target.
Erland Sommarskog, SQL Server MVP, [email protected] -
Insert direct column from database table and function value into a table
Hi All,
Please resolve this query for me....
Suppose my select query is like this
Select empno from EMP; (simple select)
Select fun_dept(empno) from dual;(function)
i want both the output of the select query to be written into a table like this....
Suppose out of the First Select query is ..... 45009
Output for the Second Query is...................ECE
i want to insert this output into a table...like
something like this
XX:
Empno Dept
45009 ECE
how to do this..??
Thanks in Advance,
Regards,
GitaMy exact query is like this.
create or replace function fun_sal(v_rno number,v_year number,v_period number)
return number as
cursor s is
select salary from emp where eno=v_rno and eyear=v_year and eperiod=v_period;
begin
open s;
loop
exit when s%notfound;
fetch s into v_sal;
if v_sal<1000 then
sal:=v_sal*1555;
else
sal:=0;
return sal;
end if;
end loop;
close s;
end;
create or replace procedure pro_act(v_rno number,v_year number,v_period number) as
v_eno number(10);
v_ename varchar2(10);
cursor c is
select eno,ename from emp where eno=v_rno and eyear=v_year and eperiod=v_period;
begin
open c;
loop
exit when c%notfound;
fetch c into v_eno,v_ename;
insert into master(empno,empname,rev_salary)values(v_eno,v_ename,"*****function fun_sal value has to come here*******");
commit;
end loop;
close c;
end;
how to do.... -
Oracle XML functions return tags for null columns.
I am currently writing a SOAP Message base on a SQL statement formatted as XML. However, I am having problems with Oracle XML functions not returning tags for null columns as seen in my example below. Is the a way to get Oracle XML functions to return empty tags for null column?
CREATE TABLE FOREXAMPLE_TABLE (COLUMN_1 VARCHAR2 (4000),
COLUMN_2 VARCHAR2 (4000),
COLUMN_3 VARCHAR2 (4000));
INSERT INTO FOREXAMPLE_TABLE (COLUMN_2)
VALUES ('This column is not null');
COMMIT;
SELECT XMLELEMENT ( "soap:Envelope",
XMLATTRIBUTES ( 'http://schemas.xmlsoap.org/soap/envelope/' AS "xmlns:soap"),
XMLELEMENT ( "soap:Body",
XMLATTRIBUTES ( 'http://Custom_Column/types/' AS "xmlns:ns1"),
XMLELEMENT ( "ns1:New_Instance",
XMLELEMENT ( "ns1:Input_XMLDoc",
XMLFOREST(fe.COLUMN_1 as "Column_1",
fe.COLUMN_2 as "Column_2",
fe.COLUMN_3 as "Column_3"))))) as xml
FROM FOREXAMPLE_TABLE fe
The results returned from the select statement.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/"><ns1:New_Instance>
<ns1:Input_XMLDoc><Column_2>This column is not null</Column_2>
</ns1:Input_XMLDoc></ns1:New_Instance></soap:Body></soap:Envelope>
The desired results for the select statement.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/"><ns1:New_Instance>
<ns1:Input_XMLDoc><Column_1></Column_1>
<Column_2>This column is not null</Column_2><Column_3></Column_3>
</ns1:Input_XMLDoc></ns1:New_Instance></soap:Body></soap:Envelope>
jeemanAn alternative may be be to use xmlconcat instead of xmlforest:
Time Start: 30.06.2007 18:52:41
PL/SQL procedure successfully completed.
michaels> select xmlelement
("soap:Envelope",
xmlattributes
('http://schemas.xmlsoap.org/soap/envelope/' as "xmlns:soap"),
xmlelement
("soap:Body",
xmlattributes ('http://Custom_Column/types/' as "xmlns:ns1"),
xmlelement ("ns1:New_Instance",
xmlelement ("ns1:Input_XMLDoc",
xmlconcat (xmlelement("Column_1", fe.column_1),
xmlelement("Column_2", fe.column_2),
xmlelement("Column_3", fe.column_3)
).extract('.').getstringval() as xml
from (select null column_1, 'This column is not null' column_2,
null column_3
from dual) fe
XML
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/">
<ns1:New_Instance>
<ns1:Input_XMLDoc>
<Column_1/>
<Column_2>This column is not null</Column_2>
<Column_3/>
</ns1:Input_XMLDoc>
</ns1:New_Instance>
</soap:Body>
</soap:Envelope> -
I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1. I am not sure how to do it. SOmeone please help me out.
Hi ,
In your write back XML try the below query insert
INSERT INTO TABLE_XYZ (attribute1) values (SELECT CASE WHEN @{C1}=’Yes’ then 1 when @{C1}=’No’ then 0 else null end from dual)
Regards
Rajagopal -
Introduction
In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
EmailAddress Parameter
Comment
[email protected] 2012,2013,2014 NULL
In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
Workaround
Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
EmailAddress Parameter Comment
[email protected] 2012 NULL
[email protected] 2013 NULL
[email protected] 2014 NULL
In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
From
Expression:[ParameterName]
Operator :In
Value :[@ParameterName]
To
Expression:[ParameterName]
Operator :In
Value :Split(Parameters!ParameterName.Value,",")
In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
Applies to
Microsoft SQL Server 2005
Microsoft SQL Server 2008
Microsoft SQL Server 2008 R2
Microsoft SQL Server 2012
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.For every Auftrag, there are multiple Position entries.
Rest of the blocks don't seems to have any relation.
So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
Try out this snippet.
DATA lt_data TYPE TABLE OF string.
DATA lv_data TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = 'C:\temp\test.txt'
CHANGING
data_tab = lt_data
EXCEPTIONS
OTHERS = 19.
CHECK sy-subrc EQ 0.
TYPES:
BEGIN OF ty_str,
a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
p1 TYPE string,
p2 TYPE string,
p3 TYPE string,
END OF ty_str.
DATA: lt_str TYPE TABLE OF ty_str,
ls_str TYPE ty_str,
lv_block TYPE string,
lv_flag TYPE boolean.
LOOP AT lt_data INTO lv_data.
CASE lv_data.
WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
lv_block = lv_data.
lv_flag = abap_false.
WHEN OTHERS.
lv_flag = abap_true.
ENDCASE.
CHECK lv_flag EQ abap_true.
CASE lv_block.
WHEN '[Auftrag]'.
SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
WHEN '[Position]'.
SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
APPEND ls_str TO lt_str.
ENDCASE.
ENDLOOP.
Maybe you are looking for
-
How to use create, delete, modify butttons in a table
hi all in my application i have emp table in my source view in that table i have inserted static data in columns i.e., empid, empname. i have 3 buttons create, delete, modify buttons in that table. when i press Create button it navigates to another v
-
Playing a playlist with multiple albums in Grid View in iTunes 8
Hi All, Here is a situation I came across, that was quite unexpected compared to the behaviour in iTunes 7. Suppose I have a playlist with multiple artists/albums. I have this playlist in Grid View. I choose this playlist from the left side navigatio
-
Why can I no longer use a period in a file name for Adobe Reader?
I was using Google Chrome to view pdf's but Chrome wasn't following the field tabbing order of the pdf. To resolve this issue, I decided to try disabling Chrome's pdf viewer so that pdf's would open in Adobe Reader. It didn't go as planned and deci
-
Blackberry not receiving email or accessing internet
My Blackberry Bold 9650 is not receiving email from any of my 3 accounts and it is not accessing the internet. I know this happened once before. I ran the diagnostic for the under options - mobil network. But I don't remember what to do next. Please
-
I forgot my password for ParentalControls on my iMac G5 with OS X 10.5.8
I am losing my mind. I created a ridiculous password to protect my son and now I cannot remember the password. I want to reformat the entire computer, reinstall the original software discs that came with the computer (Mac OSX Install Disc) but sinc