Miro for services using bapi_incominginvoice_create

i need to automate miro for services.
Please help how I can do this with code using above BAPI.
Thanks

Dear all,
                 It will be very helpful & ll be thankful if any ideas shared to overcome below issue.
               I was trying to create invoice using BAPI_incoming_invoice of service document type.the invoice is created but while checking in accounting data amount is gone for coin adjustment,which is wrong as per my functional.
My code & outcome is are attached.
REPORT ZBAPI_AUTO_MIRO_SERVICES.
DATA: headerdata TYPE bapi_incinv_create_header,
       itemdata TYPE TABLE OF  bapi_incinv_create_item,
       ls_itemdata TYPE  bapi_incinv_create_item,
       ls_accountingdata type bapi_incinv_create_account,
       accountingdata type table of bapi_incinv_create_account,
       return  TYPE TABLE OF  bapiret2,
       ls_return TYPE bapiret2,
       invoicedocnumber  LIKE  bapi_incinv_fld-inv_doc_no,
       fiscalyear  LIKE  bapi_incinv_fld-fisc_year,
       taxdata TYPE TABLE OF bapi_incinv_create_tax,
       ls_taxdata TYPE bapi_incinv_create_tax,
       gldata  TYPE TABLE OF bapi_incinv_create_gl_account,
       ls_gldata TYPE bapi_incinv_create_gl_account,
       vsplit TYPE TABLE OF bapi_incinv_create_vendorsplit,
       ls_vsplit TYPE bapi_incinv_create_vendorsplit.
DATA:counter TYPE i.
DATA: it_exload LIKE alsmex_tabline  OCCURS 0 WITH HEADER LINE.
DATA:BEGIN OF it_final OCCURS 0,
      doc_date(8),
      doc_type(2),
      ref_doc_no(20),
      pstng_date(8),
      comp_code(4),
      diff_inv(10),
      currency(3),
      gross_amount(13),
      exch_rate(6),
      header_txt(25),
      del_costs_taxc(2),
      alloc_number(20),
      bus_area(4),
      item_text(50),
      business_place(4),
      invoice_doc_item(6),
      po_number(10),
      tax_code(2),
      item_amount(13),
      po_item(5),
      quantity(5),
      po_unit(2),
      cond_type(4),
      freight_ven(10),
      INVOICE_DOC_ITEM1(6),
      SERIAL_NO1(2),
      TAX_CODE1(2),
      ITEM_AMOUNT1(13),
      QUANTITY1(5),
      PO_UNIT1(2),
END OF it_final.
  headerdata-invoice_ind = 'X'.
   headerdata-CALC_TAX_IND = 'X'.
   headerdata-doc_type  = 'RE'.
   headerdata-doc_date    = '20150309'.
   headerdata-ref_doc_no =  'GDFGDFG'.
   headerdata-pstng_date  = '20150309'.
   headerdata-comp_code  = 'VALC'.
*  headerdata-diff_inv   = '0000203495'.
   headerdata-currency = 'INR'.
   headerdata-gross_amount = '657.30'.
   headerdata-exch_rate = '1.00000'.
   headerdata-PMNTTRMS = '0001'.
   headerdata-bline_date = '20150309'.
   headerdata-bus_area =   '3001'.
   headerdata-header_txt = 'abcddfghvkj'.
*  headerdata-del_costs_taxc = it_final-del_costs_taxc."'P0'.
   headerdata-alloc_nmbr = 'BVKJFDLNV'.
   headerdata-item_text = 'BJFDBVKBDSVK'.
   headerdata-business_place = '1000'.
ls_itemdata-invoice_doc_item = '000001'.
   ls_itemdata-po_number = '6600003195'.
   ls_itemdata-po_item = '00010'.
   ls_itemdata-tax_code = 'S1'.
   ls_itemdata-item_amount = '585.00'.
   ls_itemdata-quantity = '3'."it_final-quantity.
   ls_itemdata-po_unit  = 'NO'.
   ls_itemdata-ref_doc = '1000363624'.
   ls_itemdata-ref_doc_it = '001'.
   ls_itemdata-REF_DOC_YEAR = '2015'.
   ls_itemdata-SHEET_NO = '1000363624'.
   ls_itemdata-SHEET_ITEM = '0000000010'.
   APPEND ls_itemdata TO itemdata.
   CLEAR ls_itemdata.
PERFORM COMMIT_WORK.
FORM COMMIT_WORK.
*  LOOP AT taxdata.
     CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
     EXPORTING
       headerdata       = headerdata
**   ADDRESSDATA         =
     IMPORTING
       invoicedocnumber = invoicedocnumber
       fiscalyear       = fiscalyear
     TABLES
       itemdata         = itemdata
*   accountingdata      = accountingdata
*      glaccountdata    = gldata
*     MATERIALDATA     = matdata
*     TAXDATA          = taxdata
**   WITHTAXDATA         =
**   VENDORITEMSPLITDATA =
       return           = return.
**   EXTENSIONIN         =
**   TM_ITEMDATA         =
**   NFMETALLITMS        =
   IF return IS NOT INITIAL.
     LOOP AT return INTO ls_return WHERE type = 'E'.
       FORMAT INTENSIFIED.
       WRITE: / ls_return-message COLOR 6.
       FORMAT INTENSIFIED OFF.
     ENDLOOP.
   ELSE.
     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         wait   = 'X'
       IMPORTING
         return = ls_return.
     IF sy-subrc = 0 .
       FORMAT INVERSE .
       WRITE:  'Invoice & Created Successfully' COLOR 5,invoicedocnumber COLOR 5 .
       FORMAT INVERSE OFF.
     ENDIF.
   ENDIF.
CLEAR headerdata.
REFRESH itemdata.
REFRESH accountingdata.
REFRESH TAXDATA.
*ENDLOOP.
ENDFORM.

Similar Messages

  • Posting Difference in MIRO for Service PO

    Dear All
    We have encountered the following problem during MIRO
    Description         Amount Crcy     Amunt in LC   LCurrcy
    Customer a/c        67586-   USD   108423.84 -       AUD
    GR IR A/c             67586    USD     84604.12         AUD
    Maintenance a/c    0           USD     23819.72         AUD
    The above entry has come through MIRO for Service Order. Most of the FI documents have been created with these differences.
    What should be the likely error.
    Regards
    Ramesh

    Hi,
    This is due to change in exchange rate only between GR date and IR date. the GR/IR account is same as GR document entry and the difference in amount due to exchange rate will not flow into GR/IR clearing account and hence posted to seperate account

  • Set quantity field disabled in MIRO for Services PO

    ¿How can I do in order to disable the quantity field in MIRO transaction ? (Only for Services PO)
    Edited by: Luis  Ganoza on Oct 11, 2011 9:01 PM

    Hi,
    Please check whether you have selected service based invoice verification indicator in service PO or not. I f not selected select and see. Ultimately the quantity field will be greyed out. An alternative is use OLMRLIST transaction and Now Click on "Change" button and Confirm the Message by Pressing Enter. Here mark  Quantity (DRSEG-MENGE)
    field as "Output Only". Thanking you.

  • How to post MIRO for services .?

    Dear All ,
                                               User is doing an entry of MIRO here the total amount for service charges are 4,500 INR & serv. tax on it is 600INR ( For ex. ) now user wants that in mormal IV the amount is having the total of serv. charges + taxes but in this case user do not want to take the credit of serv. tax hence he wants that this sserv. tax should be posted to other liability G.L instead of Serv. tax credit G.L , can u pl guide how to post such MIRO .?
    Rgds .
    SAP2008
    Edited by: sap2008 on Jan 8, 2009 10:20 AM

    Hi
    Create MIRO, change the tax code to V0- No Tax in the header level as well as item level, so that you can able to post amount without service tax.
    Regards
    Prasanna R

  • Get claims for service using Windows validation

    I have the following code which was validation using username & password. How can I use Windows credentials instead?
    private static SecurityToken GetClaims(string serviceurl, string username, string password)
    bool isincurrentusercontext = String.IsNullOrEmpty(username);
    WS2007HttpBinding binding = new WS2007HttpBinding();
    binding.Security.Mode = SecurityMode.TransportWithMessageCredential;
    binding.Security.Message.EstablishSecurityContext = false;
    EndpointAddress endpoint = new EndpointAddress(new Uri(GetStsUrl(isincurrentusercontext)));
    WSTrustChannelFactory trustChannelFactory;
    if (!isincurrentusercontext)
    binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
    binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
    trustChannelFactory = new WSTrustChannelFactory(binding, endpoint);
    trustChannelFactory.Credentials.UserName.UserName = username;
    trustChannelFactory.Credentials.UserName.Password = password;
    else
    trustChannelFactory = new WSTrustChannelFactory(new KerberosWSTrustBinding(SecurityMode.TransportWithMessageCredential), endpoint);
    trustChannelFactory.TrustVersion = TrustVersion.WSTrust13;
    trustChannelFactory.Credentials.UseIdentityConfiguration = true;
    WSTrustChannel channel = null;
    RequestSecurityToken rst = new RequestSecurityToken(RequestTypes.Issue);
    rst.AppliesTo = new EndpointReference(serviceurl);
    rst.KeyType = KeyTypes.Bearer;
    channel = (WSTrustChannel)trustChannelFactory.CreateChannel();
    SecurityToken token = channel.Issue(rst);
    ((IChannel)channel).Close();
    channel = null;
    trustChannelFactory.Close();
    trustChannelFactory = null;
    return token;
    If I change credential type from username to Windows,
    binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
    and remove these two statements,
    trustChannelFactory.Credentials.UserName.UserName = username;
    trustChannelFactory.Credentials.UserName.Password = password;
    and when i try to get the token, 
    SecurityToken token = channel.Issue(rst);
    I get the following error,
    "Secure
    channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or
    implied by the EndpointAddress correctly identifies the remote endpoint"

    Hi,
    For Client configuration, in order for the service-client communication to work we need to specify the security type and the ClientCredentialType. These settings must match the security settings in the service.
    For more information, you could refer to:
    http://www.felinesoft.com/blog/index.php/2014/02/securing-a-wcf-service-with-username-and-password-using-message-security-and-the-channel-factory-pattern/
    Regards

  • Duplication of Inv. while miro for service entry sheet

    I hve made the setting at duplicate check inv. for incoming excise inv.......... irrespective of date........
    so....... while inv. verification it will give the error for duplicate inv. if entered the same inv. twice...... if we give any date of any financial error for the same invoice it will show error..........
    And our client requirement is dat if the same inv. no. occurs in different financial year......it should not throw the error..........
    So,
    Plz. guide me so how can we can make the above settings for check of duplicate inv. for the particular financial year......
    Rgds,
    navin

    Hi,
    Go to  XK02 and enter the vendor  no.
    In the accounting data tick the duplicate inv check
    and do the MIRO. It will not accept.
    Duplicate invoice check is done at vendor level only  and not
    at PLANT LEVEL
    G.Ganesh Kumar

  • 2LIS _02_SCL  Invoice receipt quantity for services

    Hi,
    When you use service-based invoice verification (EKPO-LEBRE)
    the extractor 2lis_02_scl
    do not extract the good Invoice receipt quantity for each purchase order.
    The field 2lis_02_ITM-AKTWE give the good GR Quantity for services but do
    not ectract the good Invoice receipt quantity.
    Is there any standard solution to extract properly the invoice receipt quantity
    for services using  line item extractor?
    Thanks for your help.

    Hi,
    can you see that, your line item struc. has got this fields avialbe..if not check your
    DS and try to keep this field into your structure from LBWE..
    If you don't find in DS with std. struc. provided with LBWE, you would suppose to
    enhance the DS to accommodate this field into your struc. and write a select
    query on EKPO/EKKO wherever this field value is avialble for each PO and update
    in your result through your user exit..
    Hope it helps..if useful pls. assign points..
    Cheers,
    Pattan.

  • No Suitable Items found for PO (error M8035) while doing MIRO against service PO for the 1st time in the Company Code

    Hi
    I am encountering the error M8035 (" No Suitable Items found for PO ") while I am doing MIRO for the 1st time against service POs (item cat - D) in a company code.
    in OMSY the period opened for the company code is : Current 06 2014 previous 05 2014
    This was done because Go Live date for the new company code is 01.06.2014.
    I am doing test in the test client now.
    I have created a vendor on today's date
    I have created a service PO on today's date (GR, GR Bsd IV, IR, Serv Bsd IV - these indicators are marked in the PO)
    I have created service entry sheet on today's date (acc assignment - K, G/L a/c was determined from the Material Group maintained in the PO)
    I have accepted the service entry sheet on 04.05.2014 (FI doc posted against the matl doc - KBS to WRX on 04.05.2014)
    I am trying to do the MIRO in the same company code on 04.05.2014.
    While I am putting the PO and its line item in MIRO item and pressing enter system shows the above info msg and nothings is appearing in MIRO item.
    I have tried to do MIRO against service entry sheet also - same things happened.
    I have tried selecting Goods Service Item+planned del cost in MIRO - nothing changed.
    I have tried posting MIRO against a non service PO (acc assgnment K, Item cat - BLANK) after doing MIGO in the same company code in the same date- PO is appearing in that case.
    FI people are able to post FB60 manually for the vendor I am using in the PO - so there is no problem in the vendor also.
    I have gone through the scn post related with the topic, unfortunately none of them solved my problem.
    Please help
    Thanks
    Sanjib...

    Can you post a screen shot for PO history ?
    Regards
    Dev

  • SSO to SAP EP6 (for Employee Self Service) using WebSEAL

    Hi SDN friends,
    We are about to embark on a SSO implementation using IBM WebSEAL for SAP EP6 ESS (Employee Self Service) connecting through to an SAP R/3 4.7 server.  Since the ESS solution for 4.7 still uses ITS services, this means that we have ITS iViews in the EP6 portal.
    We have managed to look through the whitepaper 'IBM Tivoli Access Manager - Single Sign On for SAP NetWeaver - September 2005' described at https://www.sdn.sap.com/irj/sdn/developerareas/ibm
    We have the following queries, if anybody has a simple answer to these:
    -  Is it absolutely necessary to configure an SNC connection between ITS/EP6 and R/3 server to achieve SSO for the portal?
    -  Given that SAP EP6 references ITS IAC iviews, is it necessary for us to configure both ITS and EP6 for SSO, or can we simply configure EP6 for SSO?  If so, is it also necessary to configure both for SSL?
    -  Otherwise, how easy is it to set up SSO in this scenario without SSL (for demo purposes)?
    Any thoughts would be greatly appreciated.
    Cheers
    John Moy

    Hello John,
    regarding your questions:
    ad 1) no. SNC is only mandatory if you use X.509-based SSO to R/3. You can also use SAP logon ticket-based SSO from EP to R/3 or usermapping that do both not require SNC.
    ad 2) yes, you have to configure both EP and ITS at WebSeal.
    ad 3) you can always omit SSL. However for production use, it is recommended.
    Regards
    Michael

  • Custom service (using Reader Extensions) for REST invocation

    Hello,
    is it possible to implement and configure a custom service (using Reader Extensions) for REST invocation?
    Best regards
    CommanderPeek

    Yes LiveCycle does support REST as an endpoint http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000562.html

  • Different tax codes in the MIRO for single service item

    Dear all,
    Customer wants to enter 2 different tax codes in the MIRO for single service item. How it can be achieved?

    >
    Milosavljevic Sreten wrote:
    > Just loudly thinking... what can be reason that one service for same invoice is taxable with two different tax codes? 
    >
    It is cross-counties transportation. Part of route outside company country is non-taxable, inside part is taxable. Amounts are proportional to distance and hence become known only at time of invoice receipt.
    Users do not want to create 2 separate invoices. They would like to have ability to enter 2 lines in MIRO. But I need your help to understand, how it can be done? Service receipt is done by single line (because actual taxable / non-taxable amount is unknown at that time). So, is it possible to enter non-taxable amount in MIRO in some additional line?

  • Can we Use T Code MIRA instead of MIRO for posting incoming invoice?

    Hi All,
    Can we Use T Code MIRA instead of MIRO for posting incoming invoice?
    While trying to post a incoming invoice using MIRO, I am getting a error "HKONT is EMPTY". But when using MIRA i could get the invoice posted.
    And in which situations we use MIRA?
    Thanks in Advance
    Gopi Krishna

    Hello
    MIRA is for Invoice Verification in the Background
    Purpose
    This process is suitable for the following transactions:
    Posting invoices with mass amounts of data for which no item check is required
    Posting invoices referring to transactions not yet entered in the system
    Entering Invoices for Verification in the Background (Without Item List)
    When verifying invoices in the background, you enter only a small set of document header data, such as the invoice amount, the currency and the tax information. You also allocate the incoming invoice to a purchasing document or a vendor. The system saves the data and allocation criteria you enter.
    At a later point, the system verifies the invoice in the background. It uses the allocation criteria you entered to determine the item list. It then calculates the net total from the item list.
    If the net total = gross amount invoiced - tax amount (+/- tolerance), the system posts the invoice in the background.
    If the net total ¹ gross amount invoiced - tax amount (+/- tolerance), the system does not post the invoice in the background. It saves the document header data and the items determined in the background; the saved document then has to be processed manually in Invoice Verification.
    With Invoice Verification in the background, the system does not check for any quantity or price differences at item level. Since you do not enter any actual invoice item data, the system uses the default data for comparison.
    Regards
    Gregory Mathews

  • Standard text entry for Service line items using BDC

    Hi,
         I want to enter standard texts for service line items of RFQ created using BDC, if it is a line item i can pass RFQ_number+line_item number as TDNAME in SAVE_TEXT function module, but for Service line item what value we need to pass in TDNAME.
    Is there anyway we can capture the package number in BDC of ME41?
    Regards
    Bala Krishna

    .

  • Variable billing for service items using OKS

    I've a requirement as follows:
    My company wants to create service contracts with FIXED and VARIABLE billing for the same covered products/sites. We know how to setup fixed billing schedule for service items.
    How do we setup variable billing using service items (not through usage items)? What are the steps required for us to do that so that upon counter capture for the service item, variable billing is done.
    Please help.
    Thanks,
    Seth

    The release is R12.1.3
    -Seth

  • Report name for services where used in task lists

    plz let me know report name for services  where used in task lists.

    Hello Sairam,
    I am abit confused. Are you looking for report to find where the task list is used ? You can find all the available reports in The menu path Logistics -> Production -> Master Data -> Routings -> Reporting.
    If you want a specific one then please provide more details
    Thanks
    Amber

Maybe you are looking for