Restricting the po line item to max 3 line items-----BAdi

Hi below is the code I am trying however incase for eg i put line item no 10 20 and 30 . it gives an error since the line item is grater then 3, so i delete line item 30 and it works fine, but incase if i delete line item 20, then the error still persists ( a red ball next to item no 30 in the P.O line item. and so i am not able to save the P.O) How to rectify this what kind of coding is required
method if_ex_me_process_po_cust~process_item .
data: ls_mepoitem type mepoitem,
ls_customer type mepo_badi_exampl,
ls_tbsg type tbsg.
include mm_messages_mac. "useful macros for message handling
here we check customers data
DATA:wl_mepoitem TYPE mepoitem.
**declaration of work area. t_itab is in public section.
DATA : BEGIN OF wa_itab,
ebelp TYPE mepoitem-ebelp,
loekz TYPE mepoitem-loekz,
END OF wa_itab.
ls_mepoitem = im_item->get_data( ).
wl_mepoitem = im_item->get_data( ).
wa_itab-ebelp = wl_mepoitem-ebelp.
wa_itab-loekz = wl_mepoitem-loekz.
IF wl_mepoitem-loekz NE 'D'.
APPEND wa_itab TO t_itab.
ENDIF.
SORT t_itab .
***to delete those items whose entries have been made while EDITING a line item.
DELETE ADJACENT DUPLICATES FROM t_itab .
**to delete those items whose entries have been made while DELETING a line item.
IF wl_mepoitem-loekz EQ 'D'.
LOOP AT t_itab INTO wa_itab .
IF wa_itab-ebelp = wl_mepoitem-ebelp.
DELETE t_itab.
ENDIF.
ENDLOOP.
ENDIF.
counter = 0.
***Counting final no of lines in t_itab after removing the deleted and re-edited entries.
DATA: lines1(2). " type c.
DESCRIBE TABLE t_itab LINES lines1 ."from wa_itab .
*lines = t_itab-lines.
IF lines1 GE 3.
MESSAGE: 'No. Of items is greater than 3...STOP !!' TYPE 'A'.
endif.
Message was edited by:
anu c
Message was edited by:
anu c

Hi ,
RED Ball means----> Some kind of errors in that Line Item , try to double click on that errror log , then u will come to know.
as per my knowledge  ur code is ok.
Regards
Prabhu

Similar Messages

  • Numbers 3.1 restricting the period for moving average trend lines

    Numbers 3.1 is restricting the period I can specify for a moving average trend line for a scatter plot series. The max is 6. This limitation was not present in the previous version of Numbers.
    Charts imported from the previous version retain larger periods, but there is no way I can see to specify periods >6 for any new series. Is there a way to allow a period >6? That is clearly necessary for many applications.
    Thanks.

    Hi Bill,
    Numbers 3.1
    If you want a 14 day moving average over the prior 14 days, the formula in C10 is
    =AVERAGE(B2:B15) (and Fill Down)
    The formula will eventually run out of cells. Hence the red error triangles.
    Plotting columns A, B and C:
    X axis is Day (column A)
    Blue circles and blue line are Actual Y (column B and as expected, they jump around).
    Black circles and black line are calculated moving averages on a 14 day period (column C)
    Red line is Numbers Trendline (Moving Average, Period 6). How it predicts into the future (Moving Average over 6 days) I have no idea.
    I would more trust a calculated moving average, because I know what it is calculating.
    Regards,
    Ian.

  • Max line and Max line length restriction in FTP

    Hi all,
    We are using a FTP adapter in our BPEL service to read the input files from a FTP server location.
    Our service fails when the input file has more than 99 lines or if the length of the line exceeds 9 characters.
    i.e:
    Max allowed characters in a line (Max line length) is 9
    Max allowed lines in the file is 99
    If the above limit is exceeded we get the error saying that the FTP authentication failed or permission denied error.
    Do we need to set the Max line length and Max line parameters anywhere in weblogic console or in JCA properties.
    Kindly help us resolve the issue. Thanks in advance.
    Regards,
    Balaji R

    We do not have any schema for the file data since we are reading the file content as attachment.

  • The question about max line item in material document

    Dear  sir:
    I want to excute CO27 for an FP . It will create material documents. The max line item is 100 in each material document. But I want to record 400 lines in a material document.  Is it possbile to change the number of max line in material document?   How could I do to change that ?   Thanks !!

    I know about 333 in case of physical inventory because the finacial document has a technical limitation of 3 digits for Fi document item number, which means the FI document cannot take more than 999 lines.
    In case of physical inventory a material document item can create up to 3 FI item lines. So the limit for physical inventory became 333.
    I dont know from where you have the 100 as limitation, but take the above said into consideration before you change anything.

  • REGARDING RESTRICT THE DELETION OF LINE ITEM FROM CONFIRMATION SCREEN

    Dear All,
    Plz let me know how can we restrict to delete the line item(components) from the goods movement screen of confirmation of order(Cor6n) screen.
    Thanks & Regards,
    Arvind S

    Hi Aravind
    i just want to restrict the deletion only for particular user id's.
    I know we can do through authorization by creating authorization object.. am i right??
    I am not sure bout any authorization object can help you. However you can have the transaction variant for COR6N with quantity field as output also note this can be user specific.
    So you have no need to have custom transaction or development.
    Regards,
    R.Brahmankar

  • Max line items in FI reached..

    Hi,
        We are posting an invoice using MIRO and it is giving an error that "Max line items in FI has reached".
    So is there any way that we can post if the total line items are more than 999.
    Regards>

    Hello,
    Please check the note
    36353 - AC interface: Summarizing FI documents
    But be aware that contents in many fields can prevent the summarization.
    So please thoroughly compare the entries in database table BSEG, which were not
    summarized together, with each other. Do really all fields have the same content in all line items, of course except for the amount fields? If not, these fields, which are no amount fields and whose
    content is different in the line items, can be added in transaction OBCY.
    As per the note 1070206 if you have the setting Determine taxes line-by-line (Customizing transaction OBCO: TTXD-XTXIT = X. Please implement the notes 1051914 and 1070206 this should help here.
    The enhanced logic also makes postings from MM and SD are not summarized completely although the settings in note 36353 are correctly made. As a solution, note 645356 releases BSEG-XREF3 in transaction OBCY.
    The aggregation is prevented through different content in the fields of EBELN (Purchasing document or purchase order) and EBELP (Purchasing document or ordering item). Thus a higher aggregation could be achieved with SAP Note 77161 (for dummy operation 'VBRK').
    Per note 77161, you have to setup up point no. 2 by maintaining table TTYPS with fields
    TABLE   FIELDNAME
    BSEG     EBELP
    BSEG     EBELN
    In point no. 3 setup in your system. Please insert the following field in table TTYPV for object type 'RMRP'
    TABLE   FIELDNAME
    BSEG    EBELP
    Please take note that the account assignments to the purchase order (EBELN) and to the purchase order item (EBELP) are NOT deleted by default. In both the goods receipt with reference to the purchase order (MB01) and the invoice verification, they are assigned to an account in the FI document and thus PREVENT the summarization of the FI document.
    This makes it possible to clear the GR/IR clearing account at PURCHASE ORDER ITEM level.
    By implementing the changes as per notes 77161 and 36353, the clearing of the GR/IR is at PURCHASE ORDER NUMBER level.
    Also, refer to the following notes:
      645356 No summarization of FI documents from MM due to
      545137 FAQ Interface - summarization
      117708 A maximum of 999 items can be posted in the FI doc
      743744 MIRO/MR1M: FI follow-on documents or MM documents missing
    Please, check carefully the customizing with the reference notes.
    I think that this should help to resolve your inquiry.
    Best Regards,
    Vanessa.

  • Splitting sales ord line items to diff deliveries based on max line items

    Hi,
    I'm trying to split sales order line items to different deliveries based on the max line items on Sales Organization ( TVKO-MAXBI ) . I activated a new routing (copying standard 001 ) but an error is happening
    Item 000200: delivery split due to conflicting header data (ZUKRL: M106 <-> M1061)
    However the split does not work as expected. Does anyone have any ideas ?
    Pls help me
    The code is:
    data: ITEMNO        LIKE TVKO-MAXBI,
          BILLNO        LIKE TVKO-MAXBI.
    *}   INSERT
    FORM DATEN_KOPIEREN_601.
    *{   INSERT         MTDK905083                                        1
      LIKP-VKORG = CVBAK-VKORG.
      LIKP-AUTLF = CVBAK-AUTLF.
      LIKP-VSBED = CVBAK-VSBED.
      LIKP-FKARV = TVAK-FKARV.
      LIKP-TRAGR = MAAPV-TRAGR.
    Fill field ZUKRL with combination criteria
      LIKP-ZUKRL(2)      = CVBAK-VTWEG.
      LIKP-ZUKRL+2(2)    = CVBAK-SPART.
        IF NOT TVKO-MAXBI IS INITIAL.
          IF ITEMNO < TVKO-MAXBI.
            ITEMNO = ITEMNO + 1.
          else.
            LIKP-ZUKRL+4(2) = BILLNO + 1.
            ITEMNO = 1.
          endif.
        endif.
      LIKP-STAFO = CVBAK-STAFO.
      LIKP-STWAE = CVBAK-STWAE.
      MOVE CVBAK-KKBER TO LIKP-KKBER.
      MOVE CVBAK-KNKLI TO LIKP-KNKLI.
      MOVE CVBAK-KKBER TO LIKP-KKBER.
      MOVE CVBAK-GRUPP TO LIKP-GRUPP.
      MOVE CVBAK-SBGRP TO LIKP-SBGRP.
      MOVE CVBAK-CMWAE TO LIKP-CMWAE.
      MOVE CVBAK-WAERK TO LIKP-WAERK.                      "46C/note 184914
      MOVE CVBAK-CTLPC TO LIKP-CTLPC.
      IF LIKP-LFART = TVAK-KORLI.
        LIKP-KLIEF = CHARX.
      ENDIF.
      MOVE CVBAK-LIFSK TO LIKP-LIFSK.                           "45B
    Pick-up sheet number in delivery order processing is external dlv. no.
      IF CVBAK-VBKLT EQ VBKLT_AUSL_AUFT OR
         CVBAK-VBKLT EQ VBKLT_AUSL_AUFT_KORR.
        MOVE CVBAK-BSTNK TO LIKP-LIFEX.
      ENDIF.
    Consignment issue by service agent is external delivery number
      IF CVBAK-VBKLT EQ VBKLT_EDL_ENTN OR
         CVBAK-VBKLT EQ VBKLT_EDL_ENTN_KORR.
        MOVE CVBAK-BSTNK TO LIKP-LIFEX.
      ENDIF.
    *}   INSERT
    ENDFORM.

    hi friend i solved the problem.. was a mistake on my source... I send u the code to help u in advanced... thanks for your time
    data: ITEMNO        LIKE TVKO-MAXBI,
          BILLNO        LIKE TVKO-MAXBI.
    *}   INSERT
    FORM DATEN_KOPIEREN_601.
    *{   INSERT         MTDK905083                                        1
      LIKP-VKORG = CVBAK-VKORG.
      LIKP-AUTLF = CVBAK-AUTLF.
      LIKP-VSBED = CVBAK-VSBED.
      LIKP-FKARV = TVAK-FKARV.
      LIKP-TRAGR = MAAPV-TRAGR.
    Fill field ZUKRL with combination criteria
      LIKP-ZUKRL(2)      = CVBAK-VTWEG.
      LIKP-ZUKRL+2(2)    = CVBAK-SPART.
        IF NOT TVKO-MAXBI IS INITIAL.
          IF ITEMNO le TVKO-MAXBI.
            ITEMNO = ITEMNO + 1.
          else.
            BILLNO = BILLNO + 1.
            ITEMNO = 1.
          endif.
        endif.
      LIKP-ZUKRL+4(3) = BILLNO.
      LIKP-STAFO = CVBAK-STAFO.
      LIKP-STWAE = CVBAK-STWAE.
      MOVE CVBAK-KKBER TO LIKP-KKBER.
      MOVE CVBAK-KNKLI TO LIKP-KNKLI.
      MOVE CVBAK-KKBER TO LIKP-KKBER.
      MOVE CVBAK-GRUPP TO LIKP-GRUPP.
      MOVE CVBAK-SBGRP TO LIKP-SBGRP.
      MOVE CVBAK-CMWAE TO LIKP-CMWAE.
      MOVE CVBAK-WAERK TO LIKP-WAERK.                      "46C/note 184914
      MOVE CVBAK-CTLPC TO LIKP-CTLPC.
      IF LIKP-LFART = TVAK-KORLI.
        LIKP-KLIEF = CHARX.
      ENDIF.
      MOVE CVBAK-LIFSK TO LIKP-LIFSK.                           "45B
    Pick-up sheet number in delivery order processing is external dlv. no.
      IF CVBAK-VBKLT EQ VBKLT_AUSL_AUFT OR
         CVBAK-VBKLT EQ VBKLT_AUSL_AUFT_KORR.
        MOVE CVBAK-BSTNK TO LIKP-LIFEX.
      ENDIF.
    Consignment issue by service agent is external delivery number
      IF CVBAK-VBKLT EQ VBKLT_EDL_ENTN OR
         CVBAK-VBKLT EQ VBKLT_EDL_ENTN_KORR.
        MOVE CVBAK-BSTNK TO LIKP-LIFEX.
      ENDIF.

  • What is the direct link between Schedule Line item and Delivery line item?

    Hi SAP SD Gurus,
    The question is simple.  I would like to calculate the Open order quantity for a particular month based on the Schedule Line Date.
    I am taking all the Schedule lines falling below the running date of the month and sum up that and look for the deliveries happened for that Schedule lines.
    I am unable to link that Schedule line with that Delivery line item.
    The only link is Schedule Line Number in VBEP table which is not available in LIPS.  I would like sum up the Schdule line Quantities and Subtract the sum of the Delivery quantities which will give me the Open orders for the particular day of the month.
    Can anyone help me to link this VBEP table to LIPS table to connect the Schedule line number with the Delivery line item?
    Thanks in advance for your help..
    Augustine

    Anuj,
    I am aware of the Functional Modules. 
    I wanted to know for this Schedule Line, this is Delivery document created.
    Where in SAP through Tables it is linked?  Because, I need to source the Tables to calulate the open orders by way of external report through Business Object.
    The table link from VBEP to LIPS is not directly linked.  It is linked from Sales order line item level.  Because we are capturing all the Sales order Line tiems through the Delivery Status which is not equalled to C. But if there are partial deliveries against the Scheuld Line item level, we need to identify.  The only common joint should be Scheldule line number which is not available in LIPS.
    If we are developing report inside SAP, we can use the said Functional Modules to capture through Structures VBEPD.  Since it is a external reporting , we need to give correct tables and the joints.  Hence I am looking for any other way to solve this.
    Thanks
    Augustine Ponraj

  • Is it possible to place more than one Item on same line on the FORM

    Can we placed more than one Item on the form?
    for ex: I want to use TextFields to input the Date of birth in form of DD/MM/YY
    I want to put on the form like
    Enter DOB :- DD MM YYYY
    Please suggest if it is possible any way in J2ME

    It will depend on the phone. There is no way of knowing if the items actually will be on the same line or not. On a phone with a small screen, the items are likely to end up on two lines.
    You can however make sure that the lines will occupy two lines by using the setLayout(int layout) method which belongs to the Item class.

  • How to draw horizontal line at the end of table for multiple line items

    Dear Experts,
                       Pls can anyone help me how to draw horizontal line at the end of table for multiple line items . kindly help me regarding this
    Thanks
    Ramesh Manoharan

    Hi
       I tried as per your logic but it is not solving my problem .  when i am gone to table painter it is showing line type 1 and line type 2
      is below format.. if u see here line type 1 bottom line and line type 2 top line both are same..  so how to avoid this ?
                              line type 1
                             line type 2

  • Change the Profit Center in Sales Order line item's Account assignment tab

    Hi Gurus,
    I need to change the Profit Center at Sales order Line item in Account Assignment Tab. Currently  The Profit center is coming from Material Master for the Line Item's Material as default but I have to change / overwrite  that.
    Can any body provide me how can i achive that means
    Any User exits, substitution or any thing ?
    I tried MV45AFZZ but i am not able to find out the right place where I can change COBL-PRCTR.
    Sony

    Hi
    There is perform which moves the values to VBAP field.
    This PRCTR field is stored in VBAP (i.e., SO line item table)
    USEREXIT_MOVE_FIELD_TO_VBAP
    Hope it works.
    VVR

  • How to highlight the whole row of a particular line item of sale

    How to highlight the whole row of a particular line item of sales order depending on condition?
    Please help its urgent..
    Looking forward your reply.
    Moderator message: please do more research before asking, show what you have done yourself when asking, do not flag posts as "urgent".
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 9, 2011 9:30 AM

    Any ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
    MyTableModel modelS = (MyTableModel)dataModel.get("S");
    jTable1 = new JTable(modelS);
    jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
    class MyTableModel extends DefaultTableModel {
      public MyTableModel(Object[] columnNames, int numRows) {
        super(columnNames, numRows);
      public boolean isCellEditable(int row, int column) {
        if (TableKey == 'S') {
          if (column == 6) {
            return false;
        if (TableKey == 'O') {
          if (column == 0 || column == 4 || column == 5) {
            return false;
        if (TableKey == 'P') {
          return false;
      return true;
    }Can anyone help? Thanks.
    Allyson

  • Requirement to populate the Profit center field of Vendor line item thru...

    Hi,
    My requirement is to populate the Profit center field of Vendor line item.
    For this, I want to write a substitution where based on the Business Area of Vendor line item, the system should populate the Profit center while saving.
    Is it possible thru Validation & Substitutions...
    Plz guide me in writing this
    Points will be suitable rewarded for replies.
    regards
    AVM

    Tcode: GGB1
    An example shows how to make a G/L account available for line item substitution.
    GGB1
    Click FA – Doc Header
    Click Create Substitution icon
    Enter the Text
    Click Create Step icon
    Click the field u want – Say - BKPF- BKTXT
    Choose the option – Say :Constant value
    Give description of ur step
    Click Prerequisite
    Double Click Structure BKPF
    Double Click BKPF-AWKEY
    Click Constant button
    Enter the Text u want to make it appler in the Reference key
    Click Substitution and enter the constant value u want
    Go to Tcode: GGB4
    Click Substituted Fields
    Give ur table and field (Here - BKPF- BKTXT)
    Do it in a similar way..if u cannot proceed, let me know the exact field values..and i can take screenshots and send u across
    Thanks,
    Sridevi

  • The color of text item with multi-line in web

    I tried to change the background color of text item with multi-
    line, but it does not work when I run in the web, if some body
    knows that, please give a hint.
    Thanks
    Frank
    null

    I tried to change the background color of text item with multi-
    line, but it does not work when I run in the web, if some body
    knows that, please give a hint.
    Thanks
    Frank
    null

  • Copying the cost centre details to all line items in SC

    HI all,
    Im working on SRM 5.0.We are creating mult line item SC's.My reqt is that once i enter the cost centre details in the 1st item of the SC,that cost centre value should be copied automatically to all the line items in the cart w/o click of any button.
    My problem is that the CHNAGE badi cannot be used as the copying should be done immediately after the 1st item details are entered and w/o clicking of any button on the sceen,
    - Ram

    Hi Ram!
    Once you gave the Account assignment for your first line item, you should have the button "Change All Items in Document".
    If you manage to use it, then you only have to push it once => it will be copied automatically to all items of the SC.
    imre

  • Making the Net Price on a PO line item 0 if Free Indicator set on PO line

    Hello All,
    I have a requirement to make the Net Price on a PO line item 0 if Free Indicator (UMSON) is set on PO line.
    Please help me with an exit/badi using which this can be achieved.
    Thanks
    Indrajit

    Hi,
    Check this user exit
    EXIT_SAPMM06E_012.
    This user exit is triggered before saving the PO.
    Regards,
    Sachin M M

Maybe you are looking for

  • Authorize 2 Apple IDs in 1 mac

    Hello, we have a Mac at home, and each member of the family has a different user in it. I downloaded my past purchases with my Apple ID, but when my father tried to download his past purchases (with a different Apple ID) the message "This computer is

  • Content Repository Doesn't Exist Message CMS106

    I am facing trouble while configuring a content repository in SAP Netweaver/MiniSAP. I created a content repository using the transaction code oac0. I want to create my content repository to HTTP Content Server which is not a SAP Content Server rathe

  • Questions, Extreme begginer - Why wont this work.

    /* My Java Program Failing To Compile 2009 - CurrentDate() /* Importing */ import java.util.Scanner; import acm.graphics.*; import acm.program.*; class run {      public static void main(String args[]){      //Variables      Scanner ninjatext = new S

  • IPAD shuts off without warning.

    You can turn it right back on. Battery seems fine. Generally happens when I am surfing, looking at my email, or viewing facebook messages. Just found the earlier post. Will try resetting.

  • Aspire VN7 571G 55ZA Intel Graphics driver

    Hello! I upgraded my VN7 571G 55ZA to Windows 10 yesterday and since my notebook only had Windows 8.1 Home I got the Windows 10 Home Edition aswell. That edition forces updates from Windows Update and so it does for the integrated Intel Graphics 4400