Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have to develop an ABAP report program. After it's execution, I have to display a popup with evaluating it's performance. It's possible? I mean without using transaction SAT.
The scenario is simple:
1) Run report from se38 or it's using related tcode
2) After running - display the performance.
Please give me any idea how to do that. Thank you.
I assume that you want to measure the runtime of the report.
So, you could easily save the timestamp of the beginning of the program into an variable and when the execution logic finished, you can get another timestamp.
If you subtract timestamp 1 from timestamp 2, you have your running time.
For simple measurements you can you this snippet:
DATA: t1 TYPE i,
t2 TYPE i.
DATA: gt_tabrows TYPE TABLE OF exp_tablrows,
toff TYPE p DECIMALS 2.
GET RUN TIME FIELD t1.
SELECT tabname
FROM dd02l
INTO CORRESPONDING FIELDS OF TABLE gt_tabrows
WHERE tabname LIKE 'Y%'.
CALL FUNCTION 'EM_GET_NUMBER_OF_ENTRIES'
TABLES
it_tables = gt_tabrows.
GET RUN TIME FIELD t2.
toff = t2 - t1.
cl_demo_output=>new( )->begin_section(
|Y tables recordcount calculation:|
)->write_text(
| { toff } microseconds|
)->write_data( gt_tabrows )->display( ).
This sample outputs runtime of code calculating recordcounts of tables that start with Y.
If you run your programm in backgroup, the job-log gives you all your needed information.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 months ago.
Improve this question
I was wondering if you can help with below
I need to write have a conditional column for 3 month prior to review date
So, I have "review dates" column which contains review dates, and need something along the lines of "IF 3 months left before "Review Date" them then ALERT, otherwise NO ALERT"
Ideally to have rolling code so I don't have to alter it manually every time dates change
Any help will be greatly appreciated
Not sure how to approach
Yeap, I guess you can! but compare against what ? Today's date? If It is so, then Please create a new calculated column, and try this code! let me know If It is what you are looking for!
Logical_Result =
VAR NowIsTheTime =
NOW ()
RETURN
IF (
DATEDIFF ( YourTable[ReviewDate], NowIsTheTime, MONTH ) < 3,
"ALERT",
"NO ALERT"
)
If we test it on a table as column, It gives us:
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Show transaction details – SB a/c no., transaction type, date, description and amount, for transaction amounts > 1000. Sort the output based on a/c no, transaction type and date.
The way you described it, that would be something like this:
select sb a/c no., transaction type, description, amount
from some table
where amount > 1000
order by a/c no, transaction type, date
Of course, it won't work, column names can't have those names (at least, some of them), but - you didn't put much effort in question, so don't expect miracle on my side.
Also, what does "solution is not getting accepted" mean?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to allow users to be able to filter the Power BI bar chart with the following options:
GDP only (see only Country A, B, C GDP data only when GDP is selected on slicer)
Population only
GDP and Population
my current data structure(in excel) looks like this and it gets the job done but the duplication of the "Country" field seems inefficient:
is there a way to achieve the same 3 filtering options without duplicating the "Country" field?
my ideal data structure is:
Try this solution.
First, create an additional table with all your option.
I name this table as "support"
Second create measure
_GDP = CALCULATE(SUM(GDP_Population[GDP]),FILTER(GDP_Population, SELECTEDVALUE('support'[Option]) in {"Both","GDP"}))
_Population = CALCULATE(SUM(GDP_Population[Population]), FILTER(GDP_Population, SELECTEDVALUE('support'[Option]) in {"Both","Population"}))
and put it to your visual
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm still working on my university tasks and here I have to create trigger on table
MARRIAGE(ID_marriage, Date_of_wedding, Date_of_divorce);
which would work on UPDATE statement so that if someone tries to add or edit date_of_divorce it would make sure that it is AFTER date_of_wedding.
Here's how example of data looks:
ID_marriage | Date_of_wedding | Date_of_divorce
1 39/04/12 39/04/12
2 71/04/12 null
Now my question is how do I compare such dates in PL/SQL?
Thanks in advance!
No need for a trigger, a check constraint will work do:
alter table marriage
add constraint check_divorce
check (date_of_divorce is null or date_of_divorce > date_of_wedding);
As for the trigger, you need to compare the values of new.date_of_divorce and new.date_of_wedding - essentially the same condition as I have used in the check constraint. If the date_of_divorce is bigger you need to raise an exception to abort the insert or update statement.
As this is a school project, I won't give you the full code, you should find the correct syntax on your own.
The relevant chapters in the manual are:
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/triggers.htm#LNPLS99955
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#LNPLS00705
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/triggers.htm#LNPLS781
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a table which contains a field of type VARCHAR2 and length of 255, which I use to store URLs. Running a SELECT query on it returns the data, as below:
SELECT URL FROM SERVICE WHERE ID = 1
returns the URL I have stored (in this case, file:///test.url/ is returned).
Running the same thing from a stored procedure, however, I get an empty box. All my other fields are filled in, and I get no errors about it. The URL field definitely contains the data, and I have made sure that the variable it is passed into is big enough to support it.
My question is this: in order to pass a URL-esque string out via a stored procedure, do I need to handle it in a particular way? A discussion with work colleagues about this presented the idea that the characters in the URL string may be causing some form of escape clause to be triggered, but I couldn't locate any further information on the subject.
EDIT: Part of the stored procedure used:
SELECT ...,
USER.SERVICE.URL,
...
FROM USER.SITE
-- More joins
INNER JOIN USER.SERVICE
ON USER.SITE.URLID = USER.SERVICE.ID
-- More joins
WHERE USER.SERVICE.ID = 1...
like he said, you only execute the select but you're not storing it. you need to store the value of the field on a variable. In order to use it inside of a store procedure or package, you need to store it on a variable just like this
SELECT field INTO var FROM table
remember you don't need to handle it on a special way, because it's just a simple string. your procedure should look like this.
CREATE PROCEDURE DEMO(R_URL OUT VARCHAR2) IS
BEGIN
SELECT URL INTO R_URL FROM DUAL;
END;
You're running this from a stored procedure. That means you need to select it into a variable. From the sounds of it you're exposing the selected data to a client application, which means you need to pass it out somehow, e.g. by OUT parameters.
So one possible answer to your problem is that you are not populating the variable you think you're populating, or you're not passing the value to an OUT parameter (or whatever).
Anyway you bounce it, this is a debugging scenario. If you can't post your code here (and I'm sure I speak for us all when I say I really don't want to pore over your large chunk o'code) then you'll need to go through it yourself.