Wallpaper query
I've got some images for the n80, the resolution is 240x320
when viewing in gallery i can see them full screen, but when assign them as a background on the phone they sit in the middle of the screen.
I can't find anywhere where to get it to use fullscreen for background, does anyone know how to set it to fullscreen.
Or does anyone know of a good free program that will let you resize them for the phone properly, as no feature in pc suite to do this
thanks
You need to turn them into a theme. Try searching this forum for nokia theme creator
Orange Handsets : Nokia 51 > NK702 (6130) > 6210 > 6310i (silver)> 7210i > 6230 > 6230i (silver) > N80 (silver) > N95-1
T-Mobile: N96
Similar Messages
-
XFCE workaround: Laptop wallpaper not kept when undocked
So I've been running into the minor annoyance of XFCE always using the wallpaper from the monitor on the left screen after I unplug my secondary monitor. Not sure if anyone else runs into this. Just to clarify:
(pretend the pipe is the border between screens)
While docked: Wallpaper A (VGA-1) | Wallpaper B (LVDS)
Undocked: Wallpaper A (LVDS)
I would expect wallpaper B to persist on the laptop display regardless of whether the second monitor is hooked up or not.
Since I use a script to toggle my monitor off and on using a hotkey I made a few modifications to it so that you can specify the wallpaper setup while docked or undocked. You could also have completely different wallpapers while mobile if you don't want to be seen in public with your My Little Pony wallpaper.
(I still use a CRT as a second monitor, don't make fun of me)
#!/bin/bash
#Absolute path seems to be required for some reason.
location="/home/jason/.config/xfce4"
function xfset {
cat $location/$1 | while read line; do
variable=`echo $line |awk '{print $1}'`
setting=`echo $line |awk '{print $2}'`
xfconf-query -c xfce4-desktop -p $variable --create -s $setting
done
current=`xrandr |grep current |awk '{print $8 $10}'`
if [ $current == '1366768,' ]
then
#Going to Dual
xfconf-query -c xfce4-desktop -l -v|grep backdrop>$location/single.set
xrandr --output LVDS --mode 1366x768 --pos 1600x432 --rotate normal --output CRT1 --mode 1600x1200 --pos 0x0 --rotate normal --output DFP1 --off;
xfset dual.set
else
#going to single
xfconf-query -c xfce4-desktop -l -v|grep backdrop>$location/dual.set
xrandr --output LVDS --mode 1366x768 --rotate normal --output CRT1 --off --output DFP1 --off
xfce4-panel -r
xfset single.set
fi
Let me know if you have any feedback or found this useful. I'm curious if this is a problem anyone else has.
Last edited by Jasonvw (2013-02-21 09:51:36)You could look at xfconf properties comparing both monitors with one montor connected to find out differences.
i.e. xfconf-query -c xfce4-desktop -l
Setting a wallpaper in xfce through xfconf:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path --create -t string -s $wp
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show --create -t bool -s true
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style --create -t int -s 0
Where $wp is set to full path of image file.
When comparing the properties you might find monitor1 becomes monitor0 and that might explain the wallpaper switching.
You can find out the path to the current wallpaper using a query like:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path
May be some of the above will help you figure something out. I only mention it because it is disconcerting to me that you are killing stuff like xfconfd and xfdesktop to achieve the proper wallpapers. -
Querying a Flash Lite content type running in the player
In the current Flash Lite specs, it's not possible to query
the content
type that is running from within the Flash Lite player
(wallpaper,
screensaver, standalone, etc).
My questions:
1.) Is this something that can be (easily) implemented in the
next rev
of Flash Lite? I can think of a few use cases where this
might be
(potentially) useful.
Basically, this would allow for a detect mechanism, and thus
provide a
way to disable or enable functionality within content based
on how it is
being run (based on the content-type detected).
For example, if FL content is run as a screensaver, no custom
softkey
navigation would appear. However, if run as standalone
content, a custom
UI might appear ... say giving the user the option to quit,
get more
info, etc.
I am posting here to see if others would be interested in
such
functionality.
2.) From my tests, I don't think the FL content type is
inserted into
the Flash Lite SWF header, but can it be? Injecting meta data
into SWF's
is tricky business ... does it make sense to add this
functionality in
the next rev of Flash Lite? ... again, this info might be
useful in some
content use cases, which tie back to #1.
Thoughts?
-sjI could see some strong potential FL improvements by opening
this door. This could be very useful in the sense that developers
could then #include a single .as file that would act as a master
library regardless of content type.
Another feature that ties into this that I would love would
be FL version detection. Granted, this file could sort of be
created with FS2 command detection. But still, creating one library
file that covers all user input methods would be very nice.
To take this a step further, could this also detect what
edition a phone is? Again, this could be done with via a
WURFL, but that is a huge
pain (not to mention memory intensive). It would be sweet if my
code could (simply) detect a 3rd edition series 60 Nokia and
automatically build in controls for screen rotation and soft key
repositioning.
To sum up, I agree with you Scott. Btw—nice to see you
in the forums. -
A script for setting a random wallpaper
I've cooked up this small bash script for changing the wallpaper to a random one from a specified directory (it is recursive)
The script tries to be smart in determining whether the wallpaper should be scaled, centered or tiled.
Just configure it and try it out.
Anyway, here goes:
#!/bin/bash
# Random wallpaper setter, by moljac024
# Configuration
# Wallpaper directory
wpDir="$HOME/Wallpapers"
# Wallpaper list path
wpList=$HOME/.wallpaper-list
# Folders to be skipped, you can put as many as you like
#wpSkip=("Dir1/" "Dir2/")
# Scale images that have a lower resolution than that of the screen (yes or no)
scaleLowerRes="yes"
#scaleLowerRes="no"
# Screen resolution
resWidth=1280
resHeight=800
# Command for tiling the wallpaper
cmdTile="feh --bg-tile"
#cmdTile="nitrogen --set-tiled --save"OA
#cmdTile="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 2 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
#cmdTile="gconftool-2 -t str --set /desktop/gnome/background/picture_options "wallpaper" -t str --set /desktop/gnome/background/picture_filename"
# Command for scaling the wallpaper
cmdScale="feh --bg-scale"
#cmdScale="nitrogen --set-scaled --save"
#cmdScale="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 3 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
#cmdScale="gconftool-2 -t str --set /desktop/gnome/background/picture_options "zoom" -t str --set /desktop/gnome/background/picture_filename"
# Command for centering the wallpaper
cmdCenter="feh --bg-center"
#cmdCenter="nitrogen --set-centered --save"
#cmdCenter="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 1 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
#cmdCenter="gconftool-2 -t str --set /desktop/gnome/background/picture_options "centered" -t str --set /desktop/gnome/background/picture_filename"
# End of configuration
setTiled ()
`$cmdTile "$1"`
if [ "$?" = "0" ]; then
echo "Wallpaper tiled."
else
echo "Wallpaper not set!"
exit 1
fi
setScaled ()
`$cmdScale "$1"`
if [ "$?" = "0" ]; then
echo "Wallpaper scaled."
else
echo "Wallpaper not set!"
exit 1
fi
setCentered ()
`$cmdCenter "$1"`
if [ "$?" = "0" ]; then
echo "Wallpaper centered."
else
echo "Wallpaper not set!"
exit 1
fi
createList ()
# Go to the wallpaper directory
cd "$wpDir"
# Load the list of pictures to a variable
wpDirList=`(find . -regex ".*\([jJ][pP][gG]\|[jJ][pP][eE][gG]\|[gG][iI][fF]\|[pP][nN][gG]\|[bB][mM][pP]\)$" -type f)`
# Save the list to disk
if [[ ( -w "$wpList" ) ]]; then
echo -n "$wpDirList" > "$wpList"
# Filter out unwanted folders
if [[ "$dontSkip" == "false" ]]; then
for dir in "${wpSkip[@]}"
do
grep -Ev "$dir" "$wpList" > ~/.wallpapers-tmpr; mv ~/.wallpapers-tmpr "$wpList"
done
fi
# Output result
echo "Wallpaper list saved."
else
echo "Can't write wallpaper list, aborting!"
exit 1
fi
getImage ()
# Count number of pictures in the wallpaper list by counting number of lines.
# Check if the wallpaper list exists, is not empty and we have read persmission on it
if [[ ( -s "$wpList" && -f "$wpList" ) && -r "$wpList" ]]
then
wpListNumber=$(wc -l < "$wpList")
else
echo "Can't read wallpaper list, aborting!";
exit 1
fi
# Counter for bad entries in wallpaper list
badMax=100
while true; do
# Get a seed for the random number generator from /dev/urandom
SEED=$(head -1 /dev/urandom | od -N 1 | awk '{ print $2 }')
RANDOM=$SEED
# Find a random line number in the wallpaper list
# Random number from 1..n.
#r=$((RANDOM % $wpListNumber + 1))
r=$(echo $RANDOM%"$wpListNumber"+1 | bc)
# Print what the line number is
# Print the r'th line.
imgPath=`sed -n "$r{p;q;}" "$wpList"`
# #./ crops that substring but it doesn't matter if it left there
wpPath="${wpDir}${imgPath#./}"
# Check if the chosen file exists
if [ -f "$wpPath" ]; then
break
else
echo -e ""$wpPath": doesn't exist!\n"
badMax=$(( $badMax - 1 ))
if [ "$badMax" == "0" ]; then
echo "Too many non-valid entries found in wallpaper list, aborting!"
exit 1
else echo "Choosing new image..."
fi
continue
fi
done
# Calculate size and aspect for chosen image and print out information
imgHeight=$(identify -format "%h" "$wpPath")
imgWidth=$(identify -format "%w" "$wpPath")
imgAspect=$(echo "scale=1; "$imgWidth"/"$imgHeight"" | bc)
echo -e "Image: "$wpPath"\n"
echo -e "Resolution: "$imgWidth"x"$imgHeight""
echo -e "Aspect: "$imgAspect":1\n"
setWallpaper ()
# Calculate resolution aspect ratio
resAspect=$(echo "scale=1; "$resWidth"/"$resHeight"" | bc)
# If the image is smaller than the resolution and is not a tile then scale it, otherwise look at aspect
if [[ ("$scaleLowerRes" == "yes") && ( "$imgAspect" != "1.0" && ("$imgWidth" -lt "$resWidth" || "$imgHeight" -lt "$resHeight") ) ]]
then
setScaled "$wpPath"
else
case $imgAspect in
1.0)
setTiled "$wpPath"
1.5 | 1.6 | 1.7 | 1.8)
if [[ "$resAspect" < "1.5" ]]; then
setCentered "$wpPath"
else
setScaled "$wpPath"
fi
if [[ "$resAspect" < "1.5" ]]; then
setScaled "$wpPath"
else
setCentered "$wpPath"
fi
esac
fi
checkConfig ()
# Initial errors
errorsPresent="no"
dontSkip="false"
# Check if all variables are set
if [[ !( ( -n "$wpDir" ) && ( -n "$wpList" ) && ( -n "$resWidth" ) && ( -n "$resHeight" ) && ( -n "$scaleLowerRes" ) && ( -n "$cmdTile" ) && ( -n "$cmdScale" ) && ( -n "$cmdCenter" ) ) ]]
then
echo -e "\nOne or more options not set, aborting!"
exit 1
fi
# Check if there is a trailing backslash in the wallpaper directory
spDir=`echo -n "$wpDir" | tail -c -1`
if [[ !( "$spDir" == "/" ) ]]
then
wpDir=""$wpDir"/"
fi
# Check if there is read permission on wallpaper directory and if it is a directory
if [[ !( ( -r "$wpDir" ) && ( -d "$wpDir" ) ) ]]
then
echo "Can't read wallpaper directory!"
errorsPresent="yes"
fi
# Check if the specified wallpaper list is a regular file and not a directory
touch "$wpList" &> /dev/null
if [[ ( -d "$wpList" ) ]]
then
echo "Specified wallpaper list is a directory, not a file!"
errorsPresent="yes"
fi
# Check if variables are set correctly
if [[ !( "$scaleLowerRes" == "yes" || "$scaleLowerRes" == "no" ) ]]
then
echo "Specified option for scaling the wallpaper is not valid!"
errorsPresent="yes"
fi
if $(echo ""$resWidth"" | grep [^0-9] &>/dev/null)
then
echo "Specified resolution width is not a number!"
errorsPresent="yes"
fi
if $(echo ""$resHeight"" | grep [^0-9] &>/dev/null)
then
echo "Specified resolution height is not a number!"
errorsPresent="yes"
fi
# Check if any of the tests failed
if [[ "$errorsPresent" == "yes" ]]
then
echo -e "\nOne or more errors found, aborting!"
exit 1
fi
ignoreWPSkip()
dontSkip="true"
printUsage ()
echo -e "Invalid command line argument(s)!\nUsage:\n"
echo -e "`basename "$0"` [options]\n"
echo -e "Options:\n"
echo -e "-s | --set \tSet a wallpaper without updating the list"
echo -e "-u | --update \tUpdate the list without setting a wallpaper"
echo -e "-ua | --update-all\tUpdate the list without setting a wallpaper, but don't skip any folders"
echo -e "-su | --set-update\tUpdate the list and set a wallpaper"
exit 1
if [ "$#" == "1" ]; then
case "$1" in
"-s" | "--set")
checkConfig
getImage
setWallpaper
exit 0
"-u" | "--update")
checkConfig
createList
exit 0
"-ua" | "--update-all")
checkConfig
ignoreWPSkip
createList
exit 0
"-su" | "--set-update")
checkConfig
createList
getImage
setWallpaper
exit 0
printUsage
exit 1
esac
else
printUsage
exit 1
fi
Last edited by moljac024 (2009-09-14 21:02:13)I did something similar a couple of months ago, but instead of attempting to be clever and guessing what the background image is supposed to be, I just write it in the filename. Since some pictures just end up being too bright (or whatever) when used as a background to a urxvt terminal, I added some extra parameters for setting gamma, brightness, tint and the direction the image should be rendered. It relies on hsetroot for actually rendering the picture.
#!/usr/bin/python
# set-background
import sys, os, string, re
patterns = [ (re.compile("t-([a-f\d]+)"), lambda x: "-tint \#" + x)
, (re.compile("b-([\d]+)"), lambda x: "-brightness -0." + x)
, (re.compile("g-([\d]+)"), lambda x: "-gamma "+ x)
, (re.compile("f-(v|h|d)"), lambda x: "-flip" + x)
def buildCommand(file):
output = ["hsetroot"]
output.append("-" + (string.split(file,".")[-2]))
output.append(file)
for token in string.split(file,".")[1:-2]:
for (pat,f) in patterns:
if pat.match(token):
output.append( f(pat.findall(token)[0]))
return string.join(output)
print buildCommand(img)
os.system(buildCommand(img))
# vim:set et:
So for instance, an image with the name background.t-704214.f-v.full.jpg would be rendered as a stretched image, flipped vertically with a sepia tint. The files are required to be in the following format NAME.(MODIFIER.)*TYPE.SUFFIX, where the the order and number of modifiers are unimportant. The gamma values are somewhat unintuitive, but I guess you'll just have to play around with it to get it right.
And to randomize the whole thing, I just used the following script in my .xinitrc to randomly pick a image from a folder.
#!/bin/bash
bg_folder="$HOME/.backgrounds";
pics=($(ls $bg_folder))
let "n = $RANDOM % ${#pics[@]}"
(cd $bg_folder; set-background ${pics[$n]}) -
WA.R.T. - WAllpaper RoTator (another one)
hi guys!
well, i know there already are a bunch of these around.. but i couldn't really find what i wanted, and i have like zero experience scripting bash. actually, this is pretty much my first script. it uses fbsetbg (can be changed pretty easily, though) to change my wallpaper every X minutes, or it can put a random wall every time it is executed. tell me what you think, and PLEASE let me know how i can improve it
#!/bin/sh
## Wallpaper rotator by Christian Brassat ##
## /\ \ /'__`\ /\ \__/\ \__ /\ \\ \ ##
## \ \ \/'\ /\_\L\ \\ \ ,_\ \ ,_\ ___\ \ \\ \ _ __ ##
## \ \ , < \/_/_\_<_\ \ \/\ \ \/ /'___\ \ \\ \_ /\`'__\ ##
## \ \ \\`\ /\ \L\ \\ \ \_\ \ \_/\ \__/\ \__ ,__\ \ \/ ##
## GNU GPLv3 2009 ##
# Settings
displaytime="10" # Minutes every wallpaper should be displayed
directory="/##DIRECTORY##" # Directory containing the walls to be switched
loop="true" # Loop or no loop - values: true or false
# Script (do not change unless you know what you're doing)
let "displaytime *= 60" # Converts minutes to seconds for 'sleep' function
# Loops wallpapers when 'loop = true'
while [ $loop = "true" ]
do
for i in $(ls $directory)
do
fbsetbg $directory/$i
sleep $displaytime
done
done
# Switches to random wallpaper when 'loop = false'
if [ $loop = "false" ]
then
# Creates an array from all wallpapers
files=($directory/*.*) # create an array of the files.
N=${#files[@]} # Number of members in the array
((N=RANDOM%N))
randomfile=${files[$N]}
# Sets wallpaper from random file
fbsetbg $randomfile
fiPerhaps you could combine it with that one, which is made for XFCE4 and works fine:
#!/bin/bash
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
ROTATEDELAY=120
WORKDIR=/tmp/.rotate_wallpaper
FILELIST=$WORKDIR/.imagefiles
# Location of the directories of your image files.
IMAGEFILES="$HOME/wallpapers"
if [ ! -d $WORKDIR ]
then
mkdir $WORKDIR
fi
if [ -e FILELIST ]
then
rm -f FILELIST
fi
# Build file list
for I in $IMAGEFILES
do
find $I -type f \( -name '*.jpg' -o -name '*.png' -o -name '*.gif' \)>> $FILELIST
done
# Load list of images into array and remove unneeded file.
oIFS=$IFS IFS=$'\n' LINES=($(<"$FILELIST")) IFS=$oIFS
rm $FILELIST
# Pick random image, set the background, and loop forever.
cd $WORKDIR
while :
do
n=${#LINES[@]}
r=$((RANDOM % n))
IMAGE="`echo ${LINES[r]}`"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ""
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "${IMAGE}"
killall -USR1 xfdesktop
sleep $ROTATEDELAY
done
That one is using the regular means for setting the XFCE4 background (xfdesktop and xfconf).
KDE3/4 users do not need scripts for that, and while I'm not sure (not using Gnome) there are a couple of GNOME apps that can rotate the wallpaper.
Last edited by scarecrow (2009-07-05 18:17:59) -
.swf wallpaper on Vista
I downloaded Hoops and Yo-Yo desktop wallpaper which is a
flash file (swf), but it won't work. I KNOW it works on Vista
because they work on all the computers at my work. *sniffles* I
want Hoops and Yo-Yo on my computer too! How can I get Vista to
accept a swf wallpaper? And yes, I downloaded the latest Flash
player and restarted the computer, didn't work, uninstalled,
reinstalled, restarted again, didn't work.
Any ideas?I am not sure if they are downloadable, maybe you have to check it with google or whatever. Just type the name of the wallpaper or the objects/environment/bla into google and add the words "Vista Wallpaper" to your query.
Maybe google will find something. Otherwise you should look at www.microsoft.com or some wallpaper sites on the web.
Greets -
Where does blackberry torch stores the current wallpaper image?
Where does blackberry torch stores the current wallpaper image?
In Media > Pictures > Specific Folder Name as per Theme name.
tanzim
If your query is resolved then please click on “Accept as Solution”
Click on the LIKE on the bottom right if the post deserves credit -
LXDE, desktop icons, & wallpaper
I posted this on the LXDE forum, but have not received an answer.
I like to keep a clean desktop with no icons, but I also like to frequently change my wallpaper. It would seem that you can't have it both ways in LXDE. If I uncheck 'Manage the desktop and show file icons' in PCManFM preferences, the icon goes away, but then if I log out and log back in, my wallpaper is gone.
Anybody find a solution for this? I know this is an LXDE issue, and not an Arch issue, but I'm still wondering if anyone has found a solution.I'm also a great fan of XFCE4- clean, fast, fullfeatured. There are just two thing that annoy me:
1. panel icons transparency and having it covered by windows without "autohide", ala-KDE4, and
2. wallpaper rotation.
For the first one I found nothing satisfactory, and I'lll wait. for the latter, after trying many too many scripts, I ended up using this one, which is working perfectly:
#!/bin/bash
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
ROTATEDELAY=120
WORKDIR=/tmp/.rotate_wallpaper
FILELIST=$WORKDIR/.imagefiles
# Location of the directories of your image files.
IMAGEFILES="$HOME/wallpapers"
if [ ! -d $WORKDIR ]
then
mkdir $WORKDIR
fi
if [ -e FILELIST ]
then
rm -f FILELIST
fi
# Build file list
for I in $IMAGEFILES
do
find $I -type f \( -name '*.jpg' -o -name '*.png' -o -name '*.gif' \)>> $FILELIST
done
# Load list of images into array and remove unneeded file.
oIFS=$IFS IFS=$'\n' LINES=($(<"$FILELIST")) IFS=$oIFS
rm $FILELIST
# Pick random image, set the background, and loop forever.
cd $WORKDIR
while :
do
n=${#LINES[@]}
r=$((RANDOM % n))
IMAGE="`echo ${LINES[r]}`"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ""
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "${IMAGE}"
killall -USR1 xfdesktop
sleep $ROTATEDELAY
done
Simply change ROTATEDELAY and IMAGEFILES to your likings, and then chmod +x it and put it at a system PATH.
Last edited by scarecrow (2009-06-20 12:13:37) -
Error while running a query-Input for variable 'Posting Period is invalid
Hi All,
NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
Diagnosis
Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
System Response
Procedure
Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
Procedure for System AdministrationOK.
Well, if the variable is not used in any interval selection, then I would say "something happened to it".
I would make a copy of the query and run it to check if I get the same problem with period 12.
-> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
If so, then try removing the variable completely from the query and hardcode restriction to 12.
-> If problem still persists, I would have to do some thinking.
If problem is gone, then add the variable again. Check.
-> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
Good luck!
Jacob
P.S: what fisc year variant are you using?
Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM -
Logical database in adhoc query
Hello All,
Can anyone tell me what is the logical database in adhoc query?Hi
When you create a query , you have to select an infoset. Infoset can be considered as a source from which data is populated in the Query Fields.
Infosets are created from Transaction SQ02.
There can be four methods through which an Infoset can become a source of data:
1. Table join ( By joining two or more tables from Data dictionary)
example: Joining tables PA0001 and PA0006 on Pernr to get a one resultant dataset
2. Direct read of Basis Table ( Like PA0001 as a source for data in Infoset )
3. Logical Database ( A Pre-written Program by SAP that extract data from clusters, tables taking care of authorizations and validity periods)
Example : Logical database PNP, PNPCE (Concurrent Employement),PCH ( LDB for Personnel Development Data)
Custom Logical DBs can be created in T_Code SE-36.
4. Data Retrieval by a Program ( Custom code written by ABAP developers which will collect and process data) . This program has a corresponding Structure in data dictionary and the fields of this structure will be used in query)
Reward Points, if helpful.
Regards
Waseem Imran -
Query help on Goods Receipt Query with AP Invoice
Looking for a little help on a query. I would like to list all the goods receipts for a given date range and then display the AP Invoice information (if its been copied to an AP Invoice). I think my problem is in my where clause, I plagerized an SAP query to show GR and AP from a PO as a start. SBO 2005 SP01. Any help would be great appreciated. Thanks
SELECT distinct 'GR',
D0.DocStatus,
D0.DocNum ,
D0.DocDate,
D0.DocDueDate,
D0.DocTotal,
'AP',
I0.DocStatus,
I0.DocNum ,
I0.DocDate,
I0.DocDueDate,
I0.DocTotal,
I0.PaidToDate
FROM
((OPDN D0 inner Join PDN1 D1 on D0.DocEntry = D1.DocEntry)
full outer join
(OPCH I0 inner join PCH1 I1 on I0.DocEntry = I1.DocEntry)
on (I1.BaseType=20 AND D1.DocEntry = I1.BaseEntry AND D1.LineNum=I1.BaseLine))
WHERE
(D1.BaseType=22 AND D1.DocDate>='[%0]' AND D1.DocDate<='[%1]')
OR (I1.BaseType=20 AND I1.BaseEntry IN
(SELECT Distinct DocEntry
FROM PDN1 WHERE BaseType=22 AND DocDate>='[%0]' AND DocDate<='[%1]'))Hi Dalen ,
I believe it is because of the condition
(D1.BaseType=22 AND D1.DocDate>='%0' AND D1.DocDate<='%1')
OR (I1.BaseType=20 AND I1.BaseEntry IN
(SELECT Distinct DocEntry FROM PDN1 WHERE PDN1.BaseType=22 AND DocDate>='%0' AND DocDate<='%1'))
Try changing
D1.BaseType=22 OR D1.DocDate>='%0' AND D1.DocDate<='%1
PDN1.BaseType=22 OR DocDate>='%0' AND DocDate<='%1'))
Lets see what would be the result . Lets have some fun with troubleshooting
See what would be the difference in the result .
Thank you
Bishal -
Can you check for data in one table or another but not both in one query?
I have a situation where I need to link two tables together but the data may be in another (archive) table or different records are in both but I want the latest record from either table:
ACCOUNT
AccountID Name
123 John Doe
124 Jane Donaldson
125 Harold Douglas
MARKETER_ACCOUNT
Key AccountID Marketer StartDate EndDate
1001 123 10526 8/3/2008 9/27/2009
1017 123 10987 9/28/2009 12/31/4712 (high date ~ which means currently with this marketer)
1023 124 10541 12/03/2010 12/31/4712
ARCHIVE
Key AccountID Marketer StartDate EndDate
1015 124 10526 8/3/2008 12/02/2010
1033 125 10987 01/01/2011 01/31/2012
So my query needs to return the following:
123 John Doe 10526 8/3/2008 9/27/2009
124 Jane Donaldson 10541 12/03/2010 12/31/4712 (this is the later of the two records for this account between archive and marketer_account tables)
125 Harold Douglas 10987 01/01/2011 01/31/2012 (he is only in archive, so get this record)
I'm unsure how to proceed in one query. Note that I am reading in possibly multiple accounts at a time and returning a collection back to .net
open CURSOR_ACCT
select AccountID
from
ACCOUNT A,
MARKETER_ACCOUNT M,
ARCHIVE R
where A.AccountID = nvl((select max(M.EndDate) from Marketer_account M2
where M2.AccountID = A.AccountID),
(select max(R.EndDate) from Archive R2
where R2.AccountID = A.AccountID)
and upper(A.Name) like parameter || '%'
<can you do a NVL like this? probably not... I want to be able to get the MAX record for that account off the MarketerACcount table OR the max record for that account off the Archive table, but not both>
(parameter could be "DO", so I return all names starting with DO...)if I understand your description I would assume that for John Dow we would expect the second row from marketer_account ("high date ~ which means currently with this marketer"). Here is a solution with analytic functions:
drop table account;
drop table marketer_account;
drop table marketer_account_archive;
create table account (
id number
, name varchar2(20)
insert into account values (123, 'John Doe');
insert into account values (124, 'Jane Donaldson');
insert into account values (125, 'Harold Douglas');
create table marketer_account (
key number
, AccountId number
, MktKey number
, FromDt date
, ToDate date
insert into marketer_account values (1001, 123, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('27.09.2009', 'dd.mm.yyyy'));
insert into marketer_account values (1017, 123, 10987, to_date('28.09.2009', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
insert into marketer_account values (1023, 124, 10541, to_date('03.12.2010', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
create table marketer_account_archive (
key number
, AccountId number
, MktKey number
, FromDt date
, ToDate date
insert into marketer_account_archive values (1015, 124, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('02.12.2010', 'dd.mm.yyyy'));
insert into marketer_account_archive values (1033, 125, 10987, to_date('01.01.2011', 'dd.mm.yyyy'), to_date('31.01.2012', 'dd.mm.yyyy'));
select key, AccountId, MktKey, FromDt, ToDate
, max(FromDt) over(partition by AccountId) max_FromDt
from marketer_account
union all
select key, AccountId, MktKey, FromDt, ToDate
, max(FromDt) over(partition by AccountId) max_FromDt
from marketer_account_archive;
with
basedata as (
select key, AccountId, MktKey, FromDt, ToDate
from marketer_account
union all
select key, AccountId, MktKey, FromDt, ToDate
from marketer_account_archive
basedata_with_max_intervals as (
select key, AccountId, MktKey, FromDt, ToDate
, row_number() over(partition by AccountId order by FromDt desc) FromDt_Rank
from basedata
filtered_basedata as (
select key, AccountId, MktKey, FromDt, ToDate from basedata_with_max_intervals where FromDt_Rank = 1
select a.id
, a.name
, b.MktKey
, b.FromDt
, b.ToDate
from account a
join filtered_basedata b
on (a.id = b.AccountId)
ID NAME MKTKEY FROMDT TODATE
123 John Doe 10987 28.09.2009 31.12.4712
124 Jane Donaldson 10541 03.12.2010 31.12.4712
125 Harold Douglas 10987 01.01.2011 31.01.2012
If your tables are big it could be necessary to do the filtering (according to your condition) in an early step (the first CTE).
Regards
Martin -
Query help : Query to get values SYSDATE-1 18:00 hrs to SYSDATE 08:00 hrs
Hi Team
I want the SQl query to get the data for the following comparison : -
Order Created is a Date Column , and i want to find out all the values from (SYSDATE-1) 18:00 hours to SYSDATE 08:00 hours
i.e.
(SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 08:00:00.
RegardsHi, Rohit,
942281 wrote:
If i want the data in the below way i.e.
from (SYSDATE-1) 18:00 hours to SYSDATE 17:59 hours ---> (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 07:59:00.If you want to include rows from exactly 18:00:00 yesterday (but no earlier), and exclude rows from exatly 08:00:00 today (or later), then use:
WHERE ord_dtl.submit_dt >= TRUNC (SYSDATE) - (6 / 24)
AND ord_dtl.submit_dt < TRUNC (SYSDATE) + (8 / 24)
So can i use the below format : -
ord_dtl.submit_dt BETWEEN trunc(sysdate)-(6/24) and trunc(sysdate)+(7.59/24) . Please suggest . .59 hours is .59 * 60 * 60 = 2124 seconds (or .59 * 60 = 35.4 minutes), so the last time included in the range above is 07:35:24, not 07:59:59.
If you really, really want to use BETWEEN (which includes both end points), then you could do it with date arithmentic:
WHERE ord_dtl.submit_dt BETWEEN TRUNC (SYSDATE) - (6 / 24)
AND TRUNC (SYSDATE) + (8 / 24)
- (1 / (24 * 60 * 60))but it would be simpler and less error prone to use INTERVALs, as Karthick suggested earlier:
WHERE ord_dtl.submit_dt BETWEEN TRUNC (SYSDATE) - INTERVAL '6' HOUR
AND TRUNC (SYSDATE) + INTERVAL '8' HOUR
- INTERVAL '1' SECONDEdited by: Frank Kulash on Apr 17, 2013 9:36 AM
Edited by: Frank Kulash on Apr 17, 2013 11:56 AM
Changed "- (8 /24)" to "+ (8 /24)" in first code fragment (after Blushadown, below) -
Query help, subtract two query parts
Hi,
I am beginner of PL/SQL and have a problem I couldn’t solve:
Table (op_list):
Item - Amount - Status
Item1 - 10 - in
Item2 - 12 - in
Item3 - 7 - in
Item1 - 2 - out
Item2 - 3 - out
Item1 - 1 - dmg
Item3 - 3 - out
Item1 - 2 - out
Item2 - 5 - out
Item2 - 2 - in
Item3 - 1 - exp
Would like to get result of query (subtract amount of 'out/dmg/exp' from 'in' ):
Item - Amount left
Item1 - 5
Item2 - 6
Item3 - 3
I wrote code that returns sum of all incoming items and sum all out/dmg/exp items, but couldn’t solve how to subtract one part of querry from another. Or maybe there is a better way. Also worried what happens if there is no 'out/dmg/exp' only 'in'
select item.name, sum(op_list.item_amount)
from op_list
inner join item
on op_list.item = item.item_id
where op_list.status = 'in'
group by item.name
union
select item.name, sum(op_list.item_amount)
from op_list
inner join item
on op_list.item = item.item_id
where op_list.status = 'out'
or op_list.status = 'dmg'
or op_list.status = 'exp'
group by item.name
Return:
Item1 - 10 [10 in]
Item1 - 5 [2+1+2]
Item2 - 14 [12+2]
Item3 - 7
Item3 - 4 [3+1]
Thanks in advanceHi,
We can also use simple inline views to get what we need.
select a.item,a.amount-b.amount Balance from
(select item,sum(amount) Amount from op_list
where status = 'in'
group by item) a,
(select item,sum(amount) Amount from op_list
where status in ('out','dmg','exp')
group by item) b
where
a.item=b.item
order by item;
ITEM BALANCE
Item1 5
Item2 6
Item3 3Regards,
Prazy -
Query help: query to return column that represents multiple rows
I have a table with a name and location column. The same name can occur multiple times with any arbitrary location, i.e. duplicates are allowed.
I need a query to find all names that occur in both of two separate locations.
For example,
bob usa
bob mexico
dot mexico
dot europe
hal usa
hal europe
sal usa
sal mexico
The query in question, if given the locations usa and mexico, would return bob and sal.
Thanks for any help or advice,
-=beekyHow about this?
SELECT NAME
FROM <LOCATIONS_TABLE>
WHERE LOCATION IN ('usa','mexico')
GROUP BY NAME
HAVING COUNT(DISTINCT LOCATION) >= 2Results:
SQL> WITH person_locations AS
2 (
3 SELECT 'bob' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
4 SELECT 'bob' AS NAME, 'Mexico' AS LOCATION FROM DUAL UNION ALL
5 SELECT 'dot' AS NAME, 'Mexico' AS LOCATION FROM DUAL UNION ALL
6 SELECT 'dot' AS NAME, 'Europe' AS LOCATION FROM DUAL UNION ALL
7 SELECT 'hal' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
8 SELECT 'hal' AS NAME, 'Europe' AS LOCATION FROM DUAL UNION ALL
9 SELECT 'sal' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
10 SELECT 'sal' AS NAME, 'Mexico' AS LOCATION FROM DUAL
11 )
12 SELECT NAME
13 FROM person_locations
14 WHERE LOCATION IN ('USA','Mexico')
15 GROUP BY NAME
16 HAVING COUNT(DISTINCT LOCATION) >= 2
17 /
NAM
bob
salHTH!
Edited by: Centinul on Oct 15, 2009 2:25 PM
Added sample results.
Maybe you are looking for
-
Read only access on abc scheema to all other users
i want to give read only access on abc scheema to all other users. which command will be used.
-
XML data from Form?!?!
I've used LD8.0 to create a feedback form for my customers (it's at http://www.raven-multimedia.com/Feedback.pdf for reference). The first time I created it it was fairly large (1.4MB) and when a user clicked the submit-by-email button the data file
-
Iphoto not updated after install of iLife 09
I finally broke down and purchased iLife 09 primarily to update iphoto. after install it did not update. any help for me out there? Jo
-
Photo sync bug with Aperture albums?
Hi, I think I have found a bug with how iTunes syncs photos across to my new (and until my number ports across, useless) iPhone. If you set it up that only selected Aperture albums are synced, like this; [ ] album1 [tick] album2 [ ] album3 [tick] alb
-
Some photos will not open in Iphoto
Since updating to Mountain Lion, I find a few thumbnails will not open for edit or export in Iphoto. I just get an icon and a message that the original is missing or corrupt. What can I do?