Procedure to generating an ID

Oracle Database 10g Enterprise Edition Release 10.1.0.5.0
create table INV
(inv_id VARCHAR2(26) not null);
INSERT INTO inv
     (inv_id)
VALUES
     ('ABC');
INSERT INTO inv
     (inv_id)
VALUES
     ('ABC.');   
INSERT INTO inv
     (inv_id)
VALUES
     ('ABC..');
select * from invWhat I want to do is create a procedure with an INPUT of a inv_id value and loop thru the records to generate a unique ID
for example the above if I input ABC I want to loop and check to see if there is already a record there
so it should loop and if found add a '.' to the end of 'ABC' and keep looping until it had 3 '...' at the end, hence it being unique.
What I want to output is an Inv_id of 'ABC...'
apologies if it is not clear. my logic head is out the window today.
thanks.

Or the equivalent using NLV2 function...
SQL> ed
Wrote file afiedt.buf
  1  select nvl2(max(inv_id),max(inv_ID)||'.','ABC') as inv_id
  2  from   inv
  3* where  inv_id like 'ABC%'
SQL> /
INV_ID
ABC...

Similar Messages

  • Procedure to generate invoice in xml---please help

    Hi all,
    I have to write code review of a pakage which contain procedure to generate invoice in XML.The procedure contain two
    files .pkb and .pks.All i know is that it will deliver elemt of the post script layout.?But i dont understand what it mean nor i am able to understand the code.I dont have any prior knowledge about this.Please help me and tell me any tutorial to understand and know how this is done.
    Also i have pasted some part of code here .please help me in understanding what is going on.
    help help help
    * GET_INVOICE_XML
    FUNCTION GET_INVOICE_XML(inInvId NUMBER) RETURN CLOB IS
    BEGIN
      IF NOT isClobReady THEN
        dbms_lob.createtemporary(invClob, TRUE);
        isClobReady := TRUE;
      ELSE
        dbms_lob.trim(invClob, 0);
      END IF;
      vInvoice :=
        XML_VER_STR || NL ||
        ' <!DOCTYPE INVOICE_FILE SYSTEM "invoicfile.dtd">' || NL ||
        '<INVOICE_FILE VERSION="1.1">' || NL;
      GEN_PROLOG(InvId);
      GEN_INVOICE(InvId, 1);
      vInvoice := vInvoice ||
        '</INVOICE_FILE>' || NL || NL;
      APPEND_INVOICE(0);
      RETURN invClob;
    END GET_INVOICE_XML;
    PROCEDURE GEN_INVOICE(InvId NUMBER, inITBMode NUMBER) IS
    vP1    PLS_INTEGER;
    vP2    PLS_INTEGER;
    vAtt     BOOLEAN;
    inv      ABCINVOICE%ROWTYPE;
    cdr_no   NUMBER;
    t0       TIMESTAMP;
    t1       TIMESTAMP;
    execTime NUMBER(12,6);
    BEGIN
      t0 := LOCALTIMESTAMP;
      SELECT * INTO inv FROM ABCINVOICE WHERE OACT = InvId;
      dti := inv.DTI;
      SELECT NVL(SUM(cdrNO),0) INTO cdr_no FROM ABCCONTRACTS WHERE OACT = InvId AND ITB IN ('Y', 'F');
      vInvoice := vInvoice ||
        ' <INVOICE>' || NL ||
        '  <HEADER>' || NL ||
        '   <SEQ>' || inv.SEQ || '/' || inv.PROC_ID || '</SEQ>' || NL ||
        '   <LEN ';
      vPos1 := INSTR(inv.LEN, '|', 1, 1);
      vInvoice := vInvoice || 'INV="' || SUBSTR(inv.LEN, 1, vPos1-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'BAL="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'DET="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PDET="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'ITM="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PITM="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" NTF="' ||
        SUBSTR(inv.LEN, vPos2+1) || '"/>' || NL;
      vInvoice := vInvoice ||
        '   <BAR>' || inv.BAR || '</BAR>' || NL ||
        '   <BCD>' || inv.BCD || '</BCD>' || NL ||
        CASE WHEN inv.BIC IS NULL THEN '' ELSE '   <BIC>' || inv.BIC || '</BIC>' || NL END ||
        '   <REF>' || inv.REF || '</REF>' || NL ||
        '   <OHX>' || inv.OHXACT || '</OHX>' || NL ||
        '   <CID>' || inv.CID || '</CID>' || NL ||
        '   <CCO>' || inv.CCO || '</CCO>' || NL ||
        '   <CND>' || inv.CND || '</CND>' || NL ||
        '   <PBF>' || inv.PBF || '</PBF>' || NL ||
        '   <DTI>' || inv.DTI || '</DTI>' || NL ||
        '   <DTD>' || inv.DTD || '</DTD>' || NL ||
        '   <DPS>' || inv.DPS || '</DPS>' || NL ||
        '   <DPE>' || inv.DPE || '</DPE>' || NL ||
        '   <DAS>' || inv.DAS || '</DAS>' || NL ||
        '   <DAE>' || inv.DAE || '</DAE>' || NL ||
        '   <PAY>' || inv.PAY || '</PAY>' || NL ||
        '   <NAM>' || ABCUTIL.CONVERT_POL_CHAR(inv.NAM) || '</NAM>' || NL ||
        CASE WHEN inv.ADS1 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS1) || '</ADS>' || NL END ||
        CASE WHEN inv.ADS2 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS2) || '</ADS>' || NL END ||
        '   <ADZ>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADZ) || '</ADZ>' || NL ||
        '   <NIP>' || inv.NIP || '</NIP>' || NL ||
        '   <REG>' || inv.REG || '</REG>' || NL ||
        '   <PES>' || inv.PES || '</PES>' || NL ||
        '   <BCY>' || inv.BCY || '</BCY>' || NL ||
        '   <TXT>' || ABCUTIL.CONVERT_POL_CHAR(inv.TXT) || '</TXT>' || NL ||
        '   <GRO>' || TO_CHAR(inv.GRO, 'FM999990.90') || '</GRO>' || NL ||
        '   <FBL>' || inv.FBL || '</FBL>' || NL;
      IF inv.STP > 0 THEN
        GEN_TEXT(inInvId, 1);
      END IF;
      vInvoice := vInvoice ||
        '  </HEADER>' || NL ||
        '  <ADDRESS>' || NL ||
        '   <ENV>' || inv.ENV || '</ENV>' || NL ||
        '   <TNA>' || ABCUTIL.CONVERT_POL_CHAR(inv.TNA) || '</TNA>' || NL ||
        CASE WHEN inv.TAS1 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS1) || '</TAS>' || NL END ||
        CASE WHEN inv.TAS2 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS2) || '</TAS>' || NL END ||
        '   <TAZ>' ||ABCUTIL.CONVERT_POL_CHAR(inv.TAZ) || '</TAZ>' || NL;
      GEN_TEXT(inInvId, 2);
      vInvoice := vInvoice ||
        CASE WHEN inv.MTX  IS NULL THEN '' ELSE '   <MTX>' || inv.MTX  || '</MTX>' || NL END ||
        '  </ADDRESS>' || NL;
      APPEND_INVOICE(0);
      IF inv.BCY <> '99' THEN
        GEN_INVOICE_BILLING(inInvId);
        GEN_BALANCE(inInvId);
        vPos1 := INSTR(inv.LEN, '|', 1, 2) + 1;
        vPos2 := INSTR(inv.LEN, '|', vPos1, 1);
        vPos1 := SUBSTR(inv.LEN, vPos1, vPos2 - vPos1);
        IF vPos1 > 1 THEN
          GEN_SUMMARY(inInvId);
        END IF;
      END IF;
      vInvoice := vInvoice || ' </INVOICE>' || NL;
      APPEND_INVOICE(0);
    END GEN_INVOICE;Edited by: BluShadow on 28-Aug-2012 09:46
    added {noformat}{noformat} tags for readability. Please read: {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Not quite sure what you want to know about it.
    If you want a code review of it, I can tell you it's very poor code, because that's not how to generate XML data in Oracle. Oracle has built in XML functionality for generating such data, and doesn't require hard-coding XML tags.
    Here's the Oracle documentation...
    http://tahiti.oracle.com/
    pick your database version and search for things like XDB, SQLX or more specifically XMLELEMENT, XMLAGG, XMLATTRIBUTES etc.

  • Create procedure is generating too many archive logs

    Hi
    The following procedure was run on one of our databases and it hung since there were too many archive logs being generated.
    What would be the answer? The db must remain in archivelog mode.
    I understand the nologging concept, but as I know this applies to creating tables, views, indexes and tablespaces. This script is creating procedure.
    CREATE OR REPLACE PROCEDURE APPS.Dfc_Payroll_Dw_Prc(Errbuf OUT VARCHAR2, Retcode OUT NUMBER
    ,P_GRE NUMBER
    ,P_SDATE VARCHAR2
    ,P_EDATE VARCHAR2
    ,P_ssn VARCHAR2
    ) IS
    CURSOR MainCsr IS
    SELECT DISTINCT
    PPF.NATIONAL_IDENTIFIER SSN
    ,ppf.full_name FULL_NAME
    ,ppa.effective_date Pay_date
    ,ppa.DATE_EARNED period_end
    ,pet.ELEMENT_NAME
    ,SUM(TO_NUMBER(prv.result_value)) VALOR
    ,PET.ELEMENT_INFORMATION_CATEGORY
    ,PET.CLASSIFICATION_ID
    ,PET.ELEMENT_INFORMATION1
    ,pet.ELEMENT_TYPE_ID
    ,paa.tax_unit_id
    ,PAf.ASSIGNMENT_ID ASSG_ID
    ,paf.ORGANIZATION_ID
    FROM
    pay_element_classifications pec
    , pay_element_types_f pet
    , pay_input_values_f piv
    , pay_run_result_values prv
    , pay_run_results prr
    , pay_assignment_actions paa
    , pay_payroll_actions ppa
    , APPS.pay_all_payrolls_f pap
    ,Per_Assignments_f paf
    ,per_people_f ppf
    WHERE
    ppa.effective_date BETWEEN TO_DATE(p_sdate) AND TO_DATE(p_edate)
    AND ppa.payroll_id = pap.payroll_id
    AND paa.tax_unit_id = NVL(p_GRE, paa.tax_unit_id)
    AND ppa.payroll_action_id = paa.payroll_action_id
    AND paa.action_status = 'C'
    AND ppa.action_type IN ('Q', 'R', 'V', 'B', 'I')
    AND ppa.action_status = 'C'
    --AND PEC.CLASSIFICATION_NAME IN ('Earnings','Alien/Expat Earnings','Supplemental Earnings','Imputed Earnings','Non-payroll Payments')
    AND paa.assignment_action_id = prr.assignment_action_id
    AND prr.run_result_id = prv.run_result_id
    AND prv.input_value_id = piv.input_value_id
    AND piv.name = 'Pay Value'
    AND piv.element_type_id = pet.element_type_id
    AND pet.element_type_id = prr.element_type_id
    AND pet.classification_id = pec.classification_id
    AND pec.non_payments_flag = 'N'
    AND prv.result_value &lt;&gt; '0'
    --AND( PET.ELEMENT_INFORMATION_CATEGORY LIKE '%EARNINGS'
    -- OR PET.element_type_id IN (1425, 1428, 1438, 1441, 1444, 1443) )
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN PIV.EFFECTIVE_START_DATE AND PIV.EFFECTIVE_END_DATE --dcc
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN Pap.EFFECTIVE_START_DATE AND Pap.EFFECTIVE_END_DATE --dcc
    AND paf.ASSIGNMENT_ID = paa.ASSIGNMENT_ID
    AND ppf.NATIONAL_IDENTIFIER = NVL(p_ssn, ppf.NATIONAL_IDENTIFIER)
    ------------------------------------------------------------------TO get emp.
    AND ppf.person_id = paf.person_id
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN ppf.EFFECTIVE_START_DATE AND ppf.EFFECTIVE_END_DATE
    ------------------------------------------------------------------TO get emp. ASSIGNMENT
    --AND paf.assignment_status_type_id NOT IN (7,3)
    AND NVL(PPA.DATE_EARNED, PPA.EFFECTIVE_DATE) BETWEEN paf.effective_start_date AND paf.effective_end_date
    GROUP BY PPF.NATIONAL_IDENTIFIER
    ,ppf.full_name
    ,ppa.effective_date
    ,ppa.DATE_EARNED
    ,pet.ELEMENT_NAME
    ,PET.ELEMENT_INFORMATION_CATEGORY
    ,PET.CLASSIFICATION_ID
    ,PET.ELEMENT_INFORMATION1
    ,pet.ELEMENT_TYPE_ID
    ,paa.tax_unit_id
    ,PAF.ASSIGNMENT_ID
    ,paf.ORGANIZATION_ID
    BEGIN
    DELETE cust.DFC_PAYROLL_DW
    WHERE PAY_DATE BETWEEN TO_DATE(p_sdate) AND TO_DATE(p_edate)
    AND tax_unit_id = NVL(p_GRE, tax_unit_id)
    AND ssn = NVL(p_ssn, ssn)
    COMMIT;
    FOR V_REC IN MainCsr LOOP
    INSERT INTO cust.DFC_PAYROLL_DW(SSN, FULL_NAME, PAY_DATE, PERIOD_END, ELEMENT_NAME, ELEMENT_INFORMATION_CATEGORY, CLASSIFICATION_ID, ELEMENT_INFORMATION1, VALOR, TAX_UNIT_ID, ASSG_ID,ELEMENT_TYPE_ID,ORGANIZATION_ID)
    VALUES(V_REC.SSN,V_REC.FULL_NAME,v_rec.PAY_DATE,V_REC.PERIOD_END,V_REC.ELEMENT_NAME,V_REC.ELEMENT_INFORMATION_CATEGORY, V_REC.CLASSIFICATION_ID, V_REC.ELEMENT_INFORMATION1, V_REC.VALOR,V_REC.TAX_UNIT_ID,V_REC.ASSG_ID, v_rec.ELEMENT_TYPE_ID, v_rec.ORGANIZATION_ID);
    COMMIT;
    END LOOP;
    END ;
    So, how could I assist our developer with this, so that she can run it again without it generating a ton of logs ? ?
    Thanks
    Oracle 9.2.0.5
    AIX 5.2

    The amount of redo generated is a direct function of how much data is changing. If you insert 'x' number of rows, you are going to generate 'y' mbytes of redo. If your procedure is destined to insert 1000 rows, then it is destined to create a certain amount of redo. Period.
    I would question the <i>performance</i> of the procedure shown ... using a cursor loop with a commit after every row is going to be a slug on performance but that doesn't change the fact 'x' inserts will always generate 'y' redo.

  • Multiple SELECTS or one Procedure to generate Count Statistics?

    I've got an application showing purchases from a catalog. I
    need to show statistics on those purchases -- the number of
    buyers by product by month, the number of buyers by source
    (space ads, direct mail, telephone, online) by month, the number
    of buyers by state by month, etc. In other words, there are a
    lot of row counts to generate.
    The question is, am I better off creating an SQL statement for
    each count request, or, since I have so many counts to generate,
    am I better off writing an SQL Procedure to loop through all the
    rows with a single table scan and update tables with the counts?
    An example count request -- counts by product code by month:
    SELECT TO_CHAR(purchdate, 'YYYYMM'), prodcode, count(*)
    FROM transactions
    GROUP BY TO_CHAR(purchase,'YYYYMM'), prodcode
    Oracle is pretty good at optimizing SQL, and it's certainly
    easier to focus on each SQL statement one at a time. But, it
    will require many full-table scans (and/or many indexes). The
    Procedure route is much more difficult to write in a general way
    (since I really have 30 or 40 different tables to do these
    statistics on with different columns to count in each table,
    with more coming in all the time).
    One more bit of info -- these counts are only generated after
    the file is updated. These updates are done monthly or
    quarterly, so these counts are not run all the time and are not
    generated on demand. We save them as PDF files for viewing.
    Any advice is greatly appreciated! :-)
    PS. I currently do this using Oracle Reports. This ends up as
    the "one SQL statement per count" method. But, I've just gotten
    a file in with 4 million records, and I don't want to wait until
    next year for the report to finish! :-)

    Dear Mr. Nagrajan,
    Thank you for your response. I have already gone through documents but not able to understand. Is there any setup for this ? or its just work around i.e. using template and special field in JV i.e. Ref. 1 /2
    My doubts :
    I understand that Chart of Account structure is one and common for IFRS and other accounting method. We need to create only those account separately ( 2 times with prefix like IFRS revenue account, GAAP Revenue account).
    Now at time of entry, Assume some entries / adjustment are specifically for IFRS and not for other ledger. In this case, What need to do ?
    You have mentioned about DTW approach but do we need to insert all JV's again with other ledger ?
    Someone suggested that if any entry which are specific to IFRS Ledger, We need to user Ref.1 /2 column or Transcation code column and in which we can put IFRS
    Based on this, Need to create 2 seperate template for IFRS and other ledger for all report.
    This is my understanding of Solution in SAP B1. Please help me to clarify my though process
    Please do needful.If you have done implemenation and if you can share doucment, it would be great help.
    Email :[email protected]

  • Procedure to generate new numbers using BRFplus

    Hi Experts,
    I need your suggestions  regarding my proposed solution to a requirement.
    The requirement is as following..I have to read the current number from a number range and by following certain rules generate new number..For e,g, if current number is 141 then next numbers would be 142,143....149.After 149 instead of 150 , the number should be 14A,14B....14Z and then 150.Also , we are not supposed to use alphabets like Q , O ,I (for e.g.14Q , 14O , 14I are prohibited)
    Now my proposal is to use a procedure call expression and then call a static method which incorporates the logic. Is this ok?
    I checked the other expressions but  couldn't find one which supports offset and replace operations. Could you guys please provide your valuable suggestions. Can I achieve this using any other expression?
    Regards,
    Raghu.

    It depends on the release and SP-level .
    You cannot do it with NW 701 but NW 702 should be fine. Any formula functions for stirng operations you need that is not (yet) available in the standard can easily be added. However, from a recent customer visit I took some homework back to Germany. The homework consists of a list of about 10 new formula functions for string operations such as replace, find, count occurencies, ... that we will add to the BRFplus standard with a note.
    BR,
    Carsten

  • WCF OData Service stored procedure call generates "Operation could destabilize the runtime" error with $select option

    I've been trying to call a stored procedure through Entity Framework and WCF Data Services (OData). It returns an entity not a complex type. Following walkthroughs found all over the web, I came up with this code inside my service:
    [WebGet]
    public IQueryable<Entity> GetEntitiesByParameterId(int parameterId)
    return CurrentDataSource.GetEntitiesByParameterId(parameterId).AsQueryable();
    Calling the proc this way: ~WcfService.svc/GetEntitiesByParameterId?parameterId=1 executes
    the stored procedure and returns entities that should be returned. No problem there.
    Everything works well until I try to use $select OData option ie. ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name.
    Upon debugging, the method above runs without any error but it returns an Operation could destabilize the runtime error upon reaching the
    client. After so much research, apparently it is a very general error pointing to a lot of different causes. I haven't found one that really matches my particular problem. Closest are 
    http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime
    https://social.msdn.microsoft.com/Forums/en-US/d2fb4767-dc09-4879-a62a-5b2ce96c4465/for-some-columns-entity-properties-executestorequery-failed-with-error-operation-could?forum=adodotnetdataservices 
    but none of the solutions worked on my end.
    Also, from the second article above:
    This is a known limitation of WCF DS. ...
    Second is that some of the queries won't work correctly because LINQ to EF needs little different LINQ expressions than LINQ to Objects in some cases. Which is the problem you're seeing.
    It has been posted on 2012. If it its true, are there still no updates on this? And is there any other workaround to get the $select working on the stored proc call?
    What works:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$top=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$skip-5
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$filter={filter query}
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$expand=SomeNavigationProperty
    What doesn't work:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name
    Tech details:
    EntityFramework 5, WCF Data Service 5.0, OData V3
    *I've also tried upgrading to EF6 and WCF 5.6.2 and it still didn't work.
    Any help would be appreciated. Thanks!

    Someone from SO replied to my question there and said that $select is still not supported though I couldn't find any definitive documentation about it.
    From what I gather and observed, $select breaks the stored procedure call because it tries to alter the data shape already gotten from the database and attempts to return a dynamic entity instead. Something about the stored proc returning an ObjectResult might
    be messing it up. As I have said, these are merely my observations.
    Workaround: I found a simple and elegant workaround for it though. Since my stored procedures are only getting data from the database and does
    not alter data in any way (INSERT, UPDATE, DELETE), I tried using table-valued functions that returns a table equivalent to the entity on my EF. I've found that calling this function on the Service Operation method returns an IQueryable<Entity> which
    is basically what is needed. $select also works now and so does other OData query options.
    Steps:
    Create a function on the database
    Update EDMX -> Add function
    Add new Function Import with Entity return type
    Create service operation in WCF Data Service that calls CurrentDataSource.<FunctionName>()
    Test in fiddler.
    CODES
    Database Function:
    CREATE FUNCTION GetEntities(@parameter)
    RETURN @entites TABLE(
    [Id] [int],
    [Name] [nvarchar](100),
    AS
    BEGIN
    INSERT INTO @entities
    SELECT [Id], [Name], ... FROM [EntityTable]
    RETURN
    END
    WCF:
    [WebGet]
    public IQueryable<Entity> GetEntity(int parameter)
    return CurrentDataSource.GetEntity(parameter);
    It doesn't really solve the stored procedure problem but I'm marking this as answer until someone can provide a better one as it does solve what I'm trying to do.
    Hope this helps others too. :)

  • Procedure to generate Salary slip in ECC 6.0

    Hi All
    How do we generate a Salary slip in ECC 6.0? what are the steps one needs to follow?
    Thanks in advance.
    Regards
    Mohammed
    Edited by: Mohammed1 on Nov 27, 2011 3:53 PM

    Creation of a pay slip is little bit tough for a beginner.Mostly line alignments u miss and it will be confusion better take help of Technical Consultant May be ABAP or ABAP Hr Help
    Still u can try using the following steps
    We can copy the Payslip from T-Code : PE51 and for each country there will be specific country payslip
    You  can copy it to the ZForm and select the radio button " Windows" add the earning wage types under W1 and deduction wage types Under W2
    Later select 'Cummulation Id's" and insert all earning wage types under earnings and Deduction wages under deductions and save the form and u can able to view ur wage types on the payslip
    Best Regards,

  • Procedure to generate time demensions using System date

    Hi Experts,
    I have created a Table having time dimensions such as Year start date , Month Start Date , Week start date etc. Now i need to write a stored Procedure to Populate all the above time dimensions of this Table based upon Calendar day for last 5 years and also 15 years going forward.
    Can you please guide on writing the Procedure for this.
    Thanks

    Hi John,
    Thanks.
    Actually we need to implement the same in HANA.
    The Table M_TIME_DIMENSION is not helping much as i need to do various time based calculations for YTD, MTD etc. that's why i thought to create some Time Dimension Table as stated in below blog by Ravindra.
    Implementation of WTD, MTD, YTD in HANA using Input Parameters Derived from Table
    For this i need to write Procedure to populate this table with all the required time dimensions.
    Please suggest.
    Thanks

  • Generate lowercase XML tags

    Hi,
    In my PL/SQL procedures, I generate XML files based on SQL queries, like this:
    SELECT XMLELEMENT ("web_vpreparations",
    XMLAGG(
    XMLELEMENT ("web_vpreparation",
    XMLFOREST (CODE as "code",
    COMMERCIAL_NAME as "commercial_name",
    As you can see, I rename my column names to their lower-case equivalents, because the client-side application which processes the XML file expects them to be in lower-case.
    I now have a huge view with hundreds of columns and would like to avoid having to rename each one. Is there a chance I can tell the PL/SQL or the SQL to return the XML nodes in lower-case?
    Suggestions on the "SQL and PL/SQL" and "XML DB" forums range from using XMLTable (incompatible with 9i, which some of my customers have) to transforming the generated XML via XSLT (I'd rather change the client-side code than add so much extra processing). Also, I see that DBMS_XMLGEN has a function called useLowerCaseTagNames(); but that means dumping XML/SQL for DBMS_XMLGEN, which - according to Ken Atkins' "XML Data Into and Out of Oracle – Using PL/SQL" - is limited in use for "real World" projects.
    I'm currently learning PL/SQL, experimenting with all the possibilities, and seeking the best solutions for the long-term (in terms of development time, performance, functionality, support).
    I'll appreciate any help on this problem.
    Chris.

    Does anyone know if XMLFormat passed to SYS_XMLGEN can convert the tags to lowercase? Its processingIns (processing instructions) parameter seems like it might help, but I'm unable to find a good description/example on the Web...

  • Need to add extra lines in email generating from oracle

    Hi!
    I am using Oracle 9i Enterprise Edition 9.2.0.6
    I am facing a problem while generating the email from Oracle
    Problem is that I want to display the data in following format
    Terminal Statistics From: 30-MAR-2008 15:39:00 To: 06-JUN-2008 16:59:00
    Containers Examined
    Export: 2
    Import: 30
    but email shows data in following format
    Terminal Statistics From: 30-MAR-2008 15:39:00 To: 06-JUN-2008 16:59:00 Containers Examined Export: 2 Import: 30
    System combines the all the data in one line, while I have used following function to add new line when and where needed, but unable to get my desired result.
    1. utl_tcp.CRLF
    2. chr(130) || chr(10)
    3. chr(10)
    I have used following procedure to generate the email.
    PROCEDURE send_html_email(
    p_module_name in varchar2,
    p_subject in varchar2,
    p_text in varchar2 default null,
    p_html in varchar2 default null
    IS
    l_boundary varchar2(32767) default 'a1b2c3d4e3f2g1';
    l_connection utl_smtp.connection;
    l_body_html clob := empty_clob; --This LOB will be the email message
    l_offset number;
    l_ammount number;
    l_temp varchar2(32767) default null;
    l_to varchar2(100);
    l_cc varchar2(100);
    l_bcc varchar2(100);
    t_v_stpt Number:=0;
    t_v_endpt Number:=0;
    c_v_stpt Number:=0;
    c_v_endpt Number:=0;
    b_v_stpt Number:=0;
    b_v_endpt Number:=0;
    l_subject varchar2(255);
    BEGIN
    /*Function to retrieve the E-mail recipients list according to the Module/application*/
    mail_recipient(p_module_name,l_to,l_cc,l_bcc);
    l_connection := utl_smtp.open_connection( pk_parameter.setting('MAILSVR'), 25 );
    utl_smtp.helo( l_connection, pk_parameter.setting('MAILSVR') );
    utl_smtp.mail( l_connection, pk_parameter.setting('MAILFROM') );
    l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
    LOOP
    t_v_stpt := t_v_stpt + 1;
    t_v_endpt := INSTR (l_to, ',', t_v_stpt, 1);
    IF l_to is null then
    EXIT;
    ELSIF t_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_to, t_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_to, t_v_stpt, t_v_endpt -t_v_stpt));
    END IF;
    t_v_stpt := t_v_endpt;
    END LOOP;
    LOOP
    c_v_stpt := c_v_stpt + 1;
    c_v_endpt := INSTR (l_cc, ',', c_v_stpt, 1);
    IF l_cc is null then
    EXIT;
    ELSIF c_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_cc, c_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_cc, c_v_stpt, c_v_endpt -c_v_stpt));
    END IF;
    c_v_stpt := c_v_endpt;
    END LOOP;
    LOOP
    b_v_stpt := b_v_stpt + 1;
    b_v_endpt := INSTR (l_bcc, ',', b_v_stpt, 1);
    IF l_bcc is null then
    EXIT;
    ELSIF b_v_endpt = 0 THEN
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_bcc, b_v_stpt));
    EXIT;
    ELSE
    UTL_SMTP.rcpt (l_connection, SUBSTR (l_bcc, b_v_stpt, b_v_endpt -b_v_stpt));
    END IF;
    b_v_stpt := b_v_endpt;
    END LOOP;
    /*Header creation for email.*/
    IF l_to is not null or l_cc is not null or l_bcc is not null THEN
    l_temp := l_temp || 'To: ' || l_to || chr(13) || chr(10);
    l_temp := l_temp || 'CC: ' || l_cc || chr(13) || chr(10);
    l_temp := l_temp || 'BCC: ' || l_bcc || chr(13) || chr(10);
    l_temp := l_temp || 'From: ' || pk_parameter.setting('MAILFROM') || chr(13) || chr(10);
    l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
    l_temp := l_temp || 'Reply-To: ' || pk_parameter.setting('MAILFROM') || chr(13) || chr(10);
    l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
    chr(34) || l_boundary || chr(34) || chr(13) ||
    chr(10);
    -- Write the headers
    dbms_lob.createtemporary( l_body_html, false, 10 );
    dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
    -- Write the text boundary
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    l_temp := '--' || l_boundary || chr(13)||chr(10);
    l_temp := l_temp || 'content-type: text/plain; charset=us-ascii' ||
    chr(13) || chr(10) || chr(13) || chr(10);
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Write the plain text portion of the email
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
    -- Write the HTML boundary
    l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
    chr(13) || chr(10);
    l_temp := l_temp || 'content-type: text/html;' ||
    chr(13) || chr(10) || chr(13) || chr(10);
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Write the HTML portion of the message
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
    -- Write the final html boundary
    l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
    l_offset := dbms_lob.getlength(l_body_html) + 1;
    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    -- Send the email in 1900 byte chunks to UTL_SMTP
    l_offset := 1;
    l_ammount := 32767;
    utl_smtp.open_data(l_connection);
    while l_offset < dbms_lob.getlength(l_body_html) loop
    utl_smtp.write_data(l_connection, dbms_lob.substr(l_body_html,l_ammount,l_offset));
    l_offset := l_offset + l_ammount ;
    l_ammount := least(32767,dbms_lob.getlength(l_body_html) - l_ammount);
    end loop;
    utl_smtp.close_data(l_connection);
    utl_smtp.quit( l_connection );
    dbms_lob.freetemporary(l_body_html);
    END IF;
    END;
    Following procedure calls the above function and generate the email
    PROCEDURE generate_statistics
    IS
    l_minutes NUMBER:=0;
    l_sub_type cg_ref_codes.rv_meaning%type;
    l_gate_text VARCHAR2(5000);
    l_ves_text VARCHAR2(5000);
    l_exm_text VARCHAR2(5000);
    l_email_text VARCHAR2(5000);
    l_gate_tot NUMBER:=0;
    l_load_tot NUMBER:=0;
    l_discharge NUMBER:=0;
    l_exm_tot NUMBER:=0;
    /*Declare Cursor to get Examined Containers Summary*/
    CURSOR cur_examined_ctrs IS
    SELECT decode(eu.category,'I','Import','E','Export') Category, count(*) Total
    FROM service_events se, equipment_uses eu
    WHERE se.performed BETWEEN round(sysdate-l_minutes/1440,'mi')
    AND round(sysdate,'mi')
    AND se.tserv_id IN ('EXM')
    AND eu.gkey = se.equse_gkey
    AND eu.category IN ('I','E')
    GROUP BY eu.category;
    BEGIN
    /*Retrieve parameterized minutes*/
    l_minutes := nvl(pk_parameter.setting('STATSGMI'),0);
    /*Assign Values to generate email*/
    l_email_text := 'Terminal Statistics From: '||
    to_char(round(sysdate-l_minutes/1440,'mi'),'DD-MON-RRRR HH24:MI:SS')||
    ' To: '||to_char(round(sysdate,'mi'),'DD-MON-RRRR HH24:MI:SS')||
    chr(13) || chr(10)||chr(13) || chr(10);
    l_exm_text := 'Containers Examined'||utl_tcp.CRLF;
    FOR rec_examined_ctrs IN cur_examined_ctrs LOOP
    /*Generate Text for email - Vessel Activity Crane Wise Starts*/
    l_exm_text := l_exm_text ||rec_examined_ctrs.category ||': '||
    rec_examined_ctrs.total||utl_tcp.CRLF;
    l_exm_tot := l_exm_tot + rec_examined_ctrs.total;
    END LOOP;
    l_email_text := l_email_text||l_exm_text;
    pk_kictl_email.send_html_email('TERM STATISTICS',
    'Terminal Statistics Report',
    l_email_text,
    l_email_text
    END;
    I have been searching the reason and solution on net since last 2 days but hasn't find it yet.
    would anybody plz help me regarding this.
    Thanks
    Hassan

    I checked your suggestions after week end today and found that
    the suggestion of Nalla did not provide the result in my required format
    rewrite it as l_email_text := l_email_text||CHR(10)||l_exm_text;
    Peter & Krithika:
    I used html tag <BR> when and where needed and its gave me result in my required format
    e.g.: l_exm_text := l_exm_text ||'<br>'||rec_examined_ctrs.category ||': '||
    rec_examined_ctrs.total;
    Now I want to know if there any html tag thru which I can define the column number so that my text will start from there.
    means any html tag replacement of lpad (oracle funtion):
    Thanks
    Hassan

  • Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf

    Hi,
    I have a requirement to display output from a particular table in XL format. Out of all the known possible options, I am planning to use the XML publisher to generate XL output.
    For the data source, instead of using the conventional way of creating XML data using rdf,I am planning to use DBMS_XMLGEN.getxmltype pl/sql procedure to generate the XML output. And from the output, call the template to generate the required Excel output.
    Now, I am using the following code to generate XML output but am not sure how to proceed from here. I need to first print the XML data in the FND Output file after which I was planning to call the 'XML Report Publisher' (XDOREPPB) program and use the current request id to get the excel output but I am not able to find the way to print the XML data in the output file as:
    fnd_file.put_line (fnd_file.output, l_xml_type); - is throwing an error as l_xml_type is an XML data output.
    PROCEDURE xml_main (
    errbuf OUT VARCHAR2
    ,retcode OUT VARCHAR2
    ,p_project_from IN VARCHAR2
    ,p_project_to IN VARCHAR2
    AS
    l_xml_type XMLTYPE;
    BEGIN
    SELECT DBMS_XMLGEN.getxmltype
    ('SELECT fnd_global.conc_request_id
    ,TO_CHAR (segment1)
    ,to_char(start_date,''MM/DD/RRRR'')
    ,to_char(xxmcc_project_details_pkg.current_profit_projection
    (project_id),''999,999,990.90'')
    ,to_char(xxmcc_project_details_pkg.cost_to_date (project_id),''999,999,990.90'')
    ,''1''
    FROM pa_projects_all
    WHERE segment1 BETWEEN NVL (p_project_from, segment1)
    AND NVL (p_project_to, segment1)')
    INTO l_xml_type
    FROM DUAL;
         fnd_file.put_line (fnd_file.output, l_xml_type);
    END xml_main;
    Can anyone point me as to how to publish XML output using a PL/SQL procedure (DBMS_XMLGEN.getxmltype)
    Thanks.

    Pl see if the example included in this presentation helps http://www.oracle.com/technology/products/applications/Events/OOW-2006/EBS/S281401_Sridhar_Bogelli.pdf
    Also, you do not need to explicitly call XDOREPPB in later versions of XML Publisher. If you set up everything correctly (as described in the presentation above and the link below) the Output Post Processor is called automatically after the XML file is generated successfully.
    Another excellent tutorial is at http://www.oracle.com/technology/obe/fusion_middleware/fusion/bi/xmlp_ebiz/index.html
    HTH
    Srini

  • Stored procedures not working after migrating from 8i to 10g

    The Oracle stored procedures are generating an error following upgrading a ColdFusion web application from Oracle8i to 10g release 2.
    "Error","jrpp-102","05/28/08","13:35:09","insite","Error Executing Database Query.[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'S_DEFAULT_LETTER_SETTING' ORA-06550: line 1, column 7: PL/SQL: Statement ignored The specific sequence of files included or processed is: new_letter.cfm, line: 63 "
    I've been looking at this for about 3 days with a colleague in the office. We can resolve this be recreating the stored procedure with a new name (e.g. adding the suffix "_v2"). Its not really practical for us to do this throughout the system. Anyone know what the root cause might be?
    I'm currently connecting to Oracle10g using SQLTools and Oracle8 client. I've yet to upgrade to Oracle10 client.
    I've tried selecting all the stored procedures and re-compiling them but it appeared to make no difference.

    The Oracle stored procedures are generating an error following upgrading a ColdFusion web application from Oracle8i to 10g release 2.
    "Error","jrpp-102","05/28/08","13:35:09","insite","Error Executing Database Query.[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'S_DEFAULT_LETTER_SETTING' ORA-06550: line 1, column 7: PL/SQL: Statement ignored The specific sequence of files included or processed is: new_letter.cfm, line: 63 "
    I've been looking at this for about 3 days with a colleague in the office. We can resolve this be recreating the stored procedure with a new name (e.g. adding the suffix "_v2"). Its not really practical for us to do this throughout the system. Anyone know what the root cause might be?
    I'm currently connecting to Oracle10g using SQLTools and Oracle8 client. I've yet to upgrade to Oracle10 client.
    I've tried selecting all the stored procedures and re-compiling them but it appeared to make no difference.

  • Remote Stored Procedure Call Dispatcher WEB WERVICE

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

    Hello all,
    Environment: Windows OS, Oracle 10g, mod_plsql
    I am looking for solutions to the following problem:
    A way to dispatch calls to stored procedures from client to server with a minimal impact on performance.
    We are looking at two possible solutions:
    1) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through mod_plsql.
    2) Making a call to a Remote Stored Procedure Call Dispatcher (RSPCDispatcher) stored procedure through a web service.
    Solution 1) is not the preferred one as you may already know that mod_plsql will not be supported starting 12g.
    Solution 2) is the one we prefer as we believe that web services will be ever more supported in the future. When we move to 11g we may turn this web service into a native one (avoiding overhead in the OC4J for hosting the web service etc.).
    We are looking for code examples and information pointers of how we could implement this dispatcher as a stored procedure in a DB package. We know that the implementation should be similar to the one done for mod_plsql in the OWA schema but the code there is obfuscated, so we could not borrow ideas from there.
    We are not sure how to deal with the generalization of the above stated problem. We need to be able to pass to this dispatcher the stored procedure package and name we are invoking, ordered list of parameters (or parameters map), and the transport strategy (XML, JSON, etc.).
    Basically, we are notsure how to deal with the USING clause of the EXECUTE IMMEDIATE statement. We can dynamically generate the SQL statement corresponding to the stored procedure we want to call, but we are not sure how to bind the parameters we are passing?
    Also, we know that EXECUTE IMMEDIATE may be slow sometimes. So if could avoid it, this could further improve performance.
    Perhaps the run-time generalized stored procedure execution may not be what we are looking for?! Perhaps we should include several design-time steps?! What about a script that given a package name (or just a single stored procedure) would generate a wrapper package which stored procudures' names would correspond to their respective counterparts in the given package which would take two parameters - the list of parameters in some sort of format, and the transport (content delivery strategy) and would return the result in the given content delivery strategy?! This script may also define the XSD of the XML message a stored procedure is called with (the parameter map) as well as the XSD of the XML result the stored procedure returns. Also the script could generate client code with the given language strategy (Java, .NET, etc.) for calling the RSPCDispatcher web service.
    We request the following from the Oracle community folks:
    a) Please, give us any relevant information that could be helpful to resolve this problem.
    b) Any resource of how to inspect stored procedures in a package, its parameters, parameter types and direction (IN, OUT, or INOUT), etc.
    Thank you very much in advance.
    Regards,
    Georgi

  • How to generate checks when executing Automatic Payment Program (F110)

    Is it possible to generate checks automatically when I execute the automatic payment program? Will reward points to any suggestion. Thanks!

    hi patrick
    try this.....ur problem may solve.....
    Create Automatic Payment Transactions (F110)
    Purpose
    Use this procedure to generate checks proposals or ACH proposals and then subsequently issue checks or set up ACH files to be transmitted to the bank.
    Trigger
    Perform this procedure when through either an ACH or a check, a creditor of the University needs to be paid.
    Prerequisites
    Open invoices with reached due dates have to be present in the SAP system.
    Menu Path
    Use the following menu path to begin this transaction:
    ·         Select Accounting  Financial Accounting  Accounts Payable  Periodic processing  Payments to go to the Automatic Payment Transactions: Status screen.
    Transaction Code
    F110
    Business Process Information
    The automatic payment process will be centrally managed in the Accounts Payable Office. The automatic payment program will be executed each day for all open invoices (across vendors) in the system. There will be separate payment run execution corresponding to each payment method category:
    Check payments: clears the open invoices and issues a check output
    ACH payments: clears the open invoices and issues an ACH file output
    Foreign currency payments: clears open invoices but no output is issued
    State/Grant payments: clears open invoices but no output is issued
    The process steps executed during the automatic payment program are:
    Enter Payment Parameters
    Edit/review Payment Proposal
    Post Payments
    Generate Payment Medium (print checks or create ACH payment file)
    Generate Positive Payment File
    The payment parameters are entered in order to limit the open invoices and credits selected for payment. It is important to note that the payment terms that are defined on the invoice will drive whether a invoice is due for payment during the current payment run. During the payment program execution, the invoices that are due for payment will be presented to the user on a payment proposal list.
    The payment proposal is a list of expected payments grouped by vendor account. Invoices that are due for payment but cannot be paid due to some kind of accounting or system error are listed as exceptions. Examples of typical exceptions are missing banking information (for ACH payments) and blocked invoices. Some payment exceptions will be resolved at the Accounts Payable Office. However the Department must resolve some exceptions. When these types of exceptions appear on the payment proposals, the Accounts Payable Office will inform the Department of the blocked payment in order to get a resolution. Key personnel in the Accounts Payable Office will be the only resources to have access to the editing function of the payment proposal processing. Typically, there is no business reason the edit or change a payment proposal. Editing options for a payment proposal includes: changing the default disbursing bank account information or changing the payment method.
    After the payment proposals have been reviewed and edited, the proposals are posted as payments. It is important to note that any open credit on the vendor's account is also taken in consideration when creating the vendor's payment. The payment method supplement defined on the invoice will drive the check sorting.
    In addition to the printed check output, the payment program run produces an ACH file and a Positive Pay file. Both files are sent to the bank for further processing. The ACH file contains the vendor's payment and banking data. The Positive Pay file contains the check data (check processed, voided, etc) and is used for confirmation of payments.
    Helpful Hints
    ·         The R/O/C column in the field description tables below defines whether the field is required (R), optional (O), or conditional (C).
    ·         On certain screens you may have to scroll to view some data entry fields.
    ·         Click the  tab to view the current overall status of the payment process by viewing the informational messages.
    Procedure
    1. Start the transaction using the menu path or transaction code.
        Automatic Payment Transactions: Status
    2. As required, complete the following fields:
    ·         Run date
    ·         Identification
    3. Click the  tab.
    The payment program parameters are used to limit the program's selection of open invoices and credits.
        Automatic Payment Transactions: Parameters
    4. As required, complete/review the following fields:
    ·         Posting date
    ·         Docs entered up to
    ·         Company codes
    ·         Pmt meths
    ·         Next p/date
    ·         Vendor
    5. Click the  tab.
    Free selection criteria are extended parameter selection criteria used to limit the open invoices and credits selected in the payment run.
        Automatic Payment Transactions: Free Selection
    6. Perform any of the following:
    If You Want To
    Then
    Select data by a particular field value; use the match code on the Field Name field to obtain the required field
    Enter the required field value to be considered in the payment program selection of open items. The field value is entered in the Values field
    Payment selection can be based on fields on the invoice or credit memo document or fields on the vendor master.
    Example: A (AP payment block)
    Exclude the open items that match your field value
    Select  to the left of Exclude values.
    Include only those open items that match your field value
    Deselect  to the left of Exclude values.
    7. Click the  tab.
    This information is used to expand the information that is automatically recorded in the payment run log. The payment run log is used to diagnose any program errors during the payment run.
        Automatic Payment Transactions: Additional Log
    8. Perform the following:
    If You Want the Payment Program Log to Record
    Then
    Information on due date check
    Select  to the left of Due date check.
    Activate this option.
    Any payment method selection data
    Select  to the left of Payment method selection in all cases.
    Activate this option.
    Line item information the payment documents generated upon posting the payment proposal
    Select  to the left of Line items of the payment documents.
    Activate this option.
    9. As required, complete/review the following fields:
    ·         Vendors (from)
    ·         Vendors (to)
    Enter the same vendor account number range for Accounts required section of the transaction.
    10. Click the  tab.
    The specifications defined in this section of the transaction inform the payment program the correct form to use for check printing and the correct payment file format to use for ACH payments.
        Automatic Payment Transactions: Printout and DME
    11. As required, complete the following fields:
    ·         RFFOAVIS
    ·         RFFOUS_C
    12. Click the  tab.
        Exit editing
    13. Click  to save the data.
    If you want to delete the payment program parameters entered, select Edit  Parameters  Delete.
        Automatic Payment Transactions: Status (2)
    The system displays the message, "Details have been saved for the run on XX/XX/XX XXXX."
    14. Click  .
    If you want to refresh the screen in order to view the current status (processing step) of the payment program click  at any time.
        Schedule Proposal
    15. Perform one of the following:
    If You Want To
    Then
    Execute the payment program (i.e. process the payment parameters entered and create a payment proposal) immediately
    Select  to the left of Start immediately.
    Activate this option.
    Designate a target computer
    Enter the name in the Target computer field.
    16. Click  to process the payment parameters and create a payment proposal.
    While the payment program is selecting and processing data, the status will display the message, "Proposal is running." When the payment proposal has completed and is ready for review/edit, the system will display the message, "Payment proposal has been created."
        Automatic Payment Transactions: Status (3)
    The system displays the message, "Proposal run has been scheduled."
    17. Click  .
        Automatic Payment Transactions: Status (4)
    The system updates the status, "Payment proposal has been created."
    18. Perform one of the following:
    If You Want To
    Then
    Go To
    Execute the payment run
    Click  .
    Step 19
    Edit the payment proposal
    Click  .
    Step 43
    Display the payment proposal
    Click  .
    Step 54
    Display the payment proposal run log
    Click  .
    Step 57
    Delete the proposal
    Select Edit  Proposal  Delete.
    Step 60
    Display the proposal list in a printer friendly format
    Select Edit  Proposal  Proposal List....
    Step 62
    Display only the exception (error) invoices or credits
    Select Edit  Proposal  Exception List....
    Step 67
    Exit this transaction
    Step 72
        Schedule Payment
    19. Perform the following:
    If You Want To
    Then
    Execute the payment program (i.e. process the payment parameters entered and create a payment proposal) immediately
    Select  to the left of Start immediately.
    Activate this option.
    Designate a target computer
    Enter the name in the Target computer field.
    20. Click  to process the payment proposal and post the payment documents.
    While the payment program is selecting and processing data, the status will display 'Payment is running'. When the payment proposal posted the status will display 'Payment run has been carried out. Posting orders X generated, X completed. (X will represent the total number of checks produced).
        Automatic Payment Transactions: Status (5)
    The system displays the message, "Payment run has been scheduled."
    21. Click  .
        Automatic Payment Transactions: Status (6)
    The system updates the status, "Payment run has been carried out." If you click  after seeing the status update, "Payment run has been carried out", the system will display an update to the status, "Posting orders: XXXX generated, XXXX completed."
    22. Perform one of the following:
    If You Want To
    Then
    Go To
    Review the payments posted
    Click  .
    Step 23
    Display the payment proposal
    Click  .
    Step 26
    Display the payment proposal run log
    Click  .
    Step 29
    Display the payment list in a printer friendly format
    Select Edit  Payments  Payment List.
    Step 32
    Display only the exception (error) invoices or credits
    Select Edit  Payments  Exception List.
    Step 36
    Print the payment run information
    Click  .
    Step 40
    Exit this transaction
    Step 72
        Job Log Entries for F110-XXXX-XXXX / XXXX
    23. Review the displayed information.
    24. Click  .
    25. Return to Step 22.
        Display Payment Proposal: Payments
    26. Review the displayed information.
    27. Click  .
    28. Return to Step 22.
        Job Log Entries for F110-XXXX-XXXX-X / XXXX (2)
    29. Review the displayed information.
    30. Click  .
    31. Return to Step 22.
        List Variant
    32. Click  .
        Payment list
    33. Review the displayed information.
    34. Click  .
    35. Return to Step 22.
        List Variant (2)
    36. Click  .
        Payment list (2)
    37. Review the displayed information.
    38. Click  .
    39. Return to Step 22.
        Schedule Print
    40. As required, complete/review the following fields:
    ·         Start date
    ·         Start immediately
    ·         Start time
    ·         Target computer
    ·         Job name
    41. Click  .
    42. Return to Step 22.
        Accounting clerk
    43. Click  .
        Edit Payment Proposal: Payments
    44. Review the displayed information.
    45. Perform one of the following:
    If You Want To
    Then
    Go To
    Continue with the payment process
    Click  .
    Step 18
    Review/edit invoice information for the payment (invoice numbers, discounts, payment amounts, etc).
    1. Click on the line you want to select.
    2. Click  .
    Step 46
    Change the key payment information (payment method, house bank, payee name and address, etc.)
    1. Click on the line you want to select.
    2. Click  .
    This option does not work for lines that have exceptions.
    Step 51
        Edit Payment Proposal: Open Items
    46. Double-click on the line you want to choose.
        Change Line Items
    47. As required, complete/review the following fields:
    ·         Payment block
    ·         Discount amount
    ·         Cash discount %
    48. Click  .
    49. Click  .
    50. Return to Step 45.
        Change Payment
    51. As required, complete/review the following fields:
    ·         Payment method
    ·         Pmt meth.supl.
    ·         Due date
    52. Click  .
    53. Return to Step 45.
        Display Payment Proposal: Payments
    54. Review the displayed information.
    55. Click  .
    56. Return to Step 18.
        Job Log Entries for F110-XXXX-XXXX-X / XXXX (3)
    57. Review the displayed information.
    58. Click  .
    59. Return to Step 18.
        Delete proposal
    60. Click  .
        Automatic Payment Transactions: Status (7)
    The system displays the message, "Data and log deleted."
    61. Go to Step 72.
        List Variant (3)
    62. As required, complete the following field:
    ·         Variant
    63. Click  .
        Payment list (3)
    64. Review the displayed information.
    65. Click  .
    66. Return to Step 18.
        List Variant (4)
    67. As required, complete the following field:
    ·         Variant
    68. Click  .
        Payment list (4)
    69. Review the displayed information.
    70. Click  .
    71. Return to Step 18.
    72. Click  until you return to the SAP Easy Access screen.
    73. You have completed this transaction.
    Result
    You have executed a payment proposal, executed and posted a payment run and printed checks.
    reward me points.......dont forget

  • Generate a text file using Portal

    Hello Everyone,
    I need to generate a flat text file from a portal screen. I have no idea as
    to what is the best way to do this. I have a screen on which i will have a
    push button which when pressed needs to run a procedure which generates a
    text file.
    I don't know whether this is possible also or not.
    Any help in the matter would be great.
    Thanks.

    Hi,
    You can create a procedure like this.
    create or replace procedure op1
    as
    begin
    htp.init;
    owa_util.mime_header('plain/text', false);
    htp.p('Content-Disposition: attachment; filename='||'output.txt');
    owa_util.http_header_close;
    htp.p('My output is text...');
    exception
    when others then
    null;
    end;
    This will direct the ouput to a file called output.txt.
    Thanks,
    Sharmila

Maybe you are looking for

  • MacBook Pro running Lion 10.7.2 with second display

    I have a 27" Samsung monitor as my main display hooked up to my MacBook Pro. I just recently updated to Lion. Now, sometimes, when I open the MBP and turn on the Samsung monitor the MBP screen stays black and I have to go to the Displays icon on the

  • My click wheel doesn't work!

    I can still play music, but it's very annoying and frankly, i don't know what to do! Please help me!

  • Un-install Acrobat Pro 7.0 - No Install disk

    I need to uninstall Acrobat Pro 7.0 from my computer I do not have the installation disk It is not listed in control panel - add/remove programs I've tried downloading the latest version (Acrobat XI) to install the trial version... Installing Acrobat

  • Remoteapp program

    I am not able to access web area access manager under remote app programs which is under remote desktop. While accessing the web area access manager am getting the following error message   Error: The connection was denied because the user account is

  • SQL Server 2000 Reporting withJava

    Hi All, Can any one give the code to open SQL Server 2000 Reporting file (i.e, with the extension '.rdl') as we do for the crystal reports '.rpt' file in jsp. Is there any eclipse plugin for SQL Server 2000 Reporting service. thanks in advance.