Help with a select block
I have the following code and it seems to work great until the modify statement. After the program executes the statement nothing is modified in the internal table.
START-OF-SELECTION.
SELECT a~vbeln a~vstel a~route a~vsbed b~brgew a~inco1 a~inco2 a~kunnr a~kunag
b~matnr b~meins b~lgmng b~vgbel INTO CORRESPONDING FIELDS OF TABLE it_table
FROM likp AS a
INNER JOIN lips AS b ON b~vbeln = a~vbeln
WHERE a~vstel IN so_vstel
AND a~wadat_ist IN so_wadat
AND b~mtart IN so_mtart.
LOOP AT it_table INTO wa_table.
SELECT SINGLE adrnr FROM vbpa INTO w_adrnr WHERE
vbeln = wa_table-vgbel
AND parvw = 'WE'.
SELECT city1 region post_code1 INTO CORRESPONDING FIELDS OF wa_table
FROM adrc WHERE
addrnumber = w_adrnr.
ENDSELECT.
MODIFY TABLE it_table FROM wa_table.
ENDLOOP.
END-OF-SELECTION.
Regards,
Davis
declare one work area as like adrc.
data wa_adrc like adrc.
SELECT avbeln avstel aroute avsbed bbrgew ainco1 ainco2 akunnr a~kunag
bmatnr bmeins blgmng bvgbel INTO CORRESPONDING FIELDS OF TABLE it_table
FROM likp AS a
INNER JOIN lips AS b ON bvbeln = avbeln
WHERE a~vstel IN so_vstel
AND a~wadat_ist IN so_wadat
AND b~mtart IN so_mtart.
LOOP AT it_table INTO wa_table.
clear : wa_adrc.
SELECT SINGLE adrnr FROM vbpa INTO w_adrnr WHERE
vbeln = wa_table-vgbel
AND parvw = 'WE'.
if sy-subrc eq 0.
SELECT single city1 region post_code1 INTO wa_adrc
FROM adrc WHERE
addrnumber = w_adrnr.
if sy-subrc eq 0.
move wa_adrc to wa_table one by one.
endif.
endif.
MODIFY TABLE it_table FROM wa_table.
ENDLOOP.
Thanks
Seshu
Similar Messages
-
I need help with a SELECT query - help!
Hello, I need help with a select statement.
I have a table with 2 fields as shown below
Name | Type
John | 1
John | 2
John | 3
Paul | 1
Paul | 2
Paul | 3
Mark | 1
Mark | 2
I need a query that returns everything where the name has type 1 or 2 but not type 3. So in the example above the qery should bring back all the "Mark" records.
Thanks,
IanOr, if the types are sequential from 1 upwards you could simply do:-
SQL> create table t as
2 select 'John' as name, 1 as type from dual union
3 select 'John',2 from dual union
4 select 'John',3 from dual union
5 select 'Paul',1 from dual union
6 select 'Paul',2 from dual union
7 select 'Paul',3 from dual union
8 select 'Paul',4 from dual union
9 select 'Mark',1 from dual union
10 select 'Mark',2 from dual;
Table created.
SQL> select name
2 from t
3 group by name
4 having count(*) <= 2;
NAME
Mark
SQL>Or another alternative if they aren't sequential:
SQL> ed
Wrote file afiedt.buf
1 select name from (
2 select name, max(type) t
3 from t
4 group by name
5 )
6* where t < 3
SQL> /
NAME
Mark
SQL>Message was edited by:
blushadow -
Need some help with the Select query.
Need some help with the Select query.
I had created a Z table with the following fields :
ZADS :
MANDT
VKORG
ABGRU.
I had written a select query as below :
select single vkorg abgru from ZADS into it_rej.
IT_REJ is a Work area:
DATA : BEGIN OF IT_REJ,
VKORG TYPE VBAK-VKORG,
ABGRU TYPE VBAP-ABGRU,
END OF IT_REJ.
This is causing performance issue. They are asking me to include the where condition for this select query.
What should be my select query here?
Please suggest....
Any suggestion will be apprecaiated!
Regards,
DeveloperHello Everybody!
Thank you for all your response!
I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
I had created a Z table with the following fields :
ZADS :
MANDT
VKORG
ABGRU.
I had written a select query as below :
I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table
select vkorg abgru from ZADS into it_rej.
Earlier :
IT_REJ is a Work area:
DATA : BEGIN OF IT_REJ,
VKORG TYPE VBAK-VKORG,
ABGRU TYPE VBAP-ABGRU,
END OF IT_REJ.
Now :
DATA : BEGIN OF IT_REJ occurs 0,
VKORG TYPE VBAK-VKORG,
ABGRU TYPE VBAP-ABGRU,
END OF IT_REJ.
I guess this will fix the issue correct?
PLease suggest!
Regards,
Developer. -
Is it possible to make a search help with dynamic selection table?
Hi Experts,
Is it possible to create search helps with dynamic seletion tables means
i dont know the selection table names at the time of creation of search help.
These tables will be determined at runtime.
if yes, Please give an idea how to create and pass the table names at runtime.
Thanks
Yogesh GuptaHi Yogesh,
Create and fill your itab and show it with FM F4IF_INT_TABLE_VALUE_REQUEST
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'field to return from itab'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'field on your screen to be filled'
stepl = sy-stepl
window_title = 'some text'
value_org = 'S'
TABLES
value_tab = itab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Darley -
Search help with new selection within if more than 500 entries
Dear all,
I created a new search help and this works fine ... If I compare my search help with a default search help from SAP, I have 1 small feature that not seems to work ... With the default one, it is possible to make a new selection within the search help by clicking on the arrow down :
If I look at my search help, I don't have the possibility to make a new selection :
Does anyone how this can be done ?
Thanks in advance !
Greetz,
Kurt.HI,
Here are the general steps to get you started.
1. Identify the search help being used (on the ship-to-party field, F1 then Tech Info). I believe you want the collective search help SD_DEBI.
2. Create your own search help with the fields you want to use with SE11, like 'ZDEBI' as an example.
3. Append 'ZDEBI' to SD_DEBI. (Goto->Append Search Help).
4. Clean things up by "Hiding" the old search help. In the 'Included Search Help' tab of the collective search help SD_DEBI, there is a check box that you can tick to hide included search helps. -
Help with a select statement from a SQL Server within a DTS !!
Hello Gurus!
I help with the script bellow, when I run it within DTS (in SQL Sever 2000), I got the error Invalid number/or not a valid month.
Please bellow with the WHERE CLASUE '08/01/2001' AND '03/09/2002'
And in the other hand I change this forma to '01-AUG-01' AND
'03-MAR-2002', the DTS start and run witha successful messages, but it does not returns row, which is wrong.
Somebady please help!
Thanks Gurus!
GET Total ANIs with Trafic By Area Code
select
substr(b.ct_num, 0,3) as Area_Codes,
COUNT(DISTINCT B.CT_NUM) AS ANIS
from
wasabi.v_trans A,
wasabi.V_Sur_Universal B,
wasabi.V_Sub C,
wasabi.V_Trans_Typ D
where
D.Trans_typ = A.Trans_Typ AND
A.Sur_ID = B.Sur_ID AND
C.Sub_ID = A.Sub_ID AND
a.trans_stat != 'X' AND
a.Trans_DTTM >= '08/01/2001'AND
a.Trans_DTTM < '03/09/2002 AND
B.AMA3 = 'PHONE1'
AND C.SUB_ID not in (100117)
GROUP BY
substr(b.ct_num, 0,3)
ORDER BY
Area_CodesI think that you need a "to_date" function eg
change '08/01/2001' to to_date('08/01/2001','dd/mm/yyyy') -
Help with GBIC selection LH vs ZX
Dear Support,
I now have the estimated Attenuation values from our fibre provider, and wondering if anyone could help with determining if I can utilise the cheaper (LH modules) across the 20 & 15 KM streches.
Thanks in advance (many thanks to Josh for helping out with my previous post - below)
HQ to DC1 = 1310nm: 2.5dB, 1550nm: 2.2dB.
DC1 to DC2 = 1310nm: 14.5dB , 1550nm: 13.1dB
DC2 to HQ = 1310nm: 10.1dB, 1550nm: 9dB
=========================================
Dear Support,
Sorry but new to optical networking, but need some assistance on an upgrade that we are performing.
We currently have two data centres that hold our servers and are planning to upgrade from LES circuits to Gigabit links, and triangulate our topology. (effectively a ring topology)
I have already spoken to our proposed fibre provider and they have provide me with rough distances, but due to one of the data centres being more than 10 km away we need to use ZX based GBICs. Summary of distances below;
HQ -> dc1 (1 2 km)
HQ -> dc2 (15 km)
Dc1 -> dc2 (20 km)
From our HQ to dc1 we will use LH (via a GLC-LH-SM= in a 2970G) and a to dc2 we will use ZX (via a GLC-ZX-SM= in another 2970G)
From DC1 to HQ we will use LH (via a WS-G5486 in a 7204VXR) and a to dc2 we will use ZX (via a WS-G5487 in another 7204VXR)
From DC2 to HQ we will use ZX (via a WS-G5487 in a 7204VXR) and a to dc1 we will use ZX (via a WS-G5487 in another 7204VXR)
Hope this doesnt confuse things more.
Now to the question.
From the Cisco web site it mentions the following;
When shorter distances of single-mode fiber are used, it might be necessary to insert an in-line optical attenuator in the link to avoid overloading the receiver:
A 5-dB or 10-dB inline optical attenuator should be inserted between the fiber-optic cable plant and the receiving port on the Cisco 1000BASE-ZX GBIC at each end of the link whenever the fiber-optic cable span is less than 15.5 miles (25 km).
We havent yet had the fibre survey performed, but once they have advised me of the attenuation on the link, how should I calculate what level of in-line optical attenuator I should need or should all reputable fibre providers advise me of this detail.
Thanks in advance.
Regards, AdrianSummary of Optical Levels:
GLC-ZX-SM:
Transmit: 0 to +5
Receive: -23 to 0
GLC-LH-SM:
Transmit: -9.5 to -3
Receive: -20 to -3
G5486:
Transmit: -9.5 to -3
Receive: -20 to -3
G5487:
Transmit: 0 to 5.2
Receive: -24 to -3
Given the above:
HQ -> DC2: maximum receive level will be 5-10.1 = -5.1 dB, which is OK for the G5487
HQ <- DC2: maximum receive level will be 5.2-10.1 = -4.9 dB, which is OK for the GLC-ZX-SM
HQ -> DC1: maximum receive level will be -3-2.5 = -5.5 dB, which is OK for the G5486
HQ <- DC1: maximum receive level will be -3-2.5 = -5.5 dB, which is OK for the GLC-LH-SM
DC1 -> DC2:maximum receive level will be 5.2-14.5 = -9.3 dB, which is OK for the G5487
DC1 <- DC2:maximum receive level will be 5.2-14.5 = -9.3 dB, which is OK for the G5487
Therefore, you do not need attenuators anywhere.
Now, to your next queston. If you used the LH modules, you the minimum possible receive levels now become:
HQ -> DC2: minimum possible receive level will be -9.5-10.1 = -19.6 dB, which is only just OK for the G5486
HQ <- DC2: minimum possible receive level will be -9.5-10.1 = -19.6 dB, which is only just OK for the G5486
DC1 -> DC2: minimum possible receive level will be -9.5-14.2 = -24 dB, which is too low for the G5486
DC1 <- DC2: minimum possible receive level will be -9.5-14.2 = -24 dB, which is too low for the G5486
Therefore, my recommendation is to stick with the ZX modules for these links.
Hope that helps - pls rate the post if it does.
Paresh -
Help with record selection/grouping
I am trying to create a report as follows, but am running into some problems with my selection/grouping:
Data Structure (each line is a separate record; each employee has 2 records)
Employee TaskID TaskStatus Marker Date Modified
1 A CLOSED x
1 B OPEN N/A
2 A CLOSED y
2 B OPEN N/A
3 A CLOSED x
3 B CLOSED N/A
4 A CLOSED y
4 B CLOSED N/A
Report Requirements
I want a report that displays only employee number and the date that Task B was completed for all employees, and I want these records grouped based on Task B's Task Status (no problem. I did this).
However, I want to sub-group these Task B records (within Task Status) by the Marker field for Task A records! (I can't figure this out? If I only pull in Task B records, how can I compare what the associated employee has as a marker for their Task A record?)
Again, I only want to display data from the employee's Task B record, while subgrouping on a field value from the empoyee's Task A record. The report would be structured as follows:
Task B (OPEN), with Task A - Marker (x)
{Date Modified}
Task B (OPEN), with Task A - Marker (y)
{Date Modified}
Task B (CLOSED), with Task A - Marker (x)
{Date Modified}
Task B (CLOSED), with Task A - Marker (y)
{Date Modified}
Thanks.
GaryThe easiest way would be to use an SQL Command that returns both the Task A and Task B data on one record. Something like (MS SQL):
select b.employee, b.taskid as task_b, b.task_status_b, b.marker as marker_b, b.date_modified as date_modified_b,
a.taskid as task_a, a.task_status_a, a.marker as marker_a, a.date_modified as date_modified_a
from table a, table b
where a.employee = b.employee
and a.taskid = 'A'
and b.taskid = 'B'
HTH,
Carl -
Need Help With A Select Staement
This is my data set.
OPEN_DATE CLOSE_DATE
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 03-JAN-08
04-JAN-08 04-JAN-08
05-JAN-08
07-JAN-08
07-JAN-08 07-JAN-08
07-JAN-08 07-JAN-08
08-JAN-08 08-JAN-08
08-JAN-08
02-JAN-08
02-JAN-08
08-JAN-08
09-JAN-08
I'm need totals for those that are opened and closed per day. Here is what I'm trying to achieve...
Status Value DATE
Open 6 02-JAN-08
Closed 3 02-JAN-08
Open 0 03-JAN-08
Closed 1 03-JAN-08
Open 1 04-JAN-08
Closed 1 04-JAN-08
Open 0 05-JAN-08
Closed 1 05-JAN-08
Open 3 07-JAN-08
Closed 2 07-JAN-08
Open 3 08-JAN-08
Closed 1 08-JAN-08
Open 1 09-JAN-08
Close 0 09-JAN-08
This select statement gets me close but the problem is how to get the ones that should have a Value of 0
select 'Open' "Status", count(*) "Value", to_char(open_date, 'DD-MON-YY') "DATE"
from usar_log2
where open_date IS NOT NULL and
to_char(open_date, 'MON-YY') = to_char(sysdate, 'MON-YY')
and (USAR_status like 'CLOSED' or usar_status like 'OPENED' or USAR_Status like 'WORKING')
group by to_char(open_date, 'DD-MON-YY')
UNION
select 'Closed' "status", count(*) "Close", to_char(close_date, 'DD-MON-YY')
from usar_log2
where close_date is not null and
to_char(close_date, 'MON-YY') = to_char(sysdate, 'MON-YY')
and (USAR_status like 'CLOSED' or usar_status like 'OPENED' or USAR_Status like 'WORKING')
group by to_char(close_date, 'DD-MON-YY')
order by 3, 1 desc;
The above select statement's results...
Status Value DATE
Open 6 02-JAN-08
Closed 3 02-JAN-08
Closed 1 03-JAN-08
Open 1 04-JAN-08
Closed 1 04-JAN-08
Closed 1 05-JAN-08
Open 3 07-JAN-08
Closed 2 07-JAN-08
Open 3 08-JAN-08
Closed 1 08-JAN-08
Open 1 09-JAN-08
But I need this instead...
Status Value DATE
Open 6 02-JAN-08
Closed 3 02-JAN-08
<----- Open 0 03-JAN-08
Closed 1 03-JAN-08
Open 1 04-JAN-08
Closed 1 04-JAN-08
<----- Open 0 05-JAN-08
Closed 1 05-JAN-08
Open 3 07-JAN-08
Closed 2 07-JAN-08
Open 3 08-JAN-08
Closed 1 08-JAN-08
Open 1 09-JAN-08
<----- Close 0 09-JAN-08
Any help would be more appreciative.Thank you...You all are great. While I'm still
looking at the various ways you all provided, from
what I have looked at so far, they don't address
05-JAN-08 which has a null open date. There are
three possiblities, maybe four. Does 05-JAN-08 have a null open date in the data you supplied?
You showed us:
OPEN_DATE CLOSE_DATE
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 03-JAN-08
04-JAN-08 04-JAN-08
05-JAN-08
07-JAN-08
07-JAN-08 07-JAN-08
07-JAN-08 07-JAN-08
08-JAN-08 08-JAN-08
08-JAN-08
02-JAN-08
02-JAN-08
08-JAN-08
09-JAN-08
which looks like they all have open dates.
Perhaps, if there was null open dates you should have used [code][/code] or [pre][/pre] tags around your data so it looked something like
OPEN_DATE CLOSE_DATE
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 02-JAN-08
02-JAN-08 03-JAN-08
04-JAN-08 04-JAN-08
05-JAN-08
07-JAN-08
07-JAN-08 07-JAN-08
07-JAN-08 07-JAN-08
08-JAN-08 08-JAN-08
08-JAN-08
02-JAN-08
02-JAN-08
08-JAN-08
09-JAN-08And then it would have required the ANSI outer join in my query to allow for outer joining on more than one column...
SQL> ed
Wrote file afiedt.buf
1 WITH t as (SELECT to_date('02-JAN-2008','DD-MON-YYYY') as open_date, to_date('02-JAN-2008','DD-MON-YYYY') as closed_date from dual union all
2 SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('02-JAN-2008','DD-MON-YYYY') from dual union all
3 SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('02-JAN-2008','DD-MON-YYYY') from dual union all
4 SELECT to_date('02-JAN-2008','DD-MON-YYYY'), to_date('03-JAN-2008','DD-MON-YYYY') from dual union all
5 SELECT to_date('04-JAN-2008','DD-MON-YYYY'), to_date('04-JAN-2008','DD-MON-YYYY') from dual union all
6 SELECT NULL, to_date('05-JAN-2008','DD-MON-YYYY') from dual union all
7 SELECT to_date('07-JAN-2008','DD-MON-YYYY'), NULL from dual union all
8 SELECT to_date('07-JAN-2008','DD-MON-YYYY'), to_date('07-JAN-2008','DD-MON-YYYY') from dual union all
9 SELECT to_date('07-JAN-2008','DD-MON-YYYY'), to_date('07-JAN-2008','DD-MON-YYYY') from dual union all
10 SELECT to_date('08-JAN-2008','DD-MON-YYYY'), to_date('08-JAN-2008','DD-MON-YYYY') from dual union all
11 SELECT to_date('08-JAN-2008','DD-MON-YYYY'), NULL from dual union all
12 SELECT to_date('02-JAN-2008','DD-MON-YYYY'), NULL from dual union all
13 SELECT to_date('02-JAN-2008','DD-MON-YYYY'), NULL from dual union all
14 SELECT to_date('08-JAN-2008','DD-MON-YYYY'), NULL from dual union all
15 SELECT to_date('09-JAN-2008','DD-MON-YYYY'), NULL from dual)
16 ,all_dates as (select minod+rownum-1 as dt
17 from dual, (select min(open_date) minod, max(open_date) maxod from t)
18 connect by rownum <= maxod-minod+1)
19 ,stat as (select 'open' as status from dual union all select 'closed' from dual)
20 -- END OF DATA
21 select all_dates.dt, stat.status, sum(decode(decode(stat.status, 'open', t.open_date, t.closed_date), all_dates.dt, 1, 0)) as cnt
22 from stat JOIN all_dates ON (1=1)
23 LEFT OUTER JOIN t ON (NVL(t.open_date, NVL(t.closed_date, all_dates.dt)) = all_dates.dt)
24 group by all_dates.dt, stat.status
25* order by 1,2 desc
SQL> /
DT STATUS CNT
02-JAN-08 open 6
02-JAN-08 closed 3
03-JAN-08 open 0
03-JAN-08 closed 0
04-JAN-08 open 1
04-JAN-08 closed 1
05-JAN-08 open 0
05-JAN-08 closed 1
06-JAN-08 open 0
06-JAN-08 closed 0
07-JAN-08 open 3
07-JAN-08 closed 2
08-JAN-08 open 3
08-JAN-08 closed 1
09-JAN-08 open 1
09-JAN-08 closed 0
16 rows selected.
SQL>Make your requirements clear in the future. -
Here is my code , i dont have any experience with writing the nested sql , i got the below code , which needs to be modified adding a case statement which will show util_rate for 2 conditions
1. given in where condition ( to_char(time_stamp,'HH24') >= '09' and to_char(time_stamp,'HH24') <= '19')
2.Apposite to the condition above (to_char(time_stamp,'HH24') < '09'and to_char(time_stamp,'HH24') > '19')
could anybody please help me in adding the 2nd condition to the below query , please share any documentation you have for learning how to write nested sql,
Thank you
select device,time_stamp,
sum(ActiveHRS)/sum(AvailHRS) as RATE
from
select device,time_stamp,
case when usage >0 then 1
else 0 end as ActiveHRS,
'1' as AvailHRS
from
select device,time_stamp,
sum(case
when state = 9 then 0
when state = 0 then 0
else 1 end) as usage
from A
where to_char(time_stamp,'HH24') >= '09'
and to_char(time_stamp,'HH24') <= '19'
and to_char(time_stamp, 'D') in (2,3,4,5,6)
group by device, time_stamp
group by device,time_stampHere is the DDL :
desc rumi_all
Name Null Type
RUMI_DEVICE VARCHAR2(20)
STATE NUMBER(38)
TIME_STAMP DATE
LOCATION VARCHAR2(50) Here is some sample data :
RUMI_DEVICE STATE TIME_STAMP LOCATION
10.45.28.86 0 15-JUN-10 WA-102
10.45.28.51 0 15-JUN-10 WA-102
10.45.28.63 0 15-JUN-10 WA-102
10.45.29.47 9 15-JUN-10 WA-120I used the below query to get the util for the hours 9am - 7pm
select rumi_device,time_stamp,
sum(ActiveHRS)/sum(AvailHRS) as RATE
from
select rumi_device,time_stamp,
case when usage >0 then 1
else 0 end as ActiveHRS,
'1' as AvailHRS
from
select rumi_device,time_stamp,
sum(case
when state = 9 then 0
when state = 0 then 0
else 1 end) as usage
from rumi_all
where to_char(time_stamp,'HH24') >= '09'
and to_char(time_stamp,'HH24') <= '19'
and to_char(time_stamp, 'D') in (2,3,4,5,6)
group by rumi_device, time_stamp
group by rumi_device,time_stamp
Acquired Out for the above query :
RUMI_DEVICE TIME_STAMP UTIL_RATE
10.45.29.47 15-JUN-10 0.234
10.45.28.63 15-JUN-10 0.123
10.45.29.47 15-JUN-10 0.987
10.45.29.47 16-JUN-10 0.23Desired output :I want 2 extra columns which shows util rate for the above condition i.e 9am - 7pm(core hours) and also opposite to that condition after 7pm - before 9am(say, non core hours)
Desired out put :
RUMI_DEVICE TIME_STAMP Core_Util_Rate Non_Core_UtilRate
10.45.29.4 15-JUN-10 0.234 0.003
10.45.28.63 15-JUN-10 0.123 0.001
10.45.29.47 15-JUN-10 0.987 0.023
10.45.29.47 16-JUN-10 0.23 0Hope this helps in answering my question , and also could you please share some document to learn writing nested sql's , i always had tough time in understanding this :-( -
Need help with cursor selection in control panels
I can't get my cursor to work in the control panel at the top of the screen, for example, when I select text and want to change the font size, etc. It won't even select to change from font to paragraph mode. Other issues are trying to choose the selection tool, which I can only do with the "V" shortcut tool--escape doesn't work, nor does the cursor choose the icons. Help!
Windows? see InDesign tools and panels don't respond to mouse clicks (Windows 7/Vista)
-
Need help with Advanced Selection in MSA
Hi,
Has anyone managed to identify how to create additional
advanced selection criteria using links to existing combo engines ? Documentation on Mobile system maint is limited so looking for some additional help. Some criteria you can run the check against but not all why ? What should go in the hierachy fields and how do you select the choice list values ?
Thanks in advance
MHi,
Thanks,my issue is I want to use the combo box so the user can select from the drop down the relevant code from the choice list. Not rocket science really.
Example of sql generated for profession whch is kna1 field.
select KNA1.TITLE,KNA1.SFAKNA2,KNA1.SFAKNA1,KNA1.PROFRESSION as PROFESSION,KNA1.PAFKT,KNA1.NAME2,KNA1.NAME1,KNA1.KVTGRP,KNA1.KVCPPOS,KNA1.KUNNR,KNA1.KTOKD,KNA1.BPACT,KNA1.ANRED,KNA1.ABTNR,ADRC.TELNR_LONG,ADRC.STREET,ADRC.POST_CODE1,ADRC.CITY1,ADRC.ADRCDFLT,ADDR.SFAKNBP , (KNA1.PROFESSION ='MIC') as ReturnValue1 from SMOKNA1 KNA1,SMOADRC ADRC,CDBD_ADDREXT ADDR where kna1.deleted='0' and KNA1.Source='CON' and ADRC.deleted='0' and ADDR.deleted = '0' and (ADRC.ADRCDFLT='S' or ADRC.ADRCDFLT='P') and (1=1) and kna1.sfakna1=adrc.sfakna1 and adrc.sfaadrc = addr.sfaadrc order by kna1.name1
Code fails !
I have set VAR1 as a free Combo with Bdoc as Choice, segment as Choice List with fields chkey/Textx so hiearchy fields looks like this //*/Profession hiearchy params being mandt/spras/list
It will not check is this because there is an error in this definition ?
Regards
MM -
Help with REGEX to block invalid characters
I have a regex that is used to block unusual characters from being entered into a user name, so they can put pipes etc in there, I just want 0-9 and a-z (upper or lowercase), but I just noticed that it's not working. I am not up to speed on regex, I took this from somewhere else
here is the expression:
<cfif len(trim(ReReplaceNocase(form_username, '^[A-Za-z][A-Za-z0-9_]*', '', 'ALL'))) gt 0>
It is failing when I enter 2kljlkll3456 as the username
Anybody have any idea why it's not working?
After posing this I found out that the issue is that it does not allo me to have a username that starts with a number, only a letter, anybody have any idea how to fix that?
Thanks
MarkHey Dan,
I found a link that explained how the regex is actually formed which helped!
http://stackoverflow.com/questions/336210/regular-expression-for-alphanumeric-and-undersco res
Now I have managed to get a basic understanding of how they are formed the fix was easy
I had:
<cfif len(trim(ReReplaceNocase(form_username, '^[A-Za-z][A-Za-z0-9_]*', '', 'ALL'))) gt 0>
But should have had
<cfif len(trim(ReReplaceNocase(form_username, '^[A-Za-z0-9_]*', '', 'ALL'))) gt 0>
Simply removing [A-Za-z] from the start fixed it. I get it now ... so the first section defined the first character which was restricted to A-Za-z only.
I'll mark this as answered
Thanks
Mark -
Help with doing SELECT sub query within the SET of an UPDATE statement
After doing some research, it appears as if it's possible to use a SELECT subquery in the SET of an UPDATE statement. i did find some examples and here is my code, however when I click the "check" button it's saying the field (my entire select subquery) is unknown and neither in one of the specified tables or defined by a "DATA". Do I have a syntax issue or is there another reason why it's not taking this as a valid statement? Thanks for the help!
LOOP AT IT_DATA
UPDATE /BIC/AZDP_O0140
SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL )
FROM /BIC/AZDP_O0140
WHERE MATERIAL EQ IT_DATA-MATERIAL
GROUP BY MATERIAL).
ENDLOOP.my Update does indeed have a WHERE clause but because of the issue i'm having, all my criteria in my WHERE is black text in the ABAP editor. The editor doesn't even recognize the keywords "WHERE" or "EQ". Below is my entire statement which contains all WHERE criteria in both the Update and the Subquery, i've just removed it for testing to help simplify the query and eliminate as many other factors as posisble that may be causing problems:
LOOP AT IT_DATA.
UPDATE /BIC/AZDP_O0140
SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL ) FROM /BIC/AZDP_O0140
WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
AND PLANT EQ IT_DATA-PLANT
AND /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
AND DELIV_NUMB EQ IT_DATA-DELIVERY
AND MATERIAL EQ IT_DATA-MATERIAL
GROUP BY MATERIAL)
WHERE WHSE_NUM EQ IT_DATA-WAREHOUSE
AND PLANT EQ IT_DATA-PLANT
AND /BIC/ZTRAN_NO EQ IT_DATA-TRANS_NUM
AND DELIV_NUMB EQ IT_DATA-DELIVERY
AND MATERIAL EQ IT_DATA-MATERIAL.
ENDLOOP.
i should also mention the sources i found were not within the SAP Library but instead on other third-party ABAP websites. so because i was having issues i wanted to post here to see if anyone else has come up with a working solution. but if this cannot be done i can likely come up with a solution for my needs using multiple internal tables, this would just have been much easier since i can get a query like this to do what i want in SQL Server. Thought i could utilize this in ABAP as well. -
Help with ComboBox Selection Update
Hello,
I am trying to make this application display all its labels in a different language depending on which locale the user picks from the ComboBox. The variables are being read from the ResourceBundles correctly (see command-line debugging statements) but I cannot get the pane to 'refresh' when the item is selected. I've tried everything I can think of! Please help! :)
(This assignment was to internationalize a program we wrote for a previous assignment, so this program wasn't originally written to do this. I am trying to add this functionality to my existing project, so it's not ideal).
Thank you for any advice, help or hints you can give!
Program(PrjGUI)
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.TimeZone;
public class PrjGUI extends JFrame
//**** Instance Variables for both classes
private JRadioButton optGram, optOz;
private JTextField txtWeightEnter, txtResult, txtDateTime;
private JButton cmdConvert;
private JComboBox comboSelectLocale;
//arrays--one for combo box list, and the other for values to use when a particular list item is selected
private String[] localeList = {"English, USA", "Fran\u00E7ais, France", "Espag\u00F1ol, M\u00E9xico"};
private Locale[] localeCode = {(new Locale("en", "US")), (new Locale("fr", "FR")), (new Locale("es", "MX"))};
private JLabel lblChoose, lblWeightEnter;
protected String titleTxt, enterTxt, btnTxt, gramTxt, ozTxt, resultDisplayTxt, localeTimeZone, dateFormat;
protected ResourceBundle res;
protected Locale currentLocale;
//declare Handler Object
private CmdConvertWeight convertWeight;
//**************main method******************
public static void main(String[] args)
PrjGUI convertWeight1 = new PrjGUI();
}//end of main******************************
//constructor
public PrjGUI()
//create panel for components
Container pane = getContentPane();
//set the layout
pane.setLayout(new GridLayout(0, 1, 5, 5));
//set the color
pane.setBackground(Color.GREEN);
//make a font to use in components
Font font1 = new Font("SansSerif", Font.BOLD, 16);
/**New calendar object to display the date and time*/
GregorianCalendar calendar = new GregorianCalendar();
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
/**currentLocale = localeCode[comboSelectLocale.getSelectedIndex()];
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, currentLocale); //uses key for ResourceBundle*/
TimeZone timeZone = TimeZone.getTimeZone("CST");
//TimeZone timeZone = TimeZone.getTimeZone(localeTimeZone); //uses key for resourceBundle
formatter.setTimeZone(timeZone);
//***create UI objects***
/**NEW OBJECTS FOR prjInternational:
* a drop-down combobox, a label, and a txt field
txtDateTime = new JTextField(formatter.format(calendar.getTime()));
//txtDateTime = formatter.format(calendar.getTime());
lblChoose = new JLabel("Please choose your language.");
lblChoose.setFont(font1);
lblChoose.setBackground(new Color(0, 212, 255)); //aqua blue
comboSelectLocale = new JComboBox(localeList);
comboSelectLocale.setFont(font1);
comboSelectLocale.setBackground(new Color(0, 212, 255)); //aqua blue
//comboSelectLocale.setSelectedIndex(0);
//add a listener to the combo box to get the selected item
/**default values for variables so I can debug--at the moment
* I can't get the resouceBundle to work--it can't locate the
* file. So I will hard code these in for now.
/*titleTxt="Food Weight Converter";
enterTxt="Please enter the Weight you wish to convert.";
btnTxt="Convert this weight!";
gramTxt="grams";
ozTxt="oz";
resultDisplayTxt="Result will display here.";*/
comboSelectLocale.addItemListener(new ItemListener()
public void itemStateChanged(ItemEvent e)
res = setCurrentLocale(comboSelectLocale.getSelectedIndex());
System.out.println(res.getString("enterTxt"));
updateItems(res);
//set variables from Resource Bundle
/* titleTxt = res.getString("titleTxt");
System.out.println(res.getString("enterTxt")); //debug
enterTxt = res.getString("enterTxt");
btnTxt = res.getString("enterTxt");
gramTxt = res.getString("gramTxt");
ozTxt = res.getString("ozTxt");
resultDisplayTxt = res.getString("resultDisplayTxt");*/
//2 radio buttons
//optGram = new JRadioButton("grams", true);
optGram = new JRadioButton(gramTxt, true);
//optOz = new JRadioButton("oz.");
optOz = new JRadioButton(ozTxt);
optGram.setBackground(Color.GREEN);
optGram.setFont(font1);
optOz.setBackground(Color.GREEN);
optOz.setFont(font1);
//button group so only one can be chosen
ButtonGroup weightUnit = new ButtonGroup();
weightUnit.add(optGram);
weightUnit.add(optOz);
//label and text field for weight
//JLabel lblWeightEnter = new JLabel("Please enter the weight you wish to convert:");
JLabel lblWeightEnter = new JLabel(enterTxt);
lblWeightEnter.setFont(font1);
txtWeightEnter = new JTextField("20.05", 6);
txtWeightEnter.setBackground(new Color(205, 255, 0)); //lime green
txtWeightEnter.setFont(font1);
//button to make conversion
//cmdConvert = new JButton("Convert this weight!");
cmdConvert = new JButton(btnTxt);
cmdConvert.setFont(font1);
//textfield to display result
//txtResult = new JTextField("Result will display here");
txtResult = new JTextField(resultDisplayTxt);
txtResult.setBackground(new Color(205, 255, 0)); //lime green
txtResult.setFont(font1);
//register the handler
convertWeight = new CmdConvertWeight();
cmdConvert.addActionListener(convertWeight);
//add content to pane
pane.add(txtDateTime);
pane.add(lblChoose);
pane.add(comboSelectLocale);
pane.add(lblWeightEnter);
pane.add(txtWeightEnter);
pane.add(optGram);
pane.add(optOz);
pane.add(cmdConvert);
pane.add(txtResult);
//create window for object
setTitle(titleTxt);
setSize(400, 300);
setVisible(true);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}//end of constructor
/** ACTION LISTENER CLASS TO RESPOND TO USER'S INPUT (EVENTS) **/
private class CmdConvertWeight implements ActionListener
public void actionPerformed(ActionEvent e)
//System.out.println("we made it to the Action Listener"); //debug
//get info from fields
double weight = Double.parseDouble(txtWeightEnter.getText());
double weightConvert = 0;
String weightConvertString;
if (optGram.isSelected())//if user's weight is in grams, converting to oz
weightConvert = weight/28.35;
weightConvertString = Double.toString(weightConvert);
txtResult.setText(txtWeightEnter.getText() + " grams is equal to " + weightConvertString + " oz.");
}//end if gram select
else if (optOz.isSelected())//if user's weight is in oz, converting to grams
weightConvert = weight*28.35;
weightConvertString = Double.toString(weightConvert);
txtResult.setText(txtWeightEnter.getText() + " oz. is equal to " + weightConvertString + " grams.");
}//end if oz select
}//end actionPerformed
}//end CmdConvertWeight
/**setCurrentLocale method from combo box listener*/
public ResourceBundle setCurrentLocale(int index)
Locale currentLocale = localeCode[index];
System.out.println(currentLocale); //debug
System.out.println("MyResource_" + currentLocale); //debug
ResourceBundle res = ResourceBundle.getBundle("MyResource_" + currentLocale);
return res;
}//end setCurrentLocale
public void updateItems(ResourceBundle res)
//convertWeight1.setTitle(res.getString(titleTxt));
System.out.println(res.getString(btnTxt));//debug
lblWeightEnter.setText(res.getString(enterTxt));
optGram.setText(res.getString(gramTxt));
optOz.setText(res.getString(ozTxt));
cmdConvert.setText(res.getString(btnTxt));
txtResult.setText(res.getString(resultDisplayTxt));
}//end updateItems
}//end of class PrjGUIResourceBundles(each in a different file)
public class MyResource_fr_FR extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Convertisseur de poids de nourriture"},
{"enterTxt", "Veuillez \u00E9crire le poids que vous souhaitez convertir."},
{"btnTxt", "Convertissez ce poids!"},
{"gramTxt", "grammes"},
{"ozTxt", "onces"},
{"resultDisplayTxt", "Le r\u00E9sultat montrera ici."},
{"localeTimeZone", "CET"},
{"dateFormat", "Locale.FR"}
public Object[][] getContents()
return contents;
public class MyResource_es_MX extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Convertidor del peso del alimento"},
{"enterTxt", "Incorpore por favor el peso que usted desea convertir."},
{"btnTxt", "\u00F1convierta este peso!"},
{"gramTxt", "gramos"},
{"ozTxt", "onzas"},
{"resultDisplayTxt", "El resultado exhibir\u00E1 aqu\u00ED."},
{"localeTimeZone", "CST"},
{"dateFormat", "Locale.MX"}
public Object[][] getContents()
return contents;
public class MyResource_en_US extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Food Weight Converter"},
{"enterTxt", "Please enter the weight you wish to convert."},
{"btnTxt", "Convert this weight!"},
{"gramTxt", "grams"},
{"ozTxt", "oz"},
{"resultDisplayTxt", "Result will display here."},
{"localeTimeZone", "CST"},
{"dateFormat", "Locale.US"}
public Object[][] getContents()
return contents;
}Edited by: JessePhoenix on Nov 2, 2008 8:30 PMcatman2u wrote:
does anyone from Lenovo actually read this forum?
From the Communiy Rules in the Welcome section....
Objectives of Lenovo Discussion Forums
These communities have been created to provide a high quality atmosphere in which users of Lenovo products and services may share experiences and expertise. While members from Lenovo may participate at intervals to engage in the discussions and offer advice and suggestions, this forum is not designed as a dedicated and staffed support channel. This is an informal and public forum, and Lenovo does not guarantee the accuracy of information and advice posted here -- see important Warranty information below.
No amount of ranting is going to get you anything more than you will achieve with a clear exposition of your issue... so you might want to try doing that instead of ranting and assuming that everyone already knows what you know etc etc.
Cheers,
Bill
I don't work for Lenovo
Maybe you are looking for
-
I have iphoto 9.2.1 and it will not load. After I click on the app it opens but the screen continousley tries to load. Please Help
-
IMPORT QUICKTIME 7.01 FILES INTO AVID EXPRESS??
Can anybody help me with importing FCP files (quicktime 7) into Avid Express?
-
Just DL'd Numbers and Pages for IOS. I want to be able to sync and work with my Mac iWork files as IOS file and back. Seems the only way to move files to and from iCloud is through an upload/download process in a Web browser. Am I missing something o
-
Purchased iMac used. can't access iPhoto since OS X 10.9.2 update
I purchased my iMac used in 2011. I had alot of software already installed. I've never had any problems until now. I recently updated my iMac w/ the latest OS X Maverick 10.9.2 & since then it will not let me access iPhoto bc (You can't use this v
-
Dataguard PROTECTION_LEVEL
Dear All Hi I want to know when you have Data guard in 10g Rel2 and your primary database protection mode is configured as MAXIMUM PROTECTION , when the standby database goes down , how long the PROTECTION_LEVEL remains RESYNCHRONIZATION before the p