How to get internal table with maximum value of a field in other internal
Let say I have an table itab consisting of:
itab-matnr = marm-matnr.
itab-umren = marm-umren.
itab-ean11 = marm-ean11.
there are many "ean11" for one "matnr"
How could I create itab2 with only "biggest" "ean11". could you give me examlple
Hi,
data: mat_no type MATNR.
Loop at ITAB1.
IF mat_no = itab1-matnr.
here check the ean11 with previos ean11(Store it like matnr), and move the biggest one andf modify that row or move that in ITAB2 with a Modify statment, so that there will no second row with same material No
ENDIF.
MAT_NO = ITAB1-Matnr (Moving Itab1 material no to a Local field)
ENDLOOP.
Endloop.
Similar Messages
-
How to get the table with no. of records after filter in webdynpro
Dear Gurus,
How to get the table with no. of records after filter in webdynpro?
Thanks in advance.
SankarHello Sankar,
Please explain your requirement clearly so that we can help you easily.
To get the table records from your context node use method get_static_attributes_table()
data lo_nd_mynode type ref to if_wd_context_node.
data lt_atrributes_table type wd_this->elements_mynode.
lo_nd_mynode = wd_context->get_child_node( name = wd_this->wdctx_mynode ).
lo_nd_mynode->get_static_attributes_table( importing table = lt_atrributes_table ).
Note: You should have already defined your context node as a Dictionary Structure.
BR,
RAM -
Query to insert a row in a table with same values except 1 field.
Suppose I have a table with 100 columns(fields).
I want to insert a row with 99 fileds being the same as previous ones except one fileld being different.
The table doesn't have any constraints.
Kindly suggest a query to solve the above purpose..And for much more lazy people, a desc of table is shorter to write. :-)
Then copy & paste into any editor, then mode column to add a comma after every column name in one shot.Or have the system do it for you. Be lazy.
SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '';
Indeed, it can be converted to a script called desc(.sql)
SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '&1' ORDER BY Column_Id;
Then desc or @desc. -
How to create a table with distinct values ?
I want to create a new table based on an existing table distinct values only, how can I avoid to create the duplicate values ?
e.g.
table1
field1 field2
0001 ABD
0001 ABD
0002 DCF
0002 DCF
new table
field1 field2
0001 ABD
0002 DCF
thankscreate table table2
as
select distinct field1,field2
from table1 -
How to get the table of value field? and can we expand the technical limits
Dear
I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
We have a note for R.4.x Please see below:
OSS note 160892
You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
David Sun
Regards!how to extend the limit of value numbers? please see the original question.
-
How to create a table with varied number of columns?
I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
Can I do it? How? Thanka a lot.Why did you create a new thread for this?
How to create a table with varied number of columns? -
How to get updated table values from objectlistdataproviders
how to get updated table values from objectlistdataproviders
Hi,
Here is a sample code
start-of-selection.
*Select the data you need into an internal table
loop at it_mara into wa_mara.
data that needs to be displayed in the output list
write:/ box as checkbox,
wa_mara-matnr under text-001,
wa_mara-maktx under text-002,
wa_mara-lgort under text-003.
Hide the data that needs to moved to internal table
hide:wa_mara-matnr, wa_mara-maktx, wa_mara-lgort.
endloop.
clear wa_mara.
end-of-selection.
lines = sy-linno.
at line-selection.
clear:it_matnr.
do lines times.
check sy-index > 1.
box = space.
read line sy-index field value box.
if box = 'X'.
*data selected using check box is moved to internal table
append wa_mara to it_matnr.
endif.
enddo.
Regards,
Jisha. -
How to get internal table from SAP Data Provider C#
Hello.
ABAP:
DATA: lt_t001 TYPE TABLE OF t001.
DATA: url(1000) TYPE c.
SELECT * INTO TABLE lt_t001 FROM t001.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'APPLICATION'
subtype = 'X-R3TABLE'
TABLES
data = lt_t001
CHANGING
url = url
EXCEPTIONS
OTHERS = 4.
C#:
using SAPDataProvider;
using SAPTableFactoryCtrl;
public void SetDataFromUrl(string url)
SAPDataProviderClass p = new SAPDataProviderClass();
p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
SAPTableFactoryClass tf = new SAPTableFactoryClass();
Table tb = (Table)tf.NewTable();
tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
How to get internal table from SAP Data Provider ?Hi Sergey,
I'm trying to do the same, have you found a solution to solved it?
thanks for your help.
Regards.
Jonathan -
How can I get the variable with the value from Thread Run method?
We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
How can I get the variable with the value?
This is sample code:
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run method "+sathr.x);
// I should get Inside the run method::: But I get only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to read it from external method. This I dont want to doWe want to access a variable from the run method of a
Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
Even
though I make the variable as public /public static, I
could get the value till the end of the run method
only. After that scope of the variable gets lost
resulting to null value in the called method/class..
I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
public class SampleSynchronisation
public static void main(String[] args)
SampleSynchronisation app = new SampleSynchronisation();
public SampleSynchronisation()
MyRunnable runner = new MyRunnable();
new Thread(runner).start();
// yield this thread so other thread gets a chance to start
Thread.yield();
System.out.println("runner's X = " + runner.getX());
class MyRunnable implements Runnable
String X = null;
// this method called from the controlling thread
public synchronized String getX()
return X;
public void run()
System.out.println("Inside MyRunnable");
X = "MyRunnable's data";
} // end class MyRunnable
} // end class SampleSynchronisation>
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run
method "+sathr.x);
// I should get Inside the run method::: But I get
only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to
read it from external method. This I dont want to do -
How can I get the variable with the value from Thread's run method
We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
How can I get the variable with the value?
This is sample code:
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run method "+sathr.x);
/* I should get:
Inside the run method
But I get only:
Inside*/
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to read it from external method. This I dont want to doYour main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.
-
How to get the latest credit limit values per each customer in the report.
Hi All,
Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
I have below requiremnt.
I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
one more thing these credit limits should roll up correctly at the HTR level.
One HTR having number of customers .
for example HTR 100 can have customer number 200,300,400.
Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
Example below :
Cube DATA :
HTR Customer Doct number Credit managment view
100 200 10001 200
100 200 10002 200
100 300 10004 300
100 300 10005 300
100 400 10006 400
100 400 10007 400
100 400 10008 400
Master data tabel (P Table)(Credit managment view)
Credit managment view Credit limits
200 1000.00
300 50000.00
400 90000.00
Please remeber :
We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .Create a formula variable of type replacement path with reference as attibutes of Credit management view and choose your key figure credit limit,say zcredit.
Now create a formula or CKF and use zcredit.
This should display the credit limit in your report as normal key figure.
I didnot get this part "one more thing these credit limits should roll up correctly at the HTR level.", may be the above will solve this too.Try it.
Hope this helps. -
How to get pivot table by using dates
Hi,
How to get pivot table by using dates in column.
Below is the sample table and its value is given.
create table sample1
Order_DATE DATE,
order_CODE NUMBER,
Order_COUNT NUMBER
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,232);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,935);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,43);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,5713);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,11346);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,368);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,1380);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,133);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,7109);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,14336);
select * from sample1;So how to get the data like below.
order_date
order_code 30-sep-12 29-sep-12
1 232 368
2 935 1380
3 43 133
4 5713 7109
5 11345 14336Using the extra data I inserted in my previous reply:select ORDER_CODE,
SUM(DECODE(extract (month from ORDER_DATE),1,ORDER_COUNT,0)) JAN,
SUM(DECODE(extract (month from ORDER_DATE),2,ORDER_COUNT,0)) FEB,
SUM(DECODE(extract (month from ORDER_DATE),3,ORDER_COUNT,0)) MAR,
SUM(DECODE(extract (month from ORDER_DATE),4,ORDER_COUNT,0)) APR,
SUM(DECODE(extract (month from ORDER_DATE),5,ORDER_COUNT,0)) MAY,
SUM(DECODE(extract (month from ORDER_DATE),6,ORDER_COUNT,0)) JUN,
SUM(DECODE(extract (month from ORDER_DATE),7,ORDER_COUNT,0)) JUL,
SUM(DECODE(extract (month from ORDER_DATE),8,ORDER_COUNT,0)) AUG,
SUM(DECODE(extract (month from ORDER_DATE),9,ORDER_COUNT,0)) SEP,
SUM(DECODE(extract (month from ORDER_DATE),10,ORDER_COUNT,0)) OCT,
SUM(DECODE(extract (month from ORDER_DATE),11,ORDER_COUNT,0)) NOV,
SUM(DECODE(extract (month from ORDER_DATE),12,ORDER_COUNT,0)) DEC
from SAMPLE1
where trunc(order_date, 'YY') = trunc(sysdate, 'YY')
group by order_code
order by order_code;
ORDER_CODE JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
1 0 0 0 0 0 0 0 0 600 600 0 0
2 0 0 0 0 0 0 0 0 2315 2315 0 0
3 0 0 0 0 0 0 0 0 176 176 0 0
4 0 0 0 0 0 0 0 0 12822 12822 0 0
5 0 0 0 0 0 0 0 0 25682 25682 0 0Now a bit of explanation.
1) Whenever you pivot rows to columns, no matter what version of Oracle and no matter what method you use, you have to decide in advance how many columns you are going to have and what the names of the columns are. This is a requirement of the SQL standard.
2) I use the WHERE clause to get just the data for this year
3) With EXTRACT, I get just the month without the year.
4) Using DECODE, I put every month's data into the correct column
5) Once I do all that, I can just GROUP BY order_code while SUMming all the data for each month. -
How to get nested table meta data
how to get nested table column name, column type and column size
by using java. i need code for this.
please help me.The Follopwing program does display the the details of table. Hope you get the solution
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
public class Main {
public static void main(String[] args) throws Exception {
Connection conn = getOracleConnection();
System.out.println("Got Connection.");
Statement st = conn.createStatement();
st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM SCHEDULE_SET");
ResultSetMetaData rsMetaData = rs.getMetaData();
int numberOfColumns = rsMetaData.getColumnCount();
System.out.println("resultSet MetaData column Count=" + numberOfColumns);
for (int i = 1; i <= numberOfColumns; i++) {
System.out.println("column MetaData ");
System.out.println("column number " + i);
// indicates the designated column's normal maximum width in
// characters
System.out.println(rsMetaData.getColumnDisplaySize(i));
// gets the designated column's suggested title
// for use in printouts and displays.
System.out.println(rsMetaData.getColumnLabel(i));
// get the designated column's name.
System.out.println(rsMetaData.getColumnName(i));
// get the designated column's SQL type.
System.out.println(rsMetaData.getColumnType(i));
// get the designated column's SQL type name.
System.out.println(rsMetaData.getColumnTypeName(i));
// get the designated column's class name.
System.out.println(rsMetaData.getColumnClassName(i));
// get the designated column's table name.
System.out.println(rsMetaData.getTableName(i));
// get the designated column's number of decimal digits.
System.out.println(rsMetaData.getPrecision(i));
// gets the designated column's number of
// digits to right of the decimal point.
System.out.println(rsMetaData.getScale(i));
// indicates whether the designated column is
// automatically numbered, thus read-only.
System.out.println(rsMetaData.isAutoIncrement(i));
// indicates whether the designated column is a cash value.
System.out.println(rsMetaData.isCurrency(i));
// indicates whether a write on the designated
// column will succeed.
System.out.println(rsMetaData.isWritable(i));
// indicates whether a write on the designated
// column will definitely succeed.
System.out.println(rsMetaData.isDefinitelyWritable(i));
// indicates the nullability of values
// in the designated column.
System.out.println(rsMetaData.isNullable(i));
// Indicates whether the designated column
// is definitely not writable.
System.out.println(rsMetaData.isReadOnly(i));
// Indicates whether a column's case matters
// in the designated column.
System.out.println(rsMetaData.isCaseSensitive(i));
// Indicates whether a column's case matters
// in the designated column.
System.out.println(rsMetaData.isSearchable(i));
// indicates whether values in the designated
// column are signed numbers.
System.out.println(rsMetaData.isSigned(i));
// Gets the designated column's table's catalog name.
System.out.println(rsMetaData.getCatalogName(i));
// Gets the designated column's table's schema name.
System.out.println(rsMetaData.getSchemaName(i));
st.close();
conn.close();
public static Connection getOracleConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@son15644:1521:CXPqa1";
String username = "ess4qa2";
String password = "ess4qa2pw";
Class.forName(driver); // load Oracle driver
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
} -
How to get ALV Display with First column alone in sort
How to get ALV Display with First column alone in sort
HI,
You can build Internal Table and send this to the parameter "IT_SORT".
eg:
"the sorting Internal Table structure is as whown below.
DATA: t_sort_info type slis_t_sortinfo_alv.
"Build the Sort Internal Table
t_sort_info-fieldname = 'CARRID'.
t_sort_info-subtot = 'X'.
append t_sort_info.
t_sort_info-fieldname = 'FLDATE'.
t_sort_info-subtot = 'X'.
append t_sort_info.
Then pass this "IT_SORT_INFO" table to the Function module "Reuse_alv_*". (Note send the body of the Internal table only like "<b>IT_SORT = IT_SORT_INFO[]</b>".
Here i am making ALV output sorted on CARRID & FLDATE.
You can specify only the First Column name for sorting.
Regards,
Manju
Message was edited by:
MANJUNATHA KS -
How to create a table with events in smartforms?
How to create a table with events view in smartforms?
It doesn't like general table with header, main area and footer.
for example:
in smartforms: LE_SHP_DELNOTE
table name is TABLEITEM(Delivery items table)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.
Maybe you are looking for
-
Upgrading from Adobe Acrobat Pro 6.0?
I edit proofs in Adobe Acrobat Pro v6.0. The proofs are created in a more recent version and I'm encountering more and more problems with saving comments. I obvioulsy need to upgrade to a newer version. Will I have to buy a complete new program? Than
-
Took some pictures this weekend outside and the backgrounds are washed out. How do I edit that in Photoshop CS5 or Lightroom 3? I am still trying to learn these two programs. Any suggestions will be appreciated.
-
Can a website steal your email address when surfing on a mac
Can a website steal your email address just by visiting it on a Mac using Safari? (and without specifically entering the address on any newsletter sign ups or anything)
-
I'm in the process of moving from one version of OID to another. We use certificates and a java class to map incoming certificates to a user in the OID. Works fine and has for a long time. When I try the working code against the 10.1.4.3 OID instance
-
Satellite L775-12L refuses to open SD Card
Hello! I have a recent problem with my L775-12L laptop regarding SD Card Reader. Since yesterday my computer refuses to open SD Card while it was always working before. I didn't do anything with my computer and now when I insert my usual SDHC Card 8G