SQL Query for user defined form
Hi experts,
I want query to update some fields in my user defined form using stored procedure on clicking of ADD button.
Explanation:
I have User Defined form call "DC request" with Object 'DCLM'..On click of Add button, it is saving my record info into the form. But in one field if value in not entered then it is saving as 'Null'.
Addon is already made, can not change in coding.
I want to update this field with '0' value through query in stored procedure on click of Add Button. Can anyone help me out to achieve this.
Thanks
Hi Team Bone.
Please try below Transaction Notification which will Restrict User to ADD if Field_Name is NULL and then User Need to Enter ZERO i.e. 0 for Adding.
IF @OBJECT_TYPE = 'DCLM' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
BEGIN
If Exists (Select T0.DocEntry from [Table_Name] T0 Where ( T0.Field_Name is null OR T0.Field_Name = ' ' ) AND T0.DocEntry = @lisT_of_cols_val_Tab_del )
begin
SET @error = -100000
SET @error_message = 'Filed_Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
End
End
Please change Table_Name and Field_Name with with UDO field.
Hope this help
Regards::::
Atul Chakraborty
Similar Messages
-
Base Document and Target Document Menu for User Defined Forms
Hi Experts,
I am facing a problem regarding enabling the menu "Base Document" Menu UID="5898" and "Target Document" Menu UID="5899" . Both of these menu Items are not enabled for User Defined Form .Actually I have developed a user Defined form for Purchase Requisition that targets Purchase Order . User can Copy Line Items From Purchase Requisition to Purchase Order and I am tracking the DocEntry and LineId of PR into PO Item's using UDS . I want to Open this PR Document upon Click of BaseDocument Menu .I have tried all the options. I have used Form.enableMenu() method also . But none of those options work for this menu . I ahve also searched about this problem i this forum also but there is no soultion so far posted regarding this.
I really want to confirm whether it is possible or not using SDK for User Defined Forms . Is there any possiblity of implementing any WorkArounds and Having this feature implemented .
I am Expecting a true solutions as this Forum has so many Experienced Experts .
Thanks and Regards,
Pooja Singh.Hello Poja,
It is not possible, because the requested menus are depending on the forms, and the are not exists,
WorkAround:
add the menus to the User Defined forms, and use right click to activate them:
oForm.Menu.Add("5898", "Base Document", BoMenuType.mt_STRING, oForm.Menu.Count)
oForm.EnableMenu("5898", True)
And hanle the menu event when you clicked them and the form is your custom form.
Regards,
János -
Type property for user defined forms
Hi,
When creating a user defined form using Screen Painter,
how can we assign Type property for the form so that we are sure it will not clash with system forms in the future?
Thanks,
Satish.Thanks Juli
Just one last question. It it be alright to assign a text value(Partner namespace in front) for the form type property.Does it have any drawbacks?
Thanks,
Satish -
Problem When Try to add Master data record for User define form
Hi,
I have made one user define form. And assign UDO and fields proerly in form.
But when I try to add the record from the form it will give me error
Invalid Code [Operation Master -Code] [Message 173-36]
I have already bind the code field of the table to one field in the screen painter.
Please give me the reply.
Regards,
Gunjan Shukla.Dear Shukla
Can you please try to do the binding in the code (after loading the from).
Doing that, do you still have the problem?
Best regards,
Miki -
Using SQL query on user defined table
Hi all,
i'am currently working on a project which use user defined table and i would like to know if sap allow us to do insertion/deletion/update on those table using sql query or if we have to use the DI only?
thanks
Best regards,Hi,
Definitely you can insert in UDT. You can update but you cant change the Code field after added the rest of the field
can be updated. You cant delete in UDT but you cant delete anytime in SQL Management Studio.
THanks.
CLint -
Authorizations For User Defined Forms
Hi Experts !!!
I have created a user form , and would like to apply authorization for that user form.
Whether it is possible.I tried using standard method,but it seems that no such provision available ,
And also I have created UDT . and would like to provide series for that UDT . My client wants that particulat UDT should be by 2 different users .and they need Series for that .
Suggestions are appreciated
Regards
Krishna VamsiHi,
You Can give authorizations to your customized (user developed) screens.
Administration --> System Initialization --> Authorizations --> Additional Authourization Creator
In right hand side you can find the structur.
There defaultly XL reporter autorization will be there select the any one and click add same level button in bottom of the screen.
Then in Right hand Side
Authorization ID - give some unique id
Name --> Description of Authorization
In Option --> Select Full/read/None
Item --> Tick as Item
Then Come down you can find big text box, near to that you can find edit button, just click that it will open a popup window.
In that window you please enter the Form Id of your user form
to find the form id --> Just Enable the system information menu in menu bar and move the cursor to any item in your user screen, you can find the form id.
Just type that form id in that pop up box.
then Add the window.
now Open the General Authorization.
There in last row you can find the user authorization. just expand that you can find your authorization id and name there which you have created.
Give your authorization there.
thats it.
There is no need for SDK Developement for Authorization. -
Regarding creation of document number for user defined form
Hi all,
we had created a form , but we don't no how to generate document number as in sap
we created but it is not creating automatically
after adding only it is showing that number in series
but i need that number at the time of opening onlyhi srvanth
Use this code in a data binding of the form to load automatically the doc numbers
ds = oform.DataSources.DBDataSources.Add("@TODACT")
oform = oapp.Forms.ActiveForm
Dim reset As SAPbobsCOM.Recordset
Dim qsr As String
reset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
qsr = "SELECT max(T0.DocNum) as c FROM [dbo].[@TODACT] T0"
reset.DoQuery(qsr)
If reset.Fields.Item("c").Value <= 0 Then
a = 1
Else
a = (reset.Fields.Item("c").Value) + 1
End If
oitem = oform.Items.Item("doct")
oedit = oitem.Specific
oedit.DataBind.SetBound(True, "@TODACT", "DocNum")
oedit.Value = a
this will load document number everytime you load the form at the edit box with unique id "doct"
hope this helpful
you have to bind this edit box with DocNum Userfield of the table.
report back if there is any error
Regards
Cool Ice
Edited by: Cool Ice on Aug 19, 2008 7:20 AM -
How to handle form close event or escape key press event for user defined f
Experts,
Please let me know how to handle form close event or escape key press event for user defined form...
Thanks & Regards,
Pravin.Hi
You can catch the form close event like this
If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
Try
SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
Catch ex As Exception
SBO_Application.SetStatusBarMessage(ex.Message)
End Try
End If
Hope this helps
Regards
Arun -
Regarding query generation to user defined forms
Hi all,
i had created user defined form with some fields and tables
tables in the sense matrix
i had entered the data in that table
and added that data
after that i came back to that form and used the fields that are below the table to calucalate the maximum and minimum from the columns of matrix
so to get the data of that particular form only i used the $ command to extract data depending on the report number
but iam unable to get the result
any one help me regarding this
it is required urgent
Thanks And Regards
sravanth.smSravanth,
Let's see if I can help you.
Assume your form's title table is called @TITLE and the matrix table is called @ROWS. In the form's title you have the record key DocEntry. In the Matrix you have a column COLUMN from were you are going to get some value. ok?
Maximum of the column
SELECT Max(T0.COLUMN) FROM [dbo].[@ROWS] T0 WHERE T0.DocEntry=$[@TITLE.DocEntry]
To get the minimum, just use the Min() function.
Regards,
Vítor Vieira -
Transaction Notification For User Defined Object
Dear Expert,
I want to create a transaction notification for my user defined form. I have a matrix on my form which has a field as 'Code'. I want that this field (On Row Level) should have unique values all the time while adding or updating the form.
Object Type: MaterialMaster
Table Name: MaterialDetails
FieldName: U_Code
Plz help me to get this notification.
RegardsHi Amit,
Please check below query.
IF @object_type = 'MaterialMaster' AND @transaction_type IN('A','U') and @error = 0
BEGIN
IF ( SELECT COUNT(*)
FROM MaterialDetails A
WHERE A.U_Code IN (SELECT U_Code FROM MaterialDetails WHERE U_Code = @list_of_cols_val_tab_del)
GROUP BY A.U_Code
HAVING COUNT(*) > 1
) >1
BEGIN
set @error = -10
set @error_message = 'You can not Add Dublicate Code'
END
End
Hope this help
Regards::::
Atul Chakraborty -
Crystal Report Templates for User-Defined Objects
Hello Experts,
I am running SAP B1 8.8 PL11. In the current patch SAP has default Crystal Reports that can be used as Layouts for Invoices, Credit Memo's so on. Is it possbile to have layouts for user defined objects ( say for instance i have a customized form under sales module, can i import a crystal template for this customized form?). In the report layout manager i don't see an option to import user-defind objects.
Any help would be appreciated.
Thanks,
PraneethIf this is still a problem please re-post to the SAP Integration Kit forum.
-
Problem writing a sql query for a select list based on a static LOV
Hi,
I have the following table...
VALIDATIONS
ID Number (PK)
APP_ID Number
REQUESTED Date
APPROVED Date
VALID_TIL Date
DEPT_ID Number (FK)
I have a search form with the following field item variables...
P11_DEPT_ID (select list based on dynamic LOV from depts table)
P11_VALID (select list based on static Yes/No LOV)
A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
SELECT v.APP_ID,
v.REQUESTED,
v.APPROVED,
v.VALID_TIL,
d.DEPT
FROM DEPTS d, VALIDATIONS v
WHERE d.DEPT_ID = v.DEPT_ID(+)
AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
Can anyone help me to extend my query to include this situation?
Thanks.Hello !
Let's have a look at my example:create table test
id number
,valid_til date
insert into test values( 1, sysdate-3 );
insert into test values( 2, sysdate-2 );
insert into test values( 3, sysdate-1 );
insert into test values( 4, sysdate );
insert into test values( 5, sysdate+1 );
insert into test values( 6, sysdate+2 );
commit;
select * from test;
def til=yes
select *
from test
where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
=decode('&til','yes',1,-1);
def til=no
select *
from test
where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
=decode('&til','yes',1,-1);
drop table test; It's working fine, I've tested it.
The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
For understandings:
1.) TRUNC removes the time part of DATE
2.) The difference of to date-values is the number of days between.
3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
4.) DECODE is like an IF.
Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
Good luck,
Heinz -
How to migrate sql server 2000 user defined function returns table
Hi,
How do I capture the SQL Server 200 user defined function that returns table? Is this supported in the current version of Oracle Migration Workbench? I am using the latest version - Release 9.2.0.1.0 with SQL SERVER 2000 plug-in.
I was able to capture the SQL Server 2000 user defined function that returns string and smalldatetime but not the functions return table during the migrate data source stage.
Thanks in Advance,
SusanSusan,
This is not currently supported. The next release of the Oracle Migration Workbench (due very soon), will do a better job of catching this mad reporting an error. We are looking into a suitable mapping and have created bug # 2355073 - TABLE DEFINITIONS NOT ACCEPTED FOR TABLE FUNCTIONS to track this issue.
Once possible solution we are looking into is using the object type to emulate. Here is an example from the bug:
Original table
SQL> create table tabela (a number, b number, c number, d number);
SQL> insert some values...
SQL> select * from tabela;
A B C D
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
SQL Server 2000 code
CREATE FUNCTION FUNCRETORNATABELA()
RETURNS TABLE
AS
RETURN SELECT A,B,C,D FROM TABELA
SELECT A,B,C,D
FROM FUNCRETORNATABELA()
ORDER BY A
Oracle code (workaround)
SQL> create or replace type MyObjType as object (
2 a number, b number, c number, d number);
3 /
Type created.
SQL> create or replace type MyTabType as table of MyObjType;
2 /
Type created.
SQL> create or replace function teste return Mytabtype pipelined as
2 aa MyObjType := MyObjType(null, null, null, null);
3 cursor c1 is select a,b,c,d from tabela;
4 begin
5 open c1;
6 loop
7 fetch c1 into aa.a, aa.b, aa.c, aa.d;
8 exit when c1%NOTFOUND;
9 pipe row (aa);
10 end loop;
11 close c1;
12 return;
13 end;
14 /
Function created.
SQL> select * from table(teste);
A B C D
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
SQL> select a, c from table(teste) order by c desc;
A C
4 4
3 3
2 2
1 1
Donal -
What is the Object Type for User Define table ?
Dear All Experts,
I create one of the User Define Table with no. of UDF's
I already register User Define Table with Unique ID.
As per my knowledge, Unique ID is our Object type for that User Define Table.
I want to add Transaction Notification Code for created Used Define Table.
This Transaction Notification prevents user to must enter name in that form.
IF (@object_type = 'Z_Roto' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U'))
BEGIN
If not Exists (Select T0.DocEntry from [@Z_ROTO] T0 Where ( T0.Name is null OR T0.Name = ' ' ) AND T0.Code = @list_of_cols_val_tab_del )
begin
SET @error = 1
SET @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
End
End
Please help me for this problem.
Thanks & Regards,
Nishit MakadiaHi All,
Thanks for your replay.
Below code is working for User Define Table's Transaction Notification
IF (@transaction_type = 'A' OR @transaction_type = 'U') AND @object_type = 'Z_Roto'
BEGIN
If Exists (Select T0.Code from [@Z_ROTO] T0 Where ( T0.Name is null OR T0.Name = ' ' ) AND T0.Code = @list_of_cols_val_tab_del)
begin
select @error = 10
select @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
End
End
Necessary to Remember 4 Things. That are mentioned below.
1) Register User Define Table (UDT) with using "Object Registration Wizard". For Example : @object_type = 'Z_Roto'
2) When you define selection criteria then it must be compulsory for use Code Field. For Example : Select T0.Code from [@Z_Roto]
3) When you define selection criteria then it must be compulsory for use Code for @list_of_cols_val_tab_del.
4) Use error code as 10 Number
Thanks & Regards,
Nishit Makadia -
Is there a range of error codes reserved for user defined error codes?
I would like to create my own error codes for a CVI dll but I want to make sure I don't use error codes already defined for something else. Is there a range reserved for such use?
Samee thing for warnings (errorcode > 0)
ThanksI have never found a positive mention of a "safe" range of error codes available for user-defined error conditions, but I can suggest you some source of informations.
First of all, every library has its specific list of error codes, usually listed in the relative include file. All these error codes are listed in the online help too (search for "error codes" in the index tab of the help).
Second, GetGeneralErrorString () is a function that can be used to trap errors of the following libraries with a unique error function:
User Interface Library
Easy I/O instrument driver
Toolbox instrument driver
ActiveX Library
DIAdem Connectivity Library
.NET Library
DataSocket instrument driver
Network Variable Library
Real-Time Utility Library
TDM Streaming Library
UDP Support Library
This means that the error codes from this libraries do not overlap, so you could derive from its code some ranges not used by these libraries.
Nevertheless, there is not a single function for error trapping: every library has its proper list of error codes and a function to decode them in human readable form, andthere is no guarantee that these ranges does not overlap. It's up to you to trap errors from every function in the proper way.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Maybe you are looking for
-
How do I get safari back it suddenly won't open and says "safari quit unexpectedly"
I can't get safari to open.. keeps saying safari quit unexpectedly..I restarted, unplugged the pc and modem and still won't work
-
Erratic zooming in and out using drag and drop to copy.
While using the drag and drop to copy method in AI 18.0(and17) there is erratic zooming in and out behavior. I've called Adobe and Apple about this issue and it still remains. I've also tried the Hot Fix download but the problem still remains. I'm us
-
Question regarding the powershell creation of service applications in SharePoint 2010/2013
Hi I create all my service applications in SharePoint 2010/2013 using Powershell. Is there a "best practice" when to start the service Instance for a service application? Is it better to start the service instance prior to creating a service applicat
-
How to move PI objects in IR and ID from DEV to QAS
Hi experts, I am new to PI and with lot of research and help from you all experts I could successfully create a scenario from XML to CSV conversion. I created message interface, interface mapping objects etc.. in "Integration Repository" and
-
RMAN-20021: database not set
Hi All, We have database Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production running on RedHat edition 4. I have done incomplete recovery of database to previous incarnation using autobackup controlfile with RMAN, opened database with resetlog