Hit detection between a line and a UIView?

Hi all,
I'm trying to figure out if a UIView I've got on the screen is intersecting a line I'm drawing.
Here's the code for drawRect:
-(void)drawRect:(CGRect)rect
// Get the current graphics context and clear it
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClipToRect(ctx, CGRectMake(0, 0, 240, 320));
CGContextClearRect(ctx, rect);
// The line style
CGContextSetLineWidth(ctx, 3.0);
CGContextSetLineCap(ctx, kCGLineCapRound);
CGContextSetRGBStrokeColor(ctx, 1.0, 1.0, 1.0, 1.0);
// Create the line
CGContextMoveToPoint(ctx, source.x, source.y);
CGContextAddLineToPoint(ctx, dest.x, dest.y);
// Draw the line
CGContextDrawPath(ctx, kCGPathStroke);
CGContextStrokePath(ctx);
That draws a line from and to wherever I need it, but when I draw it over a UIView that's already on the screen, I need to know if the centre point of the UIView is on that line. So, if you have a line going from 0,0 to 10,10, you have points at 1,1 2,2 3,3 ... 10,10. If the centre point of the UIView is at, say, 3,3, it would be on that line.
I've seen use of the CGContextPathContainsPoint method, but I can't get it working - my line doesn't draw. Here's the code for drawRect:
-(void)drawRect:(CGRect)rect
// Get the current graphics context and clear it
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClipToRect(ctx, CGRectMake(0, 0, 240, 320));
CGContextClearRect(ctx, rect);
// The line style
CGContextSetLineWidth(ctx, 3.0);
CGContextSetLineCap(ctx, kCGLineCapRound);
CGContextSetRGBStrokeColor(ctx, 1.0, 1.0, 1.0, 1.0);
// Create the path
CGMutablePathRef linePath = CGPathCreateMutable();
// Move to the source point and add a line to the destination point
CGPathMoveToPoint(linePath, NULL, source.x, source.y);
CGPathAddLineToPoint(linePath, NULL, dest.x, dest.y);
// Draw the line
CGPathDrawingMode(kCGPathStroke);
CGContextDrawPath(ctx, kCGPathStroke);
CGContextStrokePath(ctx);
// Save the graphics state before doing the hit detection
CGContextSaveGState(ctx);
CGPathRef path = linePath;
CGContextAddPath(ctx, path);
if(CGContextPathContainsPoint(ctx, baddie, kCGPathStroke)) {
NSLog(@"Yes");
CGContextRestoreGState(ctx);
I'm clearly doing something wrong here, but I can't quite figure it out.
Any help much appreciated!

I'm tearing my hair out with this. This is simple maths!!! Every point I put into the formula works fine, but when it's in code it fails. I think it's something to do with the frame I'm using...
This is set in the init method:
CGRect frame = CGRectMake(40.0, 60.0, 240.0, 320.0);
The source and destination of the line I'm drawing, and the point I want to check (myPoint) are passed in and set up as follows (in their respective setter methods):
source = CGPointMake(pos.x - 40.0, pos.y - 60.0);
dest = CGPointMake(pos.x - 40.0, pos.y - 60.0);
myPoint = CGPointMake(pos.x - 40.0, pos.y - 60.0);
They have 40 and 60 pixels removed as the co-ords I'm passing in are the location on the iPhone screen (320x480). I have to subtract those values to get the top-left corner of the frame I'm drawing into, i.e. 40, 60 on the screen is actually 0, 0 of the frame.
Now I draw the line in the drawRect method:
CGMutablePathRef linePath = CGPathCreateMutable();
CGPathMoveToPoint(linePath, NULL, source.x, source.y);
CGPathAddLineToPoint(linePath, NULL, dest.x, dest.y);
And here's where I check whether the point has touched the line:
float m = (source.y - dest.y) / (source.x - dest.x);
float y = (m * (source.x - myPoint.x)) + myPoint.y;
if((y >= source.y - 3) && (y <= source.y + 3) && (myPoint.x >= source.x) && (myPoint.x <= dest.x)) // ±3 pixels for tolerance
NSLog(@"Point hit the line!");
What am I doing wrong?!
The whole premise of my game rests on this one simple little problem. I've spent two weeks writing the rest of it, and a week writing THIS one part! Grrr.
Any help much appreciated. If I can't get this done within a week, pop along to London and see a grown man cry.

Similar Messages

  • Difference between Scheduling lines and Delivery schedule

    Hi SD Experts
    can u say me the clear difference between Scheduling lines and Delivery schedule.
    where we will maintain deliver schedule. whether delivery schedule is automatically created along scheduling agreements..
    with regards
    James

    Hi James,
    Schedule Lines: Has basically information realted to delivery scheduling in Sales Order level.
    Delivery Scheduling: Is a process using which system will determine what are the different activities which need to be performed and time taken for each activitiy only after which the material can be delivered to the customer.
    Delievry scheduling will be started only from the material availability date i.e., system will first determine the material avail date and then do scheduling. By default Standard SAP system does Backward Scheduling in case material availability falls beyond the required delivery date system will do forward schedluing
    Delivery Scheduling consists of the following Basic activities:
    We give deatils while creating order:
    Order Creation Date
    Required Delivery Date
    Order date - Material availability date - Transportation Planning Date - Loading date - Goods Issue Date - Required Delivery Date
    Time Between GI Date and required Delivery Date is called Transit Time
    Time Between LoadingDate and GI Date is called Loading time
    Time Between Material Availability Date and Loading Date consists of 2 components - Pick / PackTime and Transportation Planning Time
    System has to calculate all this before it determines the confirmed delivery date.
    Give your mail Id I have some Presentation I will send you across.
    REWARD POINTS IF IT HELPS
    Regards
    Srini

  • Diff between header line and work area.

    Diff between header line and work area.

    Hi,
    These are table with header line.
    DATA: T_TABLE type table of <table_name> with header line.
    data: begin of t_table occurs 0,
                  field1 type ...
                  field2 type ...
                  field3 type ...
          end of t_table.
    <b>The result is:</b>
    <u><b>TABLE</b></u>    
    FIELD NAME  |FIELD1|FIELD2|FIELD3|  
    HEADER LINE |EE1   |EE2   |EE3   | <---- Line 5 content
               1|AA1   |AA2   |AA3   |  
               2|BB1   |BB2   |BB3   |  
               3|CC1   |CC2   |CC3   |
               4|DD1   |DD2   |DD3   |
               5|EE1   |EE2   |EE3   |
    These are table without header line.
    DATA: T_TABLE type table of <table_name>.
    DATA: T_TABLEX LIKE TABLE OF t_table.
    <b>The result is:</b>
    <u><b>TABLE</b></u>    
    FIELD NAME  |FIELD1|FIELD2|FIELD3|  
                     0|---   |---   |---   | <---- No header Line
                     1|AA1   |AA2   |AA3   |  
                     2|BB1   |BB2   |BB3   |  
                     3|CC1   |CC2   |CC3   |
                     4|DD1   |DD2   |DD3   |
                     5|EE1   |EE2   |EE3   |
    These are work areas:
    Tables <table>.
    DATA: wa type <table>.
    DATA: wa like t_table.
    DATA: wa type line of <table>.
    <b>The result is:</b>
    <u><b>WORK AREA</b></u>  
    |EE1   |EE2   |EE3   | <---- Content
    Regards.
    Marcelo Ramos

  • Link between Schedule lines and delivery quantity

    Hi all,
    At the item level in a sales order, can anyone tell me the link between schedule line data and delivered quantity.
    Schedule line data can be found in VBEP and delivery qty can be found in LIPS. But I want the link between the two. For which partcular date in the schedule line item the delivery qty is displayed.
    Thanks in advance.

    Hi Amol and Rahul,
    Actually I dont want the link between sale order and delivery, I want the link between schedule line dates and delivery qty.
    Hope I am clear.
    Thanks in advance.
    Edited by: Rajini R M on Sep 11, 2008 6:12 AM

  • Difference between PO line  and purchase requisation

    Hi all ,
    i had conversion in which i need to upload purchase requisations from legacy and JDE  to SRM.in processing logic thay give extract PO line from JDE then match with Legacy.
    here i got doubt what is diffrence between PO line data and Purchase requistion,
    <<text removed>>
    Thanks & regards,
    Bala.
    Edited by: Matt on Dec 9, 2008 10:27 AM - Please do not use phrases such as "as soon as possible"

    hi ,
    Thnks u for giving response,
    actually my doubt is Diffrence between Purchase requistion and Po line.
    for understanding i am giving some text below,
    first thay given business requirement like this,
    business requirement: We need to load all requisitions created in the existing Ariba system into SRM.  The load should do the following
    in processing logic thay have given like this.
         Extract from JDE the PO Line.  It should include the following fields:
    PDKCOO - Order Company
    PDDOCO - Order Number
    PDDCTO - Order Type
    PDLNID - Line Number (Divide by 1000)
    PDVR01 - Reference
    PDVR02 - Reference 2
    PDAEXP - Extended Price (Convert to standard format u2013 add decimals)
    PDAOPN - Amount Open (Convert to standard format u2013 add decimals)
    PDCRCD - Currency Code
    PDFEA - Foreign Extended Price (Convert to standard format u2013 add decimals)
    PDFAP - Foreign Open Amount (Convert to standard format u2013 add decimals)
    PDNXTR - Status Code - Next
    PDLTTR - Status Code - Last
    We will want to pull all the indirect POs created after July 1, 2006
    3.     We will then select the order company and number for all POs that have an Open Amount not equals to 0 AND that are not closed.  These are the orders that we will load first.

  • Difference between command line and Runtime.exec()

    Hi all.
    I'm coding some lines to call sqlldr program.
    System info:
    OS: Win2k server
    Java platform: JSK 1.4
    DBMS: Oracle 9i
    I've tested sqlldr in command line and it is OK. But when i call Runtime.exec("sqlldr user/pass@servicename control=mycontrol.ctl")
    the ErrorStream show that: Message 2100 not found,No message file for product=RDBMS ,facility=UL...
    So i had to put a String array which contained "ORACLE_HOME" as the second parameter of exec method. But there's another error appear:
    SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
    ORA-12560: TNS:protocol adapter error
    I checked tnsnames.ora and it's OK. I do the command line again and it's still OK. Why did Runtime.exec("...") method get Error.
    Does Someone solve it for me.
    Thanks so much.

    I'm having the similar/same issue.
    I'm trying to run SQLLdr from JAVA.
    From a command line, it works fine.. From within JAVA, I get..
    SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
    ORA-12640: Authentication adapter initialization failed.
    Did you find a solution to your problem?

  • Different billing periods between phone line and b...

    hi, can anyone  tell me why my billing periods with my phone line and broadband are different ie i took out the phone and broadband package on the same day .the end of my usage date for my phone line and calls was yesterday 19th dec but my broadband usage does not finish until the 31 dec .

    broadband usage is calendar monthly - check the usage monitor at BT.com
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • What is the link between schedule lines and delivery document item level

    Can any one please explain me what is the link between the schedule lines of the order/scheduling agreement and the item level of the delivery.
    Is there any link between VBEP and LIPS ?

    Hi
    Most of the item level data in delivery doc is copied from Schedlue lines in Sales order for eg delivery date
    So u may say that schedule line in sales order becomes the line item in Subsequent doc that is in Delivery doc .
    The table u are talking about i.e VBEP is related to sales doc and it contain data for Schedule line in sales order and the other table i.e LIPS give the delivry doc related data at item level.
    Hope this help

  • Link between Contract line and the Billing Plan number

    Hi All,
    I have a requirement which needs a link between the Contract Line item and its Billing Plan Number. I basically have to find out the contracts which have a billing block. So a invoice would not have been created to that line item.
    Please let me know if such a link exists.
    Thanks in advance,
    jr.

    Hello
    In table <b>VBKD </b>(Sales Document: Business Data) you will find the link between the contract (VBELN) and the billing plan (FPLNR). If POSNR = '000000' then this is the billing plan of the contract header.
    The billing block can be found in VBAK-FAKSK.
    Finally, billing plan details can be found in table FPLA. If FPLA-RFPLN is filled then the item billing plan is linked to the header billing plan.
    Regards
      Uwe

  • Is SDO_DISTANCE bug between the line and multipoints?

    SDO_GEOM.SDO_DISTANCE(MDSYS.SDO_GEOMETRY(2002,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(113.363258142822,23.133208779985,113.3633,23.13331)),
    MDSYS.SDO_GEOMETRY(2005,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,2),MDSYS.SDO_ORDINATE_ARRAY(
    113.363258142822,23.1868700130491,113.365811605804,23.1322024265981))
    ,0.000005)
    the result is 5955.609972214.
    SDO_GEOM.SDO_DISTANCE(MDSYS.SDO_GEOMETRY(2002,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(113.363258142822,23.133208779985,113.3633,23.13331)),
    MDSYS.SDO_GEOMETRY(2005,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,2),MDSYS.SDO_ORDINATE_ARRAY(
    113.365811605804,23.1322024265981,113.363258142822,23.1868700130491
    ,0.005)
    the result is 284.072193675135.
    In my points the results should be the same. Why are they different?
    If change the Element_Info
    SDO_GEOM.SDO_DISTANCE(MDSYS.SDO_GEOMETRY(2002,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(113.363258142822,23.133208779985,113.3633,23.13331)),
    MDSYS.SDO_GEOMETRY(2005,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,1),MDSYS.SDO_ORDINATE_ARRAY(
    113.363258142822,23.1868700130491,113.365811605804,23.1322024265981))
    ,0.000005)
    the result will be 284.072193675135.
    Why?Is it a bug of SDO_DISTANCE?

    Have a look here:
    Re: How to use java to store Multipolygon
    this is the javadoc:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14373/oracle/spatial/geometry/JGeometry.html#JGeometry_int__int__int____double___
    public JGeometry(int gtype,
    int srid,
    int[] elemInfo,
    double[] ordinates)
    Constructs a JGeometry instance with given information
    Parameters:
    gtype - the geometry type
    srid - the SRS id; if 0 is used then the MDSYS.SDO_GEOMETRY.SDO_SRID will be set to null when converted into DB format.
    elemInfo - geometry element info array
    ordinates - geometry ordinates array
    Maybe something like:
    JGeometry ps = New JGeometry (2005, 8307, new int[]{1,1, YOUR NUMBER OF POINTS IN YOUR CLUSTER}, new double[]{YOUR ORDINATES})
    Luc

  • Differnet Charting behaviour between Java 7 and Java 8

    Hi I've developed an application with charts in Java FX and Java 7. Everything works fine, but now I've tested it with Java 8. There I can see, that something must have changed in the way a chart wil be painted.
    The following code will describe the problem. Execute it with Java 7 and Java 8 and you will see what I mean.
    package linechartsample;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.chart.AreaChart;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart;
    import javafx.stage.Stage;
    public class LineChartSample extends Application {
    @Override
    public void start(Stage stage) {
    stage.setTitle("Line Chart Sample");
    final NumberAxis xAxis = new NumberAxis();
    final NumberAxis yAxis = new NumberAxis();
    xAxis.setLabel("Month");
    final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(
    xAxis, yAxis);
    lineChart.setTitle("Stock Monitoring");
    lineChart.setCreateSymbols(false);
    XYChart.Series series1 = new XYChart.Series();
    series1.setName("Portfolio 1");
    series1.getData().add(new AreaChart.Data(1, 10));
    series1.getData().add(new AreaChart.Data(2, 20));
    series1.getData().add(new AreaChart.Data(3, 10));
    series1.getData().add(new AreaChart.Data(2, 5));
    series1.getData().add(new AreaChart.Data(1, 10));
    Scene scene = new Scene(lineChart, 800, 600);
    lineChart.getData().addAll(series1);
    StringBuilder builder = new StringBuilder();
    // builder.append("-fx-stroke: ");
    // builder.append("#");
    // builder.append(Integer.toHexString(115));
    // builder.append(Integer.toHexString(115));
    // builder.append(Integer.toHexString(115));
    // builder.append(Integer.toHexString(100));
    builder.append("-fx-fill: ");
    builder.append("#");
    builder.append(Integer.toHexString(215));
    builder.append(Integer.toHexString(115));
    builder.append(Integer.toHexString(115));
    builder.append(Integer.toHexString(100));
    series1.getNode().setStyle(builder.toString());
    stage.setScene(scene);
    stage.show();
    public static void main(String[] args) {
    launch(args);
    What happens here in Java 8???
    Additionally I've tried to draw a simple AreaChart with a series of negative values. In Java 7 the area between the line and the X-Axis will be filled. In java 8 the area between the line and the bottom of the chart will be filled. Are there any new properties which have to set to draw it in the correct way? I've checked it with the stackedAreaChart. Here everything is fin in Java7 and Java8.
    Can somebody explain me that change in the behaviour of the charts in JavaFX 8?? Or is this a Bug??
    Kind regards

    Your code is really weird. 
    Applying a fill to the line path in a line chart is a strange thing to do.  Usually a line chart is for drawing lines not filled areas.  For filled areas, JavaFX has an AreaChart.
    Setting multiple y values for a given x value in a series is also a very strange thing to do.  Usually for a LineChart plot, the x values in the series are unique.
    I haven't tried your code on Java 7 as I don't have Java 7 installed and your code doesn't really seem like a valid test case to me anyway.  That your code got you a result you wanted in Java 7 would be more a fluke than anything else, I would guess.
    For your area chart question, please ask that as a separate question with reproducible source code and test case.
    If you really think there are bugs or regressions in JavaFX, then report them in the bug tracker after running your tests on the latest development JDK at: https://jdk8.java.net/download.html

  • Header line and work area

    Hi,
    can anyone please explain me wht is the difference between header line and work area???

    Hi,
    INTERNAL TABLES
    - Internal tables are used to obtain data from a fixed structure for
    dynamic use in ABAP.
    - Each line in the internal table has the same field structure.
    - The main use for internal tables is for storing and formatting data from
    a database table within a program.
    WORK AREAS
    - Work areas are single rows of data.
    - It should have the same format as any of the internal tables.
    - It is used to process the data in an internal table one line at a time.
    Internal Tables with Header Line : Here the system automatically creates the work area. The work area has the same data type as internal table. This work area is called the HEADER line. It is here that all the changes or any of the action on the contents of the table are done. As a result of this, records can be directly inserted into the table or accessed from the internal table directly.
    Internal Tables without Header Line : Here there is no work area associated with the table. Work area is to be explicitly specified when we need to access such tables. Hence these tables cannot be accessed directly.
    HEADER LINE----
    CREATED EXPLICITLY------
    1.Internal table created by referring to another table
    Syntax: Data <f> <type> with header line.
    <type> refers to a table data type or table data objects using type or like.
    Here internal table <f> is created of the type <type>.
    Example:
    DATA t_line TYPE line OCCURS 10 with header line.
    2. Internal table created by referring to existing structure
    Syntax: Data<f> <type> occurs n with header line.
    The lines of the internal table <f> have the data type specified in <type> (Can use either like or type).
    Example:
    DATA flight_tab LIKE sflight OCCURS 10.
    CREATED BY DEFAULT---
    3. Internal table created With a new structure
    Syntax: Data : Begin of <f> occurs <n>,
    <component declaration>,
    End of <f>.
    Work area is created by default.
    Example:
    Data : Begin of itab occurs 10,
    column1 type I,
    column2(4) type C,
    column3 like mara-ernam,
    End of itab.
    reward if useful
    Regards

  • Utl_file truncates the line and fillowing records

    Here is my code ,I am seeing an unusual problem It was all ok untill two weeks ago . AfterI made somechanges (added || Chr(13)|| Chr(10) to the ce_line at the end) , A csv file that should have more that 500 records is being truncated , after nearly 113 lines , i dont see any data . It looks some thing like Below. It terminates in between the line and no data after that .
    I looked at the DBM_Output , Its shows me all 500+ records , Looks like the problem while writing to the file some things is going wrong.
    Or is it because of some data issue that its does'nt consider.
    "602992121     602992121     DATASCRUB     602992121     W     3/31/2011     6/1/2011     5/1/2031     4.875     400000
    602992315 602992315 DATASCRUB     602992315     W     DATASCRUB     602992315     K     3/14/2011     5/1/2011     4/1/2031     4.75     153000
    602992336 602992336 DATASCRUB     602992336     DATASCRUB     602992336     3/28/2011     5/1/2011     4/1/2031     4.75     278400
    602992717 602992717     DATASCRU     
    CE_LINE VARCHAR2 (500);
    CE_FILE UTL_FILE.FILE_TYPE;
    L_C1 to L_C55 are defined SYS.ODCIVARCHAR2LIST;
    L_LIMIT NUMBER := 1000;
    <<Code>>
    OPEN CUSTODIAN_EXTRACT_DETAILS FOR V_CHR_SQL;
    IF UTL_FILE.IS_OPEN (CE_FILE) THEN
    LOOP
    FETCH CUSTODIAN_EXTRACT_DETAILS
    BULK COLLECT INTO L_C1,
    L_C2,L_C3,L_C4,L_C5,L_C6,L_C7,L_C8,L_C9,L_C10,L_C11,L_C12,L_C13,L_C14,L_C15,L_C16,L_C17,L_C18,L_C19,L_C20,L_C21,L_C22,L_C23,L_C24,L_C25,L_C26,L_C27,L_C28,L_C29,L_C30,L_C31,L_C32,L_C33,L_C34,L_C35,L_C36,L_C37,L_C38,L_C39,L_C40,L_C41,L_C42,L_C43,L_C44,L_C45,L_C46,L_C47,L_C48,L_C49,L_C50,L_C51,L_C52,L_C53,L_C54,L_C55 LIMIT L_LIMIT;
    FOR I IN 1 .. L_C1.COUNT LOOP
    IF INSTR (L_C21 (I), ',') > 0 THEN
    L_C21 (I) := '"' || L_C21 (I) || '"';
    END IF;
    CE_LINE :=L_C1 (I) || ',' || L_C2 (I) || ',' || L_C3 (I)|| ','|| L_C4 (I)|| ','|| L_C5 (I)|| ','|| L_C6 (I)|| ','|| L_C7 (I)|| ','|| L_C8 (I)|| ','|| L_C9 (I)|| ','|| L_C10 (I)|| ','|| L_C11 (I)|| ','|| L_C12 (I)|| ','|| L_C13 (I)|| ','|| L_C14 (I)|| ','|| L_C15 (I)|| ','|| L_C16 (I)|| ','|| L_C17 (I)|| ','|| L_C18 (I)|| ','|| L_C19 (I)|| ','|| L_C20 (I)|| ','|| L_C21 (I)|| ','|| L_C22 (I)|| ','|| L_C23 (I) || ','|| L_C24 (I)|| ','|| L_C25 (I)|| ','|| L_C26 (I)|| ','|| L_C27 (I)|| ','|| L_C28 (I)|| ','|| L_C29 (I)|| ','|| L_C30 (I)|| ','|| L_C31 (I)|| ','|| L_C32 (I)|| ','|| L_C33 (I)|| ','|| L_C34 (I)|| ','|| L_C35 (I)|| ','|| L_C36 (I)|| ','|| L_C37 (I)|| ','|| L_C38 (I)|| ','|| L_C39 (I)|| ','|| L_C40 (I)|| ','|| L_C41 (I)|| ','|| L_C42 (I)|| ','|| L_C43 (I)|| ','|| L_C44 (I)|| ','|| L_C45 (I)|| ','|| L_C46 (I)|| ','|| L_C47 (I)|| ','|| L_C48 (I)|| ','|| L_C49 (I)|| ','|| L_C50 (I)|| ','|| L_C51 (I)|| ','|| L_C52 (I)|| ','|| L_C53 (I)|| ','|| L_C54 (I)|| ','|| L_C55 (I) || Chr(13)|| Chr(10);
    UTL_FILE.PUT (CE_FILE, CE_LINE);
    dbms_output.put_line (CE_LINE);
    DBMS_OUTPUT.NEW_LINE;
    END LOOP;
    EXIT WHEN CUSTODIAN_EXTRACT_DETAILS%NOTFOUND;
    end loop;
    END IF;
    CLOSE CUSTODIAN_EXTRACT_DETAILS;
    END IF;
    UTL_FILE.FCLOSE (CE_FILE);
    <<Code>>

    This appears to be a duplicate of UTL_FILE create a csv with 1002, 2003 and 3004 rows empty. Having two threads open simultaneously in the same forum for the same issue is counterproductive. In which thread would you like us to answer? Please close whichever thread you don't want us to answer in.
    It would be helpful if you used the \ tag (6 characters, all lower case) before and after your code to preserve formatting.  That makes it much easier to read.
    Exactly what changes did you make?  Why did you add the CHR(13) || CHR(10)?  Did you, at the same time, change utl_file.put_line to utl_file.put? 
    Justin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Useful life different bewteen straight line and declining balance

    Have any one used different useful life between straight line and declining balance ?
    Does it work correctly?
    Thanks

    HI,
    Please check in the given path:
    Financial Accounting ->Asset Accounting - Valuation- Determine Depreciation Areas in the Asset Class
    Check here for your asset class, any value maintained in the fields useful life.
    Mostly you enter default Useful life for each asset class.

  • Is there a DIRECT link between SD schedule lines and delivery lines?

    Is there a direct link (db table) between schedule lines on a sales order (VBEP) and the delivery lines (LIPS)? 
    Is there a function module to retrieve the data?
    Example-
    One order line with 3 schedule lines.
    Each schedule line is for 2 units (total of 6 units).
    Three deliveries made.  1st is for 2 units, 2nd is for 1 unit (backorder), 3rd is for 3 units.
    You can use document flow (table VBFA) or examine the SD document in the delivery line (LIPS) and link the delivery line to the order line.  The schedule line already references the order line.
    I am using math to decrement the schedule lines used and make the link between VBEP and LIPS.  It works fine.  I need four records back....
    1st schedule line for 2 units uses delivery 123
    2nd schedule line for 1 unit (partial) uses delivery 124
    2nd schedule line for 1 unit (partial) uses delivery 125
    3rd schedule line for 2 units uses delivery 125
    Like I said, it works. Just wondering if I missed a more direct link.

    As far as Db link is concern , I don’t remember exactly , but 3 years before I had written a report which see Sales order schedule lines and devilry note lines against sales order.  If you see process wise…. when ever you create PO ( production order you assign some qty using 101 movement type .. and against production order you also give sales order . When you do delivery ( run seclude run ) it delivers against that material number , its movement is 601 ...
    but I remember there’s a link between these tables, VBAP,VBFA AND VBEP , LIPS ...  against every sales order you can see sales invoice ( VBRP,VBRK) and you can also see your delivery note number in document flow .
    I hope this’ll give you some guide line, as right now I can not tell you the exact business process but I remember I written a report in SD 4 years before , in which they required Delivery against production order and sales order ... One more thing you also have production order reference on delivery item number. ( field :Empst ) . I think in my project they were maintaining this field .
    Thanks

Maybe you are looking for

  • I cant burn a cd from itunes or any other program

    i was having a problem connecting to itunes store, but after some time i just downloaded it again and installed it. Now Im unable to burn a cd from Itunes and now realized i cant burn any dvd/cd's from any program in my computer. has anyone got a sol

  • Cursor Declaration

    I am trying to declare a cursor in a stored procedure using the following sql:      CURSOR conversionCursor is select customer_number, company_id , buyer_id      from hpsiuser.conversion_master natural join      (select distinct mfg_code, customer_nu

  • Java processes

    Dear all, I am using Oracle 10.2.0.3 on Linux. When I do ps -ef on the server I see a lot of java process spawned. There are so jobs or anything running which executes any java processes. Then why is it so. Please help. Regards SL

  • HT4623 unable to download update

    When I try to download the new iOS6 update on my iphone 4 it says that it was unable to download the contact and I can retry or cancel. When I retry it just does the same thing

  • Lion backup with CCC.

    Will probably be installing Lion this PM, just wondering if there may be a problem when I backup to my EHD using Carbon Copy Clone. I assume CCC will just do away with the SL currently on it without a problem I hope.