HOW TO PRINT THE MATTER IN FOR ALL ENTRIES
HI HOW T PRINT THE FOR ALL ENTRIES MATTER
Hi Naresh,
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 sflight INTO wa_sflight
FOR ALL ENTRIES IN ftab
WHERE CARRID = ftab-carrid AND
CONNID = ftab-connid AND
fldate = '20010228'.
This condition, return all entries of the sflight.
When using FOR ALL ENTRIES the number of matching records is restricted to the number of records in the internal table. If the number of records in the database tables is too large then join would cause overheads in performance. Additionally a JOIN bypasses the table buffering.
Thanks,
Reward If Helpful.
Similar Messages
-
How accurate is the notation feature for all of you??
how accurate is the notation feature for all of you??
thanksHi,
what I normally do when I'm making a score, is that I quantize the part I recorded to, say, 1/16th. If I play the quantized part, it should sound exactly what I intended. If not, I make corrections. This way, I'm pretty sure that the interpretation of the score window will be pretty accurate. Otherwise, the score could interprete a note that's a bit too early or a bit too late as a 1/32 note, and make a mess of the notes.
When playing full piano scores, make sure to play as simple as possible, because embellishments also make messier scores.
Kind regards,
Jaap -
Hi guru's what is the diff between for all entries & joins
hi guru's what is the diff between for all entries & joins
Hi Vasu,
Joins are used to fetch data fast from Database tables:
Tables are joined with the proper key fields to fetch the data properly.
If there are no proper key fields between tables don't use Joins;
Important thing is that don't USE JOINS FOR CLUSTER tableslike BSEG and KONV.
Only use for Transparenmt tables.
You can also use joins for the database VIews to fetch the data.
JOINS
... FROM tabref1 [INNER] JOIN tabref2 ON cond
Effect
The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary.
In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON>cond.
Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same:
Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
a4
b4
c4
3
|--|||--|
Inner Join
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
1
e1
f1
g1
h1
a4
b4
c4
3
3
e2
f2
g2
h2
|--||||||||--|
Example
Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
DATA: DATE LIKE SFLIGHT-FLDATE,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID.
SELECT FCARRID FCONNID F~FLDATE
INTO (CARRID, CONNID, DATE)
FROM SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID AND
FCONNID = PCONNID
WHERE P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / DATE, CARRID, CONNID.
ENDSELECT.
If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
Note
In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
Example
Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
DATA: DATE LIKE SFLIGHT-FLDATE,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID.
SELECT FCARRID FCONNID F~FLDATE
INTO (CARRID, CONNID, DATE)
FROM SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID
WHERE FCONNID = PCONNID
AND P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / DATE, CARRID, CONNID.
ENDSELECT.
Note
Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
Only a table or view may appear to the right of the JOIN operator, not another join expression.
Only AND is possible in the ON condition as a logical operator.
Each comparison in the ON condition must contain a field from the right-hand table.
If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
Note
In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
Variant 3
... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond
Effect
Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
Left outer join between table 1 and table 2 where column D in both tables set the join condition:
Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
a4
b4
c4
3
|--|||--|
Left Outer Join
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
1
e1
f1
g1
h1
a3
b3
c3
2
NULL
NULL
NULL
NULL
NULL
a4
b4
c4
3
3
e2
f2
g2
h2
|--||||||||--|
Example
Output a list of all custimers with their bookings for October 15th, 2001:
DATA: CUSTOMER TYPE SCUSTOM,
BOOKING TYPE SBOOK.
SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
BOOKING-BOOKID)
FROM SCUSTOM LEFT OUTER JOIN SBOOK
ON SCUSTOMID = SBOOKCUSTOMID AND
SBOOK~FLDATE = '20011015'
ORDER BY SCUSTOMNAME SBOOKFLDATE.
WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
BOOKING-BOOKID.
ENDSELECT.
If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or using an alias.
Note
For the resulting set of a SELECT command with a left outer join in the FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Since not all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outer join, the syntax has been restricted to those cases that return the same solution in all database systems:
Only a table or view may come after the JOIN operator, not another join statement.
The only logical operator allowed in the ON condition is AND.
Each comparison in the ON condition must contain a field from the right-hand table.
Comparisons in the WHERE condition must not contain a field from the right-hand table.
The ON condition must contain at least one "real" JOIN condition (a condition in which a field from tabref1 as well as from tabref2 occurs).
Note
In some cases, '*' may be specivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the llen in der FROM clause, according to the structure of each table work area. There can be gaps between the table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, as in the following example (not simply by counting the total number of fields).
Example
Example of a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001 where there are available places, and display the name of the airline.
DATA: BEGIN OF WA,
FLIGHT TYPE SFLIGHT,
PFLI TYPE SPFLI,
CARR TYPE SCARR,
END OF WA.
SELECT * INTO WA
FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID AND
FCONNID = PCONNID )
INNER JOIN SCARR AS C
ON FCARRID = CCARRID
WHERE P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID,
WA-FLIGHT-CONNID.
ENDSELECT.
And for all entries,
this will help u.
use of FOR ALL ENTRIES:
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.
cheers,
Hema. -
What is the use of for all entries in select statement
what is the use of for all entries in select statement
hi,
FOR ALL ENTRIES is an effective way of doing away with using JOIN on two tables.
You can check the below code -
SELECT BUKRS BELNR GJAHR AUGDT
FROM BSEG
INTO TABLE I_BSEG
WHERE BUKRS = ....
SELECT BUKRS BELNR BLART BLDAT
FROM BKPF
INTO TABLE I_BKPF
FOR ALL ENTRIES IN I_BSEG
WHERE BUKRS = I_BSEG-BUKRS
AND BELNR = I_BSEG-BELNR
AND BLDAT IN SO_BLDAT.
*******************************8
look another example
what is the use of FOR ALL ENTRIES
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.
Hope this helps!
Regards,
Anver
<i>if hlped pls mark points</i> -
How to set the default settings for all users in 11.1.1.3
I have couple of questions
1. How can I change the default setting for all the users so that whenever they log in the planning takes them to the Task lists mode. Or is this a one time thing which they need to do individually ?
2. How can I set the defalut setting for all the users so that they can see the same page when they log into Workspace ?For workspace have a read of - http://docs.oracle.com/cd/E12825_01/epm.111/bpmui_admin/assigning_default_preferences.html
For planning you can't really set it without hacking tables.
Cheers
John
http://john-goodwin.blogspot.com/ -
How to find the workflow admins for all costcenters ?
Dear SRM gurus
We are using Classic scenario with N th step workflow with BADI.
we have a requirement.
How to find the workflow admins for the particular costcenters.
we used HRV1222A where ATTRIB EQ <Z attribute>(This is our own attribute to group all the costcenters)
used table HRP1001 to find the Admins but results are not correct because it is not showing my user id(I have all authorisations).
Is there anyway to find all the admins for a cost center(users are more than 7000+)
can anybody send work flow related presentations or cookbook
Thanks in Advance.
srinuhi
I have not received any thing.Please send again
[email protected]
[email protected] -
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 -
What is the usage of for all entries ?
What is the Usage of read table after using for all entries ?
In the following example what exactly it is doing ?
Usage of 'for all entries' in Select Statement
FORM data_retrieval.
DATA: ld_color(1) TYPE c.
DATA: BEGIN OF T_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
END OF T_VBAP.
DATA: BEGIN OF T_VBFA OCCURS 0,
VBELV LIKE VBFA-VBELV,
VBELN LIKE VBFA-VBELN,
VBTYP_N LIKE VBFA-VBTYP_N,
END OF T_VBFA.
DATA: BEGIN OF T_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN,
IHREZ LIKE VBAK-IHREZ,
END OF T_VBAK.
DATA: BEGIN OF T_KNA1 OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
END OF T_KNA1.
DATA: BEGIN OF T_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
END OF T_MAKT.
SELECT likpvbeln likplifex likpbldat likpwadat likpwadat_ist likpkodat likp~lfart
likpkunnr likpvstel lipsposnv lipslfimg lipsvrkme lipslgmng lips~meins
lipswerks lipslgort lipscharg lipsvbelv lipsposnr lipsmatnr
lipsvbeln LIPSVGBEL LIPSVGPOS vbupkosta vbupwbsta vbupposnr vbup~vbeln
VBAKIHREZ VBAKVBELN VBAP~VBELN
INTO CORRESPONDING FIELDS OF TABLE it_itab
FROM ( likp
INNER JOIN lips
ON lipsvbeln = likpvbeln
INNER JOIN vbup
ON vbupposnr = lipsposnr
and VBUPVBELN = LIPSVBELN )
left outer join VBAK
on VBAKVBELN = LIPSVGBEL
inner join VBAP
on VBAPVBELN = VBAKVBELN )
WHERE likp~vbeln IN so_vbeln
AND likp~lifex IN so_lifex
AND likp~lfart IN so_lfart
AND likp~kunnr IN so_kunnr
AND likp~vstel IN so_vstel
AND likp~bldat IN so_bldat
AND likp~wadat_ist IN so_wadat
AND vbup~kosta IN so_kosta
AND vbup~wbsta IN so_wbsta
AND LIPS~LFIMG NE 0.
SELECT VBELN IHREZ INTO TABLE T_VBAK
FROM VBAK
FOR ALL ENTRIES IN IT_ITAB
WHERE VBELN = IT_ITAB-VGBEL.
APPEND T_VBAK.
ENDSELECT.
SELECT VBELN MATNR POSNR INTO TABLE T_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_ITAB
WHERE VBELN = IT_ITAB-VGBEL AND
MATNR = IT_ITAB-MATNR AND
POSNR = IT_ITAB-VGPOS.
APPEND T_VBAP.
ENDSELECT.
SELECT VBELV VBELN VBTYP_N INTO TABLE T_VBFA
FROM VBFA
FOR ALL ENTRIES IN IT_ITAB
WHERE VBELV = IT_ITAB-VBELN AND
VBTYP_N = 'M' .
SELECT KUNNR NAME1 INTO TABLE T_KNA1
FROM KNA1
FOR ALL ENTRIES IN IT_ITAB
WHERE KUNNR = IT_ITAB-KUNNR.
APPEND T_KNA1.
ENDSELECT.
SELECT MATNR MAKTX INTO TABLE T_MAKT
FROM MAKT
FOR ALL ENTRIES IN IT_ITAB
WHERE MATNR = IT_ITAB-MATNR.
APPEND T_MAKT.
ENDSELECT.
*Populate field with color attributes
LOOP AT it_itab INTO wa_ITAB.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
REFRESH color.
colourize 'VBELN' 0. " .
WA_ITAB-farbe = color[].
ld_color = ld_color + 1.
Only 7 colours so need to reset color value
IF ld_color = 3. "8
ld_color = 1.
ENDIF.
CONCATENATE 'C' ld_color '10' INTO wa_ITAB-line_color.
WA_ITAB-NAME1 = ''.
WA_ITAB-MAKTX = ''.
WA_ITAB-IHREZ = ''.
WA_ITAB-VBELV = ''.
READ TABLE T_KNA1 WITH KEY KUNNR = WA_ITAB-KUNNR.
IF SY-SUBRC = 0.
WA_ITAB-NAME1 = T_KNA1-NAME1.
ENDIF.
READ TABLE T_MAKT WITH KEY MATNR = WA_ITAB-MATNR.
IF SY-SUBRC = 0.
WA_ITAB-MAKTX = T_MAKT-MAKTX.
ENDIF.
READ TABLE T_VBAK WITH KEY VBELN = WA_ITAB-VGBEL.
IF SY-SUBRC = 0.
WA_ITAB-IHREZ = T_VBAK-IHREZ.
ENDIF.
READ TABLE T_VBFA WITH KEY VBELV = WA_ITAB-VBELN.
IF SY-SUBRC = 0.
WA_ITAB-VBELVA = T_VBFA-VBELN.
ENDIF.
READ TABLE T_VBAP WITH KEY VBELN = WA_ITAB-VGBEL
POSNR = WA_ITAB-VGPOS
MATNR = WA_ITAB-MATNR.
IF SY-SUBRC = 0.
WA_ITAB-IHREZ = T_VBAK-IHREZ.
ENDIF.
wa_ekko-line_color = 'C410'.
MODIFY it_itab FROM wa_itab.
ENDLOOP.
ENDFORM. " data_retrievalhi Jyotirmoy,
The explanation below can give u an idea of wat is going in ur code..
Use of FOR ALL Entries
Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below
Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement.
If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty.
If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level.
Not Recommended
Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
Recommended
Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry.
Thankyou,
Regards. -
The select with for all entries is not working correctly
IF NOT i_ekko_ekpo[] IS INITIAL.
SELECT ebeln
ebelp
zekkn
vgabe
bewtp
menge
bpmng
shkzg
INTO TABLE i_ekbe
FROM ekbe
FOR ALL ENTRIES IN i_ekko_ekpo
WHERE ebeln EQ i_ekko_ekpo-ebeln.
AND ebelp EQ i_ekko_ekpo-ebelp.
IF sy-subrc EQ 0.
SORT i_ekbe.
ENDIF.
ENDIF.
I have a PO with 2 line items in i_ekko_ekpo. In EKBE, I have 49 recs for this PO and this select is returning only 13 recs.
I tried by commenting EBELP and still the same result.
Thanks
Kiran
Edited by: kiran dasari on May 22, 2009 9:56 PMHi Sudhi, I added these now but still no charm
SELECT ebeln
ebelp
zekkn
vgabe
bewtp
menge
bpmng
shkzg
INTO TABLE i_ekbe
FROM ekbe
FOR ALL ENTRIES IN i_ekko_ekpo
WHERE ebeln EQ i_ekko_ekpo-ebeln
AND ebelp EQ i_ekko_ekpo-ebelp
AND zekkn GE '00'
AND vgabe IN ('1','2').
And as per your note: in the 13 entries, am having duplicate also. This is something weird for me now.
Any more clues.
Thanks
Kiran -
How to handle Loop within Select For all entries
hi all,
i have a requirement where I need to include 2 country code .
so in selection screen s_bukrs has AU00 - AU99 & NZ00 -NZ99
select countrycode
from ZCTYCOD
into table lt_zctycod
where ( land1 ge s_bukrs-low(02) AND
land1 Le s_bukrs-HIGH(02).
SO countrycode entries r in table lt_zctycod.
Now I need to loop into this SELECT ...FOR ALL ENTRIES....
LOOP AT LT_ZCTCOD.
SELECT * FROM zbase
APPENDING TABLE ts_base
FOR ALL ENTRIES IN ts_zdocket
WHERE zzumicur = ts_docket-zzumicur AND
( status = c_rej OR
status = c_sus ) AND
CTYCOD = LT_ZCTCOD-Ctycod.
ENDIF.
Is there any best approach to AVOID LOOP INSIDE FOR ALL ENTRIES...any alternative approach to have good performance
APPRECIATE UR HELP
THANKSHi,
You can create ranges for your ZCTYCOD
DATA: R_ZTYCODE TYPE RANGE OF ...
so your program flow will be like this
1. select ZTYCOD into LT_ZTYCOD
2. loop at LT_ZTYCOD, assign each value to R_ZTYCODE
3. select form zbase ..... where CTYCOD in R_ZTYCODE
hope it helps -
How to print the out put for each customer in table
Dear SDN Team Members!
I've created a report and the output is displayed on the smartform for the same.
In this report, I've selected a list of customers and the report has to print the list of transactions being made by each customer in Smartform.
These details must be printed seperately for each customer.
I'm thinking of control statement AT NEW & AT END. But i don't know how to use them exactly so that the output is displayed seperately for each customer in the Smartform.
Please provide syntax and points will be awarded for.
Best Regards!Hi Krsihna,
Its simple.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = '<form name>'
importing FM_NAME = lv_func_name.
loop at itab.
at new customer. "customer must be the fisrt field in the itab and itab mus be sorted by customer.
call function lv_func_name
endat.
endloop.
Regards,
Ravi -
How to open the file writer for next entry after stream is close?
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class TryOut {
public static void main(String args[]) throws IOException{
int inputQuestionnAireNum = 0;
int inputPostCode = 0;
int inputGender = 0;
int inputAge = 0;
int x=0;
Scanner input = new Scanner(System.in);
FileWriter fwrite = new FileWriter("tryout.txt", true);
BufferedWriter out = new BufferedWriter(fwrite);
boolean invalidNum = false;
do{
System.out.print("1 new entry or 0 print");
x = Integer.parseInt(input.nextLine());
if(x == 1)
//Questionnaire Number
System.out.print("Enter Questionnaire Number [ ] ");
inputQuestionnAireNum = Integer.parseInt(input.nextLine());
out.write("NumBER OF Q: "+inputQuestionnAireNum+", ");
//Postal code
System.out.print("Enter Postal Code [ ] ");
inputPostCode = Integer.parseInt(input.nextLine());
out.write("PostCode: "+inputPostCode+", ");
//Age
System.out.print("Enter Age [ ] ");
inputAge = Integer.parseInt(input.nextLine());
out.write("Age: "+inputAge+", ");
//Gender
System.out.print("Enter Gender '1' for Male and '2' for for female [ ] ");
inputGender = Integer.parseInt(input.nextLine());
out.write("Gender: "+inputGender+", \n");
out.close();
} while(x != 0);
Result:
1 new entry or 0 print1
Enter Questionnaire Number [ ] 2
Enter Postal Code [ ] 1
Enter Age [ ] 3
Enter Gender '1' for Male and '2' for for female [ ] 4
1 new entry or 0 print1
Enter Questionnaire Number [ ] 2
Exception in thread "main" java.io.IOException: Stream closed
at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
at java.io.BufferedWriter.write(BufferedWriter.java:203)
at java.io.Writer.write(Writer.java:126)
at TryOut.main(TryOut.java:31)
Hi, how can i open the file writer stream again for next entry after it is has been closed? if i do not close(); all my entry will not be recorded to the text file. how can i solve this ?
Edited by: metaroot on Feb 18, 2008 6:39 PMThe short answer to your question: use out=new BufferedWriter(fwrite) inside the do loop as well.The only difference that would make would be to make the problem worse. It is poor practice. Stream stacks should be constructed once for the life of the stream.
What he needs to do is close his stream outside the loop, possibly calling flush() where he presently has close().
The more relevant answer is: Why are you not wrapping the user-friendly PrintWriter class, wrapping it around the BufferedWriter?Possibly because he doesn't like the fact that PrintWriter swallows exceptions? which makes it less user-friendly IMO.
The println and print methods are very useful, and do not need closing between loop iterations.Neither does anything else.
By the way,you say that without a close() the BufferedWriter doesn't output to the file.I don't know: I never used/tried it.Even if it doesn't, it will surely output after you come out of the loop.If you don't want to use a PrintWriter, why don't you investigate this?Posting guesses here isn' t really much help, especially about something you've never used. A BufferedWriter has a buffer and it doesn't write anything until the buffer is full, you flush it, or your close it. -
How to list the Cert Issuer for all servers in a Domain
Hello,
The objective is to list the Server name and Cert Issuer for any Cert found in the LocalMachine\My store on all servers in a Domain.
Once I'd get to a server, probably by PS remoting, I'd issue the following:
dir cert:\localmachine\my -recurse | ? Issuer -like '*'
However, the output is Thumbprint and Subject, but I really need to see the Issuer, or what is displayed in the Certificates MMC under the 'Issued By' column. What I need in my output is the following:
ComputerName Issuer
Srv1 Acme Cert Auth
Srv2 Host1.Acme.Com
Any suggestions would be appreciated.
Thanks for your help! SdeDotAs you might suspect it is even easier than that:
$omputers |
ForEach-Object{
invoke-command -ComputerName $_ -ScriptBlock {dir cert:\localmachine\my -recurse}
} |
select PSComputerName, Issuer
¯\_(ツ)_/¯
Indeed.
=]
Both work great!
Thanks for the response and help Mike and Jrv!
Thanks for your help! SdeDot
Cheers, you're very welcome.
Don't retire TechNet! -
(Don't give up yet - 13,225+ strong and growing) -
How to change the download destination for all users in a same machine?
Hi !
Can anybody help me?
This is the scenario:
My application is going to be deployed in PCs with high rotation and politics inside the company those machines can't persist user information outside a session. This means that an user always is a new user in a PC, and when he logs off, his information (.../documents and settings/UserName/) is deleted by a central machine.
The problem is that my users always have to download the application by JWS, because JWS saves (or caches) the application inside user folders.
I know that it's possible to change download destination by a logged user, not like a global configuration.
My question is:
It is possible to configure the JWS properties (or something) to ensure that there will be only one .jar per machine not per user in the machine?
-Diego
Edited by: Diego_Trejos on Feb 16, 2009 1:06 PMYou can set up a system cache for sharing jars: See here: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/enterprise_config.03.06.html
-
How to find the Transport request for table entry
Hi ,
There was certain entry made in the SAP std table and which got transported to subsequent system. I want to find the Transport Request Number which was containign that table entry and which gor transported.
Please suggest how can I find that transport number.
Thanks
SaurabhHi,
Yes we can get , Basis team will help.
B'coz i had same requirement my basis got the TR for me.
Take their help.
He said u can like this.
SE11 - > Table Display - > Table Entry in Menu Bar - > Transport Entries.
Rhea.
Maybe you are looking for
-
I can't install itunes to windows 7 64 bit because of computing space requirements
I tried to install iTunes 10.7 on my computer but it stops when the installation says :computing space requirements. Then it just says "rolling back action", "the installation was unsuccessful". I don't know what's going on because I have more than 4
-
Hi. I have jpg image with 6.5Mb, 6000px*4500px. I load the picture to "Image" control with the same size(6000*4500) and the "Image" control is in the "Panel" control in order to enable "Scrollbar" so user can navigate picture. However, when user brow
-
Simple ws-policy demo not working
Hi Gurus, It's been quite awhile, I could not work it out though. I guess your help would be the last change to stop it from driving me crazy~ The goal is to implement a simple ws-seurity enabled webservice demo using only username/password token as
-
N95-3 pc suite media play back video/sound/off bal...
why when i make a video and up transfer it to my computer i go to the "view media" in pc suite and the video plays much slower then the sound of the video...do i have to convert the file or something..cuz i want to enjoy my videos but i cant because
-
I got a CISCO IP/VC 3511 MCU and tried to upgrade, it because there were not all of the configurations available as shown in the administrator documentation. So I started the Upgrade Utility for the 3511 and it wrote failure: you have to restart manu