1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

AP Invoice Interface Sample Script in R12

Discussion in 'Oracle Apps Technical' started by jagadekara, Jan 29, 2015.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi All,

    I need AP Invoice Interface Sample Script in R12. Does any one have this?
     
  2. hsabanka

    hsabanka Active Member

    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    85
    hi attaching

    insert into AP_INVOICES_INTERFACE (
    invoice_id,
    invoice_num,
    vendor_id,
    vendor_site_id,
    invoice_amount,
    INVOICE_CURRENCY_CODE,
    invoice_date,
    gl_date,
    DESCRIPTION,
    PAY_GROUP_LOOKUP_CODE,
    source,
    org_id
    )
    values (
    AP_INVOICES_INTERFACE_S.NEXTVAL,
    'test_inv2',
    01,
    46,
    1200.00,
    'USD',
    '20-Nov-2014',
    '20-Nov-2014',
    'test Invoice',
    'Supplier',
    'MANUAL INVOICE ENTRY',
    161
    );


    insert into AP_INVOICE_LINES_INTERFACE (
    invoice_id,
    invoice_line_id,
    line_number,
    line_type_lookup_code,
    amount,
    dist_code_combination_id
    )
    values (
    AP_INVOICES_INTERFACE_S.CURRVAL,
    AP_INVOICE_LINES_INTERFACE_S.NEXTVAL,
    1,
    'ITEM',
    1200.00,
    100010645
    );


    commit;
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Thank Hsabanka,

    With this code I am able to create invoice with lines and distributions.

    But I need to insert one Invoice Header with 10000 amount and 3 line item with 2000, 5000 and 3000, and 4 distributions. Means for second line item I need 2 distributions with 1000 and 4000 amounts.

    So how can I achieve this?
     
  4. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Jagadekara,

    You can have 1 invoice header with multiple line items: in your case, you can have something like:

    However, it's not possible to have 2 distribution lines for 1 invoice line.

    The Payables Open Interface Import process currently does not support entering one invoice line with multiple distributions. There's a request for enhancement (ER) which has been logged with Oracle to request the ability to have multiple distributions for each line when importing invoices. Please see note 1279776.1 and ER 10087267 for more information.

    However, as a work around you can use a distribution set to generate multiple distributions.
    You need to specify a distribution set in the row in AP_INVOICE_LINES_INTERFACE.Distribution_Set_Name or AP_INVOICE_LINES_INTERFACE.Distribution_Set_ID.
     
  5. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Thank you so much Rajen.