Query Requirement for Stock on hand.
Hi All,
Actually I am have written a query for showing a running total for an Item with all Sales Order and Purchase Order order by ship date (due date).
SELECT T0.[ItemCode], T0.[ShipDate],t2.[CardCode],t4.[OnHand],-T0.[OpenQty]*t4.[NumInSale] as StockMovt FROM RDR1 T0 INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry INNER JOIN OITM T4 ON T0.[ItemCode]=t4.[ItemCode] WHERE T0.[ItemCode] =[%0] and T2.[DocStatus] ='o'
UNION
SELECT T1.[ItemCode], T1.[ShipDate],t3.[CardCode], t5.[OnHand], T1.[OpenQty] as StockMovt FROM POR1 T1 INNER JOIN OPOR T3 ON T1.DocEntry = T3.DocEntry INNER JOIN oitm t5 ON T1.[ItemCode]=t5.[ItemCode] WHERE T1.[ItemCode]=[%0] and T3.[DocStatus] = 'o' ORDER BY [ShipDate]
What i require is the additional field which shows the cumulative or running total for each record. Can anyone please help in how it can be achived.
Thanks & Regards
Shiva
Hi Prasanna,
I made some modification to ur query and its perfectly working. I still have the other query...can you please help me.
The out put that you have asked for is as follows
# ItemCode ShipDate CardCode OnHand StockMovt
1 BAS3B 04.06.09 AUCHRA 14,320.00 -108
2 BAS3B 04.06.09 BLUMER 14,320.00 0
3 BAS3B 04.06.09 GREENTsup 14,320.00 0
4 BAS3B 05.06.09 bizzy 14,320.00 -12
5 BAS3B 05.06.09 BROWNT 14,320.00 -120
6 BAS3B 18.06.09 GOODVI 14,320.00 0
7 BAS3B 26.06.09 COLMAN 14,320.00 -15,000.00
8 BAS3B 30.06.09 GREENTsup 14,320.00 3,000.00
9 BAS3B 21.07.09 GREENTsup 14,320.00 5,000.00
10 BAS3B 03.08.09 BEALES 14,320.00 -12
11 BAS3B 05.08.09 ACORN 14,320.00 -6
12 BAS3B 16.08.09 JLEWBS 14,320.00 -120
13 BAS3B 22.08.09 GREENTsup 14,320.00 1,000.00
14 BAS3B 22.08.09 GREENTsup 14,320.00 2,000.00
15 BAS3B 25.08.09 BEALES 14,320.00 -6
16 BAS3B 25.08.09 GREENTsup 14,320.00 2,000.00
17 BAS3B 27.08.09 BEALES 14,320.00 -6
18 BAS3B 27.08.09 ELIZAS 14,320.00 -24
19 BAS3B 01.10.09 GATES 14,320.00 -120
20 BAS3B 15.01.10 GREENTsup 14,320.00 2,000.00
Further to this I need a running total for the stock movement. Basically it nothing but the difference between the last two columns.
Regards
Shiva
Similar Messages
-
Dear Expert
I want the Query for to convert Value in to words,the value is the document total value.HI,
Try This It may help you
->> Create 1 UDF in Header on Requrie Documents (ex. Marketing Documents).
->> Create 3 Function in MSSQL Server Management.
->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
for example:
Create UDF in Header on Marketing Documents.
->> Choose Tools on Top menu.
->> User - Defined Fields. -> User Manage Fields.
->> Open the User Manage Fields Widnow.
->> Marketing Documents. -> Title.
->> Select Title and Click Add button in Bottom on User Manage Fields Window.
->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
Create Function in MSSQL Server Management.
Check this Link, (have 3 Functions in Link).
http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
1st Funciton - to Convert one Digit Number to words
2nd Funciton - to convert 2 digit number to words.
3rd Funciton - to convert amt in numbers to words.
->> Open the MSSQL Server Management Window.
->> Choose your Company database and Create NEW Query.
->> Create 3 Function Queries one by one.
->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
2nd New Query tab put the 2nd Function then Run the Function.
3rd New Query tab put the 3rd Function then Run the Function.
Create FMS in Query Generator and Save as Query Manager.
->> Adminstration.
->> Reports. -> Query Generator.
->> Open the Query Generator and put the below FMS query.
for example : Purchase Order Doc. Toal(in wrods).
declare @Doc_total numeric (19,6)
set @Doc_total=$http://OPOR.DocTotal
select dbo.fNumToWords (@Doc_total)
->> Assign the FMS in UDF on Purchase Order.
->> Auto Refresh of Document Total.
Ex.
1. Goto the UDF and Clcik Shift+Alt+F2.
2. Select the SEARCH BY SAVED QUERY.
3. Assign the FMS Query.
4. Select the AUTO REFRESH WHEN FIELD CHENGES.
5. Select Document Total.
6. Check the Display Saved Values
I am including here, source code of functions required for converting Number into words according to Indian or Nepali Numbering style. In Indian or Nepali Numbering style, 100000 is 1 Lakh and 100 Lakhs or 10000000 is 1 Crore. This makes the numbering style different from English and International Numbering Style.
1. Function to Convert one Digit Number to words.
CREATE Function dbo.fConvertDigit(@decNumber decimal)
returns varchar(6)
as
Begin
declare
@strWords varchar(6)
Select @strWords = Case @decNumber
When '1' then 'One'
When '2' then 'Two'
When '3' then 'Three'
When '4' then 'Four'
When '5' then 'Five'
When '6' then 'Six'
When '7' then 'Seven'
When '8' then 'Eight'
When '9' then 'Nine'
Else ''
end
return @strWords
end
2. Function to convert 2 digit number to words.
CREATE Function dbo.fConvertTens(@decNumber varchar(2))
returns varchar(30)
as
Begin
declare @strWords varchar(30)
--Is value between 10 and 19?
If Left(@decNumber, 1) = 1
begin
Select @strWords = Case @decNumber
When '10' then 'Ten'
When '11' then 'Eleven'
When '12' then 'Twelve'
When '13' then 'Thirteen'
When '14' then 'Fourteen'
When '15' then 'Fifteen'
When '16' then 'Sixteen'
When '17' then 'Seventeen'
When '18' then 'Eighteen'
When '19' then 'Nineteen'
end
end
else -- otherwise it's between 20 and 99.
begin
Select @strWords = Case Left(@decNumber, 1)
When '0' then ''
When '2' then 'Twenty '
When '3' then 'Thirty '
When '4' then 'Forty '
When '5' then 'Fifty '
When '6' then 'Sixty '
When '7' then 'Seventy '
When '8' then 'Eighty '
When '9' then 'Ninety '
end
Select @strWords = @strWords + dbo.fConvertDigit(Right(@decNumber, 1))
end
--Convert ones place digit.
return @strWords
end
3. Function to convert amt in numbers to words. (Built with the help of above 2 functions)
CREATE function dbo.fNumToWords (@decNumber decimal(12, 2))
returns varchar(300)
As
Begin
Declare
@strNumber varchar(100),
@strRupees varchar(200),
@strPaise varchar(100),
@strWords varchar(300),
@intIndex integer,
@intAndFlag integer
Select @strNumber = Cast(@decNumber as varchar(100))
Select @intIndex = CharIndex('.', @strNumber)
if(@decNumber>99999999.99)
BEGIN
RETURN ''
END
If @intIndex > 0
begin
Select @strPaise = dbo.fConvertTens(Right(@strNumber, Len(@strNumber) - @intIndex))
Select @strNumber = SubString(@strNumber, 1, Len(@strNumber) - 3)
If Len(@strPaise) > 0 Select @strPaise = @strPaise + ' paise'
end
Select @strRupees = ''
Select @intIndex=len(@strNumber)
Select @intAndFlag=2
while(@intIndex>0)
begin
if(@intIndex=8)
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(left(@decNumber,1))+' Crore '
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=7)
begin
if(substring(@strNumber,1,1)='0')
begin
if substring(@strNumber,2,1)<>'0'
begin
if (@strRupees<>NULL and substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise=NULL)
begin
Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
else
begin
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and ' + dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else if(@intIndex=6)
begin
if(substring(@strNumber,2,1)<>'0' or substring(@strNumber,3,1)<>'0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and @intAndFlag=2 and @strPaise='')
begin
if len(@strRupees) <= 0
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
Select @intAndFlag=2
end
else
begin
Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
Select @intAndFlag=2
end
end
else
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
Select @intAndFlag=1
end
end
end
else
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
end
end
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=5)
begin
if(substring(@strNumber,1,1)='0')
begin
if substring(@strNumber,2,1)<>'0'
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
else
begin
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and '+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else if(@intIndex=4)
begin
if ( (substring(@strNumber,3,1)<>'0' or substring(@strNumber,4,1)<>'0') and substring(@strNumber,2,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
end
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=3)
begin
if substring(@strNumber,1,1)<>'0'
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Hundred '
Select @strNumber=substring(@strNumber,2,len(@strNumber))
if( (substring(@strNumber,1,1)<>'0' or substring(@strNumber,2,1)<>'0') and @intAndFlag=2 )
begin
Select @strRupees=@strRupees+' and '
Select @intAndFlag=1
end
Select @intIndex=@intIndex-1
end
else
begin
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
end
else if(@intIndex=2)
begin
if substring(@strNumber,1,1)<>'0'
begin
Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))
Select @intIndex=@intIndex-2
end
else
begin
Select @intIndex=@intIndex-1
end
end
else if(@intIndex=1)
begin
if(@strNumber<>'0')
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(@strNumber)
end
Select @intIndex=@intIndex-1
end
continue
end
if len(@strRupees)>0 Select @strRupees=@strRupees+ ' rupees '
IF(len(@strPaise)<>0)
BEGIN
if len(@strRupees)>0 Select @strRupees=@strRupees + ' and '
END
Select @strWords = IsNull(@strRupees, '') + IsNull(@strPaise, '')
select @strWords = @strWords + ' only'
Return @strWords
End
Regards
Balaji Sampath -
Serial Numbers for stock on hand.
Hi guys,
I want to migrate stock on hand of finished goods. I also have to migrate serial numbers for these finished goods. But, i cant find a transaction where I can do this!!! Can anyone help pls!?
I tried to do GR in MIGO, but the serial number tab opens up only for GR towards an order.Hello Sandeep,
1. As suggested by Dillibabu, you need to maintain your material with Sr number profile as per the business needs.
Please check the sr number profile usage in T-code OIS1 and OIS2 (Configuration mode - SPRO)
2. There are two option to upload/migrate the data
a. Manual Approch : incase, you have very few data you can think about this approch.
b. LSMW : Use LSMW if you have mass data migration, the object is provided by SAP for goods movement.
Object 0110 Goods movement
Method 0000
Program Name RM07MMBL
Program Type B Batch Input
Take the help from technical guy if you are new to LSMW.
Hope this helps.
Regards,
Arif Mansuri
Reward if answer is helpful. -
I would like to know if it is possible to create a query that would display the stocks of all items on a specific date and will display the item cost or the purchase price of each item in stock. Let say for example, today is January 14, 2010. I would like to check how many stocks in my inventory last January 8, 2010. Does anybody knows how to create this?
Thank you.Hi Don Elicor,
Check the below thread, you will be get some idea or Solution.
Inventory Report by Query
Query for Inventory Activity for whse & dates
Item Stock Report
Item Stock Report
Regards,
Madhan. -
Query required for JE posted with the customer
Dear Experts,
Following is the scenario - Accountant passes Journal Entries once in a while with regard to customers also, i would require a alert for the scenario.
Whenever the user posts a JE with regard to a customer alert has to generate to the manager else a query report is required would do.
SaravananHi,
You can use the below as an alert for Manual Journal Entries that has been created the last 2 days with posting to Business Partner account.
SELECT t0.transid, t0.shortname
FROM JDT1 T0 INNER JOIN OJDT T1 ON T0.TransId = T1.TransId
WHERE shortname <> account and T1.createdate > getdate()-2 and t0.transtype = 30
If you want to have a different date range just change the '-2' to the amount of days you want, if you only want entries created today, just remore it. If you prefer it to be by posting date rather than by creaation (system) date, just change createdate to refdate.
Hope it helps,
Jesper -
Query required for below situation.
Hi All,
I have two table
T1 --> deal_site_id, subsection_id
T2 --> deal_site_id, subsection_id, catalog_id
requirement is first I need to check all the subsection_id in table T1 depending upon one deal_site_id.
Then what ever subsection_id I get from table T1 I need to check if those are available in table T2. If they are available then do nothing but if they are not available in table T2 then delete the row from table T1.
I've tried to write the query like below but stuck with exception.
DELETE FROM (SELECT * FROM T1 lid inner join T2 ld
ON LID.DEAL_SITE_ID = LD.DEAL_SITE_ID
WHERE lid.deal_site_id = 3070
AND LD.SUBSECTION_ID NOT IN (SELECT DISTINCT liod.subsection_id from T1 liod where liod.deal_site_id = 3070 )
this is giving me an exception like ORA-01752: cannot delete from view without exactly one key-preserved table
Please help me to write this query. Thanks in advance.
Regards,
Subhadeep
Edited by: sumajumd on Feb 2, 2012 3:08 AMHi, Subhadeep,
That sounds like:
DELETE FROM t1
WHERE deal_site_id = 3070 -- or whatever
AND subsection_id NOT IN (
SELECT subsection_id
FROM t2
WHERE deal_site_id = t1.deal_site_id
AND subsection_id IS NOT NULL -- If necessary
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as DELETE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using. -
Below is the condition for which a query is to be written.
as of now this the query i have written. am getting the orderids which satisfy this rule but the output should include all those orderids which already satisfy the rule.(i.e the current o/p contains those orderids which share a common circuitid and have same start and end dates. the output required should include this as well as those orderids tat do not share circuitids.
or
the o/p should contain those orderids which do not fall into any of these categories)
The Rule:
For the Entity Circuit Orders if the Circuit Id is same for two different order IDs then the Order Start Date for the Order Id having Order Status as Installed should be same as the Order End Date for the Order Id having Order Status as Retired.
Tthe query:
select order_id from managed_element1 where order_status = 'I' and order_start_date in
(select order_end_date from managed_element1 where circuit_id in
(SELECT circuit_id FROM managed_element1 where order_status='R' GROUP BY circuit_id))The data is as below
Order_id circuit_id start_date end_date order_status
ORDER_67 BORDER_2 03/05/06 05/09/06 R
ORDER_7 BORDER_6 10/26/06 I
ORDER_11 BORDER_7 12/05/06 12/06/07 I
ORDER_1 BORDER_2 05/09/06 05/19/06 R
ORDER_2 BORDER_2 05/19/06 I
ORDER_3 BORDER_3 04/03/06 05/20/06 R
ORDER_4 BORDER_3 05/20/06 I
ORDER_5 BORDER_4 02/05/06 05/06/06 R
ORDER_6 BORDER_4 05/05/06 I
ORDER_7 BORDER_5 10/22/02 02/23/03 R
ORDER_8 BORDER_5 02/23/03 I
ORDER_9 BORDER_6 03/12/06 09/26/06 R
ORDER_10 BORDER_6 09/26/0610/26/06 R -
Query required for xml processing.
This data is present in clob i need to extract the below mentioned field.
expected query is
select
extractvalue( xmltype(table1.column1), '/UserProfileSnapshot/UserInfo/Attribute[@name="Users.Display Name"]' )
from table1
first line is incorrect <?xml version = '1.0' encoding = 'UTF-8'?>
Can anyone please help me in making a query for this incorrect clob data.
As we cannot change this first line in data.
"<?xml version = '1.0' encoding = 'UTF-8'?>
<UserProfileSnapshot key="224" version="1.0">
<UserInfo>
<Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
<Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
<Attribute name="Users.Xellerate Type">End-User</Attribute>
<Attribute name="Users.Role">Employee</Attribute>
<Attribute name="Users.First Name">user</Attribute>
<Attribute name="Users.Status">Active</Attribute>
<Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
<Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
<Attribute name="Title">MR.</Attribute>
<Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
<Attribute name="Country">US</Attribute>
<Attribute name="State">NY</Attribute>
<Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
<Attribute name="Users.Disable User">0</Attribute>
<Attribute name="Users.Change Password At Next Logon">1</Attribute>
<Attribute name="USR_CN_GENERATED">0</Attribute>
<Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
<Attribute name="Postal Code">10001</Attribute>
<Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
<Attribute name="Employee Number">2335</Attribute>
<Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
<Attribute name="Users.Last Name">testfuturedate102</Attribute>
<Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
<Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
<Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
<Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
<Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
<Attribute name="Street">500 Madison Ave</Attribute>
<Attribute name="Users.User ID">31967</Attribute>
<Attribute name="USR_UDF_CITY">New York</Attribute>
<Attribute name="Users.Lock User">0</Attribute>
<Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
<Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
<Attribute name="Users.Login Attempts Counter">0</Attribute>
<Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
</UserInfo>
</UserProfileSnapshot>"As said in {thread:id=2545133}, the quotes are certainly not the issue.
This works fine for me on 11.2.0.2 :
SQL> insert into table1 (column1)
2 values (
3 '<?xml version = ''1.0'' encoding = ''UTF-8''?>
4 <UserProfileSnapshot key="224" version="1.0">
5 <UserInfo>
6 <Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
7 <Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
8 <Attribute name="Users.Xellerate Type">End-User</Attribute>
9 <Attribute name="Users.Role">Employee</Attribute>
10 <Attribute name="Users.First Name">user</Attribute>
11 <Attribute name="Users.Status">Active</Attribute>
12 <Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
13 <Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
14 <Attribute name="Title">MR.</Attribute>
15 <Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
16 <Attribute name="Country">US</Attribute>
17 <Attribute name="State">NY</Attribute>
18 <Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
19 <Attribute name="Users.Disable User">0</Attribute>
20 <Attribute name="Users.Change Password At Next Logon">1</Attribute>
21 <Attribute name="USR_CN_GENERATED">0</Attribute>
22 <Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
23 <Attribute name="Postal Code">10001</Attribute>
24 <Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
25 <Attribute name="Employee Number">2335</Attribute>
26 <Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
27 <Attribute name="Users.Last Name">testfuturedate102</Attribute>
28 <Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
29 <Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
30 <Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
31 <Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
32 <Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
33 <Attribute name="Street">500 Madison Ave</Attribute>
34 <Attribute name="Users.User ID">31967</Attribute>
35 <Attribute name="USR_UDF_CITY">New York</Attribute>
36 <Attribute name="Users.Lock User">0</Attribute>
37 <Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
38 <Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
39 <Attribute name="Users.Login Attempts Counter">0</Attribute>
40 <Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
41 </UserInfo>
42 </UserProfileSnapshot>'
43 );
1 row inserted
SQL>
SQL> select x.*
2 from table1 t
3 , xmltable(
4 '/UserProfileSnapshot/UserInfo'
5 passing xmltype(t.column1)
6 columns userdisplay_name varchar2(30) path 'Attribute[@name="Users.Display Name"]'
7 , user_role varchar2(30) path 'Attribute[@name="Users.Role"]'
8 ) x ;
USERDISPLAY_NAME USER_ROLE
testfuturedate102, Mr. user Employee -
Suggestion required for STOCKE MATERIAL to non stock material in the PO
Hi all
by mistake system clears account assignment for non stock material due to some user exit.
1. PO line item 01 - mm 100011 -stock material - plant 1000
2 . PO line item 02 - mm 100011 -non-stock material -plant 1100 - it has account assignment - in the request - by mistake this account assignment got cleared while creatring Purchase order
now i have realised this issue while doing good receipt.
now second line item 02 - mm 100011 - needs to be correct to receive goods . what action item needs be taken so that i can pay the invoice.
can i make in the line item 02 - Account assig category K and enter GL account AND cost center. - to correct the issue.
i have corrected this issue for future in the user exit.so not clear account assignment.
MuthuBoth the cases you need to pay invoice.Only the difference is first line item the material qty goes into stock.Second line item is not stock item as you are assigning account assignment.
To correct the issue for second line item you can change it to account assignment item if system allowed.Why I am saying you mentioned user exit influencing the PO to change the line item.
So first check user criteria what are the controlling perameters to save the PO.It seems your user exit checking line items if first line item stock item then it is changing all th line items as stock item.Take ABAP person help what are the user exits exist in PO -
Location required for stock within a storage Location
Dear All,
Can we have location concept to identify different stock location within as Storage Location. We are only using MM module and not using WM Module.
Is there a option to maintain location concept to identify stock located at different location in a storage location only in MM Module.
Regards
Vikas SehraHi,
As you know, the same can be very well mapped using WM. If you are not using WM, you may check the following option.
If you are using same location for a material within a storage location, you can maintain the location as "storage bin" in the material master - "plant data / stor. 1" view as shown below:
The same will be shown in MMBE:
Please note that this storage bin is not actual storage bin, its just a text field for tracking the storage area. It doesnt have any other control.
Regards,
AKPT -
Query required for the below result format:
Table(DATA):
Bank_id Device_type Status date Station_status
1011 N Y 3/23/2012 DOWN
1011 N Y 3/23/2012 up
1011 N y 3/23/2012 up
1011 E Y 3/23/2012 down
1011 E I 3/23/2012 down
1011 W Y 3/23/2012 up
1012 N Y 3/23/2012 DOWN
1012 N Y 3/23/2012 up
1012 N y 3/23/2012 up
1012 E Y 3/23/2012 down
1012 E I 3/23/2012 down
1012 W Y 3/23/2012 up
1013 N Y 3/23/2012 DOWN
1013 N Y 3/23/2012 up
1013 N y 3/23/2012 up
1013 E Y 3/23/2012 down
1013 E I 3/23/2012 down
1013 W Y 3/23/2012 up
(SELECT QUERY RESULT SHOULD BE LIKE THIS):Report result:
Bank_id----Date-----TOTAL---UP_STATUS--DOWN_STATUS-----DEVICE
1011 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
1012 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
1013 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
N<2>N<1>,E<0>E<2>,W<1>W<0> this mean(INDICATES)
In N 2 UP 1 DOWN
IN E 0 up 2 down
In W 1 up 0 down
SCRIPTS:
CREATE TABLE FIMS_TEST
BANK_ID VARCHAR2(10 BYTE),
DEVICE_TYPE VARCHAR2(10 BYTE),
STATUS VARCHAR2(1 BYTE),
DATE_TS DATE,
STATION_STATUS VARCHAR2(10 BYTE)
INSERT SCRIPT:
SET DEFINE OFF;
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'N', 'Y', TO_DATE('03/26/2012 16:30:48', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:26', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:55', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'E', 'Y', TO_DATE('03/26/2012 16:33:51', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'I', 'Y', TO_DATE('03/26/2012 16:34:15', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1011', 'W', 'Y', TO_DATE('03/26/2012 16:34:39', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:13', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:56', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'N', 'Y', TO_DATE('03/26/2012 16:36:48', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'E', 'Y', TO_DATE('03/26/2012 16:37:17', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'E', 'I', TO_DATE('03/26/2012 16:37:42', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1012', 'W', 'Y', TO_DATE('03/26/2012 16:38:10', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'N', 'Y', TO_DATE('03/26/2012 16:38:37', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN ');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:23', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:54', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'E', 'Y', TO_DATE('03/26/2012 16:40:19', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'E', 'I', TO_DATE('03/26/2012 16:40:53', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
Insert into TEST.FIMS_TEST
(BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
Values
('1013', 'W', 'Y', TO_DATE('03/26/2012 16:41:17', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
COMMIT;thanks in advance
can any one help me please -
CREATE TABLE COUNTRIES(CID INT,CNAME VARCHAR(100))
INSERT INTO COUNTRIES VALUES(1,'AUSTRALIA')
INSERT INTO COUNTRIES VALUES(2,'INDIA')
INSERT INTO COUNTRIES VALUES(3,'FRANCE')
INSERT INTO COUNTRIES VALUES(4,'BERLIN')
SELECT * FROM COUNTRIES
o/p
CID CNAME
2 INDIA
1 AUSTRALIA
4 BERLIN
3 FRANCE
here India should be always first position remaining countries values should be in sorted orderYou can use a conditional sorting =>
SELECT *
FROM COUNTRIES
ORDER BY CASE WHEN CNAME = 'INDIA'
THEN 0
ELSE 1 END,
CNAME
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Tables used for a Stock-In-Hand Report ?
Hi,
I need to generate a stock in hand report. For this report I only need to consider Purchasing Inventory Stock and not the Sales Order Stock. What tables do I have to use?, if possible the query!
Thanks,
KishanHi Kishan,
Try and use FM 'BAPI_MATERIAL_AVAILABILITY'. I have used this FM in the past for Stock on Hand reports. Only drawback is that it only runs for one material / plant at a time!
You cold also use FM 'AVAILABILITY_CHECK':
Structure to hold ATP Controller: Control Parameters
DATA: BEGIN OF st_atpca.
INCLUDE STRUCTURE atpca.
DATA: END OF st_atpca.
Table to hold ATP: Requirements to be Checked/Considered
DATA: BEGIN OF tbl_atpcs OCCURS 0.
INCLUDE STRUCTURE atpcs.
DATA: END OF tbl_atpcs.
Table to hold ATP Server: ATP data for display
DATA: BEGIN OF tbl_atpds OCCURS 0.
INCLUDE STRUCTURE atpds.
DATA: END OF tbl_atpds.
Table to hold ATP Server: Material Table
DATA: BEGIN OF tbl_atpmat OCCURS 0.
INCLUDE STRUCTURE atpmat.
DATA: END OF tbl_atpmat.
Populate ST_ATPCA
CLEAR st_atpca.
st_atpca-anwdg = '8'. "Calling App - Explaination
st_atpca-azerg = 'T'. "ATP Display Result
st_atpca-rdmod = 'A'. "Read Mode - Totals
st_atpca-xenqmd = 'N'. "Do not read Blocks
Populate TBL_ATPCS
CLEAR tbl_atpcs.
REFRESH tbl_atpcs.
tbl_atpcs-matnr = p_matnr. "Material
tbl_atpcs-werks = p_werks. "Plant
tbl_atpcs-prreg = 'A'. "Checking Rule for Avail Check
tbl_atpcs-chmod = 'EXP'. "ATP: Check mode
tbl_atpcs-delkz = 'VC'. "MRP element indicator
tbl_atpcs-bdter = sy-datum. "Requirements date for the component
tbl_atpcs-xline = '1'.
tbl_atpcs-trtyp = 'A'. "Transaction type - Display
tbl_atpcs-idxatp = '1'.
tbl_atpcs-resmd = 'X'. "Mode for Results of Check - Proposal
tbl_atpcs-chkflg = 'X'.
APPEND tbl_atpcs.
CALL FUNCTION 'AVAILABILITY_CHECK'
TABLES
p_atpcsx = tbl_atpcs
p_atpdsx = tbl_atpds
p_atpmatx = tbl_atpmat
CHANGING
p_atpca = st_atpca
EXCEPTIONS
error = 1
OTHERS = 2.
Would recommend giving both these FM's a go and see if they have what you want.
Cheers,
Pat.
PS. If you find these suggestions helpful, kindly award Reward Points appropriately. -
Stock in hand against po no.
hi all,
i want to develope a report in which stock in hand(from mb52 tcode) will be displayed against p.o no.format like this
plant material batch stock in hand po/sto no.
my client wants the report in which stock that is placed in storage will be displayed by po sto no.
currently we are using two step sto procedure by usung 351 and 101 movement type.
pls help
regards
sumit bislaMake them understand that this not a logical requirement as you can't establish a link of PO/STO for stock in hand.
Let me tell you why it is so..if suppose you have received goods against 2-3 PO/STO & Now you are issuing goods (stock transfers/Billing/Transfer posting/Goods Issue etc), at that time system does not consider the corrosponding STO/PO against which goods are received.
Inventory of material will decrease based on batch/valuation type which you have selected.
Refer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get STO/PO-GRN Qty & Value details.
Last button on Application tool Bar it is in line of filter, total etc icons -
Ageing Report(STOCK IN HAND)
Dear All,
Can I have ageing report for stock in hands (Lot based ) in PP/MM
modules.
Kindly give your advises .
Thanks In Advance
Rakesh SehgalHi Rakesh,
pls check below two tcodes
1. MC46 - Slow Moving Items
2. MC50 - Dead stock items
Regards,
Sankaran
Maybe you are looking for
-
I replaced my hard drive and the new one seems "loose".
I recently put a new HDD in my 15" Macbook Pro as the old one failed. The new one is this one: https://www.pccasegear.com/index.php?main_page=product_info&products_id=26175 ; Western Digital 500GB 2.5" SATA. I made sure it was 9.5mm which is what was
-
I have been using GarageBand 3 on my old computer (PowerBook G4 with OS 10.4). My files contain mostly recorded instruments (no samples) with some MIDI tracks. I just got a new computer (iMac) with MacOS 10.5 and GarageBand 4. I am unable to open my
-
I can't get the ringtone to create!
for days i've been trying to create ringtones on songs where that is possible. I get through the whole process, even log into my account and there are no darned ringtones. it's maddening. i haven't seen any posts of people that finished the process o
-
Hi to all, could anybody tell the t.code about to show the trial balance for particular datewise.its very urgent. let me inform to my mail id [email protected] thanks with regards, mohan
-
BPM DOMAIN에서 최대로 지원 가능한 인스턴스 갯수는 몇개인가요???
현재 건강보험심사평가원에서 BPM 프로젝트를 진행중입니다. BPM과 BAM을 연동하는 부분에서 전체 테이블을 밤에다 데이터를 넣기 위해 1분마다 폴링하는 프로세스가 있습니다. 전체 테이블을 폴링하다 보니 테이블에 있는 로우 갯수만큼 인스턴스가 생성이 되고 있습니다. 그래서 최대로 도메인당 최대로 지원이 가능한 인스턴스 갯수가 몇개인지 알려주시길 바랍니다.