Code to add in to show results I need Please take a look
Please help
Here is my code:
SELECT l.location_no,
l.zone_code,
la.area_code,
DECODE (la.area_code, 'WA-60', 'NODA', 'WA-61', 'NODA', 'WA-62', 'NODA', 'WA-63', 'NODA', 'WA-64', 'NODA', 'WA-65', 'NODA', 'WA-66', 'NODA', 'WA-67', 'NODA', 'WA-68', 'NODA', 'WA-69', 'NODA', 'WA-70', 'NODA', 'WA-71', 'NODA', 'WA-72', 'NODA', 'WA-73', 'NODA', 'WA-74', 'NODA', 'WA-74', 'NODA', 'WA-75', 'NODA', 'WA-76', 'NODA', 'WA-77', 'NODA', 'WA-78', 'NODA', 'WA-79', 'NODA', 'WA-80', 'NODA', 'WA-81', 'NODA', 'WA-82', 'NODA', 'WA-83', 'NODA', 'WA-84', 'NODA', 'WA-REED', 'NODA', 'WA-R2', 'NODA', 'WA-R1', 'NODA', 'WA-BIN', 'NODA', 'PA-CDK', 'NODA', 'WA-PALLET', 'NODA', 'WA-BINRESV', 'NODA', 'DA-REPL', 'GOOD') DAREPL
FROM MOVE.LOCATION L,
MOVE.LOCATION_AREA LA
WHERE l.location_no = la.location_no
AND l.zone_code NOT IN ('Z-BINRES', 'Z-LARGE', 'Z-SMALL', 'Z-HVYOVR', 'Z-ENDCAP', 'Z-LOOSE', 'Z-BRKPAK', 'Z-STRLINE', 'Z-FLAT', 'Z-BULKRES', 'Z-GENERAL', 'Z-2PC', 'Z-BULK', 'Z-SSP', 'Z-RUG', 'Z-LOAD', 'Z-SSPBRK', 'Z-HOLD', 'Z-REC-SSP' )
AND la.area_code NOT IN ('DA-BULK', 'DA-CANREPL', 'WA-TIER', 'WA-OVRFLOW', 'WA-PALLET2', 'WA-SPRING', 'WA-TIER2', 'WA-DOKPIK', 'WA-DP', 'WA-HOLD', 'PA-OSDHOLD', 'PA-REED', 'RA-REC-CDK', 'WA-PALLET2', 'RECEIVING', 'RECEIVING2', 'WA-BINHOT', 'WA-CANDLE', 'WA-REED', 'WA-BIN2', 'WA-BINCOLD', 'PA-CDK', 'PA-HAZMAT', 'PA-HWR', 'PA-XMASCP', 'WA-PALLET', 'WA-BINRESV', 'WA-BIN', 'WA-BULK', 'WA-BRKPAK', 'PA-BRKPRES', 'PA-CANDLES', 'PA-BIN', 'PA-LOOSE', 'PA-HVYOVR', 'PA-BULKRES', 'PA-BRKPAK', 'WA-01', 'WA-02', 'WA-03', 'WA-04', 'WA-05', 'WA-06', 'WA-07', 'WA-08', 'WA-09', 'WA-10', 'WA-11', 'WA-12', 'WA-13', 'WA-14', 'WA-15', 'WA-16', 'WA-17', 'WA-18', 'WA-19', 'WA-20', 'WA-21', 'WA-22', 'WA-23', 'WA-24', 'WA-25', 'WA-26', 'WA-27', 'WA-28', 'WA-29', 'WA-30', 'WA-31', 'WA-32', 'WA-33', 'WA-34', 'WA-35', 'WA-36', 'WA-37', 'WA-60', 'WA-61', 'WA-62', 'WA-63', 'WA-64', 'WA-65', 'WA-66', 'WA-67', 'WA-68', 'WA-69', 'WA-70', 'WA-71', 'WA-72', 'WA-73', 'WA-74', 'WA-75', 'WA-76', 'WA-77', 'WA-78', 'WA-79',
'WA-80', 'WA-81', 'WA-82', 'WA-83', 'WA-84', 'WA-R1', 'WA-R2')
ORDER BY 1and here is some of my output/results:
LOCATION_NO ZONE_CODE AREA_CODE DAREPL
60-02-101 Z-BIN DA-REPL GOOD
60-02-102 Z-BIN DA-REPL GOOD
60-02-201 Z-BIN DA-REPL GOOD
60-02-202 Z-BIN DA-REPL GOOD
60-04-101 Z-BIN DA-REPL GOOD
60-04-102 Z-BIN DA-REPL GOOD
60-04-201 Z-BIN DA-REPL GOOD
60-06-101 Z-BIN DA-REPL GOOD
60-06-201 Z-BIN DA-REPL GOOD
60-06-202 Z-BIN DA-REPL GOOD
60-08-101 Z-BIN DA-REPL GOOD
60-08-201 Z-BIN DA-REPL GOOD
60-08-202 Z-BIN DA-REPL GOOD
60-10-201 Z-BIN DA-REPL GOOD
60-10-202 Z-BIN DA-REPL GOOD
60-12-102 Z-BIN DA-REPL GOOD
60-12-202 Z-BIN DA-REPL GOOD As you can see the first results for 60-02 there are 4 results which means they all have the DA-REPL AREA_CODE column:
60-02-101
60-02-102
60-02-201
60-02-202
As you can see with results for 60-04(results 5, 6, and 7) there are only 3 locations that have DA-REPL in the AREA_CODE column. 60-04-202 does not have DA-REPL in the AREA_CODE column, and that is the actual result I am looking for. Short of looking manually through 2-5,000 results and manually finding the results with less than 4 is there any code I can add to help here?
60-04-101
60-04-102
60-04-201
I have already tried a lot simpler code like LA.AREA_CODE != DA-REPL but as you can see above there are so many LA>AREA_CODE's to deal with and each location has multiple so even if I rul out that one it just gives me that location with another LA.AREA_CODE
I think you are both on the right track I have been at this for so long I am not a DBA so I can not CREATE TABLE only create query and run them. I am using Oracle sql developer.
Oracle SQL Developer 3.0.04
Version 3.0.04
Build MAIN-04.34
When I run your Code Frank Kulash which looks like this if I did it right which I believe I did.
WITH got_cnt AS
SELECT COUNT (*) OVER (PARTITION BY SUBSTR (l.location_no, 1, 5)) AS cnt
, l.location_no
, ... (SELECT l.location_no,
l.zone_code,
la.area_code,
DECODE (la.area_code, 'WA-60', 'NODA', 'WA-61', 'NODA', 'WA-62', 'NODA', 'WA-63', 'NODA', 'WA-64', 'NODA', 'WA-65', 'NODA', 'WA-66', 'NODA', 'WA-67', 'NODA', 'WA-68', 'NODA', 'WA-69', 'NODA', 'WA-70', 'NODA', 'WA-71', 'NODA', 'WA-72', 'NODA', 'WA-73', 'NODA', 'WA-74', 'NODA', 'WA-74', 'NODA', 'WA-75', 'NODA', 'WA-76', 'NODA', 'WA-77', 'NODA', 'WA-78', 'NODA', 'WA-79', 'NODA', 'WA-80', 'NODA', 'WA-81', 'NODA', 'WA-82', 'NODA', 'WA-83', 'NODA', 'WA-84', 'NODA', 'WA-REED', 'NODA', 'WA-R2', 'NODA', 'WA-R1', 'NODA', 'WA-BIN', 'NODA', 'PA-CDK', 'NODA', 'WA-PALLET', 'NODA', 'WA-BINRESV', 'NODA', 'DA-REPL', 'GOOD') DAREPL
FROM MOVE.LOCATION L,
MOVE.LOCATION_AREA LA
WHERE l.location_no = la.location_no
AND l.zone_code NOT IN ('Z-BINRES', 'Z-LARGE', 'Z-SMALL', 'Z-HVYOVR', 'Z-ENDCAP', 'Z-LOOSE', 'Z-BRKPAK', 'Z-STRLINE', 'Z-FLAT', 'Z-BULKRES', 'Z-GENERAL', 'Z-2PC', 'Z-BULK', 'Z-SSP', 'Z-RUG', 'Z-LOAD', 'Z-SSPBRK', 'Z-HOLD', 'Z-REC-SSP' )
and la.area_code not in ('DA-BULK', 'DA-CANREPL', 'WA-TIER', 'WA-OVRFLOW', 'WA-PALLET2', 'WA-SPRING', 'WA-TIER2', 'WA-DOKPIK', 'WA-DP', 'WA-HOLD', 'PA-OSDHOLD', 'PA-REED', 'RA-REC-CDK', 'WA-PALLET2', 'RECEIVING', 'RECEIVING2', 'WA-BINHOT', 'WA-CANDLE', 'WA-REED', 'WA-BIN2', 'WA-BINCOLD', 'PA-CDK', 'PA-HAZMAT', 'PA-HWR', 'PA-XMASCP', 'WA-PALLET', 'WA-BINRESV', 'WA-BIN', 'WA-BULK', 'WA-BRKPAK', 'PA-BRKPRES', 'PA-CANDLES', 'PA-BIN', 'PA-LOOSE', 'PA-HVYOVR', 'PA-BULKRES', 'PA-BRKPAK', 'WA-01', 'WA-02', 'WA-03', 'WA-04', 'WA-05', 'WA-06', 'WA-07', 'WA-08', 'WA-09', 'WA-10', 'WA-11', 'WA-12', 'WA-13', 'WA-14', 'WA-15', 'WA-16', 'WA-17', 'WA-18', 'WA-19', 'WA-20', 'WA-21', 'WA-22', 'WA-23', 'WA-24', 'WA-25', 'WA-26', 'WA-27', 'WA-28', 'WA-29', 'WA-30', 'WA-31', 'WA-32', 'WA-33', 'WA-34', 'WA-35', 'WA-36', 'WA-37', 'WA-60', 'WA-61', 'WA-62', 'WA-63', 'WA-64', 'WA-65', 'WA-66', 'WA-67', 'WA-68', 'WA-69', 'WA-70', 'WA-71', 'WA-72', 'WA-73', 'WA-74', 'WA-75', 'WA-76', 'WA-77', 'WA-78', 'WA-79',
'WA-80', 'WA-81', 'WA-82', 'WA-83', 'WA-84', 'WA-R1', 'WA-R2'))
SELECT location_no, zone_code, area_code, darepl
FROM got_cnt
WHERE cnt < 4
ORDER BY location_no
;The result/output is an error:
ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
Error at Line: 5 Column: 29
The same with your code Peter vd Zwan if I did it correctly:
SELECT l.location_no,
l.zone_code,
la.area_code,
DECODE (la.area_code, 'WA-60', 'NODA', 'WA-61', 'NODA', 'WA-62', 'NODA', 'WA-63', 'NODA', 'WA-64', 'NODA', 'WA-65', 'NODA', 'WA-66', 'NODA', 'WA-67', 'NODA', 'WA-68', 'NODA', 'WA-69', 'NODA', 'WA-70', 'NODA', 'WA-71', 'NODA', 'WA-72', 'NODA', 'WA-73', 'NODA', 'WA-74', 'NODA', 'WA-74', 'NODA', 'WA-75', 'NODA', 'WA-76', 'NODA', 'WA-77', 'NODA', 'WA-78', 'NODA', 'WA-79', 'NODA', 'WA-80', 'NODA', 'WA-81', 'NODA', 'WA-82', 'NODA', 'WA-83', 'NODA', 'WA-84', 'NODA', 'WA-REED', 'NODA', 'WA-R2', 'NODA', 'WA-R1', 'NODA', 'WA-BIN', 'NODA', 'PA-CDK', 'NODA', 'WA-PALLET', 'NODA', 'WA-BINRESV', 'NODA', 'DA-REPL', 'GOOD') DAREPL
FROM MOVE.LOCATION L,
MOVE.LOCATION_AREA LA
WHERE l.location_no = la.location_no
AND l.zone_code NOT IN ('Z-BINRES', 'Z-LARGE', 'Z-SMALL', 'Z-HVYOVR', 'Z-ENDCAP', 'Z-LOOSE', 'Z-BRKPAK', 'Z-STRLINE', 'Z-FLAT', 'Z-BULKRES', 'Z-GENERAL', 'Z-2PC', 'Z-BULK', 'Z-SSP', 'Z-RUG', 'Z-LOAD', 'Z-SSPBRK', 'Z-HOLD', 'Z-REC-SSP' )
and la.area_code not in ('DA-BULK', 'DA-CANREPL', 'WA-TIER', 'WA-OVRFLOW', 'WA-PALLET2', 'WA-SPRING', 'WA-TIER2', 'WA-DOKPIK', 'WA-DP', 'WA-HOLD', 'PA-OSDHOLD', 'PA-REED', 'RA-REC-CDK', 'WA-PALLET2', 'RECEIVING', 'RECEIVING2', 'WA-BINHOT', 'WA-CANDLE', 'WA-REED', 'WA-BIN2', 'WA-BINCOLD', 'PA-CDK', 'PA-HAZMAT', 'PA-HWR', 'PA-XMASCP', 'WA-PALLET', 'WA-BINRESV', 'WA-BIN', 'WA-BULK', 'WA-BRKPAK', 'PA-BRKPRES', 'PA-CANDLES', 'PA-BIN', 'PA-LOOSE', 'PA-HVYOVR', 'PA-BULKRES', 'PA-BRKPAK', 'WA-01', 'WA-02', 'WA-03', 'WA-04', 'WA-05', 'WA-06', 'WA-07', 'WA-08', 'WA-09', 'WA-10', 'WA-11', 'WA-12', 'WA-13', 'WA-14', 'WA-15', 'WA-16', 'WA-17', 'WA-18', 'WA-19', 'WA-20', 'WA-21', 'WA-22', 'WA-23', 'WA-24', 'WA-25', 'WA-26', 'WA-27', 'WA-28', 'WA-29', 'WA-30', 'WA-31', 'WA-32', 'WA-33', 'WA-34', 'WA-35', 'WA-36', 'WA-37', 'WA-60', 'WA-61', 'WA-62', 'WA-63', 'WA-64', 'WA-65', 'WA-66', 'WA-67', 'WA-68', 'WA-69', 'WA-70', 'WA-71', 'WA-72', 'WA-73', 'WA-74', 'WA-75', 'WA-76', 'WA-77', 'WA-78', 'WA-79',
'WA-80', 'WA-81', 'WA-82', 'WA-83', 'WA-84', 'WA-R1', 'WA-R2') as
select '60-02-101' location_no, 'Z-BIN' zone_code, 'DA-REPL' area_code, 'GOOD' darepl from dual union all
select '60-02-102', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-02-201', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-02-202', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-04-101', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-04-102', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-04-201', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-06-101', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-06-201', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-06-202', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-08-101', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-08-201', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-08-202', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-10-201', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-10-202', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-12-102', 'Z-BIN', 'DA-REPL', 'GOOD' from dual union all
select '60-12-202', 'Z-BIN', 'DA-REPL', 'GOOD' from dual
select
substr(location_no,1,5)
from
your_query
group by
substr(location_no,1,5)
having
count(*) < 4
order by
substr(location_no,1,5)
;Result/output
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 20 Column: 62
Yes I want to "show the rows where the frist 5 characters of location_no (such as '60-04') appear on fewer than 4 rows?" which would narrows my results down considerably but alternatively I would want to see which result is missing like in the case of my OP 60-04-202 was not showing because it did not have DA-REPL in the LA.AREA_CODE column so the result I would like most would be to omit the other 3 and only show the one that was missing.
Maybe I this is just not possible but if you could still help me with getting these examples you have give me to work I would be forever greatful this has been an ongoing project I am not new to development or coding but Database development is completely new to me.
Similar Messages
-
I fail to get this result ... Take a look at this media..
Take a look at this media info
General
Complete name : C:\Users\.......\Downloads\Video\Nightcore --- YouTube.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 31.1 MiB
Duration : 3mn 38s
Overall bit rate mode : Variable
Overall bit rate : 1 196 Kbps
Encoded date : UTC 2014-10-19 01:36:36
Tagged date : UTC 2014-10-19 01:36:36
gsst : 0
gstd : 218081
gssd : B4A7DD623MH1413972940055959
gshh : r3---sn-p5qlsu7l.googlevideo.com
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=60
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3mn 38s
Bit rate : 1 002 Kbps
Maximum bit rate : 2 840 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.036
Stream size : 26.0 MiB (84%)
Tagged date : UTC 2014-10-19 01:36:38
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 3mn 38s
Bit rate mode : Variable
Bit rate : 192 Kbps
Maximum bit rate : 203 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 4.99 MiB (16%)
Title : IsoMedia File Produced by Google, 5-11-2011
Encoded date : UTC 2014-10-19 01:36:37
Tagged date : UTC 2014-10-19 01:36:38
In adobe media encoder cc 2014 there is no GOP option. how can i get this result..???Take a look at this media info
General
Complete name : C:\Users\.......\Downloads\Video\Nightcore --- YouTube.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 31.1 MiB
Duration : 3mn 38s
Overall bit rate mode : Variable
Overall bit rate : 1 196 Kbps
Encoded date : UTC 2014-10-19 01:36:36
Tagged date : UTC 2014-10-19 01:36:36
gsst : 0
gstd : 218081
gssd : B4A7DD623MH1413972940055959
gshh : r3---sn-p5qlsu7l.googlevideo.com
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=60
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3mn 38s
Bit rate : 1 002 Kbps
Maximum bit rate : 2 840 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.036
Stream size : 26.0 MiB (84%)
Tagged date : UTC 2014-10-19 01:36:38
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 3mn 38s
Bit rate mode : Variable
Bit rate : 192 Kbps
Maximum bit rate : 203 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 4.99 MiB (16%)
Title : IsoMedia File Produced by Google, 5-11-2011
Encoded date : UTC 2014-10-19 01:36:37
Tagged date : UTC 2014-10-19 01:36:38
In adobe media encoder cc 2014 there is no GOP option. how can i get this result..??? -
TS3694 Has anyone ever had an error code -1202? Cannot find any info on it, please help
Has anyone ever had an error code -1202? Cannot find any info on it, please help
Have you looked at the previous discussions on the right side of this page under the heading "More Like This"?
-
Is there an add-on that shows if any of google results is already in my firefox bookmarks? i.e with a yellow star next to "+1" or preview button.
A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
See:
*https://support.mozilla.org/kb/Server+not+found
*https://support.mozilla.org/kb/Firewalls
Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do not click the Reset button on the Safe mode start window or otherwise make changes.
*https://support.mozilla.org/kb/Safe+Mode -
Hi!
I am unable to get the result for my one of the item as checkbox. Other two are working properly .Please check and let me know wheres the problem please.
***INCLUDE ZSD_CONTRACT_LIST_T01_RENTAL1 .
TABLES: vbak, vbap, wbrk, zsdsched,vbkd, fplt, fpla, tvlvt.
TYPE-POOLS: slis.
data: BEGIN OF gt_report occurs 0,
vbeln LIKE vbak-vbeln, "Sales Document
posnr LIKE vbap-posnr, "Item
ernam LIKE vbak-ernam, "Created by
erdat LIKE vbak-erdat, "Created on
audat LIKE vbak-audat, "Document Date
vbtyp LIKE vbak-vbtyp, "SD document category
auart LIKE vbak-auart, "Sales Document type
vkorg LIKE vbak-vkorg, "Sales Org
vtweg LIKE vbak-vtweg, "Distribution Channel
spart LIKE vbak-spart, "Division
vkbur LIKE vbak-vkbur, "Sales Office
guebg LIKE vbak-guebg, "Valid from date
gueen LIKE vbak-gueen, "Valid to date kunnrt LIKE kna1-name1, "Sold-to Name
kunwet LIKE kna1-name1, "Ship-to Name
kunnrt LIKE kna1-name1, "Sold-to Name
kunret LIKE kna1-name1, "Bill-to Name
kunnr LIKE vbak-kunnr, "Sold-to party
kunnrt LIKE kna1-name1, "Sold-to Name
kvgr4 LIKE vbak-kvgr4, "Territory
matnr LIKE vbap-matnr, "Material
arktx LIKE vbap-arktx, "Material Short Text
charg LIKE vbap-charg, "Batch
matkl LIKE vbap-matkl, "Material Group
pstyv LIKE vbap-pstyv, "Item Category
zmeng LIKE vbap-zmeng, "Target Quantity
zieme LIKE vbap-zieme, "Target Unit
kdmat LIKE vbap-kdmat, "Customer Material Number
werks LIKE vbap-werks, "Plant
lgort LIKE vbap-lgort, "Storage Location
vstel LIKE vbap-vstel, "Shipping Point
route LIKE vbap-route, "Route
netpr LIKE vbap-netpr, "Net Price
kpein LIKE vbap-kpein, "Condition Price Unit
kmein LIKE vbap-kmein, "Condition Unit
shkzg LIKE vbap-shkzg, "Returns Item
oidrc LIKE vbap-oidrc, "DRC Code
kunwe LIKE vbap-oid_ship, "Ship-to
aufnr LIKE vbap-aufnr, "Order Number
vkaus LIKE vbap-vkaus, "Usage
kunwet LIKE kna1-name1, "Ship-to Name
zzwprofid LIKE vbap-zzwprofid, "Waste Profile ID
kunre LIKE wbrk-kunre, "Bill-to
kunret LIKE kna1-name1, "Bill-to Name
addl_schd LIKE icon-id, "Push Button For addl line
datab LIKE zsdsched-datab, "Valid-From Date
datbi LIKE zsdsched-datbi, "Valid To Date
zschdfreq LIKE zsdsched-zschdfreq, "Contract schedule frequency
frequency LIKE zsdsched-frequency, "Frequency
monday LIKE zsdsched-monday, "Mondays
tuesday LIKE zsdsched-tuesday, "Tuesdays
wednesday LIKE zsdsched-wednesday, "Wednesdays
thursday LIKE zsdsched-thursday, "Thursdays
friday LIKE zsdsched-friday, "Fridays
saturday LIKE zsdsched-saturday, "Saturdays
sunday LIKE zsdsched-sunday, "Sundays
dzieme LIKE zsdsched-dzieme, "Target quantity UoM
comments LIKE zsdsched-comments, "Comments
END OF gt_report.
data: Begin of gt_report1 occurs 0,
fksaf LIKE fplt-fksaf,
afdat LIKE fplt-afdat,
fakwr LIKE fplt-fakwr,
fkdat LIKE fplt-fkdat,
nfdat LIKE fplt-nfdat,
fpart LIKE fpla-fpart,
bedat LIKE fpla-bedat,
endat LIKE fpla-endat,
horiz LIKE fpla-horiz,
bezei LIKE tvlvt-bezei,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
ernam LIKE vbak-ernam,
guebg LIKE vbak-guebg,
gueen LIKE vbak-gueen,
auart LIKE vbak-auart,
kunnr LIKE vbak-kunnr,
kvgr4 LIKE vbak-kvgr4,
vkbur LIKE vbak-vkbur,
vkorg LIKE vbak-vkorg,
vtweg LIKE vbak-vtweg,
vbtyp LIKE vbak-vbtyp,
name1 LIKE kna1-name1,
pstyv LIKE vbap-pstyv,
matnr LIKE vbap-matnr,
werks LIKE vbap-werks,
oid_ship LIKE vbap-oid_ship,
kpein LIKE vbap-kpein,
kmein LIKE vbap-kmein,
netpr LIKE vbap-netpr,
kdmat LIKE vbap-kdmat,
posnr LIKE vbap-posnr,
matkl LIKE vbap-matkl,
aufnr LIKE vbap-aufnr,
vkaus LIKE vbap-vkaus,
route LIKE vbap-route,
kunre LIKE wbrk-kunre, "Bill-to
kunwe LIKE vbap-oid_ship, "Ship-to
kunwet LIKE kna1-name1, "Ship-to Name
kunnrt LIKE kna1-name1, "Sold-to Name
kunret LIKE kna1-name1, "Bill-to Name
End of gt_report1.
data: gs_report LIKE LINE OF gt_report,
gs_report1 LIKE LINE OF gt_report1,
gt_sched TYPE TABLE OF zsdsched,
gt_sched_tmp TYPE TABLE OF zsdsched,
gs_sched TYPE zsdsched,
gt_sel LIKE gt_report OCCURS 0,
gt_sel1 LIKE gt_report1 OCCURS 0,
gt_vbpa TYPE TABLE OF vbpa,
gs_vbpa TYPE vbpa,
gv_auart TYPE auart,
gv_counter TYPE i.
**-- ALV variables
DATA: ls_fieldcat TYPE slis_fieldcat_alv, "Field Catalog list
gt_fieldcat TYPE slis_t_fieldcat_alv, "Field Catalog
ls_sort TYPE slis_sortinfo_alv, "Sorting list
gt_sort TYPE slis_t_sortinfo_alv, "Sort
gs_layout TYPE slis_layout_alv, "List Layout
gs_variant TYPE disvariant, "Display Variant
gv_repid LIKE sy-repid,
gv_save(1) TYPE c,
ls_fieldcat1 TYPE slis_fieldcat_alv, "Field Catalog list
gt_fieldcat1 TYPE slis_t_fieldcat_alv, "Field Catalog
ls_sort1 TYPE slis_sortinfo_alv, "Sorting list
gt_sort1 TYPE slis_t_sortinfo_alv, "Sort
gs_layout1 TYPE slis_layout_alv, "List Layout
gs_variant1 TYPE disvariant, "Display Variant
gv_repid1 LIKE sy-repid,
gv_exit(1) TYPE c.
CONSTANTS: gc_a TYPE c VALUE 'A',
gc_g TYPE c VALUE 'G',
gc_re(2) TYPE c VALUE 'RE'.
Screen-control Variables
CONTROLS:
tctrl_sched TYPE TABLEVIEW USING SCREEN 1010. " Schedule lines.
*& Report ZSD_CONTRACT_LIST
*& Created on: January 21, 2007
*& Description: List of Contracts - ALV
REPORT zsd_contract_list_rental1.
INCLUDE zsd_contract_list_t01_rental1.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK m1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t02.
SELECT-OPTIONS: s_vkorg FOR vbak-vkorg MEMORY ID vko,
s_vtweg FOR vbak-vtweg MEMORY ID vtw,
s_spart FOR vbak-spart MEMORY ID spa,
s_vkbur FOR vbak-vkbur MEMORY ID vkb.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
s_erdat FOR vbak-erdat,
s_ernam FOR vbak-ernam,
s_guebg FOR vbak-guebg,
s_gueen FOR vbak-gueen,
s_auart FOR gv_auart MEMORY ID vta
MATCHCODE OBJECT h_vakz,
s_fkarv FOR fplt-fkarv.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS:
s_kunnr FOR vbak-kunnr,
s_kunwe FOR vbap-oid_ship,
s_kunre FOR wbrk-kunre.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t03.
SELECT-OPTIONS: s_werks FOR vbap-werks MEMORY ID wrk,
s_lgort FOR vbap-lgort MEMORY ID lag,
s_vstel FOR vbap-vstel MEMORY ID vst,
s_route for vbap-route,
s_matnr FOR vbap-matnr.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t04.
PARAMETERS: p_varia TYPE disvariant-variant MEMORY ID wrk,
p_all AS CHECKBOX DEFAULT 'X',
p_group AS CHECKBOX DEFAULT 'X',
p_rental AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN END OF BLOCK m1.
Start of Selection
START-OF-SELECTION.
PERFORM get_data.
Display ALV
END-OF-SELECTION.
IF gt_report[] IS INITIAL.
MESSAGE s419(brain).
ELSE.
PERFORM create_alv.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varia.
PERFORM f01_f4_variant CHANGING p_varia.
*& Form get_data
text
FORM get_data .
select the appropriate rental data.
IF p_rental IS NOT INITIAL AND ( ( p_all IS INITIAL ) AND ( p_group IS INITIAL ) ).
SELECT avbeln aerdat aernam aaudat avbtyp aauart a~vkorg
avtweg aspart avkbur aguebg agueen akunnr a~kvgr4
bpstyv bmatnr bwerks boid_ship bkpein bkmein
bnetpr bkdmat bposnr bmatkl baufnr bvkaus b~route
dbezei efkarv eafdat efakwr efkdat enfdat e~fksaf
ffpart fbedat fendat fhoriz flodat ftndat b~oid_ship AS kunwe
INTO CORRESPONDING FIELDS OF TABLE gt_sel1
FROM vbak AS a
INNER JOIN vbap AS b ON avbeln = bvbeln
INNER JOIN vbpa as c ON avbeln = cvbeln
INNER JOIN vbkd AS g ON avbeln = gvbeln
INNER JOIN fplt AS e ON gfplnr = efplnr
INNER JOIN fpla AS f ON efplnr = ffplnr
INNER JOIN tvlvt AS d ON bvkaus = dabrvw
WHERE a~vbeln IN s_vbeln
AND a~erdat IN s_erdat
AND a~vbtyp = gc_g
AND a~ernam IN s_ernam
AND a~vkorg IN s_vkorg
AND a~vtweg IN s_vtweg
AND a~spart IN s_spart
AND a~vkbur IN s_vkbur
AND a~guebg IN s_guebg
AND a~gueen IN s_gueen
AND a~auart IN s_auart
AND a~kunnr IN s_kunnr
AND b~oid_ship IN s_kunwe
AND b~werks IN s_werks
AND b~lgort IN s_lgort
AND b~vstel IN s_vstel
and b~route in s_route
AND b~matnr IN s_matnr
AND e~fkarv IN s_fkarv
AND e~fksaf = 'A'
OR e~fksaf = 'B'.
sort gt_sel1.
*ENDIF.
IF NOT gt_sel1[] IS INITIAL.
Get Bill-to Party's for Item Lines
SELECT vbeln posnr parvw kunnr INTO CORRESPONDING FIELDS OF TABLE gt_vbpa
FROM vbpa
FOR ALL ENTRIES IN gt_sel1
WHERE vbeln = gt_sel1-vbeln
AND parvw = gc_re.
Loop through captured data for additional information
LOOP AT gt_sel1 INTO gs_report1.
Find the bill-to party
READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report1-vbeln
posnr = gs_report1-posnr
parvw = gc_re.
IF sy-subrc <> 0.
READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report1-vbeln
parvw = gc_re.
CHECK sy-subrc = 0 AND gs_vbpa-kunnr IN s_kunre.
ELSE.
CHECK gs_vbpa-kunnr IN s_kunre.
ENDIF.
gs_report1-kunre = gs_vbpa-kunnr.
Get the Customer's Name
gs_report1-kunnrt = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunnr ).
gs_report1-kunwet = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunwe ).
gs_report1-kunret = zcl_kna1=>get_name1( itp_kunnr = gs_report1-kunre ).
Get the scheduling lines for the item line.
CLEAR gv_counter.
APPEND gs_report1 TO gt_report1.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM gt_report1.
*ENDIF.
ELSE.
IF ( ( p_all IS NOT INITIAL ) OR ( p_group IS NOT INITIAL ) ) AND p_rental IS INITIAL.
Select the appropriate contract data.
SELECT a~vbeln a~erdat a~ernam a~audat a~vbtyp a~auart a~vkorg
a~vtweg a~spart a~vkbur a~guebg a~gueen a~kunnr a~kvgr4
b~posnr b~matnr b~charg b~matkl b~arktx b~pstyv b~zmeng
b~zieme b~kdmat b~werks b~lgort b~vstel b~netpr b~kpein
b~kmein b~shkzg b~oid_extbol b~oid_miscdl b~oidrc b~oid_ship AS kunwe
b~zzwprofid c~datbi c~datab b~route
baufnr bvkaus d~bezei
INTO CORRESPONDING FIELDS OF TABLE gt_sel
FROM vbak AS a
INNER JOIN vbap AS b ON a~vbeln = b~vbeln
INNER JOIN tvlvt AS d ON bvkaus = dabrvw
LEFT OUTER JOIN zsdsched AS c ON b~vbeln = c~vbeln AND
b~posnr = c~posnr
WHERE a~vbeln IN s_vbeln
AND a~erdat IN s_erdat
AND a~vbtyp = gc_g
AND a~ernam IN s_ernam
AND a~vkorg IN s_vkorg
AND a~vtweg IN s_vtweg
AND a~spart IN s_spart
AND a~vkbur IN s_vkbur
AND a~guebg IN s_guebg
AND a~gueen IN s_gueen
AND a~auart IN s_auart
AND a~kunnr IN s_kunnr
AND b~oid_ship IN s_kunwe
AND b~werks IN s_werks
AND b~lgort IN s_lgort
AND b~vstel IN s_vstel
and b~route in s_route
AND b~matnr IN s_matnr.
SORT gt_sel.
ENDIF.
IF NOT gt_sel[] IS INITIAL.
Get Bill-to Party's for Item Lines
SELECT vbeln posnr parvw kunnr INTO CORRESPONDING FIELDS OF TABLE gt_vbpa
FROM vbpa
FOR ALL ENTRIES IN gt_sel
WHERE vbeln = gt_sel-vbeln
AND parvw = gc_re.
endif.
Select the remaining records from the ZSDSCHED Table.
IF p_group IS NOT INITIAL.
SELECT * FROM zsdsched
INTO TABLE gt_sched
FOR ALL ENTRIES IN gt_sel
WHERE vbeln = gt_sel-vbeln
AND posnr = gt_sel-posnr.
SORT gt_sched.
ENDIF.
Loop through captured data for additional information
LOOP AT gt_sel INTO gs_report.
Find the bill-to party
READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report-vbeln
posnr = gs_report-posnr
parvw = gc_re.
IF sy-subrc <> 0.
READ TABLE gt_vbpa INTO gs_vbpa WITH KEY vbeln = gs_report-vbeln
parvw = gc_re.
CHECK sy-subrc = 0 AND gs_vbpa-kunnr IN s_kunre.
ELSE.
CHECK gs_vbpa-kunnr IN s_kunre.
ENDIF.
gs_report-kunre = gs_vbpa-kunnr.
Get the Customer's Name
gs_report-kunnrt = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunnr ).
gs_report-kunwet = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunwe ).
gs_report-kunret = zcl_kna1=>get_name1( itp_kunnr = gs_report-kunre ).
Get the scheduling lines for the item line.
CLEAR gv_counter.
IF NOT p_group IS INITIAL.
If we are grouping the lines add the icon button.
LOOP AT gt_sched INTO gs_sched WHERE vbeln = gs_report-vbeln
AND posnr = gs_report-posnr.
IF gv_counter > 0.
gs_report-addl_schd = '@1E@'.
CONTINUE.
ENDIF.
MOVE-CORRESPONDING gs_sched TO gs_report.
ADD 1 TO gv_counter.
ENDLOOP.
ELSE.
Otherwise get the rest of the schedule information
READ TABLE gt_sched INTO gs_sched
WITH KEY vbeln = gs_report-vbeln
posnr = gs_report-posnr
datbi = gs_report-datbi
datab = gs_report-datab.
IF sy-subrc = 0.
MOVE-CORRESPONDING gs_sched TO gs_report.
ENDIF.
ENDIF.
APPEND gs_report TO gt_report.
ENDLOOP.
Remove any duplicates from the reporting table
DELETE ADJACENT DUPLICATES FROM gt_report.
If Show all records is initial, delete non-scheduled lines (ex. Sub-items)
IF p_all IS INITIAL.
DELETE gt_report WHERE datbi = 0
AND datab = 0.
ENDIF.
endif.
endif.
ENDFORM. " get_data
*& Form create_alv
text
FORM create_alv .
if ( ( p_all is not initial ) or ( p_group is not initial ) ) and p_rental is initial.
PERFORM initialize_fieldcat USING gt_fieldcat[].
PERFORM populate_layout CHANGING gs_layout
gs_variant.
PERFORM populate_sort USING gt_sort[].
PERFORM display_alv_report.
else.
if p_rental is not initial and ( ( p_all is initial ) and ( p_group is initial ) ).
PERFORM initialize_fieldcat1 USING gt_fieldcat1[].
PERFORM populate_layout1 CHANGING gs_layout1
gs_variant1.
PERFORM populate_sort1 USING gt_sort1[].
PERFORM display_alv_report1.
*endif.
*endif.
ENDFORM. " create_alv
*& Form initialize_fieldcat
Get and enhance the field catalog data
-->L_FIELDCAT[] text
FORM initialize_fieldcat USING l_fieldcat TYPE slis_t_fieldcat_alv.
IF p_rental IS NOT INITIAL .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZSD_CONTRACT_LIST_RENTAL1'
i_internal_tabname = 'GT_REPORT1'
i_inclname = 'ZSD_CONTRACT_LIST_T01_RENTAL1'
CHANGING
ct_fieldcat = l_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'VBELN'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Contract'.
ls_fieldcat-hotspot = 'X'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNNRT'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sold-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNWET'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Ship-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNRET'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Bill-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'ADDL_SCHD'.
IF NOT p_group IS INITIAL.
ls_fieldcat-seltext_s = 'Schd'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Additional Scheduling Lines'.
ls_fieldcat-icon = 'X'.
CLEAR: ls_fieldcat-key,
ls_fieldcat-ref_fieldname,
ls_fieldcat-ref_tabname,
ls_fieldcat-reptext_ddic,
ls_fieldcat-ddic_outputlen.
ls_fieldcat-hotspot = 'X'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
ELSE.
DELETE l_fieldcat INDEX sy-tabix.
ENDIF.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'DATAB'.
ls_fieldcat-seltext_s = 'Schd From'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. From Date'.
CLEAR: ls_fieldcat-key.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat1 WITH KEY fieldname = 'DATBI'.
ls_fieldcat-seltext_s = 'Schd To'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. To Date'.
CLEAR: ls_fieldcat-key.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
ELSE.
IF p_rental IS INITIAL.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZSD_CONTRACT_LIST_RENTAL1'
i_internal_tabname = 'GT_REPORT'
i_inclname = 'ZSD_CONTRACT_LIST_T01_RENTAL1'
CHANGING
ct_fieldcat = l_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'VBELN'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Contract'.
ls_fieldcat-hotspot = 'X'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNNRT'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sold-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNWET'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Ship-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'KUNRET'.
ls_fieldcat-seltext_s =
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Bill-to Name'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'ADDL_SCHD'.
IF NOT p_group IS INITIAL.
ls_fieldcat-seltext_s = 'Schd'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Additional Scheduling Lines'.
ls_fieldcat-icon = 'X'.
CLEAR: ls_fieldcat-key,
ls_fieldcat-ref_fieldname,
ls_fieldcat-ref_tabname,
ls_fieldcat-reptext_ddic,
ls_fieldcat-ddic_outputlen.
ls_fieldcat-hotspot = 'X'.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
ELSE.
DELETE l_fieldcat INDEX sy-tabix.
ENDIF.
READ TABLE l_fieldcat INTO ls_fieldcat WITH KEY fieldname = 'DATAB'.
ls_fieldcat-seltext_s = 'Schd From'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. From Date'.
CLEAR: ls_fieldcat-key.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
READ TABLE l_fieldcat INTO ls_fieldcat1 WITH KEY fieldname = 'DATBI'.
ls_fieldcat-seltext_s = 'Schd To'.
ls_fieldcat-seltext_m = ls_fieldcat-seltext_l = 'Sched. To Date'.
CLEAR: ls_fieldcat-key.
MODIFY l_fieldcat FROM ls_fieldcat INDEX sy-tabix.
ENDIF.
ENDIF.
ENDFORM. " initialize_fieldcat
*& Form populate_layout
text
<--GS_LAYOUT
<--GS_VARIANT
FORM populate_layout CHANGING gs_layout TYPE slis_layout_alv
gs_variant TYPE disvariant.
gs_layout-colwidth_optimize = 'X'.
gs_layout-allow_switch_to_list = 'X'.
gs_layout-zebra = 'X'.
gs_variant-report = sy-repid.
ENDFORM. " populate_layout
*& Form populate_sort
text
-->l_SORT[] text
FORM populate_sort USING l_sort TYPE slis_t_sortinfo_alv.
ENDFORM. " populate_sort
*& Form display_alv_report
FORM display_alv_report .
gv_repid = sy-repid.
IF p_rental IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = gv_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'GT_REPORT'
is_layout = gs_layout
it_fieldcat = gt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gt_sort
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = gc_a
is_variant = gs_variant
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_report
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.
ELSE.
IF p_rental IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = gv_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'GT_REPORT1'
is_layout = gs_layout
it_fieldcat = gt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gt_sort
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = gc_a
is_variant = gs_variant
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = GT_REPORT1
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.
endif.
ENDFORM. " display_alv_report
*& Form initialize_fieldcat1
Get and enhance the field catalog data for rental fields
-->L_FIELDCAT[] text
*FORM initialize_fieldcat1 USING l_fieldcat1 TYPE slis_t_fieldcat_alv.
**if ***
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZSD_CONTRACT_LIST_rental1'
i_internal_tabname = 'GT_SEL1'
i_inclname = 'ZSD_CONTRACT_LIST_T01_rental1'
CHANGING
ct_fieldcat = l_fieldcat1
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
**else.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZSD_CONTRACT_LIST_rental1'
i_internal_tabname = 'GT_SEL1'
i_inclname = 'ZSD_CONTRACT_LIST_T01_rental1'
CHANGING
ct_fieldcat = l_fieldcat1
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
***endfi.
*ENDFORM. " initialize_fieldcat
*& Form populate_layout
text
<--GS_LAYOUT
<--GS_VARIANT
*FORM populate_layout1 CHANGING gs_layout1 TYPE slis_layout_alv
gs_variant1 TYPE disvariant.
gs_layout1-colwidth_optimize = 'X'.
gs_layout1-allow_switch_to_list = 'X'.
gs_layout1-zebra = 'X'.
gs_variant1-report = sy-repid.
*ENDFORM. " populate_layout
***& Form populate_sort
text
-->l_SORT[] text
*FORM populate_sort1 USING l_sort TYPE slis_t_sortinfo_alv.
*ENDFORM. " populate_sort
***& Form display_alv_report
*FORM display_alv_report1 .
gv_repid = sy-repid.
if p_rental is not initial and ( ( p_all is initial ) and ( p_group is initial ) ).
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = gv_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'gt_sel1'
is_layout = gs_layout1
it_fieldcat = gt_fieldcat1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gt_sort1
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = gc_a
is_variant = gs_variant1
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_sel1
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. " display_alv_report
*& Form f01_f4_variant
Get the Layout variant for the user.
FORM f01_f4_variant CHANGING c_variant TYPE disvariant-variant.
DATA: ls_variant TYPE disvariant,
l_exit TYPE char1.
ls_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = ls_variant
i_save = 'A'
it_default_fieldcat =
IMPORTING
e_exit = l_exit
es_variant = ls_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF l_exit EQ space.
c_variant = ls_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " f01_f4_variant
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE gt_report INTO gs_report INDEX rs_selfield-tabindex.
CHECK sy-subrc = 0.
CASE rs_selfield-fieldname.
WHEN 'VBELN'.
Set parameter ID for transaction screen field
CHECK NOT gs_report-vbeln IS INITIAL.
SET PARAMETER ID 'KTN' FIELD gs_report-vbeln.
CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN.
WHEN 'ADDL_SCHD'.
CHECK NOT gs_report-addl_schd IS INITIAL.
REFRESH gt_sched_tmp.
LOOP AT gt_sched INTO gs_sched
WHERE vbeln = gs_report-vbeln
AND posnr = gs_report-posnr.
APPEND gs_sched TO gt_sched_tmp.
ENDLOOP.
CHECK sy-subrc = 0.
CALL SCREEN '1010' STARTING AT 5 5.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
*& Module STATUS_1010 OUTPUT
text
MODULE status_1010 OUTPUT.
SET PF-STATUS 'MAIN_1010'.
SET TITLEBAR '1010' WITH gs_report-vbeln gs_report-posnr.
ENDMODULE. " STATUS_1010 OUTPUT
*& Module USER_COMMAND_1010 INPUT
text
MODULE user_command_1010 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'CANC'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_1010 INPUTHi !
This report shows the schedule line items , group schedule line items and rental contact (billing plan) lines when particular checkbox is checked. The checkboxs p_all(non-schedule line) , p_group(group schedule line items) are working in my above alv report and showing result but unfortunately when p_rental is checked it dosent give me result , it says no data selected. This when checked has to show result based on a different set of selections as I have done, but its not shwoing me the result .
Kindly help please.
Thanks -
How to show result with 4 columm
I using this to show result
$result += [PSCustomObject]@{
ServerName = "$computername"
CPULoad = "$($AVGProc.Average)%"
MemLoad = "$($OS.MemoryUsage)%"
CDrive = "$($vol.'C PercentFree')%"
i need result with 5 columms, but when i add more line to code, result format change to list, how to keep format on table
thank u$result | Format-Table -auto
\_(ツ)_/ -
Read 100 Question OMR Sheet and Show result
Hello All,
I got a Project from:
http://www.codeproject.com/Articles/451169/Csharp-Optical-Marks-Recognition-OMR-Engine-1-0?msg=4386396#xx4386396xx
thanks to umar.techBOY.
I changed it to my requirment as 100 Questions with 4 Options in A4 size Paper.
Its working fine as far as read registration is concern.
The problem with the read Answer Function.
The code for reading Answer are as follows:
private void button7_Click(object sender, EventArgs e)
//ContrastCorrection cc = new ContrastCorrection();
//panel1.BackgroundImage = cc.Apply((Bitmap)panel1.BackgroundImage);
panel1.Invalidate(); Application.DoEvents();
showTimeStamp("Slicing Started");
Rectangle[] Blocks = new Rectangle[]
OMRSheetReader.GetSheetPropertyLocation("sheets", OMREnums.OMRSheet.A450, OMREnums.OMRProperty.tensBlock1),
OMRSheetReader.GetSheetPropertyLocation("sheets", OMREnums.OMRSheet.A450, OMREnums.OMRProperty.tensBlock2),
OMRSheetReader.GetSheetPropertyLocation("sheets", OMREnums.OMRSheet.A450, OMREnums.OMRProperty.tensBlock3),
OMRSheetReader.GetSheetPropertyLocation("sheets", OMREnums.OMRSheet.A450, OMREnums.OMRProperty.tensBlock4)
List<Bitmap[]> bmps = new List<Bitmap[]>();
for (int i = 0; i < 4; i++)
bmps.Add(SliceOMarkBlock(panel1.BackgroundImage, Blocks[i], 25));
showTimeStamp("Slicing ended");
string ans = "";
foreach (Bitmap[] blk in bmps)
foreach (Bitmap line in blk)
ans += rateSlice(line,25) + ",";
ans += "\r\n";
panel1.Invalidate();
Application.DoEvents();
MessageBox.Show(ans);
private int rateSlice(Bitmap slice, int OMCount)
Rectangle[] cropRects = new Rectangle[OMCount];
Bitmap[] marks = new Bitmap[OMCount];
for (int i = 0; i < OMCount; i++)
cropRects[i] = new Rectangle(i * slice.Width / OMCount, 0, slice.Width / OMCount, slice.Height);
int crsr = 0;
foreach (Rectangle cropRect in cropRects)
Bitmap target = new Bitmap(cropRect.Width, cropRect.Height);
using (Graphics g = Graphics.FromImage(target))
g.DrawImage(slice, new Rectangle(0, 0, target.Width, target.Height),
cropRect,
GraphicsUnit.Pixel);
marks[crsr] = target;
crsr++;
long maxPD = (slice.Width / OMCount) * slice.Height * 255;
List<long> inks = new List<long>();
List<long> fullInks = new List<long>();
foreach (Bitmap mark in marks)
inks.Add(InkDarkness(mark));
fullInks.Add(inks[inks.Count - 1]);
int indofMx = -1,indofMn = -1;
long maxD = 0, minD = 0; ;
for (int i = 0; i < OMCount; i++)
if (inks[i] > maxD)
maxD = inks[i];
indofMx = i;
minD = maxD;
for (int i = 0; i < OMCount; i++)
if (inks[i] < minD)
minD = inks[i];
indofMn = i;
for (int i = 0; i < OMCount; i++)
inks[i] -= minD - 1;
bool parallelExist = false, spe = false, tpe = false, fpe = false;
for (int i = 0; i < OMCount; i++)
if (i != indofMx)
if ((double)fullInks[indofMx] / fullInks[i] <= 2)
if (tpe) fpe = true;
if (spe) tpe = true;
if (parallelExist) spe = true;
parallelExist = true;
int negScore = parallelExist ? -1 : 0;
negScore = spe ? -2 : negScore;
negScore = tpe ? -3 : negScore;
negScore = fpe ? -4 : negScore;
if (!parallelExist)
return indofMx + 1;
bool atleastOneUnfilled = false;
for (int i = 0; i < OMCount; i++)
if (i != indofMx)
if ((double)fullInks[indofMx] / fullInks[i] >= 3)
atleastOneUnfilled = true;
if (atleastOneUnfilled)
return negScore;
return 0;
private long InkDarkness(Bitmap OMark)
int darkestC = 255, lightestC = 0;
UnmanagedImage mark = UnmanagedImage.FromManagedImage(OMark);
for (int y = 0; y < OMark.Height; y++)
for (int x = 0; x < OMark.Width; x++)
Color c = mark.GetPixel(x, y);
if (((c.R + c.G + c.B) / 3) > lightestC)
lightestC = ((c.R + c.G + c.B) / 3);
if (((c.R + c.G + c.B) / 3) < darkestC)
darkestC = ((c.R + c.G + c.B) / 3);
int dc = 0;
for (int y = 0; y < OMark.Height; y++)
for (int x = 0; x < OMark.Width; x++)
Color c = mark.GetPixel(x, y);
if (((c.R + c.G + c.B) / 3) < (lightestC + darkestC) / 2)
{ dc += 255; }
return dc;
private Bitmap[] SliceOMarkBlock(System.Drawing.Image fullSheet, Rectangle slicer, int slices)
List<Rectangle> cropRects = new List<Rectangle>();
Bitmap[] bmps = new Bitmap[slices];
for (int i = 0; i < slices; i++)
cropRects.Add(new Rectangle(slicer.X, slicer.Y + (slicer.Height / slices) * i, slicer.Width, slicer.Height/slices));
Bitmap src = (Bitmap)fullSheet;
int crsr = 0;
foreach (Rectangle cropRect in cropRects)
Bitmap target = new Bitmap(cropRect.Width, cropRect.Height);
using (Graphics g = Graphics.FromImage(target))
g.DrawImage(src, new Rectangle(0, 0, target.Width, target.Height),
cropRect,
GraphicsUnit.Pixel);
bmps[crsr] = target;
crsr++;
return bmps;
throw new Exception("Couldn't slice");
Its Showing result like ---> -2,-3,-2,-4,-4,-4 and so on up to 100 Questions
is there any one Help me for this.It looks like you've already engaged the author on the CodeProject site and they have attempted to help you. It would be best to finish the discussion there. I'll move this to the C# forums (since it is C# code) but it may get moved again to
Off-Topic since the issue revolves around this particular CodeProject article (and since the author has already attempted to help).
Reed Kimble - "When you do things right, people won't be sure you've done anything at all" -
Problem with store ResultSet and show result in table
Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
When I try to println() contains of this result set in this method - it works OK (commented part),
but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
Is there any way to store data from ref_cursor for a long time?
2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
storeNewResultSet(), setUserDataForCollection()...
I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
Thanks for your help.
ADF BC, JDev 11.1.1.0
This is my code from ViewObjectImpl
package tp.model ;
import com.sun.jmx.mbeanserver.MetaData ;
import java.sql.CallableStatement ;
import java.sql.Connection ;
import java.sql.PreparedStatement ;
import java.sql.ResultSet ;
import java.sql.ResultSetMetaData ;
import java.sql.SQLException ;
import java.sql.Statement ;
import java.sql.Types ;
import oracle.jbo.JboException ;
import oracle.jbo.server.SQLBuilder ;
import oracle.jbo.server.ViewObjectImpl ;
import oracle.jbo.server.ViewRowImpl ;
import oracle.jbo.server.ViewRowSetImpl ;
import oracle.jdbc.OracleCallableStatement ;
import oracle.jdbc.OracleConnection ;
import oracle.jdbc.OracleTypes ;
public class Profiles1ViewImpl extends ViewObjectImpl {
private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
public Profiles1ViewImpl () {
/* 0. */
protected void create () {
getViewDef ().setQuery ( null ) ;
getViewDef ().setSelectClause ( null ) ;
setQuery ( null ) ;
public Connection getCurrentConnection () throws SQLException {
// Note that we never execute this statement, so no commit really happens
Connection conn = null ;
PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
conn = st.getConnection () ;
st.close () ;
return conn ;
/* 1. */
protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
// callStoredProcedure ( qc , SQL_STM ) ;
super.executeQueryForCollection ( qc , params , numUserParams ) ;
/* 2. */
private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
ResultSet rs = null ;
rs = callStoredProcedure ( qc , SQL_STM ) ;
return rs ;
/* 3. */
public ResultSet callStoredProcedure ( Object qc , String stmt ) {
CallableStatement st = null ;
ResultSet refCurResultSet = null ;
try {
st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call
st.setObject ( 1 , 571 ) ; //set id of my record to 571
st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
st.registerOutParameter ( 3 , Types.NUMERIC ) ;
st.registerOutParameter ( 4 , Types.VARCHAR ) ;
st.execute () ; //executeUpdate
System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
// setUserDataForCollection(qc, refCurResultSet); //don't work
// createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
/* this works but only one-time call - so my resultSet(cursor) really have a data
while ( refCurResultSet.next () ) {
String nameProfile = refCurResultSet.getString ( 2 ) ;
System.out.println ( "Name profile: " + nameProfile ) ;
return refCurResultSet ;
} catch ( SQLException e ) {
System.out.println ( "sql ex " + e ) ;
throw new JboException ( e ) ;
} finally {
if ( st != null ) {
try {
st.close () ; // 7. Close the statement
} catch ( SQLException e ) {
System.out.println ( "sql exx2 " + e ) ;
/* 4. Store a new result set in the query-collection-private user-data context */
private void storeNewResultSet ( Object qc , ResultSet rs ) {
ResultSet existingRs = getResultSet ( qc ) ;
// If this query collection is getting reused, close out any previous rowset
if ( existingRs != null ) {
try {
existingRs.close () ;
} catch ( SQLException s ) {
System.out.println ( "sql err " + s ) ;
setUserDataForCollection ( qc , rs ) ; //should store my result set
hasNextForCollection ( qc ) ; // Prime the pump with the first row.
/* 5. Retrieve the result set wrapper from the query-collection user-data */
private ResultSet getResultSet ( Object qc ) {
return ( ResultSet ) getUserDataForCollection ( qc ) ;
// createRowFromResultSet - overridden for custom java data source support - also doesn't work
protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
return value ;
}Hi I have the same problem like you ...
My SQL Definition:
CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
v_title VARCHAR2(100),
v_store VARCHAR2(50),
v_sales NUMBER(20,4),
v_cost NUMBER(20,4),
v_units NUMBER(12,4),
v_margin NUMBER(6,2),
v_ly_sales NUMBER(20,4),
v_ly_cost NUMBER(20,4),
v_ly_units NUMBER(12,4),
v_ly_margin NUMBER(6,2),
v_sales_variance NUMBER(6,2)
CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
AS
v_sales_format_tab nb_tab_storedata;
FUNCTION sales_data_by_format_gen (
key_value IN VARCHAR2,
l_to_date IN DATE DEFAULT SYSDATE-1,
l_from_date IN DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
RETURN nb_tab_storedata;
I have a PLSQL function .. that will return table ..
when i use this in sql developer it is working fine....
select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
'05-Aug-2012',
'01-Aug-2012') )
it returning table format record.
I am not able to call from VO object. ...
Hope you can help me .. please tell me step by step process...
protected Object callStoredFunction(int sqlReturnType, String stmt,
Object[] bindVars) {
System.out.println("--> 1");
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
System.out.println("--> 2");
st.executeUpdate();
System.out.println("--> 3");
return st.getObject(1);
catch (SQLException e) {
e.printStackTrace();
throw new JboException(e); -
Custom field not getting populated in the "Show Results where" drop down
Hi all,
In appointment detail page by clicking on Add button on the user related information section , it takes us to a search layout showing the list of available users.
Here we have to filter the user's based on a custom field which has already been created in the user object. But I am not able to add the custom field in the "Show results where" drop down for which the search has to be done.
It is getting reflected in the normal search layouts.So Can any one tell me why the change is not getting reflected in the user related info search layout?I tested your use case and you are correct. I would recommend that you submit a service request to CRM On Demand customer care in reference to this issue.
-
What is the easiest way to add a slide show to a dream weaver page?
What is the easiest way to add a slide show to a dream weaver page?
Copy & paste the following code into a new, blank document. Change images to your own. SaveAs test.html and preview in browsers.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 with Cycle2</title>
<!--help for older IE browsers-->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--Latest jQuery Core Library-->
<script src="http://code.jquery.com/jquery-latest.min.js">
</script>
<!--Cycle2 Slideshow Plugin-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>
<style>
/**Slideshow**/
.cycle-slideshow {
position: relative;
z-index: 1;
width: 400px; /**adjust width as required**/
margin:75px auto;
text-align: center;
.cycle-slideshow img { max-width: 100% }
/* prev / next links */
.cycle-prev, .cycle-next {
position: absolute;
top: 0;
width: 20%;
opacity: 0;
filter: alpha(opacity=0);
z-index: 800;
height: 100%;
cursor: pointer;
.cycle-prev {
left: 0;
background: url(http://malsup.github.com/images/left.png) 50% 50% no-repeat;
.cycle-next {
right: 0;
background: url(http://malsup.github.com/images/right.png) 50% 50% no-repeat;
.cycle-prev:hover, .cycle-next:hover {
opacity: .7;
filter: alpha(opacity=70)
/**END SLIDESHOW STYLES**/
</style>
</head>
<body>
<h1><a href="http://jquery.malsup.com/cycle2/">JQuery Cycle2</a></h1>
<!--begin slideshow-->
<div class="cycle-slideshow"
data-cycle-fx="fade"
data-cycle-timeOut="2000"
>
<!-- prev/next links -->
<div class="cycle-prev"></div>
<div class="cycle-next"></div>
<!--insert your images below-->
<img src="http://jquery.malsup.com/cycle2/images/p1.jpg" alt="description">
<img src="http://jquery.malsup.com/cycle2/images/p2.jpg" alt="description">
<img src="http://jquery.malsup.com/cycle2/images/p3.jpg" alt="description">
<img src="http://jquery.malsup.com/cycle2/images/p4.jpg" alt="description">
<p>Mouse over image for previous / next links</p>
</div>
<!--end slideshow-->
</body>
</html>
Nancy O. -
How to show result from process in popup page?
<br>We want to use one popup page for many information in application. So we want to make the following thing.
<br>We want to execute process and show result in popup page (through hidden parameter-"P2_MESSAGE").
<br>We also assign title of region on that popup page through "P2_TITLE".
<br>What I do not know is how to show popup after process-branch problem.
<br>Process is executed from one button. Button is located on page "28" and popup page is "2"
<br>Code for javascript should be like:
<br>
javascript:popupURL('f?p=&APP_ID.:2:&APP_SESSION.::::P2_TITLE,P2_MESSAGE:'+'status '+','+'&P28_X.')<br>THXI have found in one thread:
<br>
<br>1) create an application item APP_ONLOAD (of course you can choose your own name)
<br>2) create an application level before footer computation on APP_ONLOAD to clear the item after the page is generated.
<br>3) place &APP_ONLOAD. (dot also) in the on load property of the page.
<br>4) fill the APP_ONLOAD using :APP_ONLOAD := 'onload="your own javascript to call a popup window;"' in the plsql of an after On Submit - After Computations and Validations process (type PL/SQL anonymous block)
Fill the when button pressed property of the process with the button you want to use to show the popup.
<br>5) create a branch to branch to the current page (or a other if you wish)
<br>
Looks OK but when I create in PL/SQL js with "&" signe, which I use for filling some hidden values in popup page I get error.
begin
is_test_ok (1, :P28_X);
:APP_ONLOAD := 'onload="javascript:popupHeightURL(''f?p=&APP_ID.:2:&APP_SESSION.::::P2_TITLE,P2_MESSAGE:''+''statusu testova''+'','+''&P28_X.'')"';
end;<br>Should I use ASCII codes for that or what? Any example please!
<br>THX -
Segment builder,not showing results.
hi experts
While creating a campaign i assigned marketing attributes to business partner .its visible in the marketing tab page in the respective bp but in the segment builder its not showing results.Hello,
have you added the marketing attributes as a data source to the Segment Builder using Transaciton Code CRMD_MKTDS?
Regards
Gregor -
How to shows result as Alias name.
Dear All,
I am having following query and output, in that inside query showing one record check another query, that result i want to show as Alias, Can we show result as alias ?
select SPL.speciality_description,Emp.FIRSTNAME,DT.full_date
,max(decode(diagnosis_description,
(SELECT DIAGNOSIS_DESCRIPTION
FROM (SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=1),patientcount)) as First
,max(decode(diagnosis_description,
(SELECT DIAGNOSIS_DESCRIPTION FROM (
SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=2),patientcount)) as Second
,max(decode(diagnosis_description,
(SELECT DIAGNOSIS_DESCRIPTION FROM (
SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=3),patientcount)) as Third
,max(decode(diagnosis_description,
(SELECT DIAGNOSIS_DESCRIPTION FROM (
SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=4),patientcount)) as Forth
,max(decode(diagnosis_description,
(SELECT DIAGNOSIS_DESCRIPTION FROM (
SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=5),patientcount)) as Fifth
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_SPECIALITY SPL ON SPL.SPECIALITYID = PD.SPECIALITYID
INNER JOIN D_EMPLOYEEMASTER EMP ON EMP.EMPID = PD.DOCTORID
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual)
group by SPL.speciality_description, Emp.FIRSTNAME, DT.full_date
order by SPL.speciality_description,Emp.FIRSTNAME,DT.full_date
Output:
REGISTRATION Dr.POOJA 19-JUL-10 12:00 AM 56 74 99 32 96
REGISTRATION Dr.POOJA 21-JUL-10 12:00 AM 93 74 45 43 69
REGISTRATION Dr.POOJA 22-JUL-10 12:00 AM 34 34 76 66 24
REGISTRATION Dr.POOJA 24-JUL-10 12:00 AM 99 75 97 78 69
REGISTRATION Dr.POOJA 26-JUL-10 12:00 AM 54 34 76 66 24
REGISTRATION Dr.POOJA 28-JUL-10 12:00 AM 76 75 97 78 33
REGISTRATION Dr.POOJA 30-JUL-10 12:00 AM 54 23 34 65 23
Travel Clinic Dr.PRAN 19-JUL-10 12:00 AM 56 74 99 32 96
Travel Clinic Dr.PRAN 21-JUL-10 12:00 AM 93 74 45 43 69
Anothe Query :
SELECT DIAGNOSIS_DESCRIPTION
FROM (SELECT row_number() OVER (ORDER BY DIAGNOSIS_DESCRIPTION DESC) r,
DG.DIAGNOSIS_DESCRIPTION
FROM A_PERFORMANCEDOCTORWISE PD
INNER JOIN D_DATE DT ON DT.DATE_ID = PD.DATEID
INNER JOIN D_DIAGNOSIS DG ON DG.DIAGNOSISID = PD.DIAGNOSISID
WHERE DT.FULL_DATE between (select TO_CHAR(sysdate-15,'DD/MON/YYYY') from dual)
and (select TO_CHAR(sysdate,'DD/MON/YYYY') from dual) and ROWNUM < 6
) WHERE r=1
Output:
Neurocytoma
I want to show this result as Alias name. Can anybody tell me how to do that ?
Thanks and Regard's
Harish PatilHi,
If I've understood the intention of your code correctly, you are trying to pivot the rows into columns and assign a "nice" header to the resulting columns.
You cannot dynamically assign a column name to a pivoted row. You need to know beforehand what row you are pivoting so you can assign a column name to it. This isn't as difficult as it sounds, there are a number of ways you could know what row will become what column.
Since I have no way to test using your code, I am posting an example for you that uses the EMP table that is part of the standard example databases shipped with Oracle.
Also, notice that, the code I am presenting is enclosed between the tags (which you cannot see) [ code ] and [ / code ] which is why it appears nicely formatted. Your code would be much easier to read and folks would be much more likely to understand what you want and therefore help you if you take the time to format your code so it is comprehensible.
See the basics of using tags to format your code at this page:
http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ
Now the example that will help you get what you want:
/* this query calculates the total salaries per deptno */
SELECT job,
deptno,
sum(sal) sal
FROM emp
GROUP BY job, deptno;
/* output is */
JOB SUM(SAL)
CLERK 4150
SALESMAN 5600
PRESIDENT 5000
MANAGER 8275
ANALYST 6000
/* this query pivots the above query (which is what you're trying to do) */
SELECT *
FROM (
SELECT job,
deptno,
sum(sal) sal
FROM emp
GROUP BY job, deptno
PIVOT (sum(sal) FOR deptno IN (10, 20, 30, 40));
/* output is */
CLERK SALESMAN PRESIDENT MANAGER ANALYST
4150 5600 5000 8275 6000If you are not using 11g, there are ways of doing the above without using the PIVOT clause. There are lots of examples in this forum on how to pivot rows. Here is one that pretty much does manually what the PIVOT clause does:
select max(case when job='CLERK'
then ename else null end) as clerks,
max(case when job='ANALYST'
then ename else null end) as analysts,
max(case when job='MANAGER'
then ename else null end) as mgrs,
max(case when job='PRESIDENT'
then ename else null end) as prez,
max(case when job='SALESMAN'
then ename else null end) as sales
from (
select job,
ename,
row_number()over(partition by job order by ename) rn
from emp
) x
group by rn
/* outputs */
CLERKS ANALYSTS MGRS PREZ SALES
MILLER FORD CLARK KING TURNER
JAMES SCOTT BLAKE MARTIN
ADAMS JONES WARD
SMITH ALLENHTH,
John.
Edited by: 440bx - 11gR2 on Aug 2, 2010 9:28 AM - added missing verb "is" in sentence
Edited by: 440bx - 11gR2 on Aug 2, 2010 9:32 AM - missing "s" in select. -
A php search engine that only shows results that match entire serch string
I have set up a dreamweaver search engine through php and a fulltext search (WHERE MATCH (....) AGAINST (...). However, when someone inputs more than one word into the search form, the search engine churns out results that only have one of those words. How do I get it to only show results that have all the search string words inside? (or, at least, how do I get those results to show up at the top?)
I have seen some advice (here) that uses php code to process the search query, divide up the words, and place a BOOLEAN '+' between each of the words. By doing this, the search engine will only show results that fully match all the terms.
My problem is that I do not know how to put this code into my Dreamweaver-created code.
My dreamweaver created code:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$form_rsSearch = "-1";
if (isset($_get['search'])) {
$form_rsSearch = $_get['search'];
mysql_select_db($database_dataConnect, $dataConnect);
$query_rsSearch = sprintf("SELECT title, content FROM encyclopedia WHERE MATCH (title, content) AGAINST (%s)", GetSQLValueString($form_rsSearch, "text"));
$rsSearch = mysql_query($query_rsSearch, $dataConnect) or die(mysql_error());
$row_rsSearch = mysql_fetch_assoc($rsSearch);
$totalRows_rsSearch = mysql_num_rows($rsSearch);
$input_rsSearchResults = "-1";
if (isset($_GET['search'])) {
$input_rsSearchResults = $_GET['search'];
mysql_select_db($database_EMdataConnect, $dataConnect);
$query_rsSearchResults = sprintf("SELECT title, content FROM encyclopedia WHERE MATCH(title, content) AGAINST(%s)", GetSQLValueString($input_rsSearchResults, "text"));
$rsSearchResults = mysql_query($query_rsSearchResults, $dataConnect) or die(mysql_error());
$row_rsSearchResults = mysql_fetch_assoc($rsSearchResults);
?>
and the code the website (link above) gives is:
function search(String $search_string) {
//strip Boolean search characters out of search string
$search_string = string_replace($search_string,"+","");
$search_string = string_replace($search_string,"-","");
$search_string = string_replace($search_string,"*","");
//split the search string up into an array of words
Array $tokenized_search = split($search_string, " ");
//init an empty final search string
String $processed_search = "";
//for each word in the search, wrap it
//with an + and * character and then append
//it to the processed_search variable
foreach($tokenized_search as $token) {
$processed_search+="+"+$token+"* ";
//build the sql for the query and query the DB
String $db_query = "select id, description
from product_descriptions
where MATCH(description)
AGAINST ('"+$processed_search+"' IN BOOLEAN MODE)";
Array results = execute_database_query($db_query);
return results;
If anyone can instruct me on the correct way to go about this, I would be very much obliged.
Thank you,
YWSWDon't use the Search bar, type the address in the Location bar.
-
Error while executing BBP_UPDATE_PORG Tr Code with ADD Option
Hi All,
I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
Example Scenario:
step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
step 2: I run the BBPUPDVD in SRM System.
Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
Runtime Error DYNPRO_SEND_IN_BACKGROUND
Date and Time 09/15/2008 10:56:58
ShrtText
Screen output without connection to user.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Information on where terminated
The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in "BBP_PORG_INSERT".
The main program was "RSM13000 ".
The termination occurred in line 59 of the source code of the (Include) program "LBBP_PARTNER_MAINTU11"
of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor 590).
The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
56
57 * update database
58 IF NOT LT_FRG0060_NEW[] IS INITIAL.
>>>>> INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
60 ENDIF.
61
62 IF NOT LT_FRG0061_NEW[] IS INITIAL.
63 INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
64 ENDIF.
Kindly guide me or provide solution.
We are in SRM 4.0 and ECC 5.0.
Thanks a lot in advance.
Regards,
Sudarsan
Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PMHi All,
I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
Example Scenario:
step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
step 2: I run the BBPUPDVD in SRM System.
Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
Runtime Error DYNPRO_SEND_IN_BACKGROUND
Date and Time 09/15/2008 10:56:58
ShrtText
Screen output without connection to user.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Information on where terminated
The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in "BBP_PORG_INSERT".
The main program was "RSM13000 ".
The termination occurred in line 59 of the source code of the (Include) program "LBBP_PARTNER_MAINTU11"
of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor 590).
The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
56
57 * update database
58 IF NOT LT_FRG0060_NEW[] IS INITIAL.
>>>>> INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
60 ENDIF.
61
62 IF NOT LT_FRG0061_NEW[] IS INITIAL.
63 INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
64 ENDIF.
Kindly guide me or provide solution.
We are in SRM 4.0 and ECC 5.0.
Thanks a lot in advance.
Regards,
Sudarsan
Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PM
Maybe you are looking for
-
I have a personal Macbook Pro, which I have had for a very long time. My iTunes account has a lot of music from CD's but also has a lot of purchased music. I also have a Macbook Air for work and have purchased a lot of music on this computer using th
-
Cannot add new items to a value list in AW database
I have a database which I have been using for many years. One of the fields is a value list. I just went to add another item to the list, and no matter what I do, the Create button is grayed out. I have another value list in the same database that wo
-
Can anyone help me save an audio file to a cd-r? I want to make sure I know what I am doing without making a mess so any help would be GREATLY APPRECIATED!!!!! Thanks in advance, Tonia
-
trying to install Snow Leapord. System restarted 1/2 way through install. now i have a white screen with an apple on it. what do i do?
-
How to revert back to mac os 10.6
how do I revert back to MAC OS 10.6 from 10.8?