OPEN ....... FOR 'SELECT...........with references to string var

I am having a problem refencing a string variable within the WHERE clause of an OPEN statement, where DATASET is a ref cursor and the string variables are defined below. Sorry if too much detail below.
Thank you for any help,
Scott
Error msg = ORA-00904: invalid column name
strInvCountTableName := 'cats_invcount' || to_char(sysdate, 'MMDDYYHH24MISS');
strUsageTableName := 'cats_partusage'|| to_char(sysdate, 'MMDDYYHH24MISS');
strCSSLType := 'S';
strPDType := 'P';
strVanType := 'V';
strMCDCType := 'M';
strSpareStatus := 'S';
strAvailableStatus := 'A';
OPEN dataset FOR 'SELECT
Inv.PARTID, Inv.LOCATIONDETAILID,Inv.Total,Inv.Average,
Part.PARTCODE,Part.MFGPARTNUMBER,Part.MANUFACTURER,Part.DESCRIPTION,
(Usg.USAGECOUNT/Inv.Average) TURN,Usg.USAGECOUNT,Usg.USAGECODE,
Ldel.LOCATIONDETAILCODE,
Loc.NAME LOCATIONNAME,Loc.REGION,Loc.MTA
FROM ' || <<this
strInvCountTableName || ' Inv,' || <<works
strUsageTableName || ' Usg, <<fine
CATS_PART PART,
CATS_LOCATIONDETAIL LDEL,
CATS_LOCATION LOC,
CATS_LOCATIONSTATUS STAT,
CATS_LOCATIONTYPE TYP
WHERE
Inv.PARTID = Usg.PARTID AND
Inv.LOCATIONDETAILID = Usg.LOCATIONDETAILID AND
Inv.PARTID = Part.PARTID AND
Inv.LOCATIONDETAILID = Ldel.LOCATIONDETAILID AND
Ldel.LOCATIONID = Loc.LOCATIONID AND
Ldel.LOCATIONSTATUSID = STAT.LOCATIONSTATUSID AND
Loc.LOCATIONTYPEID = TYP.LOCATIONTYPEID AND
(STAT.CODECOMPONENT = ' || strSpareStatus || ' AND << this does not work
     (TYP.CODECOMPONENT = ' || strCSSLType || ' OR <<
TYP.CODECOMPONENT = ' || strPDType || ' OR << i've tried putting literals in " "
TYP.CODECOMPONENT = ' || strVanType || ') OR << but still no luck
(STAT.CODECOMPONENT = ' || strAvailableStatus || ' AND <<
     TYP.CODECOMPONENT = ' || strMCDCType || '))'; <<

This is just the 'double single quote' problem. Just add two single quotes around the reference - these two quotes will resolve to a single quote:
(STAT.CODECOMPONENT = ''' || strSpareStatus || ''' ANDor
(STAT.CODECOMPONENT = ''S'' AND

Similar Messages

  • How to keep the field open for input with error message in report program

    Hi,
      Need a help in solving the below issue.
    "How to keep the field open for input with error message in report program"
    Regards,
    C.Shasiraj.

    Hi...
    you have to use the event:
    <b>AT SELECTION-SCREEN ON <FIELD> EVENT.</b>
    u have to give an error message in this event.
    Consider the following <b>Example:</b>
    <b>PARAMETERS : NUMBER TYPE I.
    AT SELECTION-SCREEN ON NUMBER.
      IF NUMBER = 10.
        MESSAGE 'Number vakue is 10' TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      WRITE NUMBER.
    </b>
    in this if u give the value of number = 10, it will not proceed further, if u give some other value other than 10 you will proceed further...
    Execute this program once u will understand....
    also Consider the following links :
    <b>Regarding events:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a237d9b511d1950e0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a23ad9b511d1950e0000e8353423/frameset.htm
    <b>Regarding messages:</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/aa575426ad11d2954d0000e8353423/frameset.htm
    This is very useful.......
    Reward points if useful....
    Suresh....

  • How do I send my pages attachment so that it will open for those with Microsoft word?

    How do I send my pages attachment so that it will open for those with Microsoft Word?

    Hi Victoria,
    Pages does not run on Windows.
    Word cannot open a Pages file.
    If you want someone without pages to be able to open your attachment, you will have to send it in a format openable on the recipient's computer.
    If the recipient needs only to read the document, the most universal format is pdf. To send a pdf copy of your file, press command-P to open the Print dialogue, then click the PDF button and choose email PDF. This will open a new message in your default email client and attach the pdf file to that message.
    If the recipient needs to be able to edit/change your document, and has MS Word, then either Save a copy as a Word file or go File > Export and choose Word as the file format for the export.
    Be aware that MS Word does not support all features of Pages (and vice versa), and that formatting of the document may be affected by font substitution if you use fonts that are not available on the recipient's machine.
    Regards,
    Barry

  • Issue material for Subcontracting with reference to PO for multiple batches

    Hi All,
    Issue: I want to issue 5-6 materials with reference to PO which have multiple batches. How can that be done?
    Thus, if my raw material in stock are:
    mat X   Batch 1    50 nos
    mat X   Batch 2    40 nos
    mat X   Batch 3     30 nos
    mat Y Batch 6    10 nos
    mat Y Batch 7    10 nos
    mat Y Batch 8    10 nos
    mat Y Batch 9    10 nos
    i f for semi finished material A, sub contractor order 45000009 is created, where raw material required are:
    Mat X      100 nos
    Mat Y      30 nos
    then how can I issue the raw materials wrt PO, and select multiple batches at the same time, without user entering the material again and again.
    I have gone through the SDN multiple times to see the probable solution exists, but I have not received any solution.
    Regards,
    Ankush

    DO MB1B transaction, with Movement type 541,
    Enter the material with different Batches for required qty. as different line items.
    e.g
    line item 1 : mat X Batch 1 50 nos
    line item 2 :  mat X Batch 2 40 nos
    line item 3 :  mat X Batch 3 10 nos
    line item 4: mat Y Batch 6 10 nos
    line item 5 :  mat Y Batch 7 10 nos
    line item 6 :  mat Y Batch 8 10 nos
    Edited by: sudhansu satapathy on Oct 21, 2011 7:29 PM

  • Error: "File couldn't be opened for writing" with CinemaDNG sequence

    Using a Premiere Pro > After Effects workflow with my colorist.
    I created a project in Premiere CS6 and used MOV transcodes because Premiere CS6 does not read CinemaDNG sequences. I do not have CC installed on my computer. My colorist, on his computer (we are both using Mavericks), imported the .prproj into AE CS6. We tried to replace MOV files with CinemaDNG sequences, and AE returned this error:
    After Effects error: File couldn't be opened for writing: "[file path]". ( 3 :: 0 )
    Normally when you replace footage with a CinemaDNG sequence in AE, Adobe Camera Raw pops open so you can make changes before the file is important. I have never seen this error before.
    My colorist has CC installed as well as CS6, so we tried that instead.
    Colorist opened the Premiere CS6 project in Premiere CC, creating a new Premiere CC project. Replaced MOV files with CinemaDNG sequences within Premiere CC with no error, project plays fine in Premiere CC. Finally! So we imported the new Premiere CC project in AE CC, and all linked CinemaDNG sequences appear as color bars (unlinked footage). When testing to import a CinemaDNG sequence, AE CC returned the same error as AE CS6.
    So we tried opening the same CinemaDNG files in Photoshop CS6 and Photoshop CC to see if there was an error with Camera Raw. Both versions of Photoshop open the CinemaDNG files correctly in Camera Raw (version 8.3). So now we have CinemaDNG files functioning properly in Premiere Pro, Photoshop, but... not AE?
    Tried replicating this on a second, Mountain Lion computer with both versions of AE, and returned the same issue.
    CinemaDNG files from a different source DID open in AE CC and AE CS6 on both computers, which leads me to believe there is some kind of permissions/metadata issue in this particular set of CinemaDNG files I'm using that's causing problems for AE, but NOT Premiere Pro or Photoshop. Anyone experience anything like this?

    try the "oddball problems" fix:
    http://www.bulletsandbones.com/GB/GBFAQ.html#oddballprobs
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Pricing procedure for order with reference from order

    Dear Friends,
    If I create a sales order with reference to another sales order of different type, the pricing procedure is copied too.
    But I would to use another pricing procedure for second document
    I found the oss note 14136 but this is for reference from invoce
    I tried to create new data transfer routine for orders in copy from 51, but does not work
    Can you help me??
    thanks
    best regards
    GdA

    > If I create a sales order with reference to another sales order of different type, the pricing procedure is copied too. But I would to use another pricing procedure for second document,
    Based on my understanding of query.
    You are looking for a different pricing procedure in second doc.
    For instance, the PricProc for SalesDoc1 is ZPR001 and  the PricProc for SalesDoc2 is ZPR002, in addition to that, you want SalesDoc1 to become reference doc for SalesDoc2.
    For this, ZPR002 & ZPR001 should have common base price condition type and rest pricing can change.
    And for maintaining different Pricing Procedure with similar combination of sales area for SalesDoc1 & SalesDoc2, maintain different document pricing procedure for both docs and maintain Pricing procedure accordingly..
    Thanks & Regards
    J Prakash

  • Populate html:select with List of Strings

    Hello everyone,
    I need to populate an html:select with a List of Strings. The list I receive is not composed of objects, only Strings. I want each of these Strings to be an option of the select.
    I've tried this way:
                    <html:select property="tamanho" >
                       <html:options collection="gradeTamanho"/>
                    </html:select>Didn't work. Does anyone know how?
    thanks

    Does anyone know how to do this? There has to be someway that I can populate an Option List with a list of contentIDs in a folder. Maybe using CMIS?

  • Internal Order Budget Check for PO with reference to PR / RFQ

    Hi All,
    I have a scenario where the budget availability control is not working for PO created with reference to PR or RFQ. While creating the PO if i modify the PO value more than RFQ or PR value then system is looking for budget control.
    If we create a direct PO system is checking for Budget control where the PO value is more than availability budget.
    We have the budget control check with internal order for services and non stock material based on substitution rule created for cost element group and cost center group.
    In tolerance limits budget availability control we have not activated for PR, itu2019s activated from PO.
    Kindly let me know what is the reason for budget availability control is not active where the PO is created with reference to PR or RFQ.
    Thanks & Regards,
    Rama Mohan

    493900 - FAQ: Release Strategy:
    It is not possible to create a purchase order if the referenced purchase requisition is not released. But the system allows you to put the purchase order on hold and then release the purchase requisition.
    On the other hand you can create a purchase order with reference to an unreleased request of quotation.

  • Funds Management for PO with reference to a PR

    Hello,
    I'd like to check the system's behavior on the next issue:
    Letu2019s say I have a funds reservation for $18,000,000.00 and I create a purchase requisition with one item with reference to this funds reservation for an amount of $17,000,000.00.
    Then I create a purchase order with one item, making reference to the purchase requisition for $10,000,000.00.
    At the moment I have availability in the reserve of $1,000,000.00 and a commitment (also pre-commitment) of $17,000,000.00 ($10,000,000.00 from the purchase order and $7,000,000 from the requisition).
    If I later (after I had saved) try to update the purchase order item increasing its net value, for example in more than one million (exceding the reserve's available amount), the systems generates an availability control error indicating that I donu2019t have enough funds in the funds reservation (which its true).
    My question concerning the systemu2019s behavior is, doesnu2019t it recognize the fact that the PO is referenced to a PR, therefore being able to consider also the remaining amount of the PR as a funds source for the increased value of the PO item (instead of only the reservation available amount)?
    If I make a new PO with reference to the same position of the PR, I can do it for the whole available value (funds reservation + PR), and the system makes the necessary reduction for the PR at funds level.
    However, as I mentioned before, if I increase the value of the PO item it only recognizes the available amount in the funds reservation as a funds source to AVC check.
    Iu2019d like to know if this is a right behavior and if there's a way to make the system use the amount commited in the Purchase requisition, to be able to increase the item in the PO, making the necessary reduction in the PR and funds reservation (BUT RECONIZING BOTH FUNDS RESERVATION AND PURCHASE REQUISITION AS POSSIBLE SOURCE OF FUNDS FOR THE INCREASE, INSTEAD OF ONLY THE AMOUNT AVAILABLE IN THE RESERVATION, DURING THE AVC CHECK).
    In the activity "Define Activation of Availability Control" is specified "Active with usual check logic".
    Kind regards,
    Edited by: Víctor Domínguez on Mar 9, 2009 7:20 PM
    Edited by: Víctor Domínguez on Mar 9, 2009 7:21 PM
    Edited by: Víctor Domínguez on Mar 9, 2009 7:21 PM

    Thanks for your answer, but I'm using type C (Active with usual check logic) for the fiscal year in question (2009).
    But the system is only checking the available amount in the funds reservation when I increase the value in the purchase orde item, it doesn't try to decrease the value of the purchase requisition, which still has a $7,000,000 commitment, in order to be able to use that as funds to be able to increase the value in the PO. That's what I don't know if it's a normal system behavior or it could be something in the customizing to help me solve this issue (bear in mind that I'm updating the purchase order, because when I create the PO there's no problem or even creating a new one with reference to the PR, it let's me use not only the amount available in the funds reservation, but also the commitment in the PR as available funds for my PO).
    I wouldn't want to decrease the value of the purchase requisition to be able to increase the availability in the funds reservation (so I could increase the PO item value), because it has been released and approved. And I can't either fix the "closed" indicator on the requisition to release commitment, because the remaining value of the requisition could be used to create other purchase orders.
    Edited by: Víctor Domínguez on Mar 9, 2009 10:04 PM

  • What is the sql command for SELECT with OR condition

    Hi
    What is the correct sql command for doing select with or condition??
    SELECT * from TempData
    WHERE port = '123'
    OR serialnumber = '555'
    So if there is a port = 123 or if there is a serialnumber = 555, I will get a successful select.
    Thanks for helping a newbie!!

    Hi
    What is the correct sql command for doing select with
    or condition??
    SELECT * from TempData
    WHERE port = '123'
    OR serialnumber = '555'
    So if there is a port = 123 or if there is a
    serialnumber = 555, I will get a successful select.
    Thanks for helping a newbie!!Make sure you bracket your OR conditions
    eg
    SELECT * from TempData
    WHERE column = 'VALUE'
    and port = '123'
    OR serialnumber = '555'
    is read as
    SELECT * from TempData
    WHERE (column = 'VALUE'
    and port = '123' )
    OR serialnumber = '555'
    which is not the same as
    SELECT * from TempData
    WHERE column = 'VALUE'
    and ( port = '123'
    OR serialnumber = '555' )

  • Creating a LabVIEW Shared DLL for use with C# and Strings?

    Hi All,
    I am trying to create a prototype for a LabVIEW Shared DLL that all the VI does is take in a string and return an upper cased string. Needless to say the DLL builds fine but when I try calling the shared DLL from C# the .NET application recieves an exception about "Ansi char arrays can not be marshaled as byref or as an unmanaged-to-managed parameter". Does anyone have an example of how to pass a string to a VI and return a string or an example of a better way of accomplishing this.
    We are using labVIEW 7.1 on Windows 2000.
    I am in quite a bit of a hurry to prove that this type of a LabVIEW Shared DLL VI would work. The eventual system will be passing in a string of XML with a large amount of
    data and returning XML.
    Thanks in advance,
    Jim

    Hello jprucha,
    This occurs because LabVIEW DLLs are not considered managed code. As such, we need to define the C# function as unsafe to be able to call unmanaged DLLs.
    You can find more information about C# and managed code at Microsoft's developer website linked below.
    MSDN Home Page
    Good luck with the development,
    Matt F
    Keep up to date on the latest PXI news at twitter.com/pxi

  • AGR_USERS, but for users with reference user assigned

    Hi...
    How do I get a complete list is "Users By Role" when a large number of users only have roles via a reference user?
    Table AGR_USERS does not list these roles!
    /vitofava

    Hi,
    S_BCE_68001400 (rsusr002) and select your users by the assigned reference user.(4th selection field)
    b.rgds, Bernhard

  • BAPI For CREATE SALES ORDER WITH REFERENCE TO ORDER

    Hi ,
    I want to develop a new RFC for 'Creating Sales Order' with reference to another sales order -
    Is there any BAPI available for the same ? (Version 4.7) - I know its available for new create and change
    but couldn't find for create with reference to Order ...
    Thanks in advance ...
    Regards
    Rajesh.

    Hi,
    You can use this FM "/SAPNEA/SMAPI_ORDER_CREATE". I haven;t tried this but you can still give it a try. Mention the Reference Order Type and other data in the header work area and pass it to the FM.
    Reward if it's useful.
    Thanks,
    Anil

  • GR to be done against only Inbound delivery for selected vendors

    GR to be done against only Inbound delivery for selected vendors. If the user putsthe combination " Goods Receipt+ Purchase Order+ Purchase Order Number " in MIGO , the error should be displayed as "Create MIGO with Ref to ASN"
         At the time of MIGO, when user put the combination of Goods Receipt+ Purchase Order and purchase order number, BADI will activate.
         BADI will search the vendor code from the entered purchase order in the Z table in which user maintain the vendor codes.
         If BADI finds the vendor code in the Z table then, will give error as u201CPlease create inbound delivery firstu201D.
         If BADI does not find the vendor code in Z table then it will inactive.
         In short we are restricting the selected vendor for MIGO with reference to PO.

    Hi,
    If u had used confirmation control key (0001) - In Item details of PO, as per standard SAP u cannot proceed for GR without inbound delivery. Otherwise use MB_MIGO_BADI. Thanking you

  • Opening a selection screen in display mode

    I have an ALV grid created in OOPS. Each line of this ALV has name of a report and its variant name. Here I have created a button on toolbar. When a user selects a line and clicks this button, selection screen of the selected report is to be opened in display mode with selection screen filled as per its variant. Both the report name and varaint name will be same as the selected line. I am able to open the selection with varaint filled, but it comes in editable mode. How do I make it non-editable mode?

    Hi,
    For making your selection screen non editable you will have to disable them for input.
    For this you will have to modify the screen structure.
    try this:
    loop at screen
    if screen-fieldname = 'XYZ'.
    screen-input = '0'.
    endif.
    modify screen.
    endloop.
    You can write this code at selection screen of the program which calls this selection screen.
    Call this code under a condition, so that it get triggeres only when you call this screen form the ALV.

Maybe you are looking for

  • Itunes is not detecting my ipod nano 7th G (on windows 8.1)

    Hi everyone, Since I've installed the last windows 8.1 release, when I plug my ipod, I have the following message "An ipod has been detected but it could not be identified properly. Please disconnect and reconnect the ipode, then try again. If the pr

  • Applet failed to load in Internet Explorer when using JRE 1.5 update 5

    I have downloaded JRE 1.5 Update 5 and checked the relevant checkbox in Internet Explorer Advanced tab to use JRE 1.5 for applets. Did the same in Java Control Panel. However none of the applets seem to load. For example I went to this site: http://j

  • Mail sending using sender importing parameter using so_object_send function

    Hi all,         I using so_object_send function module to send mail. My requirement is with respect to any user          logged in the sender mail address should be taken by V_SENDER parameter in exporting         parameter. <code> CALL FUNCTION 'SO_

  • Problem with NotificationService

    I am using BPEL 10.1.2.0.0 (fresh install) and created a simple User Task to test out email notification. This bpel instance uses LDAP / OID for authentication, and I have modified the ns_emails.xml to add the correct EmailAccount information for Out

  • Mail crashes if I click on old messages while receiving new

    Mail has really become sensitive after the 10.5.2 update. 1. Crashes after showing the beach ball, if I have the nerve to begin using Mail while its still receiving new mails upon launch. 2. Crashes if I use a layout in an outgoing mail and have my d