Query related to Internal Table
Hi ,
I have a small query related to internal table , can we dump millions of records to an internal .
The actual requirment is like i need to develop a report in BI side where i have to dump records into an internal table from PSA tables without filtering .
Can we do so ....
or do we have any other option to dump the data to an internal tables .
need some tips on the same .
Thanks ,
VInay.
Hello Vinay,
I believe the following extract will give you a brief idea on the size limitations for an internal table.......
Internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. <u><i>The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries.</i></u>
Hope it proved useful
Reward if helpful
Regards
Byju
Similar Messages
-
How many records are fetched my query into my internal tables
Hi
I am in the debugger, would like to know, how many records are fetched my query into my internal tables. How do I find out ?
thanks
sivaHi,
Do the following,
Step 1:
Fill your internal table with select query.
Step 2 : Use DESCRIBE statement with LINE addition to get the no of rows in the internal table.
for further informations, check
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
Regards,
Anirban -
Extracting the result of a query into a internal table
Hi,
Does anyone knows or have an idea how to extract the result of a query into a internal table, is there a function module or BAPI?
Thanks in advance,
CKSo then normally I would use a statment like:
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_SALESORDER_GETLIST</b>");
to call a particluar function, but I tried using
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_MDDATAPROVIDERBW_GETCATALOGS</b>");
and it did not seem to work. I also tried -
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>MDDataProviderBW.GetCatalogs</b>");
How do I format the function?
Thanks
Paul -
SAP QUERY LOOPS AND INTERNAL TABLE
Hi All, I have a query which i have made. It runs from Table EKPO which has PO details and what I want to do is now via ABAP Code pull through the total of goods receipt for the PO and Line Item into a field. Sounds Easy enough..Problem now,
The table which contains the GR data is EKBE which agains a PO and Line Item can have many 101 movements and 102 movements so what I want is an ABAP Statent to basically sum up the total of 101 for the PO & LINE ITEMS and then minus this from the total of 102 for the PO & LINE ITEMS and post the result in to this new field I have created.
I am pretty decent with ABAP Code in Querys I.e Select statements etc but from what I can see i need to create an internal table and do a loop and collect statement but I keep on failing due to not enough knowledge. Please can some one help me with this and provide me with the code and explanation as i would like to understand,
POINTS WILL BE REWARDED
Thanks
Kind Regards
Adeel SarwarHi,
This is the full code i have entered but its not working. Any help would be appreciated. If you could rectify the code and internal tables that would be great.
Thanks
TABLES: EKBE.
DATA: PurO LIKE EKPO-EBELN,
POLI LIKE EKPO-EBELP.
*New Table and Vars defined
DATA: BEGIN OF IT_EKBE,
IT_EKBE LIKE EKBE,
END OF IT_EKBE.
DATA: BEGIN OF IT_SUM OCCURS 0,
EBELN TYPE EBELN,
EBELP TYPE EBELP,
DMBTR TYPE DMBTR,
MENGE TYPE MENGE,
END OF IT_SUM.
CLEAR: QTYD.
MOVE: EKPO-EBELN TO PurO,
EKPO-EBELP TO POLI.
SELECT * FROM EKBE INTO IT_EKBE
WHERE EBELN = PurO
AND EBELP = POLI
AND BEWTP = 'E'
LOOP AT IT_EKBE.
MOVE CORRESPOING IT_EKBE TO IT_SUM.
IF IT_EKBE-BWART = '102'.
IT_SUM-DMBTR = IT_SUM-DMBTR * -1.
IT_SUM-MENGE = IT_SUM-MENGE * -1.
ENIDF.
COLLECT IT_SUM.
CLEAR IT_SUM.
ENDLOOP.
ENDSELECT.
If sy-subrc = 0.
QTYD = IT_SUM.
ELSE.
QTYD = 0.
ENDIF. -
Query statement for internal table
is it possible to use a select statement to select data from an internal table? if yes, can anyone show me the codes to it? thx
Hi Daphne,
You use SELECT statement to read data from database table but not from Internal table.
For reading data from Internal table, you have to use READ statement.
Syntax:
READ TABLE itab { table_key
| free_key
| index } result.
Effect of using read statement:
This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read.
If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
Reward if usefull
thanks
swaroop -
Query related to database tables
Hi,
Im having a requirement wherein i would like to create one ztable and the purpose is only to get the fields but not the values for the same. Bez, with the help of these fields in ztable and developing some logic and it shld be dynamic based on the no of fields appended into ztable.
To be clear, can i write a select query only to get the fields from the table but not the values ( in this no way i will get the values bez i won't insert any records for the same).
I thnk im clear from my end.
Thanks
rohithTo get the fields, you can write the query like this too :
tables: dd03l.
data: begin of itab occurs 0,
fieldname like dd03l-fieldname,
end of itab.
*parameters: p_tab like dd03l-tabname.
select fieldname from dd03l into table itab where tabname = 'VBAK'.
LOOP AT ITAB.
WRITE:/ itab-fieldname.
ENDLOOP. -
hi all,
I have to check an internal table data(it_tab)
It holds records like
A B C D E F
325 1 1 512 0 0010
325 1 1 548 36 0010
325 1 1 554 42 0010
325 2 2 512 0 0011
325 2 2 548 36 0011
325 2 2 554 42 0011
325 3 3 512 0 0012
325 3 3 554 42 0012
800 3 1 512 0 0011
800 3 1 530 18 0011
800 4 2 512 0 0012
800 4 2 532 20 0012
800 4 2 533 21 0012
800 4 2 538 26 0012
800 4 2 556 44 0012
800 5 3 512 0 0013
800 5 3 532 20 0013
800 5 3 538 26 0013
800 5 3 556 44 0013
I have to check whether the number generated in D is increasing one by one
for eg D : 512, 513, 514,...
Here it is not in the sequence
So i need to check whther it is in sequence if not so i should delete the record
Could you suggest the way to check the in_tab?
Regards
senthilHi,
Try the follwoing:
You just need to use AT NEW control break after the loop statement.
DATA: Var1(5) TYPE n.
DATA: Var2(5) TYPE n.
DATA: Count(5) TYPE n.
DATA: it_tab2 type table of it_tab.
clear: count.
LOOP at it_tab.
AT NEW a
Clear: count, Var1, Var2.
Count = Count + 1.
IF Count >= 2.
var2 = it_tab-D.
If var2 = var1 + 1.
append it_tab to it_tab2.
endif.
endif.
var1 = it_tab-D.
ENDAT
Endloop.
Reward points if helpful answer.
Ashvender -
SAP query change the internal table extracted after a join instruction
Hi Gurus
I would like to know if it is possible to change the data in internal table after that the
join instruction has been executed .
I should have to delete some lines extracted if some conditions are satisfied.
Do you think that it is not possible and it is better to crete a program?
Thanks in advanceHI,
use select and end select.
select single msegbukrs msegwerks msegmatnr msegmenge msegaufnr msegsmbln msegbwart msegshkzg mseg~meins
afkorsnum afpoverid
maststlnr maststlal stpoidnrk stpomenge stpomeins stkobmeng
into (itab-mblnr,
itab-budat,
itab-bktxt,
itab-bukrs,
itab-werks,
itab-matnr,
itab-menge,
itab-aufnr,
itab-smbln,
itab-bwart,
itab-shkzg,
itab-meins,
itab-rsnum,
itab-verid,
itab-stlnr,
itab-stlal,
itab-matnr_r,
itab-bdmng,
itab-meins_r,
itab-bmeng)
from mkpf
inner join mseg on msegmblnr eq mkpfmblnr and mkpfmjahr eq msegmjahr
inner join mara on maramatnr eq msegmatnr
inner join afpo on afpoaufnr eq msegaufnr
inner join mast on mastmatnr eq msegmatnr and mastwerks eq msegwerks
inner join afko on afkoaufnr eq msegaufnr and afkostlal eq maststlal
inner join stko on stkostlnr eq maststlnr and stkostlal eq maststlal
inner join stpo on stpostlnr eq stkostlnr
inner join stas on stasstlnr eq maststlnr and stasstlal eq maststlal and stasstlkn eq stpostlkn
where mseg~werks in s_werks
and mseg~matnr in s_matnr
and mkpf~budat in s_budat
and mseg~aufnr in s_aufnr
and mseg~bwart eq '101'
and mast~stlan eq '1'
and stko~stlty eq 'M'
and stpo~stlty eq 'M'.
if condtion .
append: itab.
endif.
clear: itab.
endselect.
Edited by: ZAHID HAMEED on Oct 12, 2011 3:56 PM -
Query related to external table authentication
Hi Gurus,
I am new to OBIEE. When we login to the Oracle Business intelligence, we used to give user as Administrator and password as Administrator.
At this point, can we authentication the userid and password which is stored in external table in a users schema?
~ John"Administrator" will always be a user which is registered in the repository. All other users can be authenticated by external table authentication.
You can create an init block which sets the USER system variable by
SELECT user FROM users WHERE user = ':USER' and password = ':PASSWORD' -
Hello ,
After upgrade , we have observed that there are junk characteristics in field PLZU-PLNNR ( Key for Task List Group)
Could someone explain the contents of table PLZU & what are the dependencies of PLZU with other PL* tablesHello,
I'm not sure I got your exact request.
Below you can find the routing tables and you can chech the contect of each in the TA SE11
(the key fields are always flagged in the tables).
Routing
PLPO Routing Operation Details
PLKO Routing Header Details
MAPL Routing Link to Material
PLAB Relationships - Standard Network
PLAS Task List - Selection of Operations
PLMZ Component Allocation
PLPH CAPP Sub-operations
PLFH PRT Allocation
PLWP Maintenance Package Allocation
PLMK Inspection Characteristics
Best Regards,
Dora -
How to fetch the data from query to internal table ?
Dear all ,
I would like to fetch the query data(sq01) into my internal table ? is it possible to do that ?
Best Regards,
CarlosHi
Try this <b>RRW3_GET_QUERY_VIEW_DATA</b>
Also, you can have a look at this...
<a href="/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii Query results into Internal table</a>
Regards
Raj -
Hi All,
I have one logical issue related to internal table manipulation.
I have one internal table :
I_DAT - This is related to Loading/Unloading of Goods.
for example with 3 fields
VSTEL, KUNNA, KMMANG.
Now suppose my data looks like this after sorting:
VSTEL KUNNA KMMANG
100 - -
200 - -
300 - -
400 - -
- 500 X
- 600 X
- 700 X
- 800 X
Here 100,200,300,400 are Loading points.
ANd 500,600,700,800 are unloading points.
Now what i want is For loading & Unloading points i need to pick up Address and print one after other.
But how they need to print is:
FOR INITIAL LOADING OF
ADDRESS- For 100
FIRST STOP: FOR LOADING OF
ADDRESS- For 200
SECOND STOP: FOR LOADING OF
ADDRESS- For 300
Etc .....
Then
FOR UNLOADING OF:
ADDRESS- For 400
FIRST STOP: FOR UNLOADING OF
etc.
FINAL STOP: FOR FINAL UNLOADING OF
We might get as many records :
Can any body give me the logic:
Printing Address is not a problem:
But Above every address we need to print FIRST STOP, SECOND etc like that.
For this i need logic.
Can anybody give the solution!
Thanks in advance.
Thanks & Regards,
Prasad.Try this.I think you want output like this......
DATA: BEGIN OF LINE,
CARRID TYPE SBOOK-CARRID,
CONNID TYPE SBOOK-CONNID,
FLDATE TYPE SBOOK-FLDATE,
CUSTTYPE TYPE SBOOK-CUSTTYPE,
CLASS TYPE SBOOK-CLASS,
BOOKID TYPE SBOOK-BOOKID,
END OF LINE.
DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY TABLE LINE.
SELECT CARRID CONNID FLDATE CUSTTYPE CLASS BOOKID
FROM SBOOK INTO CORRESPONDING FIELDS OF TABLE ITAB.
LOOP AT ITAB INTO LINE.
AT FIRST.
WRITE / 'List of Bookings'.
ULINE.
ENDAT.
AT NEW CARRID.
WRITE: / 'Carrid:', LINE-CARRID.
ENDAT.
AT NEW CONNID.
WRITE: / 'Connid:', LINE-CONNID.
ENDAT.
AT NEW FLDATE.
WRITE: / 'Fldate:', LINE-FLDATE.
ENDAT.
AT NEW CUSTTYPE.
WRITE: / 'Custtype:', LINE-CUSTTYPE.
ENDAT.
WRITE: / LINE-BOOKID, LINE-CLASS.
AT END OF CLASS.
ULINE.
ENDAT.
ENDLOOP.
This is also helpful......
LOOP AT <itab>.
AT FIRST. ... ENDAT.
AT NEW <f1>. ...... ENDAT.
AT NEW <f2 >. ...... ENDAT.
<single line processing>
AT END OF <f2>. ... ENDAT.
AT END OF <f1>. ... ENDAT.
AT LAST. .... ENDAT.
ENDLOOP.
Regards
Abhishek -
Data selection from internal table.
Hi all,
Can anyone suggest me the replacement of the statement:
Select sum( col1 ) from table into var1 where col2 = 'abc' and col3 like '1.%' or col3 = 1.
above statement works on database table but i need the same query on an internal table.
please tell me.
Thanks in advance
RahulPLEASE HELP !
points will be awarded. -
Multiple internal table display
Hi All,
I have query regarding the internal tables,
Is it possible to display more than one internal table in ABAP List view
one beneath another......in the same page.....?
thanks in advance.....Hi,
Yes, in classical do like this
loop at itab.
write:/
endloop.
loop at itab1.
write:/
endloop.
and in alv refer this code.
*& Form sub_alv_display *
This form displays the output using REUSE_ALV_GRID_DISPLAY *
function module *
FORM sub_alv_display .
*--Local Variables
DATA : lv_index LIKE sy-tabix.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
wa_layout1-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout1
it_fieldcat = it_fieldcat[]
i_tabname = 'it_final'
it_events = it_events
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
LOOP AT it_fieldcat INTO wa_fieldcat.
lv_index = sy-tabix.
IF wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-fieldname = 'TITLE'.
wa_fieldcat-seltext_m = text-026.
wa_fieldcat-outputlen = 10.
ENDIF.
MODIFY it_fieldcat FROM wa_fieldcat INDEX lv_index TRANSPORTING
fieldname seltext_m outputlen.
CLEAR : wa_fieldcat.
ENDLOOP.
wa_layout2-no_colhead = 'X'.
wa_layout2-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout2
it_fieldcat = it_fieldcat[]
i_tabname = 'it_total'
it_events = it_event1
TABLES
t_outtab = it_total
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
wa_layout3-no_colhead = 'X'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout3
it_fieldcat = it_fieldcat2[]
i_tabname = 'it_ship'
it_events = it_event2
TABLES
t_outtab = it_ship
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
IF NOT it_final IS INITIAL OR
NOT it_total IS INITIAL OR
NOT it_ship IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
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.
ENDIF.
ENDFORM. "sub_alv_display
Regards,
Prashant -
Hi 2 all,
How to join two internal tables in abap,
give me a exampleHi raja,
We have to use FOR ALL ENTRIES
to join internal tables.
1. INNER JOIN
DBTAB1 <----
> DBTAB2
It is used to JOIN two DATABASE tables
having some COMMON fields.
2. Whereas
For All Entries,
DBTAB1 <----
> ITAB1
is not at all related to two DATABASE tables.
It is related to INTERNAL table.
3. If we want to fetch data
from some DBTABLE1
but we want to fetch
for only some records
which are contained in some internal table,
then we use for alll entries.
1. simple example of for all entries.
2. NOTE THAT
In for all entries,
it is NOT necessary to use TWO DBTABLES.
(as against JOIN)
3. use this program (just copy paste)
it will fetch data
from T001
FOR ONLY TWO COMPANIES (as mentioned in itab)
4
REPORT abc.
DATA : BEGIN OF itab OCCURS 0,
bukrs LIKE t001-bukrs,
END OF itab.
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
itab-bukrs = '1000'.
APPEND itab.
itab-bukrs = '1100'.
APPEND itab.
SELECT * FROM t001
INTO TABLE t001
FOR ALL ENTRIES IN itab
WHERE bukrs = itab-bukrs.
LOOP AT t001.
WRITE :/ t001-bukrs.
ENDLOOP.
regards,
amit m.
Maybe you are looking for
-
Kernel panic crashes ! 12" PB, 10.5.2
Hi all, does anyone know what might be leading to many, many kernel panic crashes by looking at this log ? this is after re-installing to leopard fresh, then to tiger, then back to leopard, then wondering if it's just running too hot but these crashe
-
I have a problem resetting my itunes account password
I have a problem resetting my itunes account password have loas the aswer to my secret password and my password to my email account, what to do? contact me at [email protected]
-
Can't connect to db - tried several solutions in forum
All, I have researched this on the forums, and can't seem to find a solution that matches my problem.. My VM got messed up due to memory issues and crashed.. BSOD for DRIVER_IRQL_NOT_LESS_LOR_EQUAL.. So I rebooted.. started my WLS_FORMS and WLS_REPOR
-
I have ExportPDF and now I cannot open any of my PDF files in my documents. Why?
I just signed up for AdobeExportPDF, and now I cannot open any of my existing PDF documents in my files. Why? How can I fix this?
-
Hi all! First I apologize my poor english. Developping a web service secured by wssecurity (apache's wss4j) I got this following apache's guide (http://ws.apache.org/wss4j/axis.html): AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Mu