How to get data from maintaince view into internal table
Hi,
I want to get the all data from v_t179 (maintanence view) into intrenal table.
if i write select stmt , it is giving error.
I want all data into internal table.
regards,
Ajay
I think this is what you want:
TABLES: t179, t179t.
DATA: v_t179_int TYPE TABLE OF v_t179.
SELECT * FROM t179
JOIN t179t ON
t179~prodh = t179t~prodh
INTO CORRESPONDING FIELDS OF TABLE v_t179_int.
Rob
Similar Messages
-
How to get data from MS CRM into Crystal Reports
Hello All,
Can anybody tell me how to get data into crystal XI reports with MS CRM.
Thanks in Advance
RameshFirst you should refer to the Rules of Engagement and then add more info.
Start off by telling us what version of CR are you using and what is MS CRM?
Thank you
Don -
How to transfer data from excel files into z-tables
Please help me with a code which transfers data from excel file to z-table.
Thanks in advance
ShuvirHi Daniel,
Export Data
Purpose
Use this procedure to export SAP data to a local file such as Microsoft Excel.
Menu Path
Use the following menu path to begin this process:
· SystemèListèSaveèLocal File
Helpful Hints
When reviewing fields, R = Required, O = Optional and C = Conditional.
Procedure
1. Start the transaction using the menu path or transaction code.
Whatever Data You Want to Export
2. Select SystemèListèSaveèLocal File. This works well for any data in SAP. This is the only option for the top-level (first page) of a report.
In a drill-down view within a report the Local File button on the toolbar may be used and has the same options.
Choose File Format
3. Click .
4. Click to continue. If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
Choose File Save Location Step 1
5. Click to the right of the Directory field to choose a different location.
Choose File Save Location Step 2
6. Click or browse your computer to locate the directory where you want to save your file.
7. Complete the following field:
· File name:
You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML). The file extension tells your computer what program to open the file with. If you do not have the file extension at the end, you may not be able to open it.
8. Click to continue.
Generate File in Location and Format Selected
9. Click to create the file in the location and format selected. In this example the file was named "example.xls" and saved on the desktop.
Result
You have completed the export process.
thanks
karthik -
Upload data from flat file into internal table
Hi friends,
I want to upload the data from a flat file into internal table , but the problem is that all the columns in that flat file are seperated by "|" character instead of tabs.
Plz help me out.........HEllo,
DO like this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X' " Check here
* HEADER_LENGTH = '1'
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_COJRNL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
VAsanth -
How to insert data from APEX form into two tables
Hi,
I'm running APEX 4.1 with Oracle XE 11g, having two tables CERTIFICATES and USER_FILES. Some of the (useless) fields are cut to reduce information:
CREATE TABLE CERTIFICATES
CERT_ID NUMBER NOT NULL ,
CERT_OWNER NUMBER NOT NULL ,
CERT_VENDOR NUMBER NOT NULL ,
CERT_NAME VARCHAR2 (128) ,
CERT_FILE NUMBER NOT NULL ,
) TABLESPACE CP_DATA
LOGGING;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_PK PRIMARY KEY ( CERT_ID ) ;
CREATE TABLE USER_FILES
FILE_ID NUMBER NOT NULL ,
FILENAME VARCHAR2 (128) ,
BLOB_CONTENT BLOB ,
MIMETYPE VARCHAR2 (32) ,
LAST_UPDATE_DATE DATE
) TABLESPACE CP_FILES
LOGGING
LOB ( BLOB_CONTENT ) STORE AS SECUREFILE
TABLESPACE CP_FILES
STORAGE (
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS UNLIMITED
FREELISTS 1
BUFFER_POOL DEFAULT
RETENTION
ENABLE STORAGE IN ROW
NOCACHE
ALTER TABLE USER_FILES
ADD CONSTRAINT CERT_FILES_PK PRIMARY KEY ( FILE_ID ) ;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_USER_FILES_FK FOREIGN KEY
CERT_FILE
REFERENCES USER_FILES
FILE_ID
NOT DEFERRABLE
What I'm trying to do is to allow users to fill out all the certificate data and upload a file in an APEX form. Once submitted the file should be uploaded in the USER_FILES table and all the fields along with CERT_ID, which is the foreign key pointing to the file in the USER_FILES table to be populated to the CERTIFICATES table. APEX wizard forms are based on one table and I'm unable to build form on both tables.
That's why I've created a view (V_CERT_FILES) on both tables and using INSTEAD OF trigger to insert/update both tables. I've done this before and updating this kind of views works perfect. Here is where the problem comes, if I'm updating the view all the data is updated correctly, but if I'm inserting into the view all the fields are populated at CERTIFICATES table, but for USER_FILES only the fields FILE_ID and LAST_UPDATE_DATE are populated. The rest three regarding the LOB are missing: BLOB_CONTENT, FILENAME, MIMETYPE. There are no errors when running this from APEX, but If I try to insert into the view from SQLDeveloper, I got this error:
ORA-22816: unsupported feature with RETURNING clause
ORA-06512: at line 1
As far as I know RETURNING clause in not supported in INSTEAD of triggers, although I didn't have any RETURNING clauses in my trigger (body is below).
Now the interesting stuff, after long tracing I found why this is happening:
First, insert is executed and the BLOB along with all its properties are uploaded to wwv_flow_file_objects$.
Then the following insert is executed to populate all the fields except the BLOB and it's properties, rowid is RETURNED, but as we know RETURNING clause is not supported in INSTEAD OF triggers, that's why I got error:
PARSE ERROR #1918608720:len=266 dep=3 uid=48 oct=2 lid=48 tim=1324569863593494 err=22816
INSERT INTO "SVE". "V_CERT_FILES" ( "CERT_ID", "CERT_OWNER", "CERT_VENDOR", "CERT_NAME", "BLOB_CONTENT") VALUES (:B1 ,:B2 ,:B3 ,:B4, ,EMPTY_BLOB()) RETURNING ROWID INTO :O0
CLOSE #1918608720:c=0,e=11,dep=3,type=0,tim=1324569863593909
EXEC #1820672032:c=3000,e=3168,p=0,cr=2,cu=4,mis=0,r=0,dep=2,og=1,plh=0,tim=1324569863593969
ERROR #43:err=22816 tim=1324569863593993
CLOSE #1820672032:c=0,e=43,dep=2,type=1,tim=1324569863594167
Next my trigger gets in action, sequences are generated, CERTIFICATES table is populated and then USER_FILES, but only the FILE_ID and LAST_UPDATE_DATE.
Finally update is fired against my view (V_CERT_FILES), reading data from wwv_flow_files it populates BLOB_CONTENT, MIMETYPE and FILENAME fields at the specific rowid in V_CERT_FILES, the one returned from the insert at the beginning. Last, file is deleted from wwv_flow_files.
I'm using sequences for the primary keys, this is only the body of the INSTEAD OF trigger:
select user_files_seq.nextval into l_file_id from dual;
select certificates_seq.nextval into l_cert_id from dual;
insert into user_files (file_id, filename, blob_content, mimetype, last_update_date) values (l_file_id, :n.filename, :n.blob_content, :n.mimetype, sysdate);
insert into certificates (cert_id, cert_owner, cert_vendor, cert_name, cert_file) values (l_cert_id, :n.cert_owner, :n.cert_vendor, :n.cert_name, l_file_id);
I'm surprised that I wasn't able to find a valuable source of information regarding this problem, only MOS note about running SQLoader against view with CLOB column and INSTEAD OF trigger. The solution would be to ran it against base table, MOS ID 795956.1.
Maybe I'm missing something and that's why I decided to share my problem here. So my question is how do you create this kind of architecture, insert into two tables with a relation between them in APEX ? I read a lot in the Internet, some advices were for creating custom form with APEX API, create a custom ARP, create two ARP or create a PL/SQL procedure for handing the DML?
Thanks in advance.
Regards,
SveThank you however I was wondering if there was an example available which uses EJB and persistence.
-
How to upload all excel files data from one folder into internal table.
Dear All,
I have one requirement, It is like I want to upload the frontend file data into my internal table, But here my scenario is;
If I have one folder ( Called : Temp) in my frontend system, in this folder ( Called : Temp) I have 100 excel files. In each excel file I have some 1000u2019s of entries. All these data of every file I want to take into my internal table.
If I have one file I can go for, CALL METHOD cl_gui_frontend_services=>file_open_dialog and then upload method to upload. But I want to take all these excel files from that folder at a time, is there any class or any thing is there..? plz help..
Thanks...
Edited by: satishsuri on Jan 11, 2011 9:33 AMHi satishsuri ,
You will have to use 3 methods together :
CALL METHOD cl_gui_frontend_services=>directory_browse "Browse the Directory
CALL METHOD cl_gui_frontend_services=>directory_list_files "Get all the files from the directory
CALL METHOD cl_gui_frontend_services=>gui_upload "Upload each file in a loop
Example:
TYPES: BEGIN OF ty_data,
line TYPE string,
END OF ty_data.
DATA: str_file TYPE string,
str_dir TYPE string,
it_file_table TYPE STANDARD TABLE OF file_info,
wa_file_table TYPE file_info,
v_count TYPE i,
it_data TYPE STANDARD TABLE OF ty_data,
wa_data TYPE ty_data.
CALL METHOD cl_gui_frontend_services=>directory_browse
CHANGING
selected_folder = str_dir.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = str_dir
CHANGING
file_table = it_file_table
count = v_count.
LOOP AT it_file_table INTO wa_file_table.
CONCATENATE str_dir wa_file_table-filename INTO str_file SEPARATED BY '\'.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = str_file
filetype = 'ASC'
CHANGING
data_tab = it_data.
LOOP AT it_data INTO wa_data.
WRITE : / wa_data-line.
ENDLOOP.
ULINE.
ENDLOOP.
Regards,
Jovito -
How to get data from another view on the RFx to populate bidders web dynpro
i am trying to populate bidders in the table on the bidder tab when a user click a button based on the line item data. How do i have access to get the line item since it is in a separate component controller and view for the RFx? thanks you.
Hi,
You mean Data transfer between two components..
To pass the value from one component to other component, you can use used component scenario.
For example let use assume we have two comp ..
Comp A,
Comp B.
now we need to pass the value from Comp A to Comp B.
Then declare the Comp A as used component in Comp B.
Now then you can create a node in the comp A component controller and check the interface check box there then the
node and the attribute will be present in the interface controller also .
and this interface controller context you can access in the component and map it to view there and display it.
Webdynpro Application Integration..
http://wiki.sdn.sap.com/wiki/display/WDABAP/WebdynproApplicationsIntegration
cheers,
Kris. -
How to import data from CSV file into a table by using oracle forms
Hi,
I have a CSV file and i want to insert in oracle database in a table by using a button in oracle forms.
the user can select CSV file by using open dialog .
can any one help me to find method to make import and select file from the client machine ?
thx.1. create table blob
CREATE TABLE IB_LOVE
DOC BLOB,
CONTRACT_NO VARCHAR2(20 BYTE) NOT NULL
)2. use the code below to insert:
INSERT INTO ordmgmt.ib_love
(contract_no, doc
VALUES (:control.contract_no_input, NULL
lb$result :=
webutil_file_transfer.client_to_db (:b2.file_name, v_file_blob_name, v_col_blob_name,
'CONTRACT_NO = ' || :control.contract_no_input);
:SYSTEM.message_level := 25;
COMMIT;
:SYSTEM.message_level := 0;3. use the code below to download
if :control.CONTRACT_NO_INPUT is not null then
vboolean := webutil_file_transfer.DB_To_Client_With_Progress(
vfilename, --filename
'IB_LOVE', ---table of Blob item
'DOC', --Blob column name
'CONTRACT_NO = ' || :CONTROL.CONTRACT_NO_INPUT, ---where clause to retrieve the record
'Downloading from Database', --Progress Bar title
'Wait to Complete'); --Progress bar subtitle client_host('cmd /c start '||vfilename);
client_host('cmd /c start '||vfilename);
else
errmsg('Please choose contract no');
end if;4. use the code below to open file dialog
x:= WEBUTIL_FILE.FILE_OPEN_DIALOG ( 'c:\', '*.gif', '|*.gif|*.gif|', 'My Open Window' ) ;
:b2.FILE_NAME:=X; -
Getting data from CTE's into existing table
Hello,
I don't understand what is wrong with following query, when I search on the net I find simular sql statements .... my cte works (tested seperately), I've used the for loop just to copy from one table to another ... but when I combine them it goes wrong...
The code that is in commet are some variations I have tried.
with x as (
select
p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
from competentiepersoon cp
join persoon p on p.id = cp.persoonid
join competentie c on c.id = cp.competentieid
where sectorid = 14 --c1.id
y as (
select t1.comp as comp1, t2.comp as comp2, t1.sect, count(*) as tel
from x t1, x t2
where t1.comp != t2.comp
and t1.id = t2.id
group by t1.comp, t2.comp, t1.sect
z as (
select
comp1, comp2, sect, tel / (select count(*) from y where comp1 = y1.comp1 or comp2 = y1.comp1 or comp1 = y1.comp2 or comp2=y1.comp2 ) as match
from y y1
--insert INTO competentiematching(competentieid1, competentieid2, sectorid, matching)
--values select comp1, comp2, sect, match from z;
for toInsert in ( select * from z )
loop
insert into competentiematching values(toInsert.comp1, toInsert.comp2,toInsert.sect,toInsert.match);
end loop; => keeps giving "missing select statement"
ps sorry for my english :).Hi,
There is no need to use a LOOP, or even PL/SQL: you can just do an INSERT statement like this:
insert into competentiematching (...) -- List of columns isn't strictly required, but it's a good idea
with x as (
select
p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
from competentiepersoon cp
join persoon p on p.id = cp.persoonid
join competentie c on c.id = cp.competentieid
where sectorid = 14 --c1.id
y as (
select t1.comp as comp1, t2.comp as comp2, t1.sect, count(*) as tel
from x t1, x t2
where t1.comp != t2.comp
and t1.id = t2.id
group by t1.comp, t2.comp, t1.sect
z as (
select
comp1, comp2, sect, tel / ( select count(*)
from y
where comp1 = y1.comp1
or comp2 = y1.comp1
or comp1 = y1.comp2
or comp2 = y1.comp2
) as match
from y y1
SELECT ... -- Main query goes here
;There was no main query after the sub-query y1 in the code you posted.
An INSERT statement like the one above will work in SQL or in PL/SQL.
If you do need to use a loop, then the syntax is:
FOR toInsert IN ( <query> )
LOOP
END LOOP;Where I wriote <query> above, you should put the entire query, starting with the keyword WITH when it is used. For example:
FOR toInsert IN (
with x as (
select
p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
LOOP
END LOOP; -
Hi,
How to get the data from AL11? in AL11 there is a directory. so, how to get the data from this directory into internal table?
SAP Directory location is : /usr/sap/trans/
thanks in advacne.
regards,
baluhi
try this
data : dsn(100) type c value '/tmp/test.txt'.
data : wa(100) type c.
data : d1(100) type c.
OPEN DATASET DSN FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. --> Creates a file in AL11
TRANSFER DSN TO WA. --> Transfer data from presentation to application system
CLOSE DATASET DSN.
OPEN DATASET DSN FOR INPUT IN TEXT MODE ENCODING DEFAULT.
READ DATASET DSN INTO D1. -- > Read the data from the file in the application server again to presentation.
CLOSE DATASET DSN.
Regards -
How to get data from Oracle to SAP
Hi All,
I want to get data from Oracle to my internal table in SAP,
I worked on puting the data from SAP to Oracle, it's working fine...
Can anybody suggest the code for accessing from Oracle with 4 primary keys in oracle.
regards
manishhi
good
there is two things in sap open sql and native .if you ll use the open sql than you can access any database.
thanks
mrutyun -
Retrieving data from Excel format to internal table(deep structure)
hi all,
can anybody help me how to Retrieving data from Excel format to internal table(deep structure)
and if u have any sample code for that please send it.
my internal table is like this
DATA: BEGIN OF ty_text,
vbeln TYPE vbeln,
posnr TYPE posnr,
seqno TYPE seqno,
textid TYPE tdid,
tdline TYPE tdline,
END OF ty_text.
DATA: BEGIN OF ty_item,
vbeln TYPE vbeln,
posnr TYPE posnr,
dispct1(16),
dispct2(16),
dispct3(16),
text LIKE table of ty_text,
END OF ty_item.hi,
check this code
TABLES:zmatnr.
TYPE-POOLS truxs.
DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA row LIKE alsmex_tabline-row.
data : gi_final like zmatnr occurs 0 with header line.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
PERFORM search.
START-OF-SELECTION.
perform process.
form process.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pfname
i_begin_col = 1
i_begin_row = 2
i_end_col = 12
i_end_row = 65000
TABLES
intern = itab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
describe table itab lines itab_count.
row = 1.
loop at itab.
if itab-row <> row.
append gi_final.
clear gi_final.
endif.
case itab-col.
when '1'.
gi_final-MATNR = itab-value.
when '2'.
gi_final-Maktx = itab-value.
endcase.
row = itab-row.
endloop.
append gi_final.
clear gi_final.
endform.
FORM search .
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = pfname.
ENDFORM.
regards
siva -
Without NI DAQ device- how to get data from MSP into labVIEW and process it
Hi,
I do not have an NI DAQ device. I have an MSP430 and my sensor is an ADXL335 Accelerometer. How do I get data from my MSP into labVIEW and process it?
Just looking for a nudge in the right direction. I'm having a hard time finding resources on labVIEW that don't involve NI specific DAQs.
Thanks in advance,
AzizThere are many ways to get data into LabVIEW that do not involve NI-DAQ devices.
I think your easiest option would be to stream it via serial port if the data rate isn't too fast.
Troy
CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
Beware of the man who won't be bothered with details. - William Feather
The greatest of faults is to be conscious of none. - Thomas Carlyle -
Can we get data from business views in CR 2008/XI?
Hi All,
Can we get data from business views in CR 2008/XI?
If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
Thank you,
Krishna PingaliHi Krishna,
Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
Contact our Sales department for pricing and availability.
Thank you
Don -
How to extraxct data from a view.
hi,
i'm tying to extrct data from a view vbdka, with select. but i;m getting a syntax error that it anot a DB Table or DB view, pls tell me how to extract data from that view.
thanks.hi,
just check out if u have declared the table or not n see if it is not a structure also
madhuri.
Maybe you are looking for
-
Hi, How can we modify a triple? For example, to modify an id I do: UPDATE owltst a SET a.id = '7' WHERE a.triple.GET_SUBJECT() = '<http://www.example.org/family/Tom>' But to modify the subject, i don't know because the column's name is triple then ho
-
Firefox 27 running but not running
I'm running Windows 7 32-bit. When I installed it, I installed Firefox 27. It worked fine. Then, out of the blue, it began freezing--not momentary, but the kind of freeze which forces one to "crash" shutdown. Sometimes 5 minutes into using firefox, s
-
Regarding the lenght of the string?
hai friends, can any one tell me how to find the length of the string..? ex: data x type string x = 9989. where now length of x is 4. so how can i find what is the length of the string,..? regards satish.v
-
I am tracking my steps and distance per day using a pedometer. To force myself to learn more about MathScript, I decided to monitor the results using MathScript. In Excel, the charts allow using dates on the x-axis which is helpful for reviewing th
-
I've seen the responses on previous post (at least some of them) saying it is not necessary to combine two iTunes accounts. The solution is to authorize both accounts on all computers and you're fine. I disagree. First, my wife and I have three iTu