Extract Cube data for all entries of an internal table
Hi
I want to fetch the data from the cube for all entries of another internal table.
Scenario : Fetching the COMPANY_CODE and DATE into an internal table and for those company codes and Dates, I have to fetch the records of the Cube.,
I am using the Function Module : RSDRI_INFOPROV_READ
But not sure how to accommodate the multiple selections condition for this.
Selection Required:
*For all entries of it_cc
where comp_code = it_cc-comp_code and
date = it_cc-date.*
Please help me how to such multiple conditions and "for all entries" functionality for fetching the data from the cube.
Thanks.
Veera Karthik G
HI
You can try like this
LOOP AT lt_donotcall_old .
<ls_donotcall>-examination_date = sy-date.
<ls_donotcall>-examination_time = sy-time.
ENDLOOP.
append it_donotcall_old.
Reward all helpfull answers
Regards
Pavan
Similar Messages
-
For all entries with 2 internal table
HI experts.
How to use 2 for all entries in a select statement.
Below refer to my below code.
select vbeln matnr lfimg vgbel posnr from lips into corresponding fields of table
it_lips for all entries in it_likp where
vbeln = it_likp-vbeln and
matnr = it_mara-matnr.
I want to add another for all entries it_mara.
Please help me .Thanks in advanced.hi,
it is possible....
use this query...
declare another internal table of the same type as it_lips.
data : it_lips_final like it_lips.
select vbeln matnr lfimg vgbel posnr from lips into corresponding fields of table
it_lips for all entries in it_likp where
vbeln = it_likp-vbeln .
loop at it_lips.
read table it_mara into it_mara with key matnr = it_lips-matnr.
if sy-subrc = 0.
append it_lips to it_lips_final.
endif.
endloop.
refresh it_lips[].
it_lips[] = it_lips_final[]
what the above code does is selects all the entries of vbeln from lips and filters it in the loop reading it from mara checking for matnr value and finally
all the entries according to your requirement is there in it_lips_final which we move it to it_lips again...
this is something similar to writing a for all entries for 2 table.... but in another fashion
Regards
Siddarth -
Using for all entries of two internal tables in where clause of the select
Hi experts,
My requirement is, need to select Marc-minbe and wrpl-sobst, for all the entries of the two internal tables it_mara , and it_t001w.
here is the select queries i have used,
select matnr normt from mara into it_mara for all entries in it_data where normt = it_data-normt.
select konnr werks from t001w into it_t001w for all entries in it_data where konnr = it_data-konnr.
now i need to select minbe of marc table and sobse of wrpl table for all the entries of above internal tables, it_mara and it_t001w, using both matnr of it_mara and werks of it_t001w in where condition.
Pls advise how i can do it.
Thanks.
Moderator message: very basic, please work on this yourself first, these forums are not a substitute for ABAP training.
Edited by: Thomas Zloch on Dec 6, 2010 9:38 AMHi
call SE16 with table TFTIT in order to get a full list (it will be long...)
A list of FMs with parameters can be found in table FUNCT.
Finally go to sm37rsdf4
that will give you all the function modules with description
Here is the list:
http://www.erpgenie.com/abap/functions.htm
hope this helps...
Regards
CSM Reddy -
Read MULTIPLE idocs data with all sgmn to my internal table in a single
Dear SAP Folks!
I have a question, I know to read SINGLE idoc data with all segments, we have FM IDOC_READ_COMPLETELY but my requirement is to Read MULTIPLE idocs data with all segments to my internal table in a single shot without keeping this FM in loop! since it is performance issue, at a time i may want to read 1000 idocs data!
Could anyone please let me know is there any way to get this, keeping mind of performance and any other FM?
Best Regards,
SriniHi,
I know idoc numbers and i can write a select Query to DB table EDID4 to get all segments data to my internal table. But i am looking for FM to do this. because i have too many number of idocs and each idoc is having many segments(I am thinking in performance point of view!) The FM IDOC_READ_COMPLETELY can accept only ONE IDOC number as import parameters at a time to get segment data. in similar way do we have any other FM? or other way? except select query to EDID4 table?
Best Regards,
Srini -
Read data : for all entries
wht happens if v read data using FOR ALL ENTRIES in select statement
Hi Ankur,
You can only use FOR ALL ENTRIES IN ...WHERE ...in a SELECT statement.
SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result set. If the internal table itab does not contain any entries, the system treats the statement as though there were no WHERE cond condition, and selects all records (in the current client).
For Example:
SELECT *
FROM SCARR
INTO TABLE t_scarr.
LOOP AT t_SCARR INTO wa_scarr.
SELECT SINGLE *
FROM sflight
INTO wa_sflight
WHERE carrid EQ wa_scarr-carrid.
APPEND wa_sflight TO t_sflight.
ENDLOOP.
Instead of the Above use below code:
SELECT *
FROM SCARR
INTO TABLE t_scarr.
SELECT *
FROM SFLIGHT
INTO TABLE t_sflight
FOR ALL ENTRIES IN scARR
WHERE carrid EQ t_scarr.
this condition, return all entries of the sflight
Refer the Below Links for more Info:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm
Regards,
Sunil -
FOR ALL ENTRIES IN with two tables
Hi Guy's,
I have two int. tables, gt_likp, gt_lips.
I need to use "FOR ALL ENTRIES IN" with this two tables.
SELECT matnr
vkorg
vtweg
ypcogsl
FROM mvke
INTO TABLE gt_mvke
<b> "FOR ALL ENTRIES IN gt_likp gt_lips"</b>
WHERE matnr = gwa_liefpos_tab-matnr
AND vkorg = gt_likp-vkorg
AND vtweg = gt_lips-vtweg.
How to do this?
Please Help.
Thanks in Advance.Hi,
Fill gt_likp-vkorg values in a range(r_vkorg). Use gt_lips in FOR ALL ENTRIES.
Basically you can use only 1 internal table with FOR ALL ENTRIES statement.
SELECT matnr
vkorg
vtweg
ypcogsl
FROM mvke
INTO TABLE gt_mvke
FOR ALL ENTRIES IN gt_lips
WHERE matnr = gwa_liefpos_tab-matnr
AND vkorg in r_vkorg
AND vtweg = gt_lips-vtweg.
- SRao -
For all entries with large sets
Hello All,
Does for all entries have restriction that the itab should not exceed the maximum entries? Look at code below:
select pernr raufpl raplzl catshours
from catsdb
into corresponding fields of table lit_catshrs
for all entries in itab
where pernr = itab-pernr
and status in ('10', '20', '30')
and workdate in s_date.
if itab have 7000 entries in production system, will the select statement cause a short dump such as DBIF_RSQL_INVALID_RSQL?
Thanks,
Alex MHi,
check the sequence of the fields in the internal table lit_catshrs
Because RSQL error occurs because of this.
and Whenevr you use for all entries of some Internal Table it is a must to check that
IF not ITAB[] Is initial.
< write the select>
endif.
Other performance related thing w.r.t to ABAP are
1) Dont use nested seelct statement
2) If possible use for all entries in addition
3) In the where addition make sure you give all the primary key
4) Use Index for the selection criteria.
5) You can also use inner joins
6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234
reward if useful
regards,
Anji -
Here iam using for-all-entries.
Hi...
2....here iam using for-all-entries.
if the internal table is empty.then what will happen for next select statement.
thanks and regards,
k.swaminathHi
if you write like this
<b>select data from table into itab where condituioj
select data from table into itab1 for all entries in itab where condition</b>
with out checking the weather the above select statement have data or not then it will give all the data which eist in that table
<b>select data from table into itab where condituioj
if not itab[] is initial
select data from table into itab1 for all entries in itab where condition
endif.</b>
in this sitvation you don't get any data
reward if usefull -
2 for all entries with different condition
Hi
i have an internal 2 internal table which have the following field
ITAB1 : Stock category, plant, storage location , SKU code (those value are given though flat file)
ITAB2 : Grid value , meterial NO, SKU code (those values are determine through a FM where we export the SKU code and it will retreive the matnr and grid value in an ITAB2)
I have to do select FROM database MCHB
with the condition Grid value , material NO , Stock category, plant, storage location
Note that gris value and matnr are found in two different internal table i was thinking of doing for all entries but
is it possible to do for all entries from 2 internal table
SELECT FOROM MCHB
FOR ALL ENTRIES in ITAB1
FOR ALL ENTRIES in ITAB2
WHERE
grid value = itab2-gridvalue
matnr = itab2-matnr
stock cat = itab1-stock cat
plant = itab1-plant
storage location = itab1-storage location
Please help on how to tackle this?Hi,
You have to create a new third internal table with the fields matnr, grid value, stock category, plant and storage location....
Then process the itab1 and get the process the itab2 for the corresponding SKU Code (which I believe is the common field for both of the internal tables) and then populate the third internal table itab3...
Then use the itab3 for the FOR ALL ENTRIES.
Thanks
Naren -
Use of for all entries in abap
Please tell me how to use "for all entries" in linking two
tables for retrieve informations by using corresponding fields in both the tables.plz send the codings.REPORT YVCHIERSEQ .
TYPE-POOLS:SLIS.
DATA:T_VBAK TYPE STANDARD TABLE OF VBAK INITIAL SIZE 0,
T_VBAP TYPE STANDARD TABLE OF VBAP INITIAL SIZE 0,
W_VBAK TYPE VBAK,
W_VBAP TYPE VBAP,
G_VBELN TYPE VBAK-VBELN,
W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
W_KEYINFO TYPE SLIS_KEYINFO_ALV.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS:S_VBELN FOR G_VBELN.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION.
CLEAR:W_VBAK,
W_VBAP.
REFRESH:T_VBAK,
T_VBAP.
START-OF-SELECTION.
PERFORM SUB_GET_VBAK.
PERFORM SUB_GET_VBAP.
PERFORM SUB_DISP_OUTPUT.
FORM SUB_GET_VBAK.
SELECT * FROM VBAK INTO TABLE T_VBAK WHERE VBELN IN S_VBELN.
ENDFORM.
FORM SUB_GET_VBAP.
SELECT * FROM VBAP INTO TABLE T_VBAP FOR ALL ENTRIES IN T_VBAK WHERE
VBELN = T_VBAK-VBELN.
ENDFORM.
FORM SUB_DISP_OUTPUT.
W_FIELDCAT-COL_POS = 1.
W_FIELDCAT-FIELDNAME = 'VBELN'.
W_FIELDCAT-SELTEXT_M = 'SALESORDER'.
W_FIELDCAT-TABNAME = 'VBAK'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 2.
W_FIELDCAT-FIELDNAME = 'ERNAM'.
W_FIELDCAT-SELTEXT_M = 'NAME'.
W_FIELDCAT-TABNAME = 'VBAK'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 3.
W_FIELDCAT-FIELDNAME = 'VBTYP'.
W_FIELDCAT-SELTEXT_M = 'SD CATEGORY'.
W_FIELDCAT-TABNAME = 'VBAK'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 4.
W_FIELDCAT-FIELDNAME = 'KUNNR'.
W_FIELDCAT-SELTEXT_M = 'SOLD TO PARTY'.
W_FIELDCAT-TABNAME = 'VBAK'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 5.
W_FIELDCAT-FIELDNAME = 'NETWR'.
W_FIELDCAT-SELTEXT_M = 'NET VALUE'.
W_FIELDCAT-TABNAME = 'VBAK'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 1.
W_FIELDCAT-FIELDNAME = 'POSNR'.
W_FIELDCAT-SELTEXT_M = 'SALES ITEM'.
W_FIELDCAT-TABNAME = 'VBAP'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 2.
W_FIELDCAT-FIELDNAME = 'MATNR'.
W_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
W_FIELDCAT-TABNAME = 'VBAP'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 3.
W_FIELDCAT-FIELDNAME = 'MATKL'.
W_FIELDCAT-SELTEXT_M = 'MAT GROUP'.
W_FIELDCAT-TABNAME = 'VBAP'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_FIELDCAT-COL_POS = 4.
W_FIELDCAT-FIELDNAME = 'NETWR'.
W_FIELDCAT-SELTEXT_M = 'NET VALUE'.
W_FIELDCAT-TABNAME = 'VBAP'.
APPEND W_FIELDCAT TO T_FIELDCAT.
CLEAR W_FIELDCAT.
W_KEYINFO-HEADER01 = 'VBELN'.
W_KEYINFO-ITEM01 = 'VBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = SY-CPROG
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT =
IT_FIELDCAT = T_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
i_tabname_header = 'VBAK'
i_tabname_item = 'VBAP'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = W_KEYINFO
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab_header = T_VBAK
t_outtab_item = T_VBAP
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.
ENDFORM. -
Select statment using FOR ALL ENTRIES not allow to do sum,
Hi All,
SELECT DELIV_NUMB
SUM( GRS_WGT_DL )
UNIT_OF_WT
FROM /BIC/AGSSD000600
INTO TABLE I_GROSS
FOR ALL ENTRIES IN I_LAYTWO
WHERE DELIV_NUMB = I_LAYTWO-DELIV_NUMB
GROUP BY DELIV_NUMB UNIT_OF_WT.
While compiling it shows the error
The addition "FOR ALL ENTRIES" excludes all aggregate functions with
the exception of "COUNT( * )", as the single element of the SELECT
clause.
Please give some solution to do sum
with regards,
Thambe .You could just select all entries into an internal table and then loop through and use COLLECT or similar to get your sum values.
Gareth. -
Advice required on a select statement using "FOR ALL ENTRIES"
Hi,
this is really intresting ...
I have a small requirement where in i have to find out
the valid entries in my internal table (T_MATNR) by using a select statement to a check table (MARA) which has all the fields present in the internal table T_MATNR.
Select statement is
SELECT MATNR
MTART
from MARA
for all entries in T_MATNR
into table T_MATNR
where matnr eq T_MATNR-MATNR.
If you observe the itab in the option 'FOR ALL ENTRIES' and the destination table is the same. I want to know whether this is correct? will it cause any performance issue? right now this statement is working fine for me.Hi,
U have to use
SELECT MATNR
MTART
from MARA
<b>into table I_MATNR(different table)</b>
for all entries in T_MATNR
where matnr eq T_MATNR-MATNR.
If u r specifying both same table name then for what entries it will retrieve, if u have alreay selected some entries and appending u can use
SELECT MATNR
MTART
from MARA
<b>into table T_MATNR</b>where matnr eq T_MATNR-MATNR.
then
SELECT MATNR
MTART
from MARA
<b>appending table T_MATNR</b>
for all entries in T_MATNR
where matnr eq T_MATNR-MATNR.
In this way u can do.
Hope u got it. -
Can we load data for all levels in ASO cube
Hi All,
Can we load data for all levels of members in ASO cube in 9.3.1.
RegardsYes you can load data for all levels in an ASO cube in any version HOWEVER, none of the upper level data in any cube will be there when you look for it. You will get a warning message in the load because ASO cubes don't store data at upper levels. It is the same as loading data into dynamic calc members in BSO cube. It will do the load without compalints, but there will be no data there (At least you get the warning in ASO)
-
Data Type mismatch in for all entries.
Dear Friends,
I have a problem...please advice me for that..... I m using code as following...actually the isse is when ever i am using
WHERE docno = it_j_1iexchdr-rdoc (along with FOR ALL ENTRIES IN) the error is occured data type mismatch.
becoz DOCNO is field of(j_1iexchdr) and RDOC is a character field of same table...but i want to get reference data..so i need to compare both field...u can undersdand my requirement in following coding.. Error line is denoted by (<----
DATA: BEGIN OF it_j_1iexchdr OCCURS 0,
bukrs LIKE j_1iexchdr-bukrs, " Company Code.
exnum LIKE j_1iexchdr-exnum, " Excise Invoice No.
exdat LIKE j_1iexchdr-exdat, " Excise Invoice Dt.
kunag LIKE j_1iexchdr-kunag, " Sold-to-party
kunwe LIKE j_1iexchdr-kunwe, " Ship-to-party
rdoc LIKE j_1iexchdr-rdoc,
rdoc TYPE j_1iexchdr-docno,
addldata1 LIKE j_1iexchdr-addldata1, " Reason for Issueing Excise Invoice
exbed LIKE j_1iexchdr-exbed, " Excise Duty
ecs LIKE j_1iexchdr-ecs, " 2%Cess
exaddtax1 LIKE j_1iexchdr-exaddtax1, " Shec
trntyp LIKE j_1iexchdr-trntyp, " OTHR
END OF it_j_1iexchdr.
DATA: wa_j_1iexchdr LIKE it_j_1iexchdr.
DATA: BEGIN OF it_j_1iexchdr1 OCCURS 0,
trntyp LIKE j_1iexchdr-trntyp,
docno LIKE j_1iexchdr-rdoc,
rdoc LIKE j_1iexchdr-rdoc,
END OF it_j_1iexchdr1.
DATA: wa_j_1iexchdr1 LIKE it_j_1iexchdr1.
SELECT bukrs exnum exdat kunag kunwe rdoc
addldata1 exbed ecs exaddtax1 trntyp
FROM j_1iexchdr
INTO CORRESPONDING FIELDS OF TABLE it_j_1iexchdr
WHERE bukrs IN v_bukrs
AND exdat IN v_exdat
AND trntyp = 'OTHR'.
IF it_j_1iexchdr[] IS NOT INITIAL.
SELECT trntyp docno rdoc
FROM j_1iexchdr
INTO CORRESPONDING FIELDS OF table it_j_1iexchdr1
FOR ALL ENTRIES IN it_j_1iexchdr
WHERE docno = it_j_1iexchdr-rdoc <----
I
AND trntyp = 'DLFC'.
ENDIF.
Pl help me as soon as possible...
Thanks & Regards,
Swapnika PanseHi,
In table j_1iexchdr, there are two fields
RDOC J_1IRDOC1 CHAR 10 Reference Document 1
DOCNO J_1IDOCNO NUMC 10 Internal Excise Document Number
RDOC is of character type and DOCNO is of numeric type.
Your declaration for fields is :
docno LIKE j_1iexchdr-rdoc,
rdoc LIKE j_1iexchdr-rdoc,
And in the select query you are trying to fetch docno which is of type j_1iexchdr-rdoc. SO, change your declaration from
docno LIKE j_1iexchdr-rdoc,
to
docno LIKE j_1iexchdr-docno,
This should solve your problem.
Thanks,
Archana -
Unable to Get the Data Using For All Entries
Hi everybody, i am using for all entries in a program. but when i am writing a code using for all entries i am getting an error as
Where condition does not refers to the FOR ALL ENTRIES tables...
SELECT KUNNR
NAME1
ORT01
LAND1
FROM KNA1 INTO TABLE ITAB1 WHERE KUNNR IN S_KUNNR.
IF NOT ITAB1 IS INITIAL.
SELECT VBELN
ERDAT
KUNNR
FROM VBAK INTO TABLE ITAB2 FOR ALL ENTRIES IN ITAB1 WHERE KUNNR = IT_KNA1-KUNNR.
ENDIF.
can anybody help out in this
regards
hyder aliThe correct one may be like this:
SELECT KUNNR
NAME1
ORT01
LAND1
FROM KNA1 INTO TABLE ITAB1 WHERE KUNNR IN S_KUNNR.
IF NOT ITAB1 IS INITIAL.
SELECT VBELN
ERDAT
KUNNR
FROM VBAK INTO TABLE ITAB2 FOR ALL ENTRIES IN ITAB1 WHERE KUNNR = ITAB1-KUNNR. "modified here
ENDIF.
Edited by: XuJian84 on Mar 9, 2010 4:25 AM
Maybe you are looking for
-
Web does not work after downloading Opera Mobile
For two months now, my phone has been working perfectly, but three days ago, after I'd downloaded Opera Mobile, I'm not able to use the Web app on my phone. In fact, I can't open the Nokia Store or the Ovi Music Store using my home Wi-Fi connection.
-
How to add new line item to SO using BAPI_SALESORDER_CREATEFROMDAT2
Hi, I have sales order A with 1 line item, now i want to add new line item with material x and quantity y to the existing sales order A using BAPI_SALESORDER_CREATEFROMDAT2. Line item no for new line item should be generated by SAP internally.Please
-
Checks if item field link exists into a custom list
Hi; I have a custom list with 2 columns : Title and SITE (field link) Title (text) : SITE (link) : URL + DESCRIPTION I would like to write in programmming a code which allows to checks before to add a new item if this item exists or not into the l
-
Hi guys, Hi group, I would like to ask for your advice in the following matter: In standard, the Segment builder has an export function ("Export in file") that will take BP identification data. We need to add in the selection, data such as the market
-
New iMac 27" running 10.8.2. Can not dowload PDFs. Have taken two Adobe plugins out of library (as suggested in comments I found last night). Did not fix proglem. Older iMac running 10.6.8 sitting next to new one can download fine. Then have to move