Update a UDF field at runtime
I designed the Sales Order and Sales BOL form in Crystal Reports. I am looking to capture and update an UDF field every time I'm printing the one of those reports in SAP B1 2005 A. The reason for doing this is to display on the report "Original" when printed for the first time, "Duplicate" when printed for the second time and so forth. Is this possible? Thank you.
You could do a Formatted search on the UDF to change to a value when the Field "Printed" is changed.
You might want to do "Refresh Regularly" option in Formatted Search.
Krishnan
Similar Messages
-
OIM 11g r2 User UDF fields Updation based on AD ID
Hi,
We have to update the UDF fields created for the users in OIM using the data from a table.
This table contains the AD ID, and other fields.
OIM User (already available) will be updated based on AD ID ….i;e AD ID column will be used to find the user in OIM and then his UDF will be updated based on the respective data from other columns in the table .
Please can you help me on this task?
Thanks,Your requirement doesn't tell much like when you want to update your user. If it would be on daily basis then go for Schedule Task, if you want to at the time of provisioning then you can have one task and attach your code to bring AD ID in OIM..
You may leverage Event Handlers as well if your use case requires that. -
How to change field in runtime at update query
hi buddys
i have to change the particular field during runtime how is it possible
sample :
UPDATE zmpq_qcchk_hdr
SET (field) = i_hdr-ind1 WHERE
zcust = i_hdr-zcust AND zns = i_hdr-zns AND
zpgma = i_hdr-zpgma AND zdpn = i_hdr-zdpn AND
zdu = i_hdr-zdu AND zpart = i_hdr-zpart AND
zsale = i_hdr-zsaleorder AND zitem = i_hdr-zitem.
The (field) should be changed at runtime
with luv
pauldharmaYOu can concatenate the field name with the whole string like this
concatenate v_fieldname
' = i_hdr-ind1 WHERE
zcust = i_hdr-zcust AND zns = i_hdr-zns AND
zpgma = i_hdr-zpgma AND zdpn = i_hdr-zdpn AND
zdu = i_hdr-zdu AND zpart = i_hdr-zpart AND
zsale = i_hdr-zsaleorder AND zitem = i_hdr-zitem.'
into v_string.
UPDATE zmpq_qcchk_hdr
SET (v_string).
Regards,
Ravi Kanth Talagana -
DTW - Error occurs when updating UDF field
Error occurs when updating UDF field:"bank does not exist in the company Application-defined or
object-defined error65171"
What is the meaning of this message?
thanks
Edited by: Nadav Greifman on Oct 11, 2009 12:39 PMYou may check these threads forst:
Invalid valid value '0003' Error 65171
bank account is missing application -define or object define Error 65171
Re: Journal entries
Re: Error importing Incoming Payments using the Data Transfer Workbench
Thanks,
Gordon -
Automatic update of UDF Row field in a sales order
I have recently added a UDF field to the rows of a sales order which I would like to display an items MOQ. I have written a query which I have embedded into this field by way of the User Defined Values Setup. When checking this I can see that the field can be populated with the correct value by pressing shirt + F2 however, I would like this to happen automatically. I have tried setting the auto fresh on exiting altered column by Item Code and by Confirmed Del Date respectively but neither seem to work.
Any ideas?Sorry i forget to remove OITM
SELECT A.MinOrdrQty from OITM A INNER JOIN RDR1 B ON A.ItemCode=B.ItemCode WHERE A.ItemCode=$[RDR1.ITEMCODE]
Now try
--Manish -
UDF field in Crystal in Sales Order Layout
Hi,
I want to Include UDF field in sales order layout, when i open default layout it shows only standard in RDR1(UDF for rowlevel ) it doesn't shows UDF fields. Now i connected database and re-established OLE DB connection and pulled the RDR1 table, here i can get those UDF created by me. but if i use this UDF field in report details area and this results no values in the layout while preview the report in SAP B1.
Anyone guide me on this....
Regards
sreeHi Ivan,
If you want to populate UDF fields into crystal reports layout then you have to do wat i mentioned earlier.
1. Go to Menu
2. choose Database
3. choose verify database
4.enter Object Id and Document Number as a input
5.system will retrieve the values from database and pull all the fields including UDF
but this doesn't change field length of UDF you have to change it on UDF fields management in SAP by updating the field properties.
Note: later you can't reduce the length
Regards
Sree -
UDF fields missing in Deployment Manager User Metadata export wizzard
Hi,
When I try to export UDF-s using Deployment Manager, not all UDF-s appear in the Deployment Manager wizard step1 Search list for User Metadata type.
It seems that UDF Lookup type-s are not included.
Also, some text type UDF-s are missing as well, while the rest of the text type UDF-s are in the list.
I wonder if someone has encountered the issue? Is there any solution for this?
Thanks in advance.Hi,
I have tried your suggestion, exported sandbox, than published the sandbox. The UDF-s are included in the UserEO.xml.xml file, but are still cannot be retrieved in Deployment Manager wizard step1 Search list.
Even if I enter the exact name of the attribute (USR_UDF_DEPT_NO) it is not found.
The problem is even more severe:
- the UDF missing from the export, which is a lookup type field, cannot be mapped in a GTC connector.
- this UDF field is NOT CREATED in the DATABASE.
Error message:
<Error> <oracle.iam.configservice.impl> <BEA-000000> <The attribute DEPT_NO does not exist!>
<Error> <oracle.iam.ui.formservice.model.modeler.FormService> <BEA-000000> <Updating User field DEPT_NO with params....failed>
OIM version: 11.1.2.1.0
Can someone confirm if this a bug? Is there a workaround?
Best regards. -
Post Process Event Handler not getting user's CURRENT_STATE for a UDF field
I have a post process event handler in OIM R2 BP04 , which runs on Trusted Reconciliation and it compares user's ("CURRENT_USER") state and ("NEW_USER_STATE") and based on that derives a business logic.
The problem that i am facing is that, it is not able to get the User's ("CURRENT_USER") state for a UDF(EMAIL_LIST) field and it is coming as null,and hence is breaking the business logic.The same Event Handler is working on TEST and QA ( 4 node cluster)environments and is not working on PROD environment( 4 node cluster).
The different thing that was done on was that during the initial recon the event Handler was not present and after the initial load of the users i have manually executed the database sql query which have updated the "EMAIL_LIST field manually for all the users
I think that since during the initial recon as the EMAIL_LIST was not populated and was populated through the SQL update for all the users, the orchestration inter event data does not contain email list, and so it is coming as null.
But i am seeing the same behavior for new records as well, which are created and then updated after event handler is registered.
Please reply, if you have encountered something similar.
Thnx
AkshatYes i need the old state, which is
Identity[] oldUserStatesIdntArr =
(Identity[])(Identity[])interEventData.get("CURRENT_USER"); -
Not able to keep defualt value in UDF Field
Hello Frnds,
I have one question to you, I want to keep default value in one of the UDF field which is ContNo which is exist in A/R invoice.
I want to keep default value =9999999
So to do this I have followed the following process:-
First I went to ToolsUser-Defined FieldsManage User FieldsMarketing DocumentsTitleContNo
then pressing update button there is an option to enter Default value and press OK button.
After that its taking some 30 mins and giving error of "SEWSY"
Please help me to let me know the solution.
Regards,Hello Gordon,
Please note that as per your suggestion now im not updating the udf by the sql query.
As i was already trying to update it from as a exclusive user of B1, but its not updating.
Its always give the error of SEWSY. At the time of updating there is not user logged on SAP also im updating with the adminstrator role.
Please suggest me. -
Hi All,
I have added some User Defined Fields to Sales Order window. Can I place a choose fromlist in one of these UDF fields. If can, please give the code.Hi Jisha,
Vasu is right, but you can update the Sales Orders form with a new tab that contains your user fields. And in these fields you can add the CFL has you would do in a standard user form (you can even add the CFL in the XML form).
Example of the user form:
<?xml version="1.0" encoding="UTF-16" ?>
<Application>
<forms>
<action type="update">
<form FormType="139" uid="">
<items>
<action type="add">
<item uid="_Family01" type="8" left="25" tab_order="0" width="80" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family01" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 1"></specific>
</item>
<item uid="Family01" type="16" left="110" tab_order="0" width="150" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family01"></databind>
</specific>
</item>
<item uid="_Family02" type="8" left="25" tab_order="0" width="80" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family02" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 2"></specific>
</item>
<item uid="Family02" type="16" left="110" tab_order="0" width="150" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family02"></databind>
</specific>
</item>
<item uid="_Family12" type="8" left="25" tab_order="0" width="80" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family12" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 12"></specific>
</item>
<item uid="Family12" type="16" left="110" tab_order="0" width="150" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family12"></databind>
</specific>
</item>
</action>
</items>
</form>
</action>
</forms>
</Application>
Than you catch the Sales Order form Load and you load the above form:
1. Catch the Sales Order form load
2. Add the new folder by code and update the Sales Order form
Try
oForm.Freeze(True)
oForm.Resize(740, 480)
Dim PaneLevel As Integer = oForm.PaneLevel
Dim oNewItem As SAPbouiCOM.Item = oForm.Items.Add("FldFam", BoFormItemTypes.it_FOLDER)
Dim oItem As SAPbouiCOM.Item = oForm.Items.Item("3") '// 3 = Id of an existing folder in the form
oNewItem.Top = oItem.Top
oNewItem.Height = oItem.Height
oNewItem.Width = oItem.Width
oNewItem.Left = oItem.Left + oItem.Width
oNewItem.AffectsFormMode = False
Dim oFolderItem As SAPbouiCOM.Folder = oNewItem.Specific
oFolderItem.Caption = "NEW FOLDER"
oFolderItem.GroupWith("3")
'// Carregar o ficheiro XML com as modificações ao formulário normal.
UpdateFormByXML(oCompany, oApplication, pFILES & " rm150_" & GetLanguageCode(oApplication) & ".srf", oForm.UniqueID)
oForm.Items.Item("FldFam").Visible = True
oForm.PaneLevel = PaneLevel
AddFamilyFolder = True
Catch ex As Exception
oApplication.MessageBox("AddFamilyFolder(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
End Try
End Function
Function to update a form
Public Sub UpdateFormByXML(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
ByRef FileName As String, ByRef FormUID As String)
Try
Dim xDoc As Xml.XmlDocument = New Xml.XmlDocument
xDoc.Load(sPath & FileName)
xDoc.SelectSingleNode("Application/forms/action/form/@uid").Value = FormUID
oApplication.LoadBatchActions(xDoc.InnerXml)
Catch ex As Exception
oApplication.MessageBox("UpdateFormByXML(): ", oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
End Try
End Sub
Regards,
Vítor Vieira -
Difficulty in setting value of a field at runtime
I have a form with input text fields. One of the fields is disabled and automatically filled by the system. I am having problem filling this field at runtime.
What I did was that I tried to set the value of the field during the save operation (that is when I clicked on the save button). The system sets the value of the field but it did not commit the value into the table. This is is the code that I used
public String SaveParameterRecord() {
this.codeTypeId.setValue("GB011");
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
Again I tried with with method call, but it gave me java.lang.NullPointerException at the point (this.codeTypeId.setValue("GB011"))
public String CheckParameterMethod() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
this.codeTypeId.setValue("GB011");
return null;hi Frank,
The issue I see is that by putting this.codeTypeId.setValue("GB011"); wont be updating the model, and that is why after your commit, the value comes null. Is that variable depending on any other value? If you really want to update the model at that stage you will need to do something like;
public static void setExpressionValue(String expression, Object newValue) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, expression,
Object.class);
//Check that the input newValue can be cast to the property type
//expected by the managed bean.
//If the managed Bean expects a primitive we rely on Auto-Unboxing
Class bindClass = valueExp.getType(elContext);
if (bindClass.isPrimitive() || bindClass.isInstance(newValue)) {
valueExp.setValue(elContext, newValue);
And then instead using this.codeTypeId.setValue("GB011"); you will call setExpressionValue("#{bindings.yourVariable.inputValue}","GB011"). But then again I dont recommend you doing this.
If this variable depends on another variable, you can use a setPropertyListener and autoSubmit=true.
Regards -
Update the JSpinner/SpinnerDateModel at runtime.
I'm having trouble updating the the value of of JSpinner field at runtime. The scenario is;
Once the application is started the default system date/time is set on my JSpinner field. If I visit my page that contains the said Date (JSpinner) feild, it will show the time the system was started. But I always want to display the current date/time, at the time I visit the page, in the JSpinner Date field.
The hierarchy of the code is;
JPanel1 (base class)
--- JPanel2
--- JTabbedPane (consists of a couple of tabs, one of which is Jpanel3)
--- Jpanel3 (different class by itself, which contains the desired JSpinner Date field)
In JPanel3 I have implemented JSpinner as;
public JSpinner getDateSpinnerField ()
SpinnerDateModel dateModel= new SpinnerDateModel();
dateModel.setCalendarField( Calendar.MONTH );
JSpinner spinner= new JSpinner( dateModel);
JSpinner.DateEditor dateEditor = new JSpinner.DateEditor( spinner, "MM/dd/yyyy HH:mm:ss" );
dateEditor .getTextField().setEditable( false );
spinner.setEditor( dateEditor );
fromSpinner.addChangeListener( new javax.swing.event.ChangeListener() {
public void stateChanged ( javax.swing.event.ChangeEvent e )
JSpinner jSpinner = (JSpinner)e.getSource();
SpinnerDateModel spinnerDateModel = (SpinnerDateModel)jSpinner.getModel();
setDateValue( spinnerDateModel.getDate() );
return spinner;
}Let me know if I need to paste the code as well and/or if any one needs any clarifications.
thanksNo, the the setDateValue() is for a different purpose here. It's just a setter and getter which holds the date value whenever user is modifying it. Lets not get diverted from the issue at hand.
Also I have added a ChangeListener event on my tabbed pane, as implemneted below;
<JTabbedPane>.addChangeListener( new javax.swing.event.ChangeListener() {
public void stateChanged ( javax.swing.event.ChangeEvent e )
int tabPosition = ( (JTabbedPane)e.getSource() ).getSelectedIndex();
JTabbedPane pane = (JTabbedPane)e.getSource();
if ( tabPosition == 1 ) {
System.out.println( "tabPosition: " + tabPosition );
Jpanel3 panel = ( Jpanel3 )pane.getSelectedComponent();
final JSpinner spinner = panel.getFromSpinnerField();
DateEditor editor = ( (DateEditor)spinner.getEditor() );
final SpinnerDateModel dateModel = editor.getModel();
dateModel.setValue( new Date() );
System.out.println("Value1: {"+dateModel.getValue()+"}");
try {
editor.commitEdit();
editor.repaint();
editor.revalidate();
catch ( ParseException pe ) {
System.out.println( "Exception" );
pe.printStackTrace();
SwingUtilities.invokeLater( new Runnable() {
public void run() {
//spinner.invalidate();
spinner.repaint();
spinner.revalidate();
System.out.println("Value2: {"+dateModel.getValue()+"}");
But the date in the JSpinner feild doesn't get updated.
thanks
Edited by: javanuts on Mar 12, 2008 3:39 PM -
I want the system automatic update my UDFs when the OnHand was changed.
I added two UDFs in table OITW to count the warehouse OnHand by CASES and Bottles. I want the system automatic update my UDFs when the OnHand was changed. Is there any way I can do it in database level instead in the application (too much places involved).
There is few ways how to do this:
- triger as David said, but I dont recomend it through SAP policy
- in stored procedure transaction notification by adding or updating document update your user field
- create job in SQL server which in specific interval recalculate the changes of onhand and update your user defined field
- create addon which will be over functiuonalities which may change the onhand value
I think that from SAP is possible only Addon, but the easist way is trigger and if you dont need it just in time but for example every 10 seccond, the better is job which cannot fail the standard SBO transaction (triger may and may be unsafe).
Hope it helps
Petr -
Stored Procedure to Block Changing of a particular UDF Field by a particular USER ID
Hi,
I have a case where a particular UDF Field in Sales Order must not be changed by a particular USER ID.
My SP is,
IF @object_type='17' AND ( @transaction_type='U')
BEGIN
if(Select T0.XXX from ORDR T0
where T0.UserSign='1' and T0.DocEntry=@list_of_cols_val_tab_del)>0
begin
SET @error = 1
SET @error_message= 'You Cannot Change this Field'
GOTO EXITLINE
end
end
It throws me with the Error : -
[Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting the nvarchar value 'ABC' to data type int. (CINF)
The UDF Field is Alphanumeric in type.
Can any one please suggest me what could be the error.
ThanksHi Gopi Krishnan,
Please check below SP Transaction Notification.
if @object_type = '17' and @transaction_type in ('U')
begin
If Exists (SELECT T0.[DocEntry] FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN OUSR T2 ON T0.[UserSign] = T2.[USERID]
WHERE T0.[UserSign] = '1' AND T0.DocEntry = @list_of_cols_val_tab_del)
Begin
SET @error = 1002
SET @error_message = N'You are not Authorized to Update Sales Order'
End
End
Hope this help
Regards::::
Atul Chakraborty -
Dear All,
How can I validate a UDF field in Business Partner screen? As I don't want to set any default value for that UDF, I could not make it as Mandatory also. Please help me to resolve this problem.
Thanks in advance.Hi,
The SBO_sp_TransactionNotification proc can be used for this type of validation but you could also use code in your addon. The benefit of using the proc is that this will work with BPs created using the DI API (eg DTW import or another addon).
As you are only trying to read data on a system form, you can use the DBDataSources already attached to it to check the UDF value. This is a better solution because it does not rely on the UDF tab being open. You cannot use this method to write to the UDF due to the restrictions on a system form.
You could add something like the following to the item pressed event (when BeforeAction is true) of the Add button on the BP form:
SAPbouiCOM.DBDataSource sboDS = (SAPbouiCOM.DBDataSource)sboForm.DataSources.DBDataSources.Item("OCRD");
string sValue = sboDS.GetValue("U_MYUDF", 0).TrimEnd();
if(sValue == "")
BubbleEvent = false;
_sboApp.SetStatusBarMessage("You must enter a value in the UDF", SAPbouiCOM.BoMessageTime.bmt_Long, true);
You'll also need to check the form mode to make sure you only validate the field when the form is in Add or Update mode.
Kind Regards,
Owen
Maybe you are looking for
-
Partitioning an Existing Table using DBMS_REDEFINITION with no primary key?
HI, Is it possible to partiiton a table with dbms_redefination if the table contains no primary key? DB version 10.2 Thank you All..
-
Too many inactive database connections (c#, webapp, Oracle)
<br /><p> </p><p>I have a web application that uses the CrystalDecisions.Web.CrystalReportViewer to display my reports. </p><p>The application opens a connection to an Oracle database with SetDatabaseLogon(). </p><p>I have not yet implemented anythin
-
Kernel Panic help!!! MBP 10.5
Hello everyone, first off let me explain my problem. My wife's computer (The macbook pro she's had since about 2007, with original 10.5 OS) was left out the other day with the lid closed so it entered sleep mode, when she turned it back on it showed
-
WIP should charge the resosorce on the basis of Time taken to complete job
Hi, I would like to know how: WIP should charge the resosorce on the basis of Time taken to complete a job. the facility what we have in WIP is to change the unit of resource and then the costing will take place. I will clarify with the help of an ex
-
How to share OSX Mac with printer with OS 9 Mac???
i have an airport with itunes wireless network with a powerbook G4 (10.4.6) and an ibook (9.2.2). the OSX computer is sharing a brother USB printer that is connected to a wireless print server (motorola, not airport). the OSX prints perfectly (after