How to find gaps(on 10.2)
Input Data -
date from to
20.04.2009 5001 5006
20.04.2009 5820 5823
21.04.2009 3121 3124
Required Output -
date gaps
20.04.2009 5002
20.04.2009 5003
20.04.2009 5004
20.04.2009 5005
20.04.2009 5821
20.04.2009 5822
21.04.2009 3122
21.04.2009 3123
Thanks.
Hi,
Join your table to a counter table, that has all the integers from 1 to (to_val - from_val):
WITH cntr AS
( -- Begin counter table
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL < = ( -- Begin scalar sub-query to find biggest from-to difference
SELECT MAX (to_val - from_val)
FROM table_x
) -- End scalar sub-query to find biggest from-to difference
- 1
) -- end counter table
SELECT x.dt
, x.from_val + c.n AS gaps
FROM table_x x
JOIN cntr c ON c.n < x.to_val - x.from_val
ORDER BY x.dt
, c.n;
Similar Messages
-
How to find gaps in data?
Hi!
I have the following problem.
Data:
range_id actual_nr
AAA 001AAA
AAA 002AAA
AAA 003AAA
AAA 006AAA
AAA 007AAA
AAA 009AAA
BBB 001BBB
BBB 002BBB
etc.
I have to get report in the following form
from to nr_of_rows
001AAA 003AAA 3
006AAA 007AAA 2
009AAA 1
001BBB 002BBB 2
etc.
As you can see if there is a gap in sequence then I have to calculate how many rows were in sequence before the gap.
Can somebody give me some hints or even working statement?How's this?
WITH
Sample_Data
AS
SELECT 'AAA' range_id, '001AAA' actual_nr FROM Dual UNION ALL
SELECT 'AAA' range_id, '002AAA' actual_nr FROM Dual UNION ALL
SELECT 'AAA' range_id, '003AAA' actual_nr FROM Dual UNION ALL
SELECT 'AAA' range_id, '006AAA' actual_nr FROM Dual UNION ALL
SELECT 'AAA' range_id, '007AAA' actual_nr FROM Dual UNION ALL
SELECT 'AAA' range_id, '009AAA' actual_nr FROM Dual UNION ALL
SELECT 'BBB' range_id, '001BBB' actual_nr FROM Dual UNION ALL
SELECT 'BBB' range_id, '002BBB' actual_nr FROM Dual
SELECT
MIN(actual_nr_start) actual_nr_start,
actual_nr_finish,
MAX(Total)
FROM
SELECT
range_id,
MIN(actual_nr) actual_nr_start,
MAX(actual_nr) actual_nr_finish,
MAX(Level) Total
FROM
Sample_Data
CONNECT BY
range_id = PRIOR range_id
AND substr(actual_nr, 1, 3) = substr(PRIOR actual_nr, 1, 3) + 1
GROUP BY
range_id,
CONNECT_BY_ROOT actual_nr
GROUP BY
actual_nr_finish
ORDER BY
SubStr(actual_nr_start, -3),
actual_nr_start;Message was edited by:
Brian Tkatch 2
consolidated two levels. -
How to find total number of records in a BDoc?
Dear all,
I have replicated about BP 1088 records from ISU into CRM system with block size 100. Technically on SMW01, for each successfully processed BDoc, there will be 100 records (corresponds to 100 block size). But due to some failed BDocs, not all "successfully" BDocs will have 100 records each, some may have only 1 record inside...or 30...or 88 for example. So, may i know how to find or is there a report i can look into to find the total number of records clearly shown for each of the successfully processed green status BDocs???
Please help and points will be rewards!!
Thank You
Best Regards,
CKI am just showing this to show how to get the rowcount along with the cursor, if the program has so much gap of between verifying the count(*) and opening the cursor.
Justin actually covered this, he said, oracle has to spend some resources to build this functionality. As it is not most often required, it does not makes much sence to see it as a built-in feature. However, if we must see the rowcount when we open the cursor, here is a way, but it is little bit expensive.
SQL> create table emp_crap as select * from emp where 1 = 2;
Table created.
SQL> declare
2 v_cnt number := 0;
3 zero_rows exception;
4 begin
5 for rec in (select * from (select rownum rn, e.ename from emp_crap e) order by 1 desc)
6 loop
7 if v_cnt = 0 then
8 v_cnt := rec.rn;
9 end if;
10 end loop;
11 if v_cnt = 0 then
12 raise zero_rows;
13 end if;
14 exception
15 when zero_rows then
16 dbms_output.put_line('No rows');
17 end;
18 /
No rows
PL/SQL procedure successfully completed.
-- Now, let us use the table, which has the data
SQL> declare
2 v_cnt number := 0;
3 zero_rows exception;
4 begin
5 for rec in (select * from
6 (select rownum rn, e.ename from emp e)
7 order by 1 desc)
8 loop
9 if v_cnt = 0 then
10 v_cnt := rec.rn;
11 dbms_output.put_line(v_cnt);
12 end if;
13 end loop;
14 if v_cnt = 0 then
15 raise zero_rows;
16 end if;
17 exception
18 when zero_rows then
19 dbms_output.put_line('No rows');
20 end;
21 /
14
PL/SQL procedure successfully completed.Thx,
Sri -
How to do GAP analysis ?
Hi Experts,
How to do GAP analysis ? I have a BW problem statement about SD module. I have to do a GAP analysis. I am doing it for the first time. So any suggestion about the approach to start it ?
ThanksThe gap analisys is the analisys on what are the difeerences between actul system and what the customer want to develop.
GAP Analysis in simpler terms refers to study of existing state of system and desired state of system, there by identifying the gap between states. In the context of SAP, GAP analysis is very important before implementation of SAP system. The implementation team should study what is that an SAP system can provide for each business process and what is the actual business process. One should evaluate each such gap and should find out the ways to fill the gap. The gap might be filled in different ways: System enhancements, custom ABAP code development, interfaces with some other external systems. etc.
In the Enterprise Systems field, GAP Analysis is a process done while bleprinting the solution and aimed to discover the gaps between the user requirements and the "off-the-shelf" (or packaged) solution. For example you want to implement an ERP system , you do a GAP Analysis to assess gaps between the processes supported by that System and the process as executed by the organization that will be implementing the solution.
In the SAP BI area, we do a GAP Analysis to map between our logical and physical BI solution design and the Business Content that SAP offers. Business Content is a set of preconfigured BI objects aimed to save us valuable time when developing BI solutions by providing the "best practices" for that functional domain.
The reason we do a GAP analysis in BI is to find out whether we can save ourselves a lot of time by implementing a Business Content solution instead of developing from scratch.
In simple terms: Gap means small cracks. In SAP world or in Information Technology world, gap analysis is the study of the differences between two different information systems or applications( ex; existing system or legacy system with Client and new is SAP), often for the purpose of determining how to get from one state to a new state. A gap is sometimes spoken of as "the space between where we are and where we want to be."
Gap Analysis is undertaken as a means of bridging that space. Actual Gap Analysis is time consuming and it plays vital role in Business BlueprintAS IS Process stage.
A through Gap Analysis will identify the gaps between how the business operates and its needs against what the package can can't do. For each gap there will be one of three outcomes which must be recorded and actioned,
1. GAP must be closed and customised software can be developed
2. GAP must be closed but software cannot be written therefore a workaround is required
3. GAP does not need to be closed.
A point worth mentioning here is that at time people confuse between user-exits and Gap Analysis. User exits are standard gate ways provided by SAP to exit the standard code and we can write our own code with the help of ABAP workbench, its not new functionality which we are trying to build in sap but its slight enhancement within the same code.
Gap analysis is start point of Realization and once business Blueprint is finished we have to find the realization of sap system for client requirment and there will be certain gaps when compared to system fit. Those gaps can be closed either by re-engineering of business process to fit with SAP or we have to use USER exits in case of small deviations or complete enhancements with the help of ABAP to fit with the SAP system.
The Gaps can differ from company to company. Most commonly, however, missing functionality is industry-specific.
Examples:
1. MGM Studios and Lycos sometime back worked with SAP to develop its new intellectual property management and media advertising management functionality, respectively.
2. A leading Oral care product company wanted the promotion of free-goods where they wanted 'Buy one get 2 different products free'.
for more info check these links
Re: A bit confused with your Gap Analysis example
http://www.9000resource.com/what_is_gap_analysis/what_is_an_iso_9001_gap_analys_1.php?gclid=CMKw-6fh0YoCFRsRQQodczGGew
http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/Management/ASAP_Links.html
Re: gap analysis -
Discoverer Report: How to find Business Area name from Report Name.
Hi
I opened a report in Disco Desktop 4 -> Resonsibiolity --> Report Name.
So I know Report name but don’t know which Business Area it belongs to.
How to find Business Area Name from Report Name?
Cheers
VijayHi,
There is no relationship between reports and business areas. Each report can be built from many folders. Each folder can be in many business areas.
However you can try the following SQL which may give you the result you want for an v5 EUL. You will have to modify for Discoverer 4 EUL:
select distinct doc_name, obj.obj_name folder_name, bas.ba_name
from eul_us.eul5_documents doc
, eul_us.eul5_elem_xrefs xref
, eul_us.eul5_expressions exp
, eul_us.eul5_objs obj
, eul_us.eul5_ba_obj_links bol
, eul_us.eul5_bas bas
where xref.ex_from_id = doc.doc_id
and doc.doc_name = &your_report
and xref.ex_to_id = exp.exp_id
and obj.obj_id = exp.it_obj_id
and bol.bol_obj_id = obj.obj_id
and bas.ba_id = bol.bol_ba_id
Rod West -
How to find a specific word in sentence in each line?
How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
Go ballet class next Wednesday.
On the Wednesday is going to swim class.
We have a meeting on Thursday at Panda's.
Then it will show the output:
Wednesday : ballet class
Wednesday : swim class
Thursday: meeting at Panda's
I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
a specific word in sentence but how I should make Output for specific word and some words from sentence.
For example:
Input:
+"On Thursday go to ballet class"+
+"Swim class on Friday one time a month at 2 p.m."+
I used the codes for that:
class FindSchedule{
String firstline = "On Thursday go to ballet class ";
String secondline = "Swim class on Friday one time a month ";
FindSchedule(){
System.out.println(firstline + findTheIndex("Thursday", firstline));
System.out.println(secondline + findTheIndex("Friday", secondline));
public int findTheIndex(String word, String sentence){
int index;
index = sentence.indexOf(word);
return index;
public static void main (String[] args){
new FindSchedule();
}The output will be:
Thursday: ballet class
Friday: 14:00 swim class one time a week
Notice that time is changing in output complete different from input.
I need to find out how to extract some words from each sentence for output. Do you know how to do it? -
How to find out the user-exits?
hi.
how to find out the user-exits?
regards
eswar.Hi,
*& Report ZEXITFINDER
*report zexitfinder.
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*& Tables
tables : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
*& Selection Screen Parameters
selection-screen begin of block a01 with frame title text-001.
selection-screen skip.
parameters : p_tcode like tstc-tcode obligatory.
selection-screen skip.
selection-screen end of block a01.
*& Start of main program
start-of-selection.
Validate Transaction Code
select single * from tstc
where tcode eq p_tcode.
Find Repository Objects for transaction code
if sy-subrc eq 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir
where pname = tstc-pgmna.
select single * from enlfdir
where funcname = tfdir-funcname.
select single * from tadir
where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name = enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
Find SAP Modifactions
select * from tadir
into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.
Take the user to SMOD for the Exit that was selected.
at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen.
Regards -
How to find out the Transactions used per month & the USER who used that
Hi,
1)How to find out the Transactions used per month & the USER who used that?
2)and can i get the above same for minimum 20 month?
System : SAP- Enterprise Core Component.You can use my program...
*& Report Z_ABAP_TCODE_MONITOR
*****& Program Type : Report *
*****& Title : Z_ABAP_TCODE_MONITOR *
*****& Transaction code : ZTCODE_USAGE *
*****& Developer name : Shailendra Kolakaluri *
*****& Deveopment start date : 26 th Dec 2011 *
*****& Development Package : ZDEV *
*****& Transport No : DEVK906086 *
*****& Program Description : This program is to display
*List all tcodes executed during previous day.
*& Show the number of users executing tcodes
*& Modification history
REPORT Z_ABAP_TCODE_MONITOR.
*& List all tcodes executed during previous day.
*& Show the number of users executing tcodes
TYPE-POOLS : slis.
DATA: ind TYPE i,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
layout TYPE slis_layout_alv,
variant TYPE disvariant,
events TYPE slis_t_event WITH HEADER LINE,
heading TYPE slis_t_listheader WITH HEADER LINE.
*REPORT z_report_usage.
TYPES: BEGIN OF zusertcode,
date TYPE swncdatum,
user TYPE swncuname,
mandt TYPE swncmandt,
tcode TYPE swnctcode,
report TYPE swncreportname,
count TYPE swncshcnt,
END OF zusertcode.
*data : date type n.
DATA: t_usertcode TYPE swnc_t_aggusertcode,
wa_usertcode TYPE swncaggusertcode,
wa TYPE zusertcode,
t_ut TYPE STANDARD TABLE OF zusertcode,
wa_result TYPE zusertcode,
t_result TYPE STANDARD TABLE OF zusertcode.
PARAMETER: month TYPE dats DEFAULT sy-datum.
*PARAMETER: date TYPE dats.
*select-options : username for wa_usertcode-account.
START-OF-SELECTION.
PERFORM get_data.
PERFORM get_fieldcatalog.
PERFORM set_layout.
PERFORM get_event.
PERFORM get_comment.
PERFORM display_data.
FORM get_data .
*date = sy-datum - 2 .
After start-of-selection add this line (parameter Month required 01 as day).
concatenate month+0(6) '01' into month.
CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
EXPORTING
component = 'TOTAL'
ASSIGNDSYS = 'DEV'
periodtype = 'M'
periodstrt = month
TABLES
usertcode = t_usertcode
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
wa-date = month.
*wa-date = date.
wa-mandt = sy-mandt.
wa_usertcode-account = username.
LOOP AT t_usertcode INTO wa_usertcode.
wa-user = wa_usertcode-account.
IF wa_usertcode-entry_id+72 = 'T'.
wa-tcode = wa_usertcode-entry_id.
wa-report = space.
ELSE.
wa-tcode = space.
wa-report = wa_usertcode-entry_id.
ENDIF.
COLLECT wa INTO t_ut.
ENDLOOP.
SORT t_ut BY report ASCENDING.
CLEAR: wa, wa_result.
endform.
FORM get_fieldcatalog .
fcat-tabname = 't_ut'.
fcat-fieldname = 'DATE'.
fcat-seltext_l = 'Date'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'MANDT'.
fcat-seltext_l = 'Client'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'USER'.
fcat-seltext_l = 'User Name'.
fcat-key = 'X'.
APPEND fcat.
CLEAR fcat.
fcat-tabname = 't_ut'.
fcat-fieldname = 'TCODE'.
fcat-seltext_l = 'Transaction Code'.
fcat-key = 'X'.
APPEND fcat.
ENDFORM.
*& Form SET_LAYOUT
text
--> p1 text
<-- p2 text
FORM set_layout .
layout-colwidth_optimize = 'X'.
ENDFORM. " SET_LAYOUT
*& Form GET_EVENT
text
--> p1 text
<-- p2 text
*FORM get_event .
events-name = slis_ev_top_of_page.
events-form = 'TOP_OF_PAGE'.
APPEND events.
*ENDFORM. " GET_EVENT
**& Form GET_COMMENT
text
--> p1 text
<-- p2 text
*FORM get_comment .
DATA: text(30).
text = 'Billing Report'.
heading-typ = 'H'.
heading-info = text.
APPEND heading.
*ENDFORM. " GET_COMMENT
**& Form top_of_page
text
--> p1 text
<-- p2 text
*FORM top_of_page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading[]
I_LOGO =
I_END_OF_LIST_GRID =
*ENDFORM. " top_of_page
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM display_data .
sort t_ut[].
DELETE ADJACENT DUPLICATES FROM t_ut[] COMPARING ALL FIELDS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = layout
it_fieldcat = fcat[]
i_save = 'A'
is_variant = variant
it_events = events[]
TABLES
t_outtab = t_ut
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " DISPLAY_DATA -
How to find out the person who did a transport.
How to find out the person who did a transport.
There are 3 basis admins in our Org.
so is there a way of tracing out , who did what transport.
Regards,- Goto import Overview (STMS)
- Import Queue
- Select DEV req (goto Import History)
- Edit - Display More
It will show the user who did the transport
Rgds -
How to find out the user who has created a new field in the custom table.
How to find out the user details who has created a new field in the custom table.
Thanks,
JoanHi Jesudasan ,
You can know the user details with version management.Please find the
below procedure to know.
Go to table->Utilities tab->version->Version management->Compare the previous one .
Hope this solves the issue,Let me know if you have any issues.
Thanks,
Rajani -
How to find out web-inf path from the physical drive?
How to find out web-inf path from the physical drive?
I have some user profiles in web-inf directory.SO I want to know the path from root directory like
d:/program files/allaire/jrun/appname/web-inf/profiles/username like that.
Presently I am able to get the path upto the application directory and from that I am concatinationg web-inf/profiles/username .
But it is giving problems when it is deployed under unix or linux.Because web-inf there it treats as WEB_INF
SO I want to get the path of web-inf directory with out hard coding.
ThankuString path = application.getRealPath("/WEB-INF/profiles/username");
Note sure why you need this, but you don't need the real path to read the file - you can get an InputStream using the relative path. See ServletContext getResource() and getResourceAsStream(). -
How to find out appropriate user exit
Hi,
I want to know how to find out the user exit that matches to the requirement. Suppose for a material master program, there are so many include programs hence im unable to find call custer-function and even unable to debug an appropriate include. Please help me out how to learn user exits in a rightious way.
Thanks
BasuLook for program SAPICSS_ in your system and run it. This program can also be found under CMOD menu: Utilities -> SAP enhancements.
This will only give you the CMOD user exits.
There is a program someone made that searches for all sorts of user-exits (including BADI's etc.). I remember that it was posted on sapfans.com
Edited by: Maen Anachronos on Apr 6, 2009 3:22 PM -
How to find out FICO user exits that are used by User
How to find out the FICO user exits that are used by user.
Go to tcode CMOD. In the project field drop down your list there. Put a Z* there and run the list. These should be all the exits that are activated. Search for the ones that pertain to FI. You can also search by development class. You need a little ABAP knowledge to search easily. You get this by going to the tcode then to status then to the program then to the attributes. There you find the development class. Ie FBAS.
pls assign points if helpful as a way to say thanks. -
How to find out list of variants in TVARV table
hi!
can anybody can guide me on the following issues? plz
How to list all variants in TVARV table?
How to find out any Z* programs that writes to TVARV table, using the variant name?
How to find out the programs which are reads the TVARV data into a program variant?
Thanks & Regards,
vijayOr some help might be useful:
http://help.sap.com/saphelp_47x200/helpdata/en/c0/98037ae58611d194cc00a0c94260a5/frameset.htm
Regards,
Subramanian V. -
How to find out list of users who have access to particulat SID
HI
How to find out the list of users who has access, to a particular SID?
Satish.jurjen,
Thanks for replying, actually i was trying to navigate and execute the report using, SUIM...
could you help me to find out the list of users who has access to a particular system.. using SUIM.
satish.
Maybe you are looking for
-
The error message says: Runtime Error! Program: C:\Temp\AIR9923.tmp This application has requested the runtime to terminate in an unusual way. I get the same message for every application I try and install. InDesign CS5.5 is already installed. Runnin
-
Hello, My Ipad 2 just became entirely unresponsive. I've had it for only a couple months, and yesterday updated the software for the first time since I got it. It had plenty of power left when I left it last (this morning) and now won't respond to an
-
Hi, I have a requirement were in i need to get all the employees personel number based on the sales office and calculate the gmd , revenue and profits.Sales employees are divided on the base of software or hardware or services with there correspondin
-
Hi All, After creating sample order i am getting delivery block when I save it with a material price erro,This is a sample so there should be no pricing.I chked item category & order type no issue in that, Kinldy help
-
Only 1st RTMP bitrate for HTTP Live Streaming works
Using this on AWS with cloudfront/cloudformation. When I created new Cloudformation, my first RTMP will works. i.e I publish at 500kbps. Then if I stop and send single bitrate at say 800kbps, it will not works. i.e OSMF will keep buffering. SSH to my