Formatted Search on Inventory Posting
Dear Experts,
I have a FMS on inventory posting distribution rule, its supposed to display the distribution rule automatically for the items, without human intervention. How can I set this to auto-refresh ? since when using this form virtually no column is normally touched apart from the reconcile button.
Edited by: Roc on Apr 8, 2010 4:27 PM
Hi Gordan,
we have upgraded SAP B1 2005 to 2007 - we are using old query for formatted search for items in marketing document - can in that cancelled items also reflecting - can you please correct that query where i dont want to reflect cancelled items.
SELECT T0.[ItemCode] AS 'Item No.', T0.[ItemName] AS 'Item Description', T0.[UserText] AS 'Item Details', T0.[OnHand] AS 'In Stock' ,T0.PrchseItem,T0.SellItem FROM [dbo].[OITM] T0 WHERE (T0.[UserText] Like N'%[%0]%' ) AND (T0.[UserText] Like N'%[%1]%' ) AND (T0.[UserText] Like N'%[%2]%' ) AND (T0.[UserText] Like N'%[%3]%' )
Thanks
Similar Messages
-
Formatted Search - Calculate GP Base Price for Non Inventory Items
Hi Experts,
On one of our customer's 8.8 PL 15 installation, requirement was to calculate GP for Non Inventory Items (on SO screen). Since SAP does not automatically calculates it we proposed and implemented following solution.
1. Have all Non Inventory Items to be costed at Standard cost so that you can manually enter the cost in the Item Master.
2. Write following formatted search on GP Base Price field so as to calculate the GP Base Price for the Non Inventory Items only. The formatted search must not make any changes to Inventory Items as we want system to calculate the GP automatically (just in case cost changes from SO to Delivery or Invoice).
DECLARE @II AS nVarchar(1)
DECLARE @COST AS Numeric(19,2)
SET @II = (SELECT OITM.InvntItem FROM OITM WHERE OITM.ItemCode = $[RDR1.ItemCode])
SET @COST = (SELECT (OITW.AVGPrice * $[RDR1.NumPerMsr]) FROM OITW WHERE OITW.ItemCode = $[RDR1.ItemCode] AND
OITW.WhsCode = $[RDR1.WhsCode])
IF (@II = 'N')
BEGIN
SELECT @COST
END
3. Formatted search achieves what was originally required however if a user overwrites the Item Code (Inventory Item) in the SO then above formatted search clears the GP Base Price field and sets the GP basis for the item as "Manual". By obverwrite means user first selected item A0001 on line 1 and then entered A0002 on same line i.e. Line 1.
My question here is what is wrong in the formatted search that is resulting in this behaviour.
Any questions please let me know.
Thanks in advance.
Regards
DevinderHi Gordon,
Thanks for taking out time to help me however Key requirement here is
Write formatted search on GP Base Price field so as to calculate the GP Base Price for the Non Inventory Items only.
Your query sets the base price for GP Base Price for Inventory Item to ZERO and Base Price By to Manual.
Note that my Formatted search has a problem only when an Inventory Item line is overwritten. I am not sure if this is a problem with SAP itself rather than my query.
Any other ideas please?
Regards
Devinder -
Formatted Search on Item Master
Experts,
I have a client who sells commodities. They need their Pricelists to be updated with each Purchase, because of fluctuating Prices.
If I can get the following Formatted Search to work, I believe that Iu2019ll have a solution:
I created a UDF on the Item Master Inventory tab rows, which I called OITW.U_Test
I need to populate this UDF with the following calculation: (OITW.OnHand * OITW.AvgPrice) + (T1.OnOrder * (Sum of all the quantities on open POu2019s)) / (OITW.OnHand + T1.OnOrder)
Here is the logic behind it: This UDF must show a modified Moving Average. Because POu2019s does not update the AvgPrice (only the Goods Receipt PO) this is cause for concern for this client who might have Sales Orders for Items that is not in stock yet, and posted as a lower AvgPrice.
Here is what I have done so far:
Select T0.ItemCode, T1.OnHand, T1.AvgPrice, T1.OnOrder,
T1.OnHand*T1.AvgPrice as 'InStock Value',
T1.OnOrder* ?????? as 'PO Value'
From OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN POR1 T2 ON T0.ItemCode = T2.ItemCode
Any help will be appreciated.
MarliGordon,
I tested this and you are right, to use a FS will not work because of the refresh issue.
I'm now working on a Stored Procedure that will update this UDF when a PO is Added or Updated. My experience with Stored Procedures is limited to True or False statements. (If this is true, do not add the Document, if it is false add the document)
My question is: Can I populate the UDF, with a Value according to my query, with a Stored Procedure?
Thanks for your help.
Marli -
Formatted Search for Delivery Date field in SO not working
Hi All
Can anyone help me as to why my formatted search is not working?
I am currently using SAP B1A SP01 Patch 19.
I have created a user query as follows:
SELECT $ [$10.0.DATE] + 5
When I add this to the delivery field within the Sales Order and bring through the saved query which I set to auto refresh when the Posting Date field changes and to Display Saved Values it doesn't work.
Any ideas?
Thanks and best wishes
GailHI Gail,
If I am not mistaken you want to add days to the posting date...if that is so then try this out:
SELECT $[ORDR.DocDate.DATE]+5 From ORDR T0 For Browse
Set The indicator to Auto Refresh when the fields change
Nagesh -
Is there a way to NOT have the data from a formatted search highlighted
Hi all,
I have a formatted search that returns a big chunk of data, some comments that are then added to. When the fs is fired, it returns the data, but all of the data is highlighted so when the user starts typing they overwrite the data that was just returned. I know they could just hit the right arrow key or click their mouse at the end, but they don't do that half of the time. I also know they could use ctrl-z or undo when they do this, but they don't do that either. It would just be nice if they could fire the fs and when the data is returned, the cursor would be at the end of the data.
Any thoughts?I don't think there are any options for you to change default system behavior like this. What you may do is to change your FMS logic to get only one record if possible. Post your query here if you can.
Thanks,
Gordon -
Problem when create auto numbering in BP master using Formatted Search
Hi all,
I have a problem in creating auto numbering in BP for Customer type using Formatted search
My query is like this
declare @tempNo as char(20)
set @tempNo=(select Isnull(max(REPLACE(OCRD.CardCode , LEFT(OCRD.CardCode,10),'')),0) + 1
from OCRD where (CardType ='C') and LEFT(OCRD.CardCode,3) = 'CU.' )
set @tempNo='CU.'left(convert(varchar,GETDATE(),112),6)'.'+@tempNo
select cast(@tempNo as char(20))
It should be creating the new number for example
CU.201101.1
CU.201102.2
CU.201103.3
CU.201103.4
The format will be like this CU.YYYYMM.autonumbering
So if the current year is still the same it will always increase the number and it will reset the number become 1 if the current year is change.
But when i execute the number , the number doesn't increase, still generate the last number CU.201103.4
I have use this query in generate item number, it runs well but different format.
Is there some thing wrong with my query?
Thanks in advance
Regards
Jia shunHi Jia shun,
You have posted an identical threads. There is no such need. Please close this one and response to the one with answer already.
Thanks,
Gordon -
Formatted search as such G/L Account name to be shown
Dear All,
I have added in Udf in the row level of marketing document like U_Sales A/C Name, U_Cogs A/C Name, U_Inventory Account Name.
Stock is maintained Warehouse Wise. Now I want that in the row level for any item e.g warehouse 001 I want a formatted search which should refresh automatically and show the G/L account name of Sales A/c, Cogs A/c and Inventory A/C respectively in the individual udfs.
I think it could be possible through formatted search but am not able to create the query for it.. Please help.
regards,
kamleshHi Kamlesh,
Check the link
How to insert G/L account name in query
*Close the thread if issue solved.
Regards
Jambulingam.P -
Formatted search with Query auto update
hi all,
I have created 2 UDF's at title level in marketing document, and assigned Formatted search with query to it with auto refresh when posting date field changes. One UDF gets updated automatically and the other one doesnt.
any one can guide me on this.
regards
salman
Edited by: Rui Pereira on Aug 8, 2008 11:47 AMHello Salman,
I took the effort to understand you question but I am not quite sure if I have all the pieces of the puzzle yet. I can see Jeyakanthan has already grilled you with questions and you have answered all of them.
UDF1 - is this se to Auto Refresh - Refresh regularly - on Posting Date?
UDF2 - On which field is this set to Auto refresh?
UDF3 - On which field is this set to Auto refresh?
One thing to note when you have two fields with FMS and the second one dependent on the value of the first, the second one does not auto refresh because it cannot detect the Field change on the First UDF.
This is probably what you are experiencing.
If you don't mind I would like to understand the business reason for the 3 UDF's and what each one is for. There might be other options to look at to achieve the same result.
Let me know
Suda -
Hi All,
We have configured a formatted search with warehouse in a field of Inventory Transfor form. If we run the form thru' Citrix, When we press Shift+F2, the formatted search is not working and the list of warehouses is not displaying. Instead of formatted search, some other functionality is working in citrix.
Please give a solution to overcome this situation.
Regards,
Venkatesan G.
ReplyHi Venkatesan,
Shift-F2 in Citrix will hide the Windows title bar of the ICA client. As you have found, the ICA client will have priority over SBO when the keys are pressed.
Possible solutions are:
1) You can still trigger the formatted search by choosing the option from the main menu. This is not ideal but requires no configuration changes.
2) You should be able to disable the ICA client's keyboard shortcuts (depending on the version of Citrix you are using). Please have a look at the following article:
http://support.citrix.com/article/CTX140219
Kind Regards,
Owen -
Automatic Delivery Date Calc with Formatted Search
Hi,
I'm trying to have the delivery date on purchase orders automatically calculated by using document date plus a value from the business partner master data (avragelate) which we are using as shipping time.
What I have as my query is the following:
Select $[$46.0.1]+t0.[avragelate] from ocrd t0 where $[$4.0.1]=t0.[cardcode]
This is however returning an internal error when it runs.
I have the formatted search set to run this query when the document date changes.
Any ideas?
Thanks,
MichaelWhere are you linking this Formatted Search and how did you try to execute this?
I don't generally post code before testing as I value the solution I provide and its importance to you...
I had tested this and it worked just fine.
You should save this query and link this to the Delivery Date on the PO screen.
I see you are a new member to the SDK forums. If time permits please read through this link to know about the recognition program.. https://www.sdn.sap.com/irj/sdn/crphelp#section19
Please let me know
Suda -
Extra Formatted Search per field?
Hi Experts,
Currently we have a formatted search on Sales Orders which runs if you press SHIFT+F2 when in the item code field (or press the magnifying glass).
It shows us the most recent items that the customer has purchased.
Is it possible to add another formatted search to that field which will run if we use a different shortcut (i.e. SHIFT+F3)?
Thanks
GreigHi Greig,
A nice feature from you post. However, one UDF can only assigned one FMS for current B1 design. You probably need to create another UDF if you have another logic.
Thanks,
Gordon -
Problem in implementing formatted search
Dear All,
I am using the below code to implement formatted search for item master itemcode textbox. But i am unable to get the formatted search icon for the itemcode text box/ screen. Please correct me where I am going wrong.
Dim oRs As SAPbobsCOM.Recordset
oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
oQuery.QueryCategory = -1
oQuery.QueryDescription = "GetDfltBin"
oQuery.Add()
Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
oFormatted.FormID = "150"
oFormatted.ItemID = "5"
oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery
oFormatted.FieldID = "ItemCode"
oFormatted.ColumnID = "-1"
oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin'")
oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''""
oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
Regards,
Noor hussain
Edited by: noor_023 on Mar 30, 2010 12:51 PMDear J,
Thanx for your post. I am gettig this error now. "The entry already exists in the following tales odbc-2035". I am writing the above code in the page load event of item master form as below.
If ((pVal.FormType = 150 And pVal.EventType <> SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) And (pVal.Before_Action = True)) Then
'// get the event sending form
oForm = oSboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
If ((pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD) And (pVal.Before_Action = True)) Then
Dim oRs As SAPbobsCOM.Recordset
oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Dim oQuery As SAPbobsCOM.UserQueries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserQueries)
oQuery.Query = "SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0" 'Query
oQuery.QueryCategory = -1
oQuery.QueryDescription = "GetDfltBin1"
oQuery.Add()
Dim oFormatted As SAPbobsCOM.FormattedSearches = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oFormattedSearches)
oFormatted.FormID = "150"
oFormatted.ItemID = "5"
oFormatted.Action = SAPbobsCOM.BoFormattedSearchActionEnum.bofsaQuery 'bofsaQuery 'bofsaQuery
oFormatted.FieldID = "5" 'ItemCode
oFormatted.ColumnID = "-1"
oRs.DoQuery("select IntrnalKey from OUQR(nolock) Where QName = 'GetDfltBin1'")
oFormatted.QueryID = oRs.Fields.Item("IntrnalKey").Value ''"" ' oRs.GetField
oFormatted.Refresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ForceRefresh = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.ByField = SAPbobsCOM.BoYesNoEnum.tYES
oFormatted.Add()
If oFormatted.Add() Then ' 0 Then
MsgBox(oCompany.GetLastErrorDescription)
End If
End If
End If -
Formatted Search returns no values
Good Afternoon
Experts:
I have a situation where I am using a Formatted Search on the BINS column of the Inventory Tab matrix for the ItemMaster Data screen. It works great...displays the information I am looking for. Here it is:
Select T0.U_BinLoc AS 'Bin Location', T0.U_WhseCode AS 'Warehouse', T0.U_ItemCode AS 'Item Code', T0.U_Quantity AS 'Qty in Bin' FROM [@ITEMBIN] T0 where T0.U_ItemCode = $[OITM.ItemCode]
<b>Issue:</b>
If there are no entries in the @ITEMBIN table for the item in the ItemNumber field, the FormattedSearch box does not pop-up. Good so far. However, the screen changes to Update mode.
<b>Questions:</b>
1)Is there some kind of "no result invisible" character that is getting returned back to the column behind the scenes?
2)How can I alleviate this behavior and just have the screen stay in OK mode if there are no results from the Formatted Search?
Thanks,
EdJohn:
I was not aware I could utilize that type of functionality in the query for a formatted search. Thanks for the suggestion...I will try it.
Ed -
Formatted Search screen - populate multiple fields
I have an Employee Id field in my screen.
On clicking Choose button,I use a Formatted Search screen to populate value to that field.
I also have other fields like employee Name,department which should be populated, once an employee Id is chosen from Formatted Search screen.
The functionality is like that of "Purchase Order screen".
Once a vendor Id is chosen Name,Contact Person etc get populated in "Purchase Order screen".
How do I do that?
Should I trap the Choose button event of Formatted Search screen?
Please help.I think all you are missing is a check to make sure you don't try and re-run the lookup when you are validating the return value from a previous lookup.
I made a minor change to my code and achieved the behaviour you described. I have extracted the relevant code from the application . Unfortunately it looses its indentation when I post it, so it might be quite hard to read. It uses recordsets for the validation as in practice most of the real validation is more complex than this cut-down sample.
This particular example is from a screen with a Customer Code prompt, and displays the customers name below it.
Regards,
John.
<b>Constant holding menu uid of Formatted Search</b>
Public Const AZU_MNU_SEARCH As Long = 7425
<b>Declare a variable at module level</b>
Dim mblnCardLookup as Boolean
<b>Create validation routine (cut down sample included)</b>
Sub ValidateCustomer(sboApp As SAPbouiCOM.Application, sboCompany As SAbobsCOM.Company, BubbleEvent As Boolean)
On Error GoTo ErrorHandler
Const AZU_PROCEDURENAME As String = "ValidateCustomer"
Dim sboRecordset As SAPbobsCOM.Recordset
Dim sboForm As SAPbouiCOM.Form
Dim sboDSCard As SAPbouiCOM.UserDataSource
Dim sboDSName As SAPbouiCOM.UserDataSource
Set sboForm = sboApp.Forms(strUID)
Set sboDSCard = sboForm.DataSources.UserDataSources("UCARD")
Set sboDSName = sboForm.DataSources.UserDataSources("UNAME")
If sboDSCard.value <> "" Then
Set sboRecordset = sboCompany.GetBusinessObject(BoRecordset)
sboRecordset.DoQuery "Select CardCode, CardName, Currency From OCRD where CardCode Like '" & sboDSCard.value & "%'"
If sboRecordset.RecordCount < 1 Then
If sboDSName.value <> "" Then
sboDSName.value = ""
sboForm.Items("edtName").Update
End If
If Not mblnCardLookup Then
LookupCustomer sboApp
End If
BubbleEvent = False
Exit Sub
End If
sboRecordset.MoveFirst
sboDSCard.value = sboRecordset.Fields(0).value
sboDSName.value = sboRecordset.Fields(1).value
mstrCurrency = sboRecordset.Fields(2).value
sboForm.Items("edtName").Update
Else
sboDSName.value = ""
sboForm.Items("edtName").Update
BubbleEvent = False
End If
Set sboDSName = Nothing
Set sboDSCard = Nothing
Set sboForm = Nothing
Set sboRecordset = Nothing
Exit Sub
ErrorHandler:
Call AZU_STD_ERROR_MSGBOX(AZU_MODULENAME, AZU_PROCEDURENAME)
End Sub
<b>Create lookup routine (cut down sample included)</b>
Private Sub LookupCustomer(sboApp As SAPbouiCOM.Application)
On Error GoTo ErrorHandler
Const AZU_PROCEDURENAME As String = "LookupCustomer"
Dim sboForm As SAPbouiCOM.Form
Set sboForm = sboApp.Forms(strUID)
mblnCardLookup = True
sboApp.ActivateMenuItem AZU_MNU_SEARCH
Set sboForm = Nothing
Exit Sub
ErrorHandler:
Call AZU_STD_ERROR_MSGBOX(AZU_MODULENAME, AZU_PROCEDURENAME)
End Sub
<b>Add the following code to the ITEMEVENT handler</b>
'Validate Customer Code
If pVal.EventType = et_VALIDATE And pVal.ItemUID = "edtCard" And pVal.Before_Action = False Then
Call ValidateCustomer(sboApp, sboCompany, BubbleEvent)
End If
'Customer Code Lookup on TAB Key
If pVal.EventType = et_KEY_DOWN And pVal.ItemUID = "edtCard" And pVal.Before_Action = True And pVal.CharPressed = 9 Then
Set sboDSCard = sboApp.Forms(strUID).DataSources.UserDataSources("UCARD")
If sboDSCard.value = "" Then
LookupCustomer sboApp
BubbleEvent = False
End If
End If
'Force Validation on Return from Lookup
If pVal.EventType = et_FORM_ACTIVATE And mblnCardLookup = True Then
sboApp.Forms(strUID).Items("edtRef").Click
mblnCardLookup = False
End If -
Like "inventory posting list" query
Hallo..
In SAP B1, i found 'Inventory Posting List' report.
And i need modify the report, so i must create a new query.
But now, how to find the table can show stock balance in period date?
example:
stock Item No: A1234
2007-12-01 Qty : 10 (last balance)
2007-12-02 Qty : 13 (in 3)
2007-12-03 Qty : 9 (out 4)
How to show stock in only between dec 02 - dec 03, :
2007-12-02 Qty : 13 (last balance)
2007-12-03 Qty : 9 (out 4)
Anyone can help me? I confused searching, i wasted about 1 day to search stock history table?
ThankyouHi Suda,
thanks for your respond.
But i cant found the last quantity (balance qty), but i found Onhand in OITM.
So i must doing a manual calculation.
i assume i get last stock from OITM.Onhand = 10, then i query OINM day by day, and i SUM(Onhand-(Dec02+Dec03))
Or you have another solution? Thanks
but i think OnHand in OITM is not actually qty, because i use inventory posting list, i have all open balance is bigger than OITM.Onhand
Edited by: dony donse on Dec 31, 2007 11:29 AM
Maybe you are looking for
-
I'm trying to silently upgrade my environment to FF 7. I've gotten the silent install working great, it puts in my Proxy Server info, reassigns the home page and all that. But, the last version we pushed out was FF 3.5. If a user had that on their PC
-
Hello, I hope someone can point me in the right direction for my next assignment. I am very new at Java programming. For my next assignment for class I will need expand my previous program which was a mortgage calculator. The first assignment we wrot
-
After downloading a new batch of photos, all my iPhoto pictures have disappeared - I have tried to recover them - assume they are in my machine somewhere but how do I get them back? iPhoto is working with all new photos but the old ones have disappea
-
Multi Processor rendering & editing optimization
Hello, Got some great info here from my last post! So thanx So my question is...is it more ideal to use Xeon or multi processor board setups than single CPU chips? My main aim is for rendering or workflow turnaround since in the next couple of mont
-
Archiving of Object PA_TIME
Hi All, We are currently working on Archiving of Data Object PA_TIME. This is first time I am working on archiving of HR Module. Any one who worked on this Object? Please help........ Thanks a ton in Advance. Best Regards, Dhaval.