miércoles, 31 de julio de 2013

Importación de informes y plantillas


Una de las mejoras que incorporó la llegada de la versión 8.8 (y posteriores) fue la posibilidad de visualizar informes creados con Crystal Reports. Si bien muchos partners ya habían realizado modificacions para poder utilizar esta herramienta, ahora es el el propio SAP B1 el que lo incorpora de forma nativa, permitiendo su uso sin necesidad de add-on's de terceros. En versiones anteriores, SAP B1 disponía únicamente del PLD, una herramienta con funcionalidad limitada para crear y modificar las plantillas que se utilizaban para la impresión de documentos. Ahora, con la llegada de Crystal Reports, se dispone de nuevas funcionalidades, como por ejemplo:
  • Desarrollar informes mejores y más complejos:
    • Uso de datos vinculados de cualquier tabla de sistema, no sólo de las que SAP tiene internamente ralacionadas.
    • Omisión de registros de forma condicional, a partir de los valores que tomen ciertos parámetros.
    • Realización de agrupaciones y ordenaciones de forma más simple.
    • Más funciones para crear campos de fórmula a partir de combinaciones de otros campos.
    • Creación de subinformes dentro del informe principal.
  • Modificar y actualizar informes de manera más simple:
    • Los clientes pueden modificar los informes directamente de forma más intuitiva con una pequeña formación inicial.
    • Interfície de trabajo más sencilla de utilizar.
  • Disponer de reports informativos en Crystal para ser ejecutados directamente desde puntos de menú, no sólo como plantillas de documento.
A demás, gracias a la herramienta de importación/exportación, ahora es más sencillo para los partners desarrollar los informes y plantillas en sus entornos de test y enviarlos al cliente una vez finalizados.
En el post de hoy os vamos a guiar en los pasos necesarios para realizar esta importación.

PREREQUISITOS

Antes de empezar con el proceso de importación, debemos disponer de nuestro informe/plantilla de Crystal Reports en cualquiera de los 2 formatos aceptados:
  • rpt: Formato estárdar de Crystal Reports.
  • b1p: Formato creado por SAP B1 para agrupar varios reports en un mismo fichero.

Proceso de importación de plantillas (fichero "b1p")


1.- Abrimos el formulario de Gestión -> Definiciones -> General -> Gestión de informes y layout y hacemos clic en el botón Importar.
2.- Seleccionamos el fichero a importar y hacemos clic en el botón Siguiente.
3.- Seleccionamos qué plantillas dentro del fichero queremos importar. Para verlas todas, deberemos desplegarlas mediante el botón Expandir. Una vez seleccionadas, le damos a Finalizary listos.
Por último el sistema nos muestra un resumen de la importación y si ha habido algún problema. Una vez finalizado el proceso, ya tenemos las nuevas plantillas disponibles en la pantalla de gestión de layouts.

IMPORTACIÓN DE RPT'S

El proceso de importación anterior también se puede realizar para un informe suelto en formato rpt. En el caso de importar este tipo de ficheros, cuando lo tengamos seleccionado el sistema nos preguntará como lo queremos crear:
  1. Layout: plantilla para imprimir documentos de SAP B1. Cada plantilla va asociada a un documento (oferta, pedido, albarán, factura, orden de fabricación, etc...), que posteriormente se puede predefinir como plantilla por defecto para la impresión de los documentos.
  2. Informe: listado accesible desde un punto de menú asociado al área de negocio que queramos (Ventas, Compras, Inventario, etc...). Gracias a esta opción podemos añadir tantos listados como queramos para cada uno de los departamentos.
Para este tipo de importación, deberemos indicar el destino del fichero, ya sea el tipo de documento para el caso 1 o el punto de menú para el caso 2.



Y recordad que juntamente con la licencia de SAP disponéis de un editor de Crystal Reports gratuito. Si todavía no disponéis de él, podéis pedirle a vuestro partner que os lo facilite.
Esperamos que este post os sea de utilidad y ya sabéis que estamos abiertos a consultas a través de los comentarios.

Cierre Contable para SAP Business One 8.82


Estimados amigos, en esta ocasión vamos a revisar el procedimiento para realizar un cierre contable en la versión de SAP Business One 8.82. Para ello debemos ejecutar los siguientes pasos en el orden indicado:

1.    Realizar un respaldo (back up) de la Base de Datos (BD).
2.   Restaurar dicho back up a una base de datos prueba y ejecutar previamente en esta base prueba el cierre contable del periodo.
3.    Entrar al módulo de Gestión >> Utilidades >> Cierre del Periodo.
4.    Seleccionar las casillas de Socios de negocios y de Cuentas.
5.  Seleccionar el periodo que se desea cerrar pudiendo elegirse desde el mes de enero hasta mes diciembre del mismo año. Es obligatorio que los periodos se encuentren desbloqueados.
6.   Se deben seleccionar dos cuentas contables, la Cuenta de arrastre de saldo y la Cuenta de cierre del periodo, las cuales es recomendable que sean seleccionadas con el apoyo del contador de la empresa:
a.    Cuenta de arrastre del saldo: para esta cuenta se debe seleccionar la cuenta del año a cerrar o si se tiene el catálogo como Resultado de ejercicios anteriores se debe seleccionar esta cuenta.
b.    Cuenta de cierre del periodo: Esta cuenta funciona como cuenta puente y debe estar dentro del Capital Contable (Patrimonio). Normalmente se utiliza la Cuenta de Cierre de Ejercicio actual (Resultado del Ejercicio).
7. Una vez completada esta información se debe presionar el botón ejecutar para pasar a la siguiente pantalla (en esta opción no se hace aun el cierre).
8.    En la siguiente pantalla se tienen que complementar la siguiente información:
a.    Saldo Final: para el caso sería el saldo final del año 2011
b. Referencia 1 y 2, referencias de Cierre del periodo: esta referencia se copiara al asiento contable que se genere.
c.    Fechas para Saldo Final: se ingresa la fecha de cierre de año que se está cerrando. Si estuviéramos cerrando el año 2012, la fecha correcta es 31/12/2012.
d.    Comentarios: comentarios que se copian en el asiento contable.
e.    Saldo Inicial: para el caso sería el saldo inicial del año 2012.
f.    Referencia 1 y 2 Referencias de Cierre del periodo, esta referencia se copiara al asiento contable que se genere.
g.    Fechas para Saldo Inicial: para este ejemplo la fecha correcta sería el 01/01/2012.
h.   Comentarios: es la descripción que va a tener cada póliza que genere el sistema por motivo de cierre de año, ustedes pueden cambiar esta descripción.
9.    Presionar el botón de Ejecutar.
10.  Al terminar el proceso de cierre todas las cuentas desaparecerán, esto indica que el cierre ya fue hecho.
11. Para comprobar que el cierre de año se ejecuto de una manera exitosa se debe ir al módulo de Finanzas >> Informes Financieros >> Financiero >> Balance y ejecutar este reporte de enero a diciembre del año siguiente. Para este ejemplo cerramos el año 2011 y el reporte se pide del 01/01/2012 al 31/12/2012. El reporte de puede ejecutar con o sin la opción desaldos finales, el resultado debe ser exactamente el mismo y en ese caso el cierre es correcto.
12. Si existiesen cantidades diferentes se recomienda restaurar un respaldo y volver a ejecutar el cierre.
13. Una vez realizado del procedimiento en la BD de pruebas, revisar las cuentas de resultados y analizar la cuenta de pérdidas o ganancia del ejercicio.
14. Una vez revisado hace el procedimiento en la base de datos de producción y hacerlo sin que ningún usuario este trabajando. El procedimiento no lo requiere, pero se recomienda por si se necesitase restaurar la BD y no se pierdan operaciones de los usuarios.




Espero les haya servido y hasta la próxima,

 Renzo Gutiérrez


Para cualquier información adicional me pueden contactar al  correo renzo.gutierrez@makitechnology.com ó al móvil 964256190

SAP B1 Problemas con productos con valor cero (0)


En una de las empresas en la que soy consultor ocurrió un problema durante mucho tiempo inexplicable. De acuerdo a los procesos establecidos para la venta de una reparación (REP) se crearon los siguientes documentos en SAP: El articulo REP, su respectiva Lista de Materiales con todos los componentes requeridos por el área de operaciones, su Orden de Venta y su Orden de Fabricación. Luego el área de almacén entrego los materiales solicitados por operaciones, se ejecutó la Terminación report generándose el Recibo de Producción del producto terminado y finalmente se cerró correctamente la Orden de Fabricación. 

Hasta aquí todo bien y es un proceso que se ha repetido cientos de veces sin generar mayores problemas pero a la hora en que el Jefe de Cobranzas intentó emitir la Factura al cliente para poder cobrar el pago del servicio de reparación el SAP le avisa que no es posible entregar un producto con valor cero (0). ¿Qué es lo que había pasado? No exagero si digo que durante horas estuve buscando la causa de dicho error, primero verificando que se habían realizado todos los pasos necesarios en el orden establecido. Y si, todos los pasos se habían realizado en dicho orden y correctamente. El problema en definitiva iba por otro lado. Lo siguiente que revise es si no habían entregado todos los materiales, revisando las entregas y luego el Resumen de la Orden de Fabricación encontrandome con el siguiente cuadro:



De forma misteriosa el SAP consumía los artículos entregados por almacén pero no le cargaba el costo de dichos artículos ni la mano de obra al producto terminado. Estuve a punto de darme por vencido cuando caí en la cuenta que el artículo REP que habían creado tenía un problema singular.


Todos los datos estaban bien ingresados más como pueden ver en el dibujo, el Método de valoración no estaba en Promedio ponderado como todos demás artículos, si no en Estándar lo que indicaba que el precio del artículo sería ingresado manualmente y no de forma automática por el sistema. Esto ocasionaba que el Costo del artículo quedara en cero (0) haciendo imposible guiar o facturar dicho producto.

Una vez ubicado el origen del problema la solución era de lo más anodina. Primero verificamos que el asiento de diario creado por el SAP en la Orden de Fabricación estaba correcto. Luego teniamos que revalorizar el artículo REP pero con una valor tal que no alterára nuestro inventario para lo cual utilizamos el módulo de Inventario >> Operaciones de Stock >> Revaloración de Inventario e ingresabamos un valor simbólico (0.0001) solo para poder guiar o facturar. Una vez hecho esto el problema quedaba resuelto y se prodecía a la facturación.

Espero que les sea de utilidad.


 Renzo Gutiérrez


Para cualquier información adicional me pueden escribir al  correo renzo.gutierrez@makitechnology.com ó al móvil +51 964256190

Crystal Report: Problemas con la función drill down


Estimados amigos, en esta ocasión vamos a revisar un mensaje de ayuda que pude resolver oportunamente:
 
Hello everyone!

I have some difficulties using the drill down function in CR.
I have a Query wihich gives me a list of my open Production orders.
I would like to have a simple drill down from my list to the purchase orders.

I followed the CR pdf, and entered the following in the hyperlink field: 
'http://$b1$/link?table=OWOR&key='+'{Command.GYU}' 

I suppose this gives me a link to my Production orders in SAP.
GYU is the productuion order number in my querry.

When I review the CR list in SAP B1 and click on the golden arrow, I get the following error message:

"You are not permitted to perform this action.Authorisation path: Help"

Can some please tell what is wrong?

I am on PL19 and have the Fixpack for CR installed.

Thanks in advance,

Otto

El problema es muy común y resulta de una pequeña confusión de nuestro usuario. Sucede que el CR asigna automáticamente un tipo de datos de caracteres a cada campo ingresado en el reporte. Dado esto, ya podríamos entender por qué surge un error al momento de ingresar dicho hiperlink. El CR no permite la comparación de tipo de datos diferentes, es decir si nuestro tipo de datos es numérico o tipo fecha debemos previamente convertir dicho dato en una cadena string. Eso se consigue de la siguiente forma por ejemplo:

'http://$b1$/link?table=ORCT&key='+CStr ({Comando.Nro. Pago})

Lo que hemos introducido en nuestro hipervínculo es la función CStr (x) que convierte nuestro campo numérico en un campo tipo string. Ahora, a modo de comprobación deberíamos hacer click en el boton Revisar ubicado en la parte superior izquierda de nuestra ventana principal o usar la opción Alt + C.


  

Finalmente debemos obtener un cuadro de conformidad como el siguiente:



Con el reporte de CR listo solo faltaría cargarlo en el SBO y hacer las pruebas funcionales respectivas.


Renzo Gutiérrez
 


Para cualquier información adicional me pueden contactar a través del email renzo.gutierrez@makitechnology.com ó al móvil +51 964256190.

SBO: Query manager


El uso del Query Manager nos permite encontrar información de forma rápida y práctica. Los reportes obtenidos son fácilmente exportables a excel o si se desea se pueden imprimir directamente. Adicionalmente, si no hay unión de tablas, el reporteador nos permite navegar, vía los famosos golden arrow, a traves de los diversos documentos del reporte como pueden ser los datos maestros de artículos o los datos maestros de inventario.

El SBO nos brinda dos caminos para generar queries: a través de un Asistente de consulta o ingresando directamente al Generador de consultas. Ambas opciones son perfectamente válidas y amigables, dependiendo su uso del expertise del usuario. Por ahora revisaré rápidamente la 2da opción. Entramos a: Menú > Herramientas > Consultas > Generador de consultas, aquí debemos ingresar las tablas con las que queremos trabajar. Por ejemplo si queremos saber todas nuestras facturas abiertas debemos ingresar la tabla OINV (Facturas) y le damos a la tecla Tab. Automáticamente se cargan campos de la tabla OINV. Para nuestro caso seleccionamos los campos DocNum y DocStatus. En el campo Donde del Generador de consultas ingresamos el siguente código T0.[DocStatus] ='O' y le damos click en Ejecutar. Debería aparecer una pantalla como la siguiente:


Para el caso hemos encontrado cuatro factura abiertas (status "O") e inclusive podríamos ingresar al detalle de los documentos vía las flechas de la columna Número de documento. Para exportar nuestro reporte a excel debemos hacer click en el símbolo de excel ubicado debajo de la barra de menús.

Espero que les haya sido útil. Para cualquier información adicional me pueden contactar a través del email renzo.gutierrez@makitechnology.com ó al móvil +51 964256190.

Saludos cordiales, 

 Renzo Gutiérrez
 

SBO: El documento ingresado como asociado no existe


Estimados amigos, en esta ocasión revisaré una alerta del sistema que podría aparecer cuando intentamos crear una nota de crédito de proveedor. El mensaje en cuestión es el siguiente:


Sucede que en ocasiones el sistema no termina de copiar el correlativo del documento original, en este caso de la factura de compras de proveedor en la nota de crédito de proveedor. El solución al problema es la siguiente: 

0. Desde la Factura de Proveedor hacer click en el botón "Copiar a" y luego click en la opción "Nota de crédito de proveedores"


1. Ubicarse en la pestaña "Logística" de la Nota de Crédito de Proveedores


2. Dirigirse al campo "Documento original" de la pestaña "Logística"


3. Modificar dicho campo ingresando el Correlativo de la Factura de Proveedores correspondiente


4. Dar click en el botón "Crear" de la Nota de Crédito de Proveedores.


El problema debería estar resuelto siempre que el correlativo ingresado en el campo "Documento original" coincida con el correlativo de la Factura de Proveedores origen.

Que tengan un buen día,

 Renzo Gutiérrez
 


Para cualquier información adicional me pueden escribir al  correo renzo.gutierrez@makitechnology.com ó al móvil 964256190

viernes, 26 de julio de 2013

How to work with User-Defined Values


To access the User-Defined Values, you can choose menu item Tools | User-Defined Values. You can also use the shortcut key Shift+Alt+F2 instead. Another option is to access it directly from a non-assigned field by using Shift+F2. This will be discussed later.
Working with User Defined Values in SAP Business One
You must notice that the option will not be available until you brought up at least one form. This is because the UDV has to be associated with a form. It can't stand alone.
The following screenshots are taken from A/R Down Payment Invoice. It is one of the standard marketing documents. From the UDV point of view, there is no big difference between this and the other types of documents, namely, Sales Order, Purchase Order, Invoice, and so on.
After a form is opened, a UDV can be defined. We will start from an empty screen to show you the first step: bringing up a form.
Working with User Defined Values in SAP Business One
When a form is opened, you can define or change any UDV. In this case, we stop our cursor on the Due Date field and then enter Shift+F2. A system message will pop up as shown in the following screenshot:
Working with User Defined Values in SAP Business One
If you click on Yes, it will bring up the same window in the manner you select the menu item mentioned earlier from the Tools menu or press Shift+Alt+F2.
When you get the User-Define Values-Setup screen, you have three options. Apart from the default option:Without Search User-Define Values, you actually have only two choices:
  • Search in Existing User-Define Values
  • Search in Existing User-Define Values according to Saved Query
Working with User Defined Values in SAP Business One
Let's go through the last option first: Search in Existing User-Define Values according to Saved Query.The topic related to query will always be assigned with the top priority. There are quite a few screenshots that will help you understand the entire process.

Search in existing User-Defined Values according to the saved queries

The goal for this example is to input the due date as the current date automatically.
The first thing to do for this option is to click on the bottom radio button among three options. The screenshot is shown next:
Working with User Defined Values in SAP Business One
After you have clicked the Search in Existing User-Defined Values according to Saved Query radio button, you will find a long empty textbox in a grey color and a checkbox for Auto Refresh When Field Changes underneath. Don't get confused by the color. Even though in other functions throughout SAP Business One, a gray colored field normally means that you cannot input or enter information into the field. That is not the case here. You can double-click it to get the User-Defined Values.
When you double-click on the empty across-window text box, you can bring up the query manager window to select a query.
Working with User Defined Values in SAP Business One
You can then browse the query category that relates to Formatted Searches and find the query you need. The query called Auto Date Today in the showcase is very simple. The query script is as simple as this:
SELECT GetDate()
This query returns the current date as the result.
You need to double-click to select the query and then go back to the previous screen but with the query name, as shown in the following screenshot:
Working with User Defined Values in SAP Business One
It may not be good enough to select only query because if you stop here you have to always manually trigger the FMS query run by entering Shift+F2.
To automate the FMS query process, you can click on the checkbox under the selected query. After you check this box, another long text box will be displayed with a drop-down list button.
Under the text box, there are two radio buttons for Auto Refresh When Field Changes:
  • Refresh Regularly
  • Display Saved User-Defined Value
Display Saved User-Defined Values will be the default selection, if you do not change it.
Working with User Defined Values in SAP Business One
When you click on the drop-down list arrow button, you will get a list of fields that are associated with the current form.
You can see in the following screenshot that Customer/Vendor Code field has been selected. For header document UDV, this field is often the most useful field to auto refresh the UDV.
In theory, you can select any fields from the list. However, in reality only a few fields are good candidates for the task. These include Customer/Vendor Code, Document Currency, Document Number, andDocument Total for document header; Item Code and Quantity for document lines. Choosing the correct data field from this drop-down list is always the most difficult step in Formatted Search, and you should test your data field selection fully.
Working with User Defined Values in SAP Business One
Now, the text box is filled with Customer/Vendor Code for automatically refreshing the UDV.
Between two options, this query can only select the default option of Display Saved User-Defined Value. Otherwise, the date will always change to the date you have updated the document on. That will invalidate the usage of this UDV. The Refresh Regularly option is only suitable to the value that is closely related to the changed field that you have selected.
In general, Display Saved User-Defined Value is always a better option than Refresh Regularly. At least it gives the system less burden. If you have selected Refresh Regularly, it means you want to get the UDV changed whenever the base field changes.
The last step to set up this UDV is by clicking Update. As soon as you click the button, the User-Defined Values–Setup window will be closed. You can find a green message on the bottom-left of the screen saying Operation Completed Successfully.
You can find a small "magnifying glass" added to the right corner of the Due Date field.
This means the Formatted Search is successfully set up. You can try it for yourself.
Sometimes this "magnifying glass" disappears for no reason. Actually, there are reasons but not easy to be understood. The main reason is that you may have assigned some different values to the same field on different forms. Other reasons may be related to add-on, and so on.
Working with User Defined Values in SAP Business One
In order to test this FMS, the first thing to try is to use the menu function or key combination Shift+F2. The other option is to just click on the "magnifying glass". Both functions have the same result. It will force the query to run. You can find that the date is filled by the same date as posting date and document date.
You may find some interesting date definitions in SAP Business One, such as Posting Date is held by the field DocDate. Document Date however, is saved under TaxDate. Be careful in dealing with dates. You must follow the system's definition in using those terms, so that you get the correct result.
Working with User Defined Values in SAP Business One
A better way to use this FMS query is by entering the customer code directly without forcing FMS query to run first.
The following screenshot shows that the customer code OneTime has been entered.
Please note that the DueDate field is still empty.
Is there anything wrong? No. That is the system's expected behavior.
Working with User Defined Values in SAP Business One
Only if your cursor leaves the Customer Code field, can the FMS query be triggered.
That is a perfect example of When Field Value Changes. The system can only know that the field value is changed when you tab out of the field. When you are working with the field, the field is not changed yet.
Be careful to follow system requirements while entering data. Never press Enter in most of the forms unless you are ready for the last step to add or update data. If you do, you may add the wrong documents to the system and they are irrevocable.
Working with User Defined Values in SAP Business One
The previous screenshot shows the complete process of setting up search in Existing User-Define Values according to Saved Query. Now it is time to discuss the $ sign field.


Where do the $ values come from?

Many users have this question when they first read a FMS query script with system variables, because not all users have the chance to access SAP's formal document.
$ sign in the query means a system variable. There are few variables available all the time such as$[user]. This is the variable to represent the current log in user sign. However, most variables will be form dependent. To get detailed information regarding the variable, you need to activate the System Information function as shown in the next screenshot:
Working with User Defined Values in SAP Business One
This menu option is under the Views menu. You can use the shortcut key Ctrl+Shift+I to get the same result. This menu option is an On/Off switch. You can change it from off to on or from on to off if you select it. A check in front of the System Information means it is on.
When the system information switch is on, all system information related to the current mouse position will be shown on the status bar at the bottom left of the screen. It is irrelevant to the cursor position.
The following example shows that the mouse is over the top first field Customer. The information related to it is as follows:
[Form=65300 Item=4 Pane=0 Variable=1 OPDI,CardCode]
This is a header field so only two parts are useful to the FMS query:
  • The first one is Item=4. Item here means form element; it has nothing to do with item master data.
  • The second one is OPDI, CardCode. It is the table and field name for this item.
In the FMS query, the usages can be either of the following:
  • $[$4.0.0] that reflects Item=4
  • $[OPDI.CardCode] that only adds $[] to the field name
Working with User Defined Values in SAP Business One
The other similar screenshot, as follows, looks exactly the same but the mouse is over the Item No. field in the line detail of the form.
The information that relates to this field is:
[Form=65300 Item=38 Pane=1 Column=1 Row=1 Variable=11 PDI1,ItemCode]
This is a line field and three parts are useful to the FMS query:
  • Item=38: This item stands for the whole matrix of the line detail
  • Column=1: This refers to the field in the table
  • PDI1,ItemCode: Again it is table and field name
In the FMS query, the usages can be in two equivalent formats:
  • $[$38.1.0] that reflects Item=38 and Column=1
  • $[PD1.ItemCode] that only adds $[] to the field name
Working with User Defined Values in SAP Business One
The syntax for a form based line level variable is $[$Item.Column.Type].
For header items, columns are always zero because all items on the header represent a field in a table if it has a datasource. Column is only useful for line details.
The last portion is the Type. It is not related to system information found on the screen. It is the type of value you need to return, and can be any of the following:
  • 0-String(text)
  • Number
  • Currency
  • Date
For example, a value returned by $[$22.0.0] as N'USD 100' when a marketing document total is 100 US Dollars. If by $[$22.0.number], it will return 100. It returns only N'USD' if you use $[$22.0.currency]. As a default selection of type 0, it can often be omitted.
While in the form based variable, the column represents the order number of the column in the form. For example, $[$38.11.number] stands for quantity field in the marketing document. It is the eleventh column within the line detail matrix.
The syntax for a table based variable is $[Table.Field.Type].
The field in this syntax is the actual field code within the table. It is the last part of the system variables. It can be a UDF starting with U_. If you use a table based variable, the form based variable $[$38.11.number] is equivalent to $[RDR1.quantity.number].
In general, you can always use a form based variable to reduce the trouble for one query that has to be written multiple times based on the different tables for different forms.

How to get the value you need from, and for, the FMS query

To get any values from the FMS query, the first thing to remember is: only the first field can be returned to the field if you select more than one field in your query. All fields from the second one will be ignored no matter how many fields you have selected for the query. The additional fields can only be functioned as references.
To assign any values to a FMS query, the principle is: only a table available to the current form can be based to set a variable. If you open a new form, the base form variable will become inaccessible. For example, all variables on the main form of the marketing document will not be available to a freight form and vice versa.
If you create a query using the $ variables and have a form open that uses the variables then the query replaces the $ values with the current values in the form. This is an important step to test FMS query before assigning. Make sure you save the query first. Otherwise, the variable will become a hard value. You cannot get it back to $ variable.

Can you run FMS queries directly?

Can you run FMS query directly under query manager? The answer is partially yes and partially no. It depends on whether you have form variables or dollar sign field values.
If a FMS query has a variable, then this query must be saved under one of your categories. Preferably, you create an exclusive folder with the name related to Formatted Search. It is considered as the best practice.
You will get an error message if you select run query from query manager or user queries directly without any related form open. This is due to the undefined form. A $ sign will be meaningless without current form support. You will get a red "Internal error" message immediately on the status bar.

What is the negative sign's function in FMS query?

We often find that certain FMS queries have a negative sign for variables. For instance:
$[$-4.0.0]
What does the negative sign stand for?
A negative sign for a form variable means your FMS query is related to header level User-Defined Fields. The form number will have the same value as the main form but with the opposite sign.
For example, form 139 is a sales order form. UDF form for a sales order will be -139. Form 142 is a purchase order form. UDF form for a purchase order will be -142. The difference between those two related forms is only a negative sign.
When we refer the main form variable to the UDF form, a negative sign is always needed. The actual form number is not important to FMS query. Only the negative sign matters. $[$-4.0.0] refers to the BP code in the main document form. It will be used for a FMS query assigned to the UDF form.

Search in existing User-Defined Values only

The simplest form of a search for UDV is to define a list of values, which the system proposes as input values. These input values are triggered when the user selects Shift+F2 in the relevant field. The procedures to define this simplest search will be shown next.
Although this function may not be directly linked to SQL query, it is worth going through the detailed process to get one more options under the same menu function with FMS query for UDV.
The same process will be discussed as from the breaking point that showed the Without Search User-Define Values option previously. With one exception: the cursor is not on the DueDate but the Remarks field.
Instead of selecting the bottom option, the middle option, Search in existing user- define values only, will be selected as follows:
Working with User Defined Values in SAP Business One
In the right-most screen of this middle selection, you can find a button with three dots. It is the access path for predefined values.
This button needs to be clicked to assign a list of predefined values. There is nowhere else you can find it.
Working with User Defined Values in SAP Business One
After clicking on the button, a new form will pop up with the title: Field Values– Setup. There is only one field in the form. The field title is Field value. Your cursor will remain on the first line.
Working with User Defined Values in SAP Business One
You can input any letter or number here. In the example, High is inputted on the first line. You will notice the button OK has changed to Update. This Update is not only for the form but for every line. You only need to press Enter to move to the next line. It acts as a click on the Update button.
After pressing Enter, the cursor moves down to the second line. The button becomes OK again. A green message is shown on the bottom-left of the screen: Operation Completed Successfully. You can input any characters just like in the first line.
Working with User Defined Values in SAP Business One
Low is entered on the second line. The button now changes from OK to Update. As before, you just need to press Enter to move the cursor down again.
Working with User Defined Values in SAP Business One
When the line is empty and the button is OK, you can close the form by pressing Enter or clicking on theOK button. This will complete the value list input. You can always go back to Update or add new lines to the list.
Working with User Defined Values in SAP Business One
Just like the other example, you should find that the magnifying glass has been added to the right corner of the Remarks field from the last screenshot. This means that the UDV has been assigned successfully.
When you press Shift+F2, a list of values will pop up. All values that were entered on the list will be available.
Working with User Defined Values in SAP Business One
You can select any line from the list. Then press Enter to select one of the values required or click theChoose button. Click on the Cancel button if you do not want to assign any values from the list. There is an additional button besides these two buttons. It is the New button. This button allows you to edit or to add values on the list.
Working with User Defined Values in SAP Business One
As you can see, since the value selected is that of the first line, High has been returned to the field. This value can be very long. That may save you a great amount of time.
The previous screenshots conclude the process to set up Search in existing user-define values onlyfunction. 

Summary

In this article we saw how to work with User-Defined Values.