Mulitple line items for a contract in SAP

Hello Experts,
I am uploading a file which has the same contract number (EKKO-EBELN) for multiple records (line items). How to do BDC recording by looping thru the internal table. Right now, I am using the below code which takes only two records for the same contract and rejecting the remaining two records for the same contract. Can anyone help me to modify this code. The tcode is ME31K
data: l_n type i.
loop at gt_contract_temp.
  AT NEW ebeln.  
      CLEAR l_n.
*start bdc recording
      PERFORM populatebdc USING:
      'X' 'SAPMM06E' '0200',
      ' ' 'BDC_CURSOR' 'RM06E-KZABS',
      ' ' 'BDC_OKCODE' '/00',
      ' ' 'EKKO-LIFNR'  l_lifnr,
      ' ' 'RM06E-EVART' p_bsart,
      ' ' 'RM06E-VEDAT' l_bedat,
      ' ' 'RM06E-EVRTN' gt_contract_temp-ebeln,
      ' ' 'EKKO-EKORG'  gt_contract_temp-ekorg,
      ' ' 'ekko-ekgrp'  gt_contract_temp-ekgrp,
      ' ' 'RM06E-WERKS' gt_contract_temp-werks,
      ' ' 'rm06e-lgort' gt_contract_temp-lgort,
      ' ' 'RM06E-KZABS' 'X',
      'X' 'SAPMM06E' '0201',
      ' ' 'BDC_CURSOR' 'EKKO-INCO1',
      ' ' 'BDC_OKCODE' '/00',
      ' ' 'EKKO-EKGRP' gt_contract_temp-ekgrp,
      ' ' 'EKKO-PINCR' '10',
      ' ' 'EKKO-UPINC' '1',
      ' ' 'EKKO-KDATB' l_kdatb,
      ' ' 'EKKO-KDATE' l_kdate,
      ' ' 'EKKO-SPRAS' gt_contract_temp-spras,
      ' ' 'EKKO-KTWRT' gt_contract_temp-ktwrt,
      ' ' 'EKKO-WAERS' gt_contract_temp-waers.
      l_n = l_n + '01'.
ENDAT.
    CLEAR: l_ematn, l_ktmng1, l_meins,
           l_netpr1, l_peinh, l_bprme,
           l_werks, l_lgort, l_evrtp.
    CONCATENATE 'RM06E-EVRTP' '(' l_n ')' INTO l_evrtp.
    CONCATENATE 'EKPO-EMATN' '(' l_n ')' INTO l_ematn.
    CONCATENATE 'EKPO-KTMNG' '(' l_n ')' INTO l_ktmng1.
    CONCATENATE 'EKPO-MEINS' '(' l_n ')' INTO l_meins.
    CONCATENATE 'EKPO-NETPR' '(' l_n ')' INTO l_netpr1.
    CONCATENATE 'EKPO-PEINH' '(' l_n ')' INTO l_peinh.
    CONCATENATE 'EKPO-BPRME' '(' l_n ')' INTO l_bprme.
    CONCATENATE 'EKPO-WERKS' '(' l_n ')' INTO l_werks.
    CONCATENATE 'EKPO-LGORT' '(' l_n ')' INTO l_lgort.
    PERFORM populatebdc USING:
     'X' 'SAPMM06E' '0220',
     ' ' 'BDC_CURSOR' l_evrtp,
     ' ' 'BDC_OKCODE' '/00',
     ' '  l_evrtp         gt_contract_temp-ebelp,
     ' '  l_ematn         gt_contract_temp-matnr,
     ' '  l_ktmng1        gt_contract_temp-ktmng,
     ' '  l_meins         gt_contract_temp-meins,
     ' '  l_netpr1         gt_contract_temp-netpr,
     ' '  l_peinh         gt_contract_temp-peinh,
     ' '  l_bprme         gt_contract_temp-bprme,
     ' '  l_werks         gt_contract_temp-werks,
     ' '  l_lgort         gt_contract_temp-lgort,
     'X' 'SAPLMEKO' '0501',
    ' ' 'BDC_CURSOR' 'T685-KSCHL(01)',
     ' ' 'BDC_OKCODE' '=PICK',
     'X' 'SAPMM06E' '0220',
     ' ' 'BDC_CURSOR' l_netpr1,
     ' ' 'BDC_OKCODE' '/00',
     ' '  l_netpr1      gt_contract_temp-netpr.
    l_n = l_n + '01'.
    AT END OF ebeln.
      PERFORM populatebdc USING:
         'X' 'SAPMM06E' '0220',
     ' ' 'BDC_OKCODE' '=BU'.
*--Calling the transaction 'ME31K'
      CALL TRANSACTION 'ME31K' USING gt_custbdc MODE 'A' UPDATE 'S'
      MESSAGES INTO gt_custmsg.
   ENDAT.
Can anyone help me out to modify this program to upload all the line items of a contract?
Thanks
Ricky

Hi,
Has anyone worked on this kind of scenario? Pls lemme know before i start changing the whole program logic for reading the line item. Thanks
Ricky

Similar Messages

  • Problem in invoice printout for second line item of the contract.

    Hi,
    There are two line items in the contract. Both with different material and different plants. 1st line item with plant japan, and 2nd line item with plant singapore. But, when i try to take printout for 2nd line item after invoicing it, the address appearing in printout is of Japan instead of singapore.
    Any idea why this happening?
    Please revert back asap.

    Hi Chetan,
    If that is a header output, then there are issues at the design level itself. You have an output as header output and you expect the item level details to be printed in two different printouts.How is this handled in the program. Mostly header outputs are used to print the details abotu all the items in the doucment , not for a specific item. If you want to print a specific item only , then it is always advisable to configure the output as item output.
    Leaving that aside, the problem lies in the code. You may be selecting the item number when you are printing the details of the second item, but for printing address, you are not coding using the item number.
    To prove this test this scenario.
    Create an order with first item belonging to Singapore plant and second item Japan plant.
    Now create the otuput for item1----it will work fine
    Do the same for item2-----Now, the plant address will be of Singapore, while the material belongs to Japan.
    If this happens, it can be safely assumed that problem lies in the code. Do this test and then if the problem is in the program, discuss with your developer, he will rectify the bug for you.
    You can reward me if this solves your problem.

  • Help on GOA screen control at line item for only material

    Hello All
    scenario:-
    1. create a GOA
    for a material with has alternative UOM ( CAR - ORDER UNIT ; 1 CAR - 34 ea) . So i created GOA FOR MATERILA LINE ITEM.
    FOR CAR .
    2. I released GOA and distributed GOA for CAR as Oeder Unit UOM.
    3. now my buyer  go to GOA and change UOM as EA and price I AND CHANGE THE PRICE IN THE SAME  LINE  ITEM.
    4. No PO released against the COntract in the ECC 
    5. Unfortunately buyer could change this UOM from CAR to EA. now GOA shows as EA in the line item
    6. this info taken to ECC via IDOC but this info  never updated in ECC contract.
    7. my PO release as CAR forever rather than EA since my ECC contract always shows  as CAR
    i can lock this item i can create  a new line item, no issues.
    how buyer knows each time ? if the system allows buyer always try to change rather than entering new item. it is not buyer fault. it is srm fault.
    Now ican u suggest some code in ui control badi , if the PO not releases system should not allow to change  the UOM in the GOA line item for a material.
    PS:- once PO released against contract  . srm will not allow to change the UOM . that is fine.
    SAP has to correct this problem and release the note.
    Muthu

    Hi Donald/SCot/ kiran/ jay...
    are you having the same problem in SRM 700. front end validation is required here toooooo...
    please help me.
    I could not accept this functionality ..
    why SRM allows to change the UOM by the buyer after  release the GOA for the same line item
    if srm allows to do edit, SAP SRM and ECC has to update the same UOM in the existing purchasing contract. IDOCs carry all new uom but why not updated in ECC purchasing contract.
    decided to write own logic in ui badi to protect this. what to do
    Muthu

  • How can I add a new line item for production order?

    HI all,
    How can I add a new line item for production order through BAPI/FM? Thanks in advance.

    Hi Mil,
      Unfortunetly SAP is not in front of me.
    But if possible go to BAPI transaction , check for any production order's bapi for CHANGE purpose. Where you will be able to add your new line.
    Reward if useful!

  • Creation of suspension line items for Subscription orders

    hi ,
           I am currently working on IS-Media project.
    I have a requirement that I need to create a suspension for all the line items available for the subscription orders.
    I mean I have to create a new line item for all the active line items of a subscription order.
    I have seen the FM : ISM_SALES_ORDER_CHANGE.
    it is working for only single active line item.
    Could you please suggest any of the Function moulesavailable in the SAP : IS-Media?
    Thanks in advance.
    Vijay.

    Vijay,
    The best FMs that would meet your needs are below. They are listed in the order that will best address what you are trying to accomplish. They are ISM_SALES_ITEM_UNLIMIT_CHANGE, ISM_SALES_ITEM_SUSPEND and ISM_SALES_SCHEDULE_CHANGE.
    I hope this helps.
    Sibu

  • Error when adding line items in a Contract

    Hi All,
    Need your help regarding the following issue.
    The business user is trying to edit (to add more line items/materials) a contract with customized T.Code ZGME31K.
    Getting error "Enter rate USD / rate type M for 11/24/2009 in the system settings" MSG No. SG105.
    However, the Vendor, Material all are maintained in the same currency i.e. USD.
    So, not finding a scope of rectification in OB28.
    Please advice.
    Regards,
    Milan.

    Hi,
    I closed
    Re: SBWP attachment link not diverting to Contract/P.O
    as my problem got resolved.
    And I put it "unanswered" as no one gave me the correct answer.
    It came out as a result of several testing in Quality by our team. Anyway, thanks to everyone who contributed.
    Regards,
    Milan.

  • Regarding Number of Line Items for Remittance Advice (REMADV)

    Hi all,
    We have an issue where the user tries to upload remittances line items. (More than 10,000 line items).
    We had come across a statement as "Only 100 remittances are allowed per day in SAP and 1 remittance can have only 10,000 line items each".
    However, we would like to confirm the same.
    Please let us know if SAP permits maximum of 10,000 line items only. Also let us know if there is any standard SAP functionality/Function module that confirms the same.
    Regards,
    Lavanya

    I did all settings as told by you But still i am getting the same error Please specify the number of line items for the challans
    Is there any other setting needed before this or after this?
    Regards,
    Mehul

  • Separate line item for taxes in accounting document of MIGO

    All SAP Gurus,
    As we can have separate line item for Freight amount (Freight amt credited) in accounting document for MIGO.
    Similarly is it possible to have separate line item for tax amount which is inventoried.
    Regards,

    Hi Rajan,
    Freight is from pricing procedure whereas tax is from taxing procedure.
    Tax cannot be shown in separate g/l in MIGO.
    Reason:
    If u wanna show tax as separate item then we need to debit tax a/c in migo as well as it has to go to inventory which is not possible(double accounting enrty on debit side).
    I too tried to do the same by specifying 2 for posting indicator and selecting non deductible for the nonsetoff account key used in the taxing proceudre in OBCN but it is behaving like setoff tax.
    U can also try doing the same and then check.
    Reg
    Raja

  • More than 999 line items for an FI Document

    Hello All,
    Per SAP standard, an accounting document can only contain up to 999 line items. However, we have Logistics posting (Backflush) that would yield more than 999 line items in FI. We can't opt for setting summarization in transaction OBCY (FI Summarization based on Object Type) since this would affect GR/IR clearing. We can select reference transaction key MKPF (Material Doc Table) and table BSEG (Field MENGE <Qty>) but GR/IR clearing would be affected since definition of clearing is at Purchasing Doc (EBELN) and Item (EBELP).
    Do you have other recommendations?
    Thanks.

    Dear scorpio0485,
    Yes ! I have already done posting for morethan 999 line items. but in the standard program we cant do it. We need to go for Z process.
    In Zprocess we need to put one cut off line item for ex : 900 or 950. After that hardcode one GL code(clearing GL Code) in program to split the line items. Means the system generates 2 documents.
    Please give the following Code to ABAPer
    AT END OF xblnr.
          mtab[] = ttab[].
          CLEAR v_count1.
          DESCRIBE TABLE ttab LINES v_lines.
          LOOP AT ttab INTO wa_ttab.
            v_tabix = sy-tabix.
            v_count = v_count + 1.
            IF v_count EQ 900.
              count = count + 1.
              v_count1 = v_count + v_count1.
              MOVE-CORRESPONDING wa_ttab TO wa_xtab.
              IF v_wtotal < 0.
                wa_xtab-newbs = '40'.
                wa_xtab-newko = '00003100001'.
              ELSE.
                wa_xtab-newbs = '50'.
                wa_xtab-newko = '00003100001'.
              ENDIF.
              IF v_dtotal < 0.
                wa_xtab-newbs = '40'.
                wa_xtab-newko = '0003100001'.
              ELSE.
                wa_xtab-newbs = '50'.
                wa_xtab-newko = '0003100001'.
              ENDIF.
              IF v_dtotal LE 0.
                v_dtotal = v_dtotal * -1.
              ENDIF.
              IF v_wtotal LE 0.
                v_wtotal = v_wtotal * -1.
              ENDIF.
              wa_xtab-prctr = '0000900008'.
              wa_xtab-dmbtr = v_dtotal .
              wa_xtab-wrbtr = v_wtotal .
    If you need anymore,please let us know

  • Seperate Line item for taxes in MIGO and MIRO

    All SAP Gurus,
    We want to inventories the CST (central sales tax) amount.
    For this we have used the condition type JIPS, check marked the accounting key 'JI7' and gave posting indicator as '2' Separate line item.
    Now, CST amount is getting inventorised at the time of GR. (but no separate line item is created at the time of GR).
    During MIRO, the inventoried CST amount is getting deinventorised (although separate line item being created here).
    Can we have separate line item in MIRO, without getting value deinventorised? (as it happens for freight)
    Regards,

    Hi Kunal,
    Thanks for the reply.
    As you have rightly said, we need to tick 'NOT DEDUCTIBLE' in OBCN (we have already did that).
    And key has been already assigned in Atx procedure for the appropriate condition type.
    But the problem is that, we want separate line item for this tax amount in MIGO.
    Is it possible to have separate line item for the tax amount in MIGO (as we can get separate line item for freight in MIGO).
    Regards,

  • Material Quantity difference document line item for HU

    Dear Experts,
    When I try to clear differences in LI21,  i get the error message as above.
    Error Message : 'Material Quantity difference document line item for HU'
    Any idea why this error occurs?
    Regards,
    Shetty

    Hello Shetty,
    It may be due to some stock inconsistency. You may try iin case of  a non HU managed storage location HU to run LX23 and it can fix discrepancy overwrting MM-IM with LE-WM data. But if it is a HU managed then you can run HUDIFF transaction but only to see if there is stock differences not to fix anything, usually SAP Support (Development Support) does that job.
    Have a nice day !!

  • Double line Item For Tax

    Hi SAP Gurus,
    I have a issue related to invoice verification.
    We have following tax procedure
           Basic Price  + Excise + Frieght + VAT  = Gross Price
    But here frieght is taxable on which VAT is caluculated.
    But while doing MIRO system is showing two line items  for Tax condition (VAT)
    1. One line item VAT amt calculated on   (Basic price + Excise duty)
    2. Second line item VAT amt calculated on (Frieght amt.)
    I have maintained single line item in OBCN.
    My client want to have single line item.
    Pls tell me how to solve this.
    Regards
    Gitesh

    Hi
    DCGR means freight GR. System automatically creates this at the time of MIGO, if freight condition is mentioned in PO itself.
    Hence in MIGO creation systems creates one material GR and with the same number one DCGR.
    You can see it from purchase order history through PO.

  • Archiving cost center line items for current period

    Hi,
    I was not able to archive & delete the cost center line items for current period.I was succesfull in deleting the past line items of the last periods.
    Raj

    Hi Rajesh,
    I think SAP help says that the period for which you are planning to delete or archive data may have to be locked.
    Check the following links:
    For Archiving
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e55ec462a11d189000000e8323d3a/frameset.htm

  • How to handle the limitation of 9999 remittance line item for CTX payments

    Hi,
       I need to send the CTX payment from SAP in XML file format to vendors bank.
       SAP F110 -> Treasury -> Our Bank -> FED clearing system -> vendor bank.
       Fed Clearing system has a limitation of 9999 remittance line item for CTX payments.
       Do we have any standard SAP setting wherein total number of invoice in payment document can          be     limited to 9999.
    Please Advice.

    Hi ,
    First of all the Event R418 as you have mentioned have the structures FKKKO and FKKOP .
    In FKKKO you will not get the sub item and in FKKOP you will get the sub itmes .
    Before the process gets in to Event R418 it has only 1 line item and hence you are facing the problem .
    If you have multiple line items getting in to the FM then you can build the logic based on the Import date that is passed in structure FKKOP .
    Else try for the function module FKK_OPEN_ITEM_SPLIT , in R418 where in you can split the document if you are having only 1 entry in FKKOP.
    Kindly check and revert back with your findings .
    Regards ,
    Dewang

  • Single line item for multiple line item payment.

    Hi
    I have booked the 3 vendor invoices (in FB60) for a single vendor. Now today i paid (with F-53) all the three invoices together. One payment document number was generated.
    However when i saw the vendor line item, i saw that three debit line items was generated for the clearing the open invoices (i..e 3 credit line items). so when i say vendor line item report, there were total 6 cleared line items (3 for credit i.e invoice and 3 for debit i.e. payments)
    But is it possible to get  single debit line item for all the three invoices cleared. If yes, please let me know how i can get it.
    If i will have one single line item for payment, vendor report would be simpler. Please help

    Hi,
    1. If you do payment through F-53, then each invoice have separate payment line item. This is not avoidable. If you do payment through F110, then you can group the line items for payment, so there only one payment line item for many number of invoices.
    2. While clearing through F-44, system is generating automatic line items because, there are exchange rate fluctuations. You can't avoid these line items, as these automatic line items only match Debit and Credit amounts in order to post the document.
    Rgds
    Murali. N

Maybe you are looking for

  • I can send but not receive email using Outlook

    Hi all, I have had an iPhone 5C for about a year. I recently deleted my email account after being hacked, after which I received around 45 thousand bounceback emails in the space of 12 hours. It was too hard to receive them, 500 at a time on my iPhon

  • Numbers are not formatted when run report from EBS

    I am opening a new thread to solve my problem of formatting the number in xml report I dont understand i format the field number in rtf template and the number is displayed correctly when i preview it in pdf. The situation is like this : 1. i have a

  • Connecting my nano to female ipod plug in a land rover

    Hi dears , I just got a nano but do not succeed in connecting it  to the ipod  female plug of my landrover discovery 4 : look like i should get a plug with two male ends ; i am just an old  pc user discovering the Apple world ......

  • Flex Mobile textinput

    Hi, I type from Brazil, Please I need example textinput with mask for Flex Mobile, Thank's

  • Is there any maintenance at all, to run with Lion? 6 years ago...

    Maintenance? I asked this same question 6 years ago when I got my iMac/Tiger. Other than shutting down properly, making sure Firewall is on, not running any anti virus programs (in most cases) and avoiding most 3rd party utility programs. Is there an