Getting data from tables
Hello All,
I have a scenario where I have two different software systems (SAP and xyz systems), where a intermediate table will be created between the two systems that is shared. Data will be updated by the xyz systems into this shared table. Now, my questions regarding this shared table.
1) Can we write some program or something to get the data from shared table to update the SAP?
2) If possible send me the suggestions
3) Please also send me the sample code to get the data from the shared table
Thanks in advance,
SDN powered
Isn't this something for XI?
You can create RFC's which can connect to other systems.
or you just place the data on the application server and schedule a daily job to retrieve data from that to fill an SAP table.
Similar Messages
-
Getting data from table BSEG taking too long ... any solutions.
Hello people I am currently trying to get data from table BSEG for one particular G/L Account Number With restrictions using For All Entries.
The problem is that even with such tight restrictions its causing my report program to run way too slow. I put an option where you dont have to access table bseg. And it runs just fine. (all of this is done during PRD Server).
My question is
1.) How come BSEG seems to make the report slow, even though I put some tight restrictions. <b>Im using For All Entries where Zuonr eq i_tab-zuonr</b>it seems to work fine in DEV and <b>hkont EQ '0020103101'</b>(Customer Deposits).
2.) Is there a way for me to do the same thing as what I mentioned in #1 but only much faster.
Thanks guys and take careHi
It should be better you don't read BSEG table if you haven't the keys BUKRS and BELNR, because the reading could take many times if there are many hits.
If you want to find out the records of G/L Account it's better read the index table BSIS (for open items) and BSAS (for cleared items), here the field HKONT is a key (and ZUONR too). So you can improve the performance:
DATA: T_ITEMS LIKE STANDARD TABLE OF BSIS.
SELECT * FROM BSAS INTO TABLE T_ITEMS
FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
AND HKONT = '0020103101'
AND ZUONR = I_ITAB-ZUONR.
SELECT * FROM BSIS APPENDING TABLE T_ITEMS
FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
AND HKONT = '0020103101'
AND ZUONR = I_ITAB-ZUONR.
Remember every kind of item has an own index tables:
- BSIS/BSAS for G/L Account
- BSIK/BSAK for Vendor
- BSID/BSAD for Customer
These table have the same informations you can find out from BSEG and BKPF.
Max -
Query OR Stored Proc to get data from Tables from All Schemas in the d/base
Hello Experts, (I appologize if i am not using the right way to ask questions)
I have a database, and it has around 400 schemas in it. I have designed a query which will fetch the data from three different table's from Schema1.
But it will be a tedious process of entering the 400 schemas names and pulling the information.
I would like to know as to what would be the best possible way to;
1) Look for all the schemas in the database
2) Look for those specific tables in the schema, which has the data in the tables.
3) If the tables are not present, than Ignore that schema and proceed further.
4) Load the data into a table
Any help, would appreciate it.
Thanks!
The query that i am using is as follows;
-- Query to select all the Schemas from the database
select username from all_users
order by username;
-- Sample Query to see if Tables exsist in the schema
SELECT DISTINCT OWNER, OBJECT_NAME
FROM ALL_OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME IN ('ENROLLMENT', 'PRDCT', 'L_P_L')
AND OWNER in ('Schema_1', 'Schema_2', Schema_3', Schema_4',Schema_5', Schema_6')
ORDER BY OWNER;
--Query to get the data from the tables in a Schema
select 'Schema_1@DATABASE_NAME' AS SCHEMA,
(SELECT MAX(LOAD_DT) FROM Schema_1.LOAD_STATUS) AS MAX_LOAD,
L_PROD_LINE.PROD_LINE,
COUNT(DISTINCT ENROLLMENT.MEM_NBR) AS MEMBERSHIP
FROM
Schema_1.ENROLLMENT,
Schema_1.PRDCT,
Schema_1.L_P_L
WHERE
ENROLLMENT.PRODUCT_ID = PRDCT.PRODUCT_ID AND
PRODUCT.PROD_LINE_ID = L_P_L.ID
GROUP BY
L_P_L.PROD_LINE;Hi,
999355 wrote:
Hello Experts, (I appologize if i am not using the right way to ask questions)See the froum FAQ {message:id=9360002}
I have a database, and it has around 400 schemas in it. I have designed a query which will fetch the data from three different table's from Schema1.
But it will be a tedious process of entering the 400 schemas names and pulling the information.
I would like to know as to what would be the best possible way to;
1) Look for all the schemas in the database
2) Look for those specific tables in the schema, which has the data in the tables.
3) If the tables are not present, than Ignore that schema and proceed further.
4) Load the data into a table
Any help, would appreciate it.
Thanks!
The query that i am using is as follows;
-- Query to select all the Schemas from the database
select username from all_users
order by username;
-- Sample Query to see if Tables exsist in the schema
SELECT DISTINCT OWNER, OBJECT_NAME
FROM ALL_OBJECTS
WHERE OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME IN ('ENROLLMENT', 'PRDCT', 'L_P_L')
AND OWNER in ('Schema_1', 'Schema_2', Schema_3', Schema_4',Schema_5', Schema_6')
ORDER BY OWNER; Do you want to give a list of possible schemas (like the 6 above), or do you want to consider all schemas, however many and whatever they are called?
You can get the right information for ALL_OBJECTS, but, since you known all the objects of interest are tables, ALL_TABLES will be faster and simpler.
--Query to get the data from the tables in a Schema
select 'Schema_1@DATABASE_NAME' AS SCHEMA,
(SELECT MAX(LOAD_DT) FROM Schema_1.LOAD_STATUS) AS MAX_LOAD,
L_PROD_LINE.PROD_LINE,
COUNT(DISTINCT ENROLLMENT.MEM_NBR) AS MEMBERSHIP
FROM
Schema_1.ENROLLMENT,
Schema_1.PRDCT,
Schema_1.L_P_L
WHERE
ENROLLMENT.PRODUCT_ID = PRDCT.PRODUCT_ID AND
PRODUCT.PROD_LINE_ID = L_P_L.ID
GROUP BY
L_P_L.PROD_LINE;I take it that the tables in question are ENROLLMENT, PRDCT and L_P_L; they won't have different names in different schemas.
You can start this way:
BEGIN
FOR c IN (
SELECT owner
FROM all_tables
WHERE table_name IN ( 'ENROLLMENT'
, 'PRDCT'
, 'L_P_L'
GROUP BY owner
HAVING COUNT (*) = 3
LOOP
... -- Now get the results for tables in the c.owner schema
END LOOP;
END;
/This will find the schemas that have all 3 of those tables.
Inside the loop, write another dynamic query. All that will change is the value of c.owner
Sorry, I'm running out of time now. I hope this helps. -
How to get data from table to pass into alvgrid function module
i want to get some data from below table to pass into function module of alvgrid
how can i get data please help.
thanks in advanced.
form get_data.
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.
append itab.
endform.Pass your final table(internal table which you want to display) along with fieldcatalog to FM reuse_alv_grid_display.:\
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
IT_SORT = gt_sort
it_fieldcat = lt_fieldcat[]
TABLES
t_outtab = lt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
SRM - How to get data from tables???
Hi experts -
I am new to SRM and I have a requirement to code a program that will retrieve purchase orders based on selection criteria, write an ALV report and all the user to select particular lines to close the p.o.
My question is that with the following selection criteria, I see that there are tables such as CRMD_ORDERADM_H and CRMD_ORDERADM_I as well as BBP_PDBEH and BBP_PDBEI, but not exactly sure if I should do selects on them individually or can you collect the records from a function module or BAPI?
Selection criteria:
PO Number - range
Purchasing group - range
Vendor number - range
Buyer ID - range
Cost Center - range
GL Account - range
WBS - range
Asset - range
Plant - range
Company code - range
Delivery Date - range
PO Create Date - range
How can I pull the qualifying records in the easiest manner?
Thanks in advance!
MarkI'm not certain about this, but I don't think the information you need is in the SRM frontend. I think you'll have to use an RFC enabled FM to retrieve the data from the R/3 backend to the SRM system. Or maybe there is a BAPI that does this for you.
Rob -
Getting data from table control to the report program.
Hi,
I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.
Please help me finding out which variable will hold the data entered in table control(dynamically).hi,
in your table control you give some name to that table control say it_cntrl.
this only serves as the internal table to process the table control data.
like u can write like this.
loop at it_cntrl into wa_cntrl. "wa_cntrl is work area of type it_cntrl table type
......... "do your functining
end loop.
any clarification get in touch
thnks -
Join query not getting data from tables
I have total 4 tables, zemployee, zemp_comm,zemp_adress, zemp_edu1 all of this tables are connected through emp_id , but when I write left outer join it returns all rows but emp_id is retrunign null , when I insert all of the entries in respective table it show the respective emp_id, when i left some of the entries in table it will not show emp_id in records,
I am using this select statment........
Select * from zemployee as a left outer join zemp_comm as b on b~emp_id = a~emp_id left outer join zemp_adress
as c on c~emp_id = a~emp_id left outer join zemp_education1 as d on d~emp_id = a~emp_id into corresponding fields of table
emp_itb
where a~emp_name = zemployee-emp_name.
I want to show show records with emp_id whether i put entry in all tables or missed some of the entries.
please help me in this regard.Hi Amir,
You can use Inner join . please refer below code.
Select * from zemployee as a inner join zemp_comm as b on b~emp_id = a~emp_id inner join zemp_adress
as c on c~emp_id = a~emp_id inner join zemp_education1 as d on d~emp_id = a~emp_id into corresponding fields of table
emp_itb
where a~emp_name = zemployee-emp_name.
Regards,
Thangam.P -
Fetch data from table and generate attachment than mail it.
Hello Experts,
From couple of day I am searching on Google for a better database procedure that will help me to get data from tables and generate attachment and mail it but i fail.
My Scenario is:
I have a query that will fetch almost 5000 records from database tables. Each record has almost 75 characters
select a.location_code,
a.item_code,
b.description item_desc,
to_char(a.manufact_date,'ddMonyy')mfg,
to_char((a.manufact_date + nvl(b.expiry_period,0)),'ddMonyy')expr,
to_char((a.manufact_date + nvl(b.qurantine_period,0)),'ddMonyy')qrtn,
round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) days_elapsed,
a.closing_balance_posted quantity
from wms_stock_current_balance_v a, wms_item_setup_mast b
where a.closing_balance > 0
and a.item_code = b.item_code
and a.loc_type in ('RACKING','PICKING','QUICKA','BUNDLED')
and nvl(b.qurantine_period,0) > 0
and round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) <= 0
order by a.item_code, a.location_code;
Sample data of above query is
LOCATION_CODE
ITEM_CODE
ITEM_DESC
MFG
Expiry
Quarantine
Days Elapse
Quantity
13DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
14DL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
134
14DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
14DR2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
20
14LL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17ER2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17GL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17SL0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
64
18QL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
19AR5
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
160
19DL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
19JR0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
60
19TL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
20GR2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
40
36FL3
000000000000000F0487
CLEAR COOL BLACK 05ML
18-Feb-10
29-Mar-14
2-Jun-13
-124
65
19UR0
000000000000000F0591
COMFORT WHITE 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
1
12SL1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
12SR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
14OR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
8
36EL4
000000000000000F0594
CLEAR HF DECRASE 5M*360
14-Feb-10
14-Feb-11
12-Oct-10
-1088
14
13VL1
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
160
14ER0
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
105
Database Info
Oracle 10g
Version 10.2.0.1.0Look at the sample code for generating a CSV file that I've just posted in response to a similar question:
Re: How to execute a proc and spool files in a database job
And the use the search button in this forum to find sample code for sending a CLOB as a plain/text e-mail attachment using UTL_SMTP. -
How to get data from a table in a condition between twomonth
hai friends
I have a query that is i want to get data from a table based on a condition between two months in a format of char column
Ex
I have a column called from_month in the format of 'mon/yyyy'(already converted from date')
then the second column is to_month in the same format 'mon/yyyy'
now i wiil select from_month and to_month like
from month jan/2009
to month mar/2010
how to use between of two months in the format of char.Please tell me how to get two different month between data.Hi,
This may be of help.
Remember Pointless has made a point ;) (worth millions)
If possible , DO NOT store dates as strings or numbers.Let dates be dates.
WITH dat AS
(SELECT ' THIS IS JAN' x,to_char(to_date('01-JAN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS FEB' x,to_char(to_date('01-FEB-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAR' x,to_char(to_date('01-MAR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS APR' x,to_char(to_date('01-APR-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS MAY' x,to_char(to_date('01-MAY-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUN' x,to_char(to_date('01-JUN-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS JUL' x,to_char(to_date('01-JUL-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS AUG' x,to_char(to_date('01-AUG-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS SEP' x,to_char(to_date('01-SEP-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS OCT' x,to_char(to_date('01-OCT-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual UNION
SELECT ' THIS IS NOV' x,to_char(to_date('01-NOV-2009','DD-MON-YYYY'),'mon/yyyy') y FROM dual)
SELECT * FROM dat
WHERE to_date(y,'mon/yyyy') BETWEEN to_date('01 jan 2009','dd mon yyyy') AND to_date('01 mar 2009','dd mon yyyy')Cheers!!!
Bhushan -
How to get data from an internal table in some other program
I would like to get data from the internal table in the other program. When I using FM "LIST_FROM_MEMORY" to get the data, it doesn't work and the exception is not fount.
If any special code need in the other program, like write data to memory .
Many thx .
From Ross WangHi
<li>You need to have interaction if you want to use EXPORT/IMPORT statments.
<li>The internal tables in both programs must be same
<li>Program one ..Calling program
REPORT ZTEST_NOTEPAD.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF it_t001.
START-OF-SELECTION.
SUBMIT ztest_notepad1 AND RETURN.
IMPORT it_t001 FROM MEMORY ID 'ZTEST_T100'.
LOOP AT it_t001.
WRITE:/ it_t001.
ENDLOOP.
<li>Program two ...Called program
REPORT ztest_notepad1.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF it_t001.
START-OF-SELECTION.
SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
IF sy-dbcnt > 1.
EXPORT it_t001 TO MEMORY ID 'ZTEST_T100'.
ENDIF.
I hope that it gets you some idea.
Thanks
Venkat.O -
How to get data from COSP table, field HRKFT as the key to data from PM?
Dear ladies and gentlemen!
I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
What should I do in this case?
Thank you very much in advance!From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
Of course, it's not a very good solution, but for now I know no other way to solve this problem.
Maybe someone knows better ways? In this case I will be very grateful for any help!
Moderator: You'd better post it on BI forums -
OC4J - How to get data from large table (more than 9 million rows) by EJB?
SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS
O I use Jdeveloper to create EJB that has finder methods to get data from a big table (more S than 9 million rows). Deploy is OK but when run client program I always get timeout
O error or not enough memory error,
S Can any one help me?
O urgent
SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOSYour problem may be that you are simply trying to load so many objects (found by your finder) that you are exceeding available memory. For example if each object is 100 bytes and you try to load 1,000,000 objects thats 100Mb of memory gone.
You could try increasing the amount of memory available to OC4J with the appropriate argument on the command line (or in the 10gAS console). For example to make 1Gb available to OC4J you would add the argument:
-Xmx1000m
Of course you need have this available as hard memory on your server or you will incur serious swapping.
Chris -
How to get data from hierachy lookup table
there is a hierachy lookup table A, and I want to get data from A.
but the following code does work properly:
WebTreeNode result = catalog..GetHierarchy(tableName,nodeID);
could anybody give some suggestion or solution of getting data from hierachy lookup table,
3xHi fei,
Please look at the following code.
I hope it will give you some clues...
private void showHierarchy() throws StringException
ResultSetDefinition rsd = new ResultSetDefinition(<code name of your hierarchy table>);
rsd.GetFields().Add(<code name of a field in your hierarchy table>);
Search search = new Search(<code name of your main table>);
WebTreeNode treeNode = catalogData.GetResultTree(search, rsd, 0);
printHierNameRecursive(treeNode, 0);
private void printHierNameRecursive(WebTreeNode root, int level) throws StringException
WebTreeNodeArray arr = root.GetChildren();
for (int i = 0; i < arr.GetSize(); i++)
for (int tab = 0; tab < level; tab++)
System.out.print("t");
String catName = arr.GetWebTreeNodeAt(i).GetValueAt(<code name of a field in your hierarchy table>).GetStringValue();
System.out.println(catName);
printHierNameRecursive(arr.GetWebTreeNodeAt(i), level + 1);
Regards,
Nir -
How to get data from large table (more than 9 million rows) by EJB?
I have a giant table, it has more than 9 million rows.
I want to use ejb finders method to get data from this table but always get not enough memory error or time out error,
Can anyone give me solutions?
ThxYour problem may be that you are simply trying to load so many objects (found by your finder) that you are exceeding available memory. For example if each object is 100 bytes and you try to load 1,000,000 objects thats 100Mb of memory gone.
You could try increasing the amount of memory available to OC4J with the appropriate argument on the command line (or in the 10gAS console). For example to make 1Gb available to OC4J you would add the argument:
-Xmx1000m
Of course you need have this available as hard memory on your server or you will incur serious swapping.
Chris -
i have three tables A,B,C. there is one to many relation between A and B. and one to many relation existed between table b and c . how will get data from these three tables
check if this helps:
select * --you can always frame your column set
from tableA a
left join tableB b on a.aid=b.aid
left join tableC c on c.bid=b.bid
This is just a general query. However, we can help you a lot more, if you can post the DDL + sample data and required output.
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Maybe you are looking for
-
In Infoprovider DSO no query fields available ( 0PM_DS02_Q0001 )
Hi, I have a problem in Quality Managemenr (QM) module query called ( Mean Time To Repair (MTTR) and Mean Time Between Repair ) 0PM_DS02_Q0001 and this query 0PM_DS02 which loads the data from 0PM_DS01 data mart. in the query key figures are MTTR
-
My photoshop CS5 will not open either from the desktop or from the program list. I can open Bridge but when I then try to view a photo in photoshop I get a message that says Bridge has stopped working and will have to close down.
-
Simultaneous Mail and iCal problems - iCal shows old to-dos
I was getting ready for my weekly backup, so I ran all the cleaning activities in OnyX. Then when I logged in after the restart, Quicksilver crashed on me 3 times in a row and acted as if I was installing it for the first time. I did not, however, ha
-
After I upgrade iphone4 to iOS 4.3.5 and turns out cannot sync anymore
After I upgrade iphone4 to iOS 4.3.5 and turns out cannot sync anymore Please help
-
Possible to use a field code first name in mail?
Hi I want to sent a mail to my contacts. And I like to start the mail with Hello <first name of the contact>, Is it possible to do that in this mail software? Kind regards, Rene