Check all items during PO Create / Change

Dear Gurus,
During PO Create/ Change, I need to check all the items and display an error message if qty exceeds.So can anyone please let me know which user exit / badi /at which enhancement point i  have write the code.
Kind Regards
Sajid

Hello,
Use this BADI ME_PROCESS_REQ_CUST
in Method check u should write the code.
Some sample code
METHOD if_ex_me_process_req_cust~process_header .
CLEAR head.
CALL METHOD im_header->get_data
    RECEIVING
      re_data = head.
ENDMETHOD.
at implementation class go to attributes
ZCL_IM_ME_PROCESS_REQ_CUST
HEAD                StaticPubl        Type    MEREQ_HEADER         OO Purchase Requisit     
METHOD if_ex_me_process_req_cust~check .
DATA : t_item      TYPE mmpur_requisition_items,
       w_item      TYPE mmpur_requisition_item,
       ref_account TYPE REF TO if_acct_container_mm,
       t_acc_objs  TYPE mmpur_accounting_list,
       w_acc_obj   TYPE mmpur_accounting_type,
       ref_model   TYPE REF TO if_accounting_model_mm,
       w_exkn      TYPE exkn,
       t_exkn      TYPE STANDARD TABLE OF exkn,
       ref         TYPE REF TO if_purchase_requisition_item,
       i_act_items TYPE mereq_item,
       t_itemdata  TYPE STANDARD TABLE OF mereq_item,
       w_itemdata  TYPE mereq_item,
       ref_acc     TYPE REF TO if_accounting_model_mm.
TYPES : BEGIN OF ty_exkn,
         bnfpo   TYPE bnfpo,
         zexkn   TYPE dzekkn,
         loekz   TYPE kloek,
         kostl   TYPE kostl,
         prctr   TYPE prctr,
        END OF ty_exkn.
DATA : t_exkn_ext TYPE STANDARD TABLE OF ty_exkn,
       t_exkn_one TYPE STANDARD TABLE OF ty_exkn,
       w_exkn_ext TYPE ty_exkn,
       w_exkn_one TYPE ty_exkn.
TYPES : BEGIN OF ty_eban,
          banfn TYPE banfn,
          bnfpo TYPE bnfpo,
          werks TYPE werks,
          ekorg TYPE ekorg,
          knttp TYPE knttp,
        END OF ty_eban.
DATA : t_eban  TYPE STANDARD TABLE OF ty_eban,
        w_eban1 TYPE ty_eban.
TYPES : BEGIN OF ty_account,
          banfn TYPE banfn,
          bnfpo TYPE bnfpo,
          zebkn TYPE dzebkn,
          kostl TYPE kostl,   "Cost Center
          prctr TYPE prctr,   "Profit Center
        END OF ty_account.
DATA : t_account  TYPE STANDARD TABLE OF ty_account,
       t_account1 TYPE STANDARD TABLE OF ty_account,
       wa_account TYPE ty_account.
TYPES: BEGIN OF obj_line,
         clustername(30),
         programname(10),
       END OF obj_line.
DATA : obj_tab    TYPE STANDARD TABLE OF obj_line,
       obj_wa     TYPE obj_line.
DATA : t_ebkn     TYPE STANDARD TABLE OF ty_account,
       w_ebkn1    TYPE ty_account,
       w_ebkn_old TYPE ty_account,
       v_item_no  TYPE bnfpo,
       v_werks    TYPE eban-werks,
       v_ekorg    TYPE eban-ekorg,
       v_knttp    TYPE eban-knttp,
       v_banfn    TYPE eban-banfn.
CONSTANTS : c_k TYPE c VALUE 'K',
            c_a TYPE c VALUE 'A',
            c_y TYPE c VALUE 'Y'.
CLEAR : v_item_no,
        w_ebkn1,
        w_ebkn_old.
Message include
INCLUDE mm_messages_mac. "useful macros for message handling
*Retreving Item details
CALL METHOD im_header->get_items
  RECEIVING
    re_items = t_item.
LOOP AT t_item INTO w_item.
  ref = w_item-item.
  CALL METHOD ref->get_data
    RECEIVING
      re_data = i_act_items.
  APPEND i_act_items TO t_itemdata.
Retreving Account details
  ref_account = ref.
  CALL METHOD ref_account->get_items
    RECEIVING
      re_items = t_acc_objs.
  LOOP AT t_acc_objs INTO w_acc_obj.
    ref_model = w_acc_obj-model.
    CALL METHOD ref_model->get_exkn
      RECEIVING
        re_exkn = w_exkn.
    APPEND w_exkn TO t_exkn.
    MOVE-CORRESPONDING : w_exkn TO w_exkn_ext.
    w_exkn_ext-bnfpo = i_act_items-bnfpo.
    APPEND w_exkn_ext TO t_exkn_ext.
  ENDLOOP.
ENDLOOP.
*Deleting the line items which are marked with deletion indicator
DELETE t_itemdata WHERE loekz NE space.
SORT t_itemdata BY bnfpo.
READ TABLE t_itemdata INTO w_itemdata INDEX 1.
*get first line item no.
v_item_no = w_itemdata-bnfpo.
IF w_itemdata-knttp = c_k OR
   w_itemdata-knttp = c_a OR
   w_itemdata-knttp = c_y.
*Logic to handel while purchase requisitions creation
LOOP AT t_itemdata INTO w_itemdata.
*Capturing the first Line item while creating Purchase requisition.
IF sy-tabix = 1.
  v_item_no = w_itemdata-bnfpo.
*Plant
v_werks = w_itemdata-werks.
*Purchasing Organization
v_ekorg = w_itemdata-ekorg.
*Account Assaign Cat.
v_knttp = w_itemdata-knttp.
If other than first Line item
ELSE.
*Plant
IF w_itemdata-werks NE v_werks.
mmpur_message 'E' 'ZMMENHANCEMENT' '006' ' '  ' ' ' ' ' '.
ENDIF.
*Purchasing Organization
IF w_itemdata-ekorg NE v_ekorg.
mmpur_message 'E' 'ZMMENHANCEMENT' '007' ' '  ' ' ' ' ' '.
ENDIF.
*Account Assaignment Cat.
IF w_itemdata-knttp NE v_knttp.
mmpur_message 'E' 'ZMMENHANCEMENT' '008' ' '  ' ' ' ' ' '.
ENDIF.
ENDIF.
ENDLOOP.
*Account assaign. deatils
LOOP AT t_exkn_ext INTO w_exkn_ext.
IF w_exkn_ext-bnfpo = v_item_no AND w_exkn_ext-zexkn = '01'.
*APPEND w_exkn_ext TO t_exkn_one.
w_exkn_one = w_exkn_ext.
ELSE.
IF w_exkn_ext-kostl NE w_exkn_one-kostl.
mmpur_message 'E' 'ZMMENHANCEMENT' '009' w_exkn_ext-bnfpo ' ' ' ' ' '
ENDIF.
*Profit Center
IF w_exkn_ext-prctr NE w_exkn_one-prctr.
   mmpur_message 'E' 'ZMMENHANCEMENT' '010' ' '  ' ' ' ' ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF. "if w_itemdata-KNTTP = 'K' OR 'A' OR 'Y'.
ENDMETHOD.

Similar Messages

  • HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."

    HI, I just bought an iPhone 4S. Although my iPad and other iPhone 3GS connect to our server (SBS2003) I cannot get through.  It checks all items in the connection and then I get the message :Cannot get mail, the connection to the server failed."  I Tried everything, rebooting, reset all iPhone, etc.  All Apple devices work perfectly expect mine.  Please advise

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    On your iPad go to Settings > General > Reset > Reset network settings and see if that enables you to connect.
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom

  • Mass Update - checking all items in library

    So somehow all of my songs in my libarary became "unchecked" This stinks for a couple reasons...i can't use party shuffle and i can't play more than one song at a time in itunes in general.
    so my choice is to manually check all 2,000 songs in my library or find some way to re-check all of them in a mass update mode. does anyone know how to do this?
    a bonus would be to understand how they all became unchecked in the first place!!
    thanks and happy holidays

    Hold down the Command key (⌘ or Apple symbol) and then click on the checkbox of any song. This toggles them all on and off: iTunes Keyboard Shortcuts for OSX

  • How to check all items are not null in CAML Query?

    HI All,
    In a CAML Query, i got three items. In all three items, a particular column(Closure Date) should not be null. How to check in all three items, where 'Closure date' is not null?
    Thanks in advance!

    Hi,
    Try this:
    "<Where><IsNull><FieldRef Name='Closure Date' /></IsNull></Where>"
    Hope it hepls!
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • Checking on item code once created

    hi all,
    anyway to check the material master field once material code created ?
    I check the SAP SPRO, there is no configuration and BADI and exit to
    check/validate Material master fields.
    For example, once create material code, the procurement key is "F",
    some of the fields in the MRP 4 view must be maintain like REM profile
    and MRP controller.
    Rejoice !

    hi,
    If you are asking abt the field selections, then it is seen from :
    SPRO --> logistics general --> MM --> Field selection --> here first see the field selection group for the field and then check the assignment...
    If want to see the created material then you can check it in the table MARA in tcode SE16...
    Regards
    Priyanka.P

  • Not displaying all items during MIGO

    Hi All,
    When I try to do the goods issue for process order thro MIGO, the system is not showing all the line items. When I select the process order and do the Adopt in the overview, it is showing all the line items. Is there any settings to be done to show all the line items when I entered the process order.
    Regards,
    Sureshbabu G.

    It's possible that these missing items are flagged as backflushed components
    Check if they are in the production order material list

  • CHECKBOX: how to default on checked all items

    HI,
    i have an item displayed as checkbox using named LOV.
    how can i set this item having all elements selected (or checked) as default?
    can anyone help me on this? im just a newbie here :(
    THANKS in advance!
    BROKEN

    you need to use same context attribute for both the fields and you have to use on Enter event handler for Actual day field and when you press enter then only on Enter will be called on the actual day field and populate the same value in the other field
    Thanks
    Bala Duvvuri

  • MIGO: perform a check of all items on Check or Post

    Hello,
    I need to implement the following requirement:
    - Checking all items at the same time when using MIGO for goods reception (on click of "Check" or "Post");
    For this purpose I need that my implementation (regardless of the technology used), can reach all the items in the same call, since I need to compare fields of different items.
    I read the documentation of MB_MIGO_ITEM_BADI and MB_MIGO_ITEM_BADI - it appears that in none of these the items are available at the same time in any of the methods.
    Can anybody suggest a solution for this requirement?
    Regards,
    Joao

    Hello, Vivek
    My requirement is as follows:
    1 - We are implementing SAP for MILL products in a Cable Industry company;
    2 - We use MIGO for goods reception of reels of cable, the cable being the material that will subject to goods movement;
    3 - Each item is a different reel of cable. For each item, we must enter in the batch configuration the material code and batch of the reel (the reels are also materials). The configuration values are kept by MIGO in the GOITEM structure, on special /SAPMP/ append fields (max 10 characteristics);
    The validation that must be made is this:
    4 - We have to be sure that every batch of cable has a different reel in its configuration data. For that, we need to check all the item lines for the material code/batch entered in the configuration;
    5 - If we find that the same reel (material/batch) has been entered in more than one item's configuration, a message has to be displayed;
    Regards,
    Joao

  • Check/uncheck items in iTunes

    Simple ?, can't find the answer. How do you uncheck/check ALL items in your iTunes library? Thx.

    Sorry, gave you Windows option by mistake. Hold down the Command key (⌘) and click on the check box beside any song in a list and the check marks will be toggled on or off: iTunes for Mac - Keyboard Shortcuts. One click will remove all the check marks in the boxes click again and all the boxes will be checked.

  • Creating change log for sales order

    hi all,
    i want to create change log for any given sales order if it exists.
    can any one tell me how to do that??

    Hi Gouri,
    CDHDR and CDPOS are the tables for all change history.
    CDHDR contains the details such as who made the change, when, using what tcode and the change type ie. update, delete.
    CDPOS contains the field name which was changed, its old value and its new value.
    The change document object is VERKBELEG for sales documents.
    The object value is the SD document number with leading zeros.
    The following link will be also useful.
    http://www.sap-img.com/ab024.htm
    Regards,
    Nitin.

  • I'm experiencing major synchronisation issues on ICloud, especially for documents created on my Mac in pages, keynote and numbers. Contacts and agenda items work fine. I checked all my account settings.

    I'm experiencing major synchronisation issues on ICloud, especially for documents created on my Mac in pages, keynote and numbers. Contacts and agenda items work fine. I checked all my account settings. But while I can upload documents from my MAC onto ICloud, they don't show on my IOS devices (whereas previously this worked without issues).

    On this Mac I did move all the visible iCloud documents out of iCloud, into another folder, then disabled syncing, exactly as you suggested.  But there were, apparently, documents remaining in my Mac's local iCloud store, "~/Library/Mobile Documents/" that I could not see (so could not remove). The Pages file "CSU-PD-UN1.pages" was one such document.
    The act of disabling iCloud's document sync'ing, in System Prefs, just renames the local "iCloud" store to "~/Library/Mobile Documents/<appleid#>/" effectively shielding the it from the sync'ing mechanism.  Looking at this renamed folder (the screenshot above) revealed that "CSU-PD-UN1.pages" (and other files) had not been removed; it would be reasonable to assume that one, or more, of these "undeletable" files were related to my original problem, and when I re-enabled doc sync'ing, those bad files would just clog up the works again.
    So I deleted them with the Finder on both Macs (the other Mac had bad files too, but different ones), then re-enabling sync'ing on the two Macs and doc sync'ing between the Macs (and iCloud.com) appears to now work as intended.
    Sadly, iOS devices (iPhone and two iPad) now do not sync at all.  Newly created documents do not migrate to any other devices, and documents on other devices do to migrate to the iOS devices.
    Your suggestions have certainly done some good, but something is now keeping my iOS devices out of the the iCloud doc sync'ing process.  I suspect it's a similar problem as the Macs had ("invisible" files gumming up the works), so I'm going to apply some nasty tricks to explore the iOS devices file system and see if I can find them, and delete them by brue force.

  • EXIT to change / add line items during STO PO creation in T.Code ME21N

    Hi
    Can somebody suggest me a EXIT or a BADI  to change / add line items during STO PO creation in T.Code ME21N.
    The requirement is as below.
    When the user enters a material no ( which has a BOM created in CS01), and presses enter or saves the PO, i need to get the sub components of the BOM and populate them as the next line items.
    This is because the user needs to create the delivery with reference to the PO. In the delivery, the BOM material needs to be populated with all the sub components of the BOM.
    I tried to do it using EXIT_SAPMM06E_013 in which i am able to change / add the line items in the XEKPO and YEKPO internal tables. The entries are available in the internal table when the EXIT is executed.
    But when the PO is posted internally, the item is not changed/added.
    Thanks in advance.
    Guna.

    Hi,
    Try BADI "ME_PROCESS_PO_CUST".
    cheers,

  • ALE BOM. Updates ALL! items with validity date & change no.

    Hi All,
    We are having problems where ALE-BOM sent with change in validity date (with change no) to a particular item. What happens is that ALE-BOM will instead update ALL! items with the same validity date and change number.
    Next,when we process ALE again for the same BOM with a different validity date(with change no), then only that
    particular item is updated with validity date and change no.
    Would anyone know what could be the problem that when changes are sent for the first time all items are updated?
    [Version: SAP 4.6C/ SAPKH46C48]
    Regards,
    Neeth

    Dear:
                   The error itself telling you the correction. You profit center which is assigned to your cost center has a validity date less than the one you are now assigning.You can check in KE52 against the profit center assigned to your cost center master data. However the best thing is to go to KS01 and create this cost center with desired validity date.
    This will resolve your issue.
    Regards

  • Sales Order BADI need to change all items on save

    Hi,
    I have a specification where I need to set the delivery priority of all items on a sales document on save of the document, according to the gross weight of the items.
    I have tried to implement the user exit MV45AFZZ forms USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT unsuccessfully. This is because the changes made to table xvbap in the exits are only effected on the items that were either created or changed (the items that initially appear in yvbap in the exit).
    I have searched for a classic BADI (this is a ECC 5.0 system - no enhancement spots etc) and found BADI_SD_SALES_ITEM but am unable to implement this as I get the error "for SAP internal use only".
    I am out of idea.. please, some help would be highly appreciated.

    Check enhancements below using SMOD transaction.
    Create implementation using CMOD.
    SDTRM001  Reschedule schedule lines without a new ATP check
    V45A0001  Determine alternative materials for product selection
    V45A0002  Predefine sold-to party in sales document
    V45A0003  Collector for customer function modulpool MV45A
    V45A0004  Copy packing proposal
    V45E0001  Update the purchase order from the sales order
    V45E0002  Data transfer in procurement elements (PRreq., assembly)
    V45L0001  SD component supplier processing (customer enhancements)
    V45P0001  SD customer function for cross-company code sales
    V45S0001  Update sales document from configuration
    V45S0003  MRP-relevance for incomplete configuration
    V45S0004  Effectivity type in sales order
    V45W0001  SD Service Management: Forward Contract Data to Item
    V46H0001  SD Customer functions for resource-related billing
    V60F0001  SD Billing plan (customer enhancement) diff. to billing plan
    Especially pay attention to those which have name starting with
    V45A because VA01 transaction has been attached to SAPMV45A program.

  • How to create price list in all item..?

    Hi all,
    I want to modify the price list in all items because changing the price. If I have more 100 items, I have got difficult change on SBO one by one, there is not an efficient and need a long time. I used SBO 2005A PL 43.
    How to create it fast on SBO? How to create add on module to modify the price list in all items so I modify the price list is faster? I don't know relationship the tables to change the price list on SBO. Please let me know...
    Thanks in advance for your help....
    Agung

    Dear Mr Adrianto,
    In the stock module under price list there are different options. It could be possible to change the prices of Parent items according to thier children's prices.
    Also, you can use the option: Special prices for BP, if you need to change the prices for on BP.
    There is also the discount group if you want to reduce the price of items for the whole group. Please note that you can also increase prices when you use a percentage > 100%.
    Kind Regards,
    Marcella Rivi
    SAP Business One Forums Team

Maybe you are looking for

  • How to get the last update time for a table ?

    I want to know the last change of the table data , for example, a record has been changed, how can i get that time? Regards, Lament

  • Just a comment/question on OS upgrades (VZW/Sprint).

    First, the question: I upgraded the 8330 Curve OS to 4.5 on a friend's device (VZW).  No problem, everything seems to work as near as he can tell, but for some reason it is very laggy...I searched and couldn't find a specific answer to the question.

  • Safari 3.2.1 on mac fails to play embedded audio content.

    my homepage, http://bloodnok.net/ has an embedded audio snippet. the audio snippet is loaded using an <object> tag. the page is xhtml transitional (don't want to be strict) & validates on the w3c site. when i visit the site with firefox or opera from

  • Transferring Old Films

    Hi! I have a Sony Handycam Hi8 video camera (Product # CCD-TRV128). I want to transfer the films to iMovie to edit them and transfer them to DVD. The camera has an S-Video, as well as an analog input to watch the films on a TV. Is there any way to li

  • Pre query , post query where date = mon-yyyy

    I have a tabular block B2 with many records this block items are vouhcerno, voucherdate. voucherno number(6) and voucherdate date. when new form instance i execute query it shows me all the records working fine. I add one list item here when new form