Custom code - count of lines
Hi,
How can I obtain the count of lines of code in all the custom objects such as z programs, z functions, z methods, user exits etc?
THank you,
Mike
check fm RPY_FUNCTIONMODULE_READ
Check how it reads the source code and returns it.
Use a describe statement to the return table
or try this syntax
itab must hold a field of char72.
READ REPORT 'Y123' INTO ITAB.
lines_r = lines( itab ).
also check in se37 for rpy*
Also check the f1 for read report, there are many other options
Similar Messages
-
SSRS custom code for count in Report Footer
Hi All,
Please help me with the custom code used for below requirement
Debtor Name current 30+days 60+days 90+days
aaa 7000 0.00 0.00 10.00
bbb 5000 0.00 20.99 3.00
ccc 1000 0.00 0.00 0.00
Expected result in report footer :
0 1
2
if the value of 30+ , 60+ and 90+ columns >=1 then i have to display the count in Report footer,for that i have tried using a custom code like below :
Shared Dim OD As Integer=0
Public Shared Function Test(ByVal OP As Decimal) As Integer
If OP >= 1 Then
OD = OD + 1
Else
OD = OD
End If
Return OD
End Function
and using below code to display
Code.Test(Overdue)
but when i use this code in report footer is not displaying correct value.Please guide me where i am going wrong.
Please let me know if you need any other details.
Thanks in advance,
Samhith.Hi Samhith,
Per my understanding you what to count the rows which values >=1 and display them at the bottom of the table, you are trying to use the custom code to do this but failed, right?
I have tested in my local environment and find the custom code is not correctly, and I have an alternative method which is more easy and can work in both table and matrix.
As Vaibhav Chaudhari also mentioned that we can use the CountDistinct function, but more correctly, we can use the count() function and the RunningValue() function, because CountDistict will not count the duplicated values if they >=1.
Please find the expression as below:
=Count(IIf(Fields!Yourfield.Value>=1 , Fields!Yourfield.Value, Nothing))
OR:
=RunningValue(IIf(Fields!Yourfield.Value>=1 , 1, Nothing),Sum,"DataSetName")
If you still have any problem, please feel free to ask.
Regards
Vicky Liu -
I am receiving this error with the following code, which counts the number of work days between two parameters and I don't see the problem. Please help.
Public Function GetDateCount(ByVal StartDate AS DateTime, ByVal EndDate AS DateTime) AS Integer
Dim TempVal AS Integer
DimTotalDays AS Integer
TotalDays = 0
TempVal = DateDiff(DateInterval.Day, StartDate, EndDate) + 1
for I as Integer = 1 to TempVal
If(StartDate.DayOfWeek.ToString() <> "Sunday" AND StartDate.DayOfWeek.ToString() <> "Saturday") Then
TotalDays = TotalDays +1
End If
StartDate = DateAdd(DateInterval.day, 1, StartDate)
Next
Return TotalDays
End FunctionHi CNet Vase,
According to your description, you want to use custom code to count the number of work days between two parameters in the report, but when you run the report, an error occurs.
I reproduced the issue in my environment, the error message: ‘DimTotalDays’ is not declared. The error is caused by there is no space between Dim and variable TotalDays, so the system regards it as a unit. To fix this issue, please type
space behind the word Dim like below:
Dim TotalDays AS Integer
If there is any misunderstanding , please feel free to let me know.
Best Regards,
Wendy Fu -
Function MakeList(ByVal items As Object()) As String
If items Is Nothing Then
Return Nothing
END if
Dim builder As System.Text.StringBuilder =
New System.Text.StringBuilder()
builder.Append("<div>")
For Each item As Object In items
builder.Append("<div <ul>")
builder.Append(item)
builder.Append("</ul>")
Next
builder.Append("</div>")
Return builder.ToString()
End Function
Function Length(ByVal items as Object()) as Integer
If items is Nothing Then
Return 0
End If
Return items.Length
End FunctionHi Wintersbay,
According to your description, when you use the custom code in SSRS report, you got the error message.
To solve the problem, please refer to the custom code below:
Function MakeList(ByVal items As Object) As String
If items Is Nothing Then
Return Nothing
END if
Dim builder As System.Text.StringBuilder =
New System.Text.StringBuilder()
builder.Append("<div>")
For Each item As Object In items
builder.Append("<div <ul>")
builder.Append(item)
builder.Append("</ul>")
Next
builder.Append("</div>")
Return builder.ToString()
End Function
Function Length(ByVal items as Object) as Integer
If items is Nothing Then
Return 0
End If
Return items.Length
End Function
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
Wendy Fu
TechNet Community Support -
Hi..getting error while previewing the report..hi i have the custom code
hi my custom code is as follows:
Public Shared Function SetColor(ByVal OrderYear As datetime,ByVal LineTotal As numeric(38,6)) As String
SetColor= "Transparent"
If Productid >= 20 Then
SetColor= "Green"
End IF
End Function
i'm getting error as
"there is an error on line 0 of custom code:[BC30002] Type numeric is not defined:
i have same datatype for LineTotal in my database.
Please help.Thanks in advance..
luckyHi Lucky,
Just as the error message said, there is no such data type named numeric in Visual Basic. The data type is actually exist in
SQL Server, but it doesn’t means that it should also exist in
Visual Basic. And based on my research, I couldn’t find a strictly equivalent data type in Visual Basic.
Besides, it seems that there are something wrong in your code. For more details, please see:
There is no such variable named Productid in the code, we should define it in the SetColor function in advance. Because you it used in the condition of if statement.
We should remove the unused variable in the function. Such as OrderYear and LineTotal. If the function needs LineTotal variable, we can use double data type to define the data type of LineTotal after format it.
The following custom code is for your reference:
Public Shared Function SetColor(Productid As integer, ByVal LineTotal As Double) As String
SetColor= "Transparent"
If Productid >= 20 Then
SetColor= "Green"
End IF
End Function
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Hi,
I Haven't used Vb.net, as I work on C#, But in SSRS it supports only VB.net code as custom coding, so i coded in c# and converted to VB.net from online converter. The code i got from online converter is working fine in local i.e when i preview in BI studio,
but when i try to deploy the same i'm getting error
Error 3
There is an error on line 12 of custom code: [BC30201] Expression expected.
0 0
Below is the code:
' -- Author : Jai Anand
' -- Date : 06-05-2014
' -- Discription : To split the given string of numbers and Assign the days for it,
' -- example: if integer 1 - (Su) --> Sunday, 2 - (Mo) --> Monday
public Function FindPlanDays(plandate As String) As String
Dim planarray As String() = New String() {}
Dim days As String = ""
planarray = plandate.Split(","C)
Dim i As Integer = 0
While i < planarray.Length
Dim day As String = If(planarray(i) = "1", "Su,", If(planarray(i) = "2", "Mo,",
If(planarray(i) = "3", "Tu,", If(planarray(i) = "4", "We,", If(planarray(i) = "5", "Th,", If(planarray(i)="6","Fr,", If(planarray(i) = "7", "Sa,", String.Empty)))))))
days = days & day
i += 1
End While
days = If(days <> String.Empty, " (" + days.TrimEnd(","C) + ")", days)
Return days
End Function
Kindly check the code, if any issue is there,give me the solution..Thank youHi,
I found the solution and the report is deployed . The issue was with If and we should suffix with space and underscore( _) at the end of the line break and continues in next line (i.e if the statement continues in next line).
iif has always been available in VB, even in VB6.
Dim day As String = Iif(planarray(i) = "1", "Su,","Mon")
It is not a true operator, as such, but a function in the Microsoft.VisualBasic namespace.
so the modified code which worked fine to deploy
' -- Author : Jai Anand
' -- Date : 06-05-2014
' -- Discription : To split the given string of numbers and Assign the days for it,
' -- example: if integer 1 - (Su) --> Sunday, 2 - (Mo) --> Monday
public Function FindPlanDays(plandate As String) As String
Dim planarray As String() = New String() {}
Dim days As String = ""
planarray = plandate.Split(","C)
Dim i As Integer = 0
While i < planarray.Length
Dim day As String = Iif(planarray(i) = "1", "Su," ,Iif(planarray(i) = "2", "Mo,", _
Iif(planarray(i) = "3", "Tu,", Iif(planarray(i) = "4", "We,", Iif(planarray(i) = "5", "Th,", _
Iif(planarray(i) ="6","Fr,", Iif(planarray(i) = "7", "Sa,", String.Empty)))))))
days = days & day
i += 1
End While
days = Iif(days <> String.Empty, " (" + days.TrimEnd(","C) + ")", days)
Return days
End Function -
F-32 for one time customer code
Hi,
This is related with F-32 cusomer open item processing. It involves some of these document type....billing type RV , DA i.e. credit memo and many other. After processing open item if debit credit matches with differnce zero system easily post the clearing doc. But when there is difference system passes one document for balance amount. like if more of RV billing doc it will show receivable or vice cersa more of DA type doc it will show advance received right?
Normally System automatically post document for this differnce figure. Document type AB i.e. now my customer will have open item with AB document type till next clearing. However in case of one time customer sytem simulates the documet. Pass first line item with document type AB for differntial amount but shows error 'correct first line litem before posting. '
When i open that line item, it shows business partner data i.e. customer adress is blank and if you filled up that system allows to post.
As per my analysis when i tried to do F-32 for other than one time customer code system flows this address (If more of RV
balance then from RB Billing Type or advance received i.e. more of DA type then that corrosponding document.) But in case of one time customer code we do not maintain master and therefore systm can not find out that adress deatils and ask for it before posting docuemnt. This is as per logic and correctly understandable.
But i want to know is there any other way or config through which system can automatically pick that adress data in case of AB document type for one time customer code?
Kindly note that it happens only with one time customer code and all other customer codes are doing perfect.
Kindly share your views.
Regtards,
Aks
Edited by: Akshatavyas on Nov 24, 2011 12:04 PMHi,
Thanks for your response.
But tell me one thing even adjustment document posting (doc type AB) system consider it as second transaction?
I feel one thing strange that my users never found such problem earlier.
I told them to find out any such scenario where system posted AB document for one time customer code.
If not then being this is first time case can be accept.
Secondly if volume is less then i don't think any abap development is required.
Bcaz anywez we can manually enter those customer address data for AB document type.
Regards,
AKS -
More than one VAT code on one line item?
Hello,
Running ECS SRM 5.0.
Is it absolutely impossible to set more than one VAT code on one order line in a SC or PO?
Can this be acomplished by using a user exit or anything?
This demand comes from a public sector company which pays different VAT dependent on what they use as account assignment. In some orders when split account assignment is used, it might be two different VAT codes on the same line.
rgds
GARHi
Which SRM version are you using ?
As far as i know, this is standard SRM functionality as it not feasible to have multiple VAT codes against one line item.. This is not possible .. Please confirm the same with SAP by creating a Customer OSS message.. Do let me know...
However this is possible by making the code as per your business requirments using BBP_DOC_CHANGE_BADI.. However, since i have not tried this.. You need to try this yourself..
Hope this will answer your query..
Regards
- Atul -
F-26 Customer code not showing on clearing document
Hello,
I usually run transaction F-26 to do customer clearings.
I dont know what happened for this customer that when I simulate the clearing document the customer line disappear.
The document is cleared normally but the customer code line item does not show on the clearing document (type "CM"-cheque)
PS: When I run F-26 I insert any bank account and amount 0.00 just to specify the document numbers on "additional selections"
I dont know why this happened just this time. I´ve analyzed customer master data on XD03 but I dont know if its something related to this.
What else could I check ?
Thanks,
AlexHi Kyoko,
I agree with you that system probably is working as intended, and also I don't think F-26 is the ideal transaction for this. Probably F-13 is more appropriated.
Anyway, the 2 documents for customer "Y" are with zero balance clearing too (the same as customer "X") but the customer line item appears on the clearing document.
We usually run F-26 to clear more than 2 customers also. We inform the document numbers on additional selection.
So I still need to know why the item line for customer "X" did not appear on clearing document
Regards,
Alex -
Grey out custom field in VA02 line item
Hi,
We have this custom field in sales line item which we want to grey out after billing is done. I tried many things but it didn't wrk. I wrote simple code w/o checking any billing condition like
if screen-name = 'VBAP-ZZFIELD'.
screen-input = 0.
endif.
modify screen.
but even this didn't wrk. Is there anything due to which the dynamic chging of screen fields attr has no effect ? Like if we set some attribute on screen field or ny thing else.
Thx.You did put the code in MV45AFZZ include, form USEREXIT_FIELD_MODIFICATION?
For example...
if sy-tcode eq 'VA01' or
sy-tcode eq 'VA02'.
if sy-dynnr = my_screen_no. "four digit screen no.
loop at screen.
case screen-name.
when 'TABLE-FIELDNAME' "exactly as it appears on that screen
screen-input = '0'.
modify screen.
endcase.
endloop.
endif.
endif. -
Using custom code in SSRS PDF rendering
Hi,
I have a written some custom code ( a simple function to maintain a counter ) in SSRS Report properties.
Everything works fine when I render the report in Report Viewer, but the custom code is not recognized when I render the report to PDF.
What is wrong with my code?
There is no error reported. The custom code is just getting skipped when I render to PDF.
My custom code is as follows..
Public Shared Dim iCounter AS Integer = 1
Public Function IncrementCounter(SomeValue As Boolean) As Boolean
iCounter = iCounter + 1
Return SomeValue
End Function
Public Function GetCounter() As Integer
Return iCounter
End Function
and my call to the custom code is..
=code.GetCounter()Hi ha_emp,
From your description, it seems that custom code work well when you preview the report. While it would be skipped when the report is exported to PDF. After testing the custom code in my environment,I find that the custom code will run again when exporting
the report, so when we run the report on Report Server and export it to PDF, the custom code will be run twice, the value will be counted twice.
Based on my research, I find that we can delete the “Shared” in the first row of the custom code to fix this issue. Then the custom code will works well on Report Server.
If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
I am trying to save a custom code snippet in Flash CC and it does not save, any ideas why? I am using Windows 8.1 with Flash CC.
I even when into the "Edit Code Snippet XML" and added a Custom folder and a custom template. Then I went back to add the code snippet again and it still did not work.
About line 32, I added:
<category title="Custom"
isBranch="true" expanded="false"
description="Code for common interactions">
<snippet isBranch="false">
<title>Custom Snippet</title>
<description>This is an example of a custom code snippet.</description>
<requiresSymbol>true</requiresSymbol>
<code><![CDATA[
// Code goes here
trace("A custom code snippet");
]]></code>
</snippet>
</category>
Any assistance would be greatly appreciated.UserAgent for the OP is - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100405 Namoroka/3.6.3 - he might be running a 64-bit 3rd party build.
-
PublishWorkflow error when workflow contains custom code activity
I've failed to get a custom code activity working within Workflow Manager 1.0 even though I believe I've performed all of the guidance steps provided.
As other posts, I get the usual 'cannot create unknown type' error:
client.PublishWorkflow( workflowName, @"..\..\TestWorkflow.xaml" );->
Cannot create unknown type '{wf://workflow.windows.net/$Current/$Activities}SendMailActivity'.
The activity is implemented as:
namespace SharedActivities
public sealed class SendMailActivity : CodeActivity
I've created an AllowedTypes.xml file containing the following:
<?xml version="1.0" encoding="utf-8" ?>
<AllowedTypes>
<Assembly Name="SharedActivities">
<Namespace Name="SharedActivities">
<Type>SendMailActivity</Type>
</Namespace>
</Assembly>
</AllowedTypes>
The SharedActivities assembly has the following Post Build event command line
net stop "Workflow Manager Backend"
%systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:"WorkflowMgmtPool"
xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
%systemroot%\system32\inetsrv\appcmd start apppool /apppool.name:"WorkflowMgmtPool"
net start "Workflow Manager Backend"Execution output : 1>------ Rebuild All started: Project: SharedActivities, Configuration: Debug Any CPU ------
1> SharedActivities -> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1> The Workflow Manager Backend service is stopping.......
1> The Workflow Manager Backend service was stopped successfully.
1>
1> "WorkflowMgmtPool" successfully stopped
1> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1> 1 File(s) copied
1> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
1> 1 File(s) copied
1> 1 file(s) copied.
1> 1 file(s) copied.
1> "WorkflowMgmtPool" successfully started.
1> The Workflow Manager Backend service is starting.
1> The Workflow Manager Backend service was started successfully.
1>
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
The assembly containing the custom activity is loaded into the Workflow host process.
I've configured my machine (development) to allow unsafe types.
I've also
uploaded my project so you can verify the implementation.
Thanks in advance, AdamI did following step in your VS project.
Remove SendMailActivity from TestWorkflow.Xaml
Commented out "[assembly: XmlnsDefinition("wf://workflow.windows.net/$Current/$Activities", "SharedActivities")]
" line from SharedActivities assemblyInfo.cs file
build the project
Added SendMailActivity activity in TestWorkflow.xaml
run the program.
Above steps seems to be working for me.. -
How to Generate a Custom Message for A Custom Code.
Hello,
Can anyone guide me on this -
Application : 11.5.10.2
We have a cutom Trigger through which we want to display a custom message.
We have re-generated the .msb, but it seems that something is missing.
Following are the Steps We have followed to generate a custom message.
1. Responsibility "Application Developer"
2. Go to Applications
3. Select Message
4. Define a new custom message.
5. Save
6. Run Request " Generate Message"
Now when the trigger gets fired , we are not able to see our Custom message.
How do we call this messge in the custom code.
Pl. help on this , also can i get some reference note id's on this.
Thanks in advance.
Regards,
JennyCREATE OR REPLACE TRIGGER KPC_RCV_TRANSACTIONS_INTERFACE
AFTER INSERT OR UPDATE ON APPS.RCV_TRANSACTIONS_INTERFACE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
--- This Trigger Validates following things
--- 1. Creation date is not modified and is greater than system date.
--- 2. RTV should not be possible before ERS is generated.
--- 3. Inspection should not be possible through Deliver Transactions Responsibility
--- 4. Delivery of Material should not be possible through Inspection Responsibility
--- 5. Item is Excisable and Excise Invoice No Or Excise Invoice Date is Missing
--- 6. Only Inspected and Accepted material is Delivered to Subinventory
--- 7. Check for Existance of 57F4 for Subcon Job Receipts
--- 8. Check Taxes are not Missing
--- 9. Check Taxes are Correct
--- Declaring The Variables
DECLARE
v_grade number := 0;
v_employee_id number := 0;
v_responsibility varchar2(100) := 'Z';
v_closed_taxes_count number := 0;
v_taxes_count number := 0;
v_invoiced_status_code varchar2(01) := 'N';
v_57f4_id number := 0;
l_date_ok varchar2(01) := 'N';
l_gate_date_ok varchar2(01) := 'N';
l_cenvatable_flag varchar2(01) := 'N';
l_excise_ok varchar2(01) := 'N';
l_rtv_ok varchar2(01) := 'N';
l_inspection_ok varchar2(01) := 'N';
l_delivery_ok varchar2(01) := 'N';
l_rej_delivery_ok varchar2(01) := 'N';
BEGIN
-- Get Looged in Responsibility Name
begin
SELECT upper(responsibility_name)
INTO v_responsibility
FROM apps.fnd_responsibility_vl
WHERE responsibility_id = apps.fnd_global.resp_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_responsibility := 'Z';
WHEN OTHERS THEN
v_responsibility := 'Z';
END;
--- Modifications Done by SMT to Bypass checking for following Users
if (apps.fnd_global.user_id < 1091) then
return;
end if;
--- if (apps.fnd_global.user_id in (1090,1111,1112,1126,1540,1591,1570,1881)) then
--- return;
--- end if;
---- Collect the Information Required from Other Tables
--- Check whether item is cenvatable
l_cenvatable_flag := 'N';
begin
select 'Y'
into l_cenvatable_flag
from apps.ja_in_po_line_location_taxes jipll
where upper(jipll.tax_type) in ('EXCISE','CVD')
and jipll.po_header_id = :new.po_header_id
and jipll.po_line_id = :new.po_line_id
and jipll.line_location_id = :New.po_line_location_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
l_cenvatable_flag := 'N';
WHEN OTHERS THEN
l_cenvatable_flag := 'N';
end;
--- Check whether Taxes are closed
v_closed_taxes_count := 0;
begin
select count(distinct jit.tax_id)
into v_closed_taxes_count
from apps.ja_in_tax_codes jit,
apps.ja_in_po_line_location_taxes jipl
where nvl(jit.end_date,sysdate)< sysdate
and jit.tax_id = jipl.tax_id
and po_header_id = :new.po_header_id
and po_line_id = :new.po_line_id
and line_location_id = :new.po_line_location_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_closed_taxes_count := 0;
WHEN OTHERS THEN
v_closed_taxes_count := 0;
end;
--- Check Existance of Taxes
v_closed_taxes_count := 0;
begin
select count(distinct jit.tax_id)
into v_taxes_count
from apps.ja_in_tax_codes jit,
apps.ja_in_po_line_location_taxes jipl
where nvl(jit.end_date,sysdate)< sysdate
and jit.tax_id = jipl.tax_id
and po_header_id = :new.po_header_id
and po_line_id = :new.po_line_id
and line_location_id = :new.po_line_location_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_taxes_count := 0;
WHEN OTHERS THEN
v_taxes_count := 0;
end;
--- Modifications Done by SMT to Get Invoice Status Code of the Original Transaction
v_invoiced_status_code := 'N';
BEGIN
SELECT 'Y'
INTO v_invoiced_status_code
FROM apps.ap_invoices_all ap,
apps.rcv_shipment_headers rcv
WHERE ap.invoice_num like '%'||rcv.receipt_num||'%'
AND ap.org_id = rcv.ship_to_org_id
AND rcv.shipment_header_id = :NEW.shipment_header_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_invoiced_status_code := 'N';
WHEN OTHERS THEN
v_invoiced_status_code := 'N';
END;
--- RAISE_APPLICATION_ERROR(-200151,'Incorrect Transaction Date...');
--- Check the transaction_date is correct or not
l_gate_date_ok := 'Y';
IF ((:new.ship_head_attribute6 is null) or
(to_date(:new.ship_head_attribute7,'DD-MON-YYYY') < (sysdate-3)) or
(to_date(:new.ship_head_attribute7,'DD-MON-YYYY') > sysdate)) then
l_gate_date_ok := 'N';
END IF;
--- Check the transaction_date is correct or not
l_date_ok := 'Y';
IF (to_date(:new.transaction_date,'DD-MON-YYYY') < to_char(sysdate,'DD-MON-YYYY')) then
l_date_ok := 'N';
END IF;
--- Check whether Excise Invoice No and Excise Date is present
l_excise_ok := 'Y';
if (l_cenvatable_flag = 'Y' and
:new.ship_head_attribute1 is null and
upper(:new.destination_type_code) = 'RECEIVING') then
l_excise_ok := 'N';
end if;
if (l_cenvatable_flag = 'Y' and
:new.ship_head_attribute2 is null and
upper(:new.destination_type_code) = 'RECEIVING') then
l_excise_ok := 'N';
end if;
--- Check whether Inspection transaction is being made in correct Responsibility
l_inspection_ok := 'Y';
if (upper(:new.destination_type_code) = 'RECEIVING') then
if (v_responsibility like '%RECEIPT%QA%') then
l_inspection_ok := 'Y';
else
l_inspection_ok := 'N';
end if;
else l_inspection_ok := 'Y';
end if;
--- Check whether Delivery transaction is being made in correct Responsibility
l_delivery_ok := 'Y';
if (upper(:new.destination_type_code) in ('INVENTORY','SHOP FLOOR')) then
if (v_responsibility not like ('%RECEIPT%QA%')) then
l_delivery_ok := 'Y';
else
l_delivery_ok := 'N';
end if;
else l_delivery_ok := 'Y';
end if;
--- Check whether RTV is made prior to generating the ERS Invoice
l_rtv_ok := 'Y';
if (upper(:new.transaction_type) in ('REJECT','RETURN TO VENDOR')) then
if (v_invoiced_status_code = 'INVOICED') then
l_rtv_ok := 'Y';
else
l_rtv_ok := 'N';
end if;
else l_rtv_ok := 'Y';
end if;
--- Check Error and Display Proper error message
--- Transaction Date Error
if (nvl(l_date_ok,'N') != 'Y') then
apps.fnd_message.set_name('FND','Wrong GRR Date');
apps.fnd_message.raise_error;
end if;
--- Gate Entry Date Error
if (nvl(l_gate_date_ok,'N') != 'Y') then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Wrong Gate Entry Date');
apps.fnd_message.raise_error;
end if;
--- Return CENVAT Error
if (nvl(l_excise_ok,'N') != 'Y') then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Enter Excise Invoice No');
apps.fnd_message.raise_error;
end if;
--- Return Closed Taxex Error
if (nvl(v_closed_taxes_count,1) != 0) then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Taxes Wrong');
apps.fnd_message.raise_error;
end if;
--- Return Taxes Missing Error
if (nvl(v_taxes_count,0) = 0) then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Taxes Missing');
apps.fnd_message.raise_error;
end if;
--- Return from trigger, if Transaction Type = 'RECEIVE'
if (upper(:new.transaction_type) = 'RECEIVE') then
return;
end if;
--- Return Inspection Error
if (nvl(l_inspection_ok,'N') != 'Y') then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Inspection Not Allowed');
apps.fnd_message.raise_error;
end if;
--- Return Material Delivery Error
if (nvl(l_delivery_ok,'N') != 'Y') then
apps.fnd_message.set_name('FND','KPC_RCV_CHEK:Delivery not Allowed');
apps.fnd_message.raise_error;
end if;
return;
END KPC_RCV_TRANSACTIONS_INTERFACE; -
Hi,
I am trying to write Custom Code in SSRS for Age Calculation for two requirements in the same report,But report is giving error #Error in expression with my below code.
whole logic is same for both but only two lines are different,Do i need create two functions or can i use them in one function.Please guide me.
1)Age in Years (Ex: 4)
2) Age in Years + months (ex: 3 Years 6 months)
My SSRS Custom Code:
Public Shared Dim Years as Integer
Public Shared Dim Months as Integer
Public Shared Dim Days as Integer
Public Shared Dim Age as Integer
Public Shared Function CalAge(ByVal D1 As Datetime,ByVal D2 As Datetime ) As Integer
Years=Year(D1)-Year(D2)
Months=Month(D1)-Month(D2)
Days=Day(D1)-Day(D2)
If Days < 0 then
Months=Months-1
End if
If Months < 0 then
Years=Years-1
End if
If Months < 0 then
Months=Months+12
End If
Return Years
If Months=1 then
Age=Years+" Years " + Months + "Month"
else
Age=Years+" Years " + Months + "Months"
End If
Return Age
End Functionhi Guys,
I have finally changed my custom code to below :
Public Shared Dim Years as Integer
Public Shared Dim Months as Integer
Public Shared Dim Days as Integer
Public Shared Function CalAge(ByVal D1 As Datetime,ByVal D2 As Datetime ) As Integer
Days=DatePart(DateInterval.Day,D1)-DatePart(DateInterval.Day,D2)
Months=DatePart(DateInterval.Month,D1)-DatePart(DateInterval.Month,D2)
Years=DatePart(DateInterval.Year,D1)-DatePart(DateInterval.Year,D2)
If Days < 0 then
Months=Months-1
End If
If Months < 0 then
Years=Years-1
End If
If Months < 0 then
Months=Months+12
End If
Return Years
End Function
Public Shared Function CalMon(ByVal D3 As Datetime,ByVal D4 As Datetime ) As Integer
Days=DatePart(DateInterval.Day,D3)-DatePart(DateInterval.Day,D4)
Months=DatePart(DateInterval.Month,D3)-DatePart(DateInterval.Month,D4)
Years=DatePart(DateInterval.Year,D3)-DatePart(DateInterval.Year,D4)
If Days < 0 then
Months=Months-1
End If
If Months < 0 then
Years=Years-1
End If
If Months < 0 then
Months=Months+12
End If
Return Months
End Function
and using expression in SSRS fo display like this :
=IIF((Code.CalMon(Parameters!AgeCalcDate.Value,Fields!StudentBirthDate.Value))=1,Code.CalAge(Parameters!AgeCalcDate.Value,Fields!StudentBirthDate.Value) & " Years " & Code.CalMon(Parameters!AgeCalcDate.Value,Fields!StudentBirthDate.Value)
& " Month ",
Code.CalAge(Parameters!AgeCalcDate.Value,Fields!StudentBirthDate.Value) & " Years " & Code.CalMon(Parameters!AgeCalcDate.Value,Fields!StudentBirthDate.Value) & " Months ")
got the correct solution.
Maybe you are looking for
-
I'm using 17.0.1. AdBlock Plus has disappeared on me, and I can't find it. I tried reinstalling it, but that didn't work. I went to the extensions list, but all I get is a blank page. I already tried going into my profile folder and removing the exte
-
Cl_gui_alv_grid cursor problems
Hi , Hi i have a alv which contains 10 rows and a delete icon on tool bar if i select 10 th row and delete it then the coursor goes to 1st row if i select 5 th row and delete it then the cursor goes to 6th row .....which variable is controlling cur
-
Formatting for cubes and dimensions
Is it possible to use different formatting on the cubes and dimensions in the subject area in OBIEE? We're on 11.1.1.6.2. Our report writers want to easily be able to differentiate between the 2. Can we make the cubes bold or use a different font or
-
BDC - How we can identify errors in Transaction method?.
Hi , How we can identify errors in Transaction method?. Regards Nikhil V Kumar
-
OSD: install software DURING task sequence based upon collection membership
Hi, I'd like to refer to my previous post as a starting point. Below again the background of my question. But please advise on a powershell script that runs at the end of a task sequence that: *enumerates the pc's collection memberships and based upo