BADI: PO creation : ME_PROCESS_PO_CUST : check line item matnr

Hi all,
I am using a BADI for PO creation definition is ME_PROCESS_PO_CUST and method PROCESS_ITEM
if material number in the Line item is blank, create a material number(BDC or BAPI) and fill it in the line item.
I am not very conversant in Objects...
i seek help on the correctness of the method iam referring to for this purpose and also how to pass values to field matnr in the line item of the PO.
i have used Get_Data for getting all the values and am using set_Data for changing the value of matnr if it is blank. but if i set the value of matnr it doesnt seem to change and am not able to figure out where i am wrong.
Thanks in advance,
Harish Ramakrishnan.

Hi Harish!
Then you are aware of the comment of SAP to process_item:
"Under no circumstances make any changes to the database within this method. On no account use Commits."
But also method post is commented like this: "On no account use Commits in this method."
And you need a commit before you can use any created data in your PO.
Nevertheless, you tried to change a value in process_item. I guess, you use method set_data of the interface, which is import parameter of this method. I had a look into the method set_item: there is just a update to an internal (hashed) table. So technically it should be changed. But if further checks will prohibit changes of special fields - who knows.
I'm not surprised, that line checks can't change the matnr any longer, but at least online it's possible to change the material.
Maybe you can debug, what happens when doing you changes. It might be already after a view steps, where the changes get lost.
Regards,
Christian
P.S.: Do you also use method set_datax - or I'm in a totally wrong area?
Message was edited by: Christian Wohlfahrt

Similar Messages

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • What is line item datas,how can u check line item in Infocube?

    Hi friends,
    what is line item datas,how can u check line item in Infocube?

    hi konda,
    line item data
    i shall give u an example .
    consider a super market bill,
    the bill has 1.customer name        2. bill number   3. date of purchase
    the above line will be header.
    line item data are the items which u purchase.
    item 1 pencil  2 rubber  3. sharpner  4. cryon  5. sketch pens
    above are line item datas.  for a particular set of header data u may have many line item datas.
    reward points if helpful.
    bye.

  • MIGO BADI - Check line item after clicking on  ITEM_OK Field in MIGO

    Hi,
                I am looking for Enhanacement option for MIGO Transaction . What i found it, there is one Badi MB_MIGO_BADI at the creation of material document. When i click on ITEM_OK Field at material line item level. and click on CHECK Button, i want to check material master if that material is having QM View or not . That i can write in one of the method in badi which i found is CHECK_ITEM bt that method is having parameter called I_LINE_ID which have line item no. bt how should i get material doc. no and material no. at that line item?
    Plz try to give me solution.
    Thanks & Regards,
    Saurin Shah

    Hi,
    When you are posting a GR against PO when you check the document
    Method Line_modify of the badi MB_MIGO_BADI is gettin triggered and if you check the importing parameter cs_goitem
    it is getting populated wit the values of the lime item
    Like you said material no, po number, batch no, item no etc.
    Since you can get this details as you said you can check for the view maintained.
    Hope this help you.
    Regards,
    Ranjith N

  • Automatic Service Order creation and OBD line item creation - Repair Order

    Hi ALL,
    I tried to run the Repair process based on the help document of SAP:
    Configs Followed:
    1) In Material master MRP3 view, strategy group is assigned as 84 (service orders). By default this str.grp is linked with Requirement type SERA and Requirement class 203.
    2 ) Requirement class is assigned with appropriate Service order type.
    SPRO>Sales and Distribution>Basic Functions>Availability Check and Transfer of Requirements>Transfer of Requirements-->Define Requirements Classes (OVZG)
    Actual Assignment:
    Reqt. Class Service Order Type
    039 SM01
    203 SM01
    3) Task list is assigned to your Service material - Service product - OISD
    Actual Assignment:
    Service Pdt Work Centre Plant B Area Gen TL Group Counter Task List Type
    R-1001 PC-SERV 1200 8000 62 1 A
    4) Check the Requirement class setting indicator for configuration (cnfg)
    Actual Assignment:
    = mandatory
    5) SPRO>Sales and Distribution>Basic Functions>Availability Check and Transfer of Requirements>Transfer of Requirements-->Define Requirements Classes --> Determination Of Requirement Types Using Transaction
    Actual Assignment:
    Item Category Reqt class Reqt. Type
    IRRS 039 SE
    IRRE 203 SERP
    IRRP 203 SERP
    IRAL 040 KE
    6) Sales and Distribution>Sales>Sales Document Item-->Assign Item Categories for determining the item category based on usage
    Actual Assignment:
    Sal. Doc. Type Item Cat. Group Item Usage H. L . Item Cat Item Category
    RAS NORM IRRS
    RAS NORM R101 IRRS IRRE
    RAS NORM R102 IRRS IRRP
    RAS NORM R103 IRRS IRAL
    Errors Faced:
    1. Service Order is not getting created automatically.
    Error in SAP - IDES :"A service order has not been found for action 'Repairs'"
    2. Also im not getting the automatic creation of the 4th line item(Item Category - IRAL) in the repair order, which in turn stops me from creating the Outbound delivery.
    Please HELP !
    Regards

    Hi PeteA,
    Sorry, here it is...
    Let me explain the process that has been followed:
    1) Initially to start with Service Notification was created with IW51 T-code.
        In that, Sold to party and material # were entered. Then from there directly i go for Create Repair Order from the Action Box.
        Order type for repair order - RAS, and when i save both Service Notification and the Repair gets saved.
        Now, in the repair order, two line items were getting created automatically and the requirement Types for those line items are:
        Line Item I : SE
        Line Item II: SERP
    2) After that i take the material in with the help of t-code VRRE.
    3) Then, i do the acceptance of the stock ( Technical Check) with t-code QA11.
        Once i do that, i get the Third line item in the Repair Order and the requirement Type for that line item is:
        Line Item III: SERP
    Now my query is, Once i do the QA11 transaction i need to get a Service Order automatically but thats not happening.
    Also if i create a Service Order manually, and do the repair and do the technically completion of the service order, then i need to get a third line item (IRAL) in the repair order automatically and thats also not happening.
    Regards

  • BADI: ME_PROCESS_REQ_CUST  Detecting a Deleted Line Item?

    I have implemented this BADI for mapping and for defaulting GL Account Numbers that we read in a custom ZMAPPING_Table. All of my gl account mapping logic is in the 'PROCESS_ACCOUNT' method in this BADI. Just an FYI, there is some code in the 'PROCESS_ITEM' method in this BADI, for another process, as well.
    It is important that I keep track of the line items and their related GL Account Numbers, Material Groups, and all other line item data entered data during the create and change of a Purchase Requisition in a global internal table during runtime. It is working well.
    The issue is that I need to identify when a line item is being deleted in the P.R. during runtime Then,  I can delete the entry in the internal table as well.  When I delete a line item in the P.R. the logic always seems to break in the 'PROCESS_ITEM' method, and never the 'PROCESS_ACCOUNT' method.
    Is there a delete line item indicator, variable, flag, or field, that I can check during runtime in the 'PROCESS_ITEM' method in my ABAP code to see if a line item is in the process of being deleted in the P.R.? it would probably be easiest to validate this in the 'PROCESS_ITEM' method during runtime since we have some code in this method, and it always enters that logic when a line item is deleted. Below are the objects that are being read. If someone has the answer, I'd sure be happy to get the OO code for it as well, since I am still getting my feet wet with OO.
      Thank-You, Tom M.
    INCLUDE mm_messages_mac. "useful macros for message handling
      DATA: ls_mereqitem   TYPE mereq_item,
            l_matkl        TYPE t023-matkl.
      CLEAR: ls_mereqitem.
      ls_mereqitem   = im_item->get_data( ).
      l_matkl = ls_mereqitem-matkl.
      CONDENSE l_matkl.
    * Check if user is using an OLD material group
      DATA: ls_t023  TYPE t023.
      CLEAR: ls_t023.
      SELECT SINGLE begru
        FROM t023
        INTO ls_t023-begru
        WHERE matkl = l_matkl.
      CASE ls_t023-begru.
        WHEN 'OLD'.
    * PRJ0010029 Begin of Change
          IF sy-tcode = 'ME52N'  OR
             sy-tcode = 'ME52'.
            mmpur_message_forced 'W' 'ME' '303' text-002 text-003 '' ''.
          ELSE.
            mmpur_message_forced 'E' 'ME' '303' text-002 text-003 '' ''.
          ENDIF.
    * PRJ0010029 End   of Change
        WHEN OTHERS.
      ENDCASE.
    * PRJ0010029 - End
    Edited by: Tom Matys on Oct 6, 2011 4:55 PM
    Edited by: Tom Matys on Oct 6, 2011 4:55 PM

    You can check the value of the field LOEKZ of the PR item MEREQ_ITEM.
    DATA: ls_mereqitem   TYPE mereq_item.
    ls_mereqitem   = im_item->get_data( ).
    if ls_mereqitem-LOKEZ = 'X'.  " Item deleted
    endif.
    Regards,
    [Naimesh Patel|http://help-abap.zevolving.com/]

  • Issue in creation of new line item in repair order-Reg

    Hi all,
    I have a query in Service Management Module of SAP while working in standard IDES System.
    I followed the procedure given in the IDES material.
    As per the standard system the fourth line item in the repair order should be automatically created, once the service order is technically confirmed and completed. In my case iam able to get the first three (Item Categories - IRRS,IRRE,IRRP) line items but even after completing the service order technically iam not gettin the fourth line item (IRAL). Only based on the Fourth line item we can create the Outbound delivery for the repaired item. After that the billing process need to be processed. My query is how to get the fourth line item automatically in the repair order after i technically complete the Service Order. 
    To brief you on the entire process that i have followed:
    1. The QM Check need to be activated for the material.
    2. Creating the Service Notification and the repair request.
    3. Posting the GR of a piece of equipment to be repaired.
    4. Processing the technical check.
    5. Displaying the repair request and the service order.
    6. Editing the Service Order.
    7. Processing and Confirming the Service Order.
    8. Technically Completing the Service Order.
    9. Delivering the Repaired Piece of Equipment.
    Then Comes the BILLING.....
    In the above, after the eighth Step the Fourth Line item will be created automatically created but it DOESNT....
    regards
    Venu

    Hi ,
    Review your repair procedure and copy controls defined for this stage...mya be some thing is missing over there causing this behaviour.
    As you told completion of Service order will determine the last item and enable us to delivery the item to customer...
    Thanks,
    sudhi

  • Creation of a line item in the existing PO by inbound idoc (ORDERS05)

    Hi friends,
       I have the following requirement.This is for the  inbound idoc ( orders05).
    If there is an extra item line in the confirmation idoc, for which no corresponding purchase order line is found, check if the extra line's NOB-number is found in the new NOB-number check -table.
    Fetch NOB-number check table with database keys:
    E1EDP19-IDTNR (when E1EDP19-QUALF = ZNO) = NOB-number in the table
    EKPO-WERKS (from 1st purchase order item line) = site number in the table.
    If the NOB-number + WERKS is found in the control table, create a new item line in the purchase order.
    If the NOB-number + WERKS is not found in the control table, put the idoc into error.
    Can you please tell me that how to create a new item line in the purchase order.
    Waiting for your help.
    With Regards,
    Ajit Prasad.

    You like to add new line item in existing purchase order or new po.
    Thanks,
    Narayan

  • Block creation of new line item in SO

    Hi,
    Scenario:
    In the sales order, the order quantity of line item 10 is 10pcs, only 5pcs is shipped. I want to allow the remaining 5pcs to be able to ship at some other time. However, no modification is allowed in the order quantity of this line item 10. Also, no addition of new line item in this sales order.
    Question:
    How to block creation/addition of new line item or block modification in the order quantity of the existing line item, but allow the existing line item to be shipped in a sales order?
    Thanks.

    Hi Wooi,
                 You can control through User authorisation, you maintain the authorisation for VA02 for the specific User with the help of BASIS people.
    If you donot want maintain the authorisation you need to activate the User Exit for the with the help of ABAPer.
    You can use these User exits.
    The program is MV45AFZZ
    USEREXIT_READ_DOCUMENT
    USEREXIT_SAVE_DOCUMENT
    USEREXIT_SAVE_DOCUMENT_PREPARE
    I hope it will help you
    Regards,
    Murali.

  • Checking Line Item Dimension

    Hi
    Does anyone know a quicker way to do a mass check on whether 'line item dimension' has been defined in InfoCubes? 
    Please share if you do.
    Many thanks,
    Anthony

    Hi Anthony,
    You can look up table RSDDIMEV (field LINITFL).
    Hope this helps...

  • 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

  • BADI for Sales Order check on Item Level

    Hello,
    I found this BADI, 'BADI_SD_SALES_ITEM' which i guess fires at the item level. But how do i use 'THIS' particular BADI to fulfill my requirement. Can someone guide me how to use 'THIS' particular BADI or if there are any other BADI which gets fired on the sales order item level
    Thank you
    Shehryar Dahar

    better to use Exit Program MV45AFZZ.
    or u have to findout in which Method u can do changes required.
    Regards
    Peram

  • User Exit during Sales Order Creation - New Line Item needed

    I have a situation during the process of sales order creation. If a Material in a line item has say 27 EA and the Base Unit is EA. But the Sales Unit is CSE. Then whenever the user enters 27 EA and presses enter he should get two line items.
    The first line item needs to convert to maximum number of CSE posible and the rest will be the second line item with the remaining EA. The order isn't important but that is what is needed. Question is how do I approach this problem and code my user exit accordingly and where do I code it.
    I was looking at SAPMV45A and saw the program MV45AIZZ which is meant as a user exit for any PAI event handling. If anybody has encountered this kind of requirement can you please share your view on this.
    I will definitely reward points for useful answers.
    Clark

    Hello Mahendra
    The requirement is as follows :
    PART 1:
    Sales Order Enter: 
    1.     When a line item is entered on a sales order (VA01 or VA02), at enter, check the sales unit of measure (VBAP-VRKME).
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check items where VRKME <> EA
    2.     If VRKME = EA, go to MARM for MATNR.
    3.     Go to record where alternate unit of measure (MEINH) = CSE, get the value from the numerator field (UMREZ).
    4.     Divide the order quantity (VBEP-WMENG) by UMREZ.
    5.     If the result is greater than 1.0, the customer has ordered more than one case and a new line item needs to be added to the sales order for the case quantity.
    6.     Add a new line to VBAP for the same material with the case quantity.  If not a whole value, the remainder of eaches (bottles) should update the qty on the first item on VBAP.
    •     Part 1 is relevant for order types ZCA, ZOR, ZSO, RE, ZSM
    PART 2:
    Batch Job to run prior to the Delivery Due List:
    1.     Read VBUK for Delivery Status (LFSTK) = A (delivery not processed).  Get all of the document numbers (VBELN).
    2.     Go to VBEP for those document numbers to get the goods issue date for the order.  There will be many records in VBEP for the same sales order.  Look at all orders with a goods issue date (WADAT) of next day.
    3.     Go to VBAK for those document numbers to see if there are multiple sales orders for the same Sold To party (KUNNR).
    4.     For customers who have more than one order in VBAK, search all line items (for all orders).  If there are no duplicate materials across sales orders, do nothing.
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check line items where reason for rejection (VBAP-ABGRU) is not blank
    5.     If there are duplicate materials, go through the same logic as in part 1.  If the quantity across the sales orders adds up to greater than one case, add the appropriate quantity to a new line item on the first sales order.   If there is a remainder qty, update the line item on the first sales order with this qty. In this case, the quantities on the second sales order needs to be closed out with a reason for rejection code of 50, ‘Line Item Consolidation’. If there is no remainder,  update the qty on this item directly.
    •     Part 2 is relevant for order types ZOR, ZCA, ZSM
    •     This batch job will have to be run manually for Day Pick orders.  The end of this program should automatically kick off the delivery due list for Day Pick orders, shipping condition 02.
    Business Justification:
    The business requires that like order line items be consolidated to one line item prior to the order going to the warehouse for picking.  This will aid in picking at the warehouse as well as result in the customer invoice not reflecting more than one line item for the same material.  In the case where the customer has truly ordered more than a case, i.e;, 1 case, 2 bottles, the documents in SAP will still reflect 2 lines.

  • Error M8-688 - Creation of several vendor line items is not possible for document type RN.

    Hello All,
    We are using the Net Invoice Posting with document type RN(Invoice- Net). We are generating different vendor line items in the accounting document based on the withholding tax codes involved in the invoice posting. When it comes to net invoice posting system is giving an error message M8-688 - Creation of vendor line items is not possible for document type RN. Is there is any way to create multiple vendor items with net invoice posting? Please suggest.
    Thanks,
    Chandu.

    I dont think that there is any way because it is a hardcoded error message.
          IF NOT t003-xnetb IS INITIAL.
            MESSAGE e688 WITH pi_rbkpv-blart.
          ENDIF.
    SAP is checking the customizing for net/gross posting per document type in table T003
    And if it is set up as net, then it is a hard error.

  • Change Transfer Order Line Items during Creation

    Hi All,
    I  have a requirement wherein it is necessary to change the Line item (LTAP) of a transfer order , during its creation.
    I had a look at exits - MWMTO001 (EXIT_SAPLL03T_001) . But it is not useful in our case as the TO is already created before the control is passed over to the user-exit.
    Our requirement is that, if the source qty in alternate unit of measure (LTAP-VSOLA) contains a decimal value i.e. if LTAP-VSOLA = 2.500 CAR ( Carton is the alternate unit of measure ), then the TO line must be split into two lines and the qty must be distributed as 2 CAR and 6 EA ( Each is the Base unit of Measure ), considering that 1 CAR = 12 EA.
    I tried searching for any FM/BAPI for changing TO's, so that it can be used in the above exit after TO creation, but could not find any . Any suggestions to over come this will be highly appreciated.
    Thanks & regards,
    Sandeep

    Hi Jurgen,
    You are right. The system does not propose TO's with different UoM's for the same material. The TO split thro configuration which you have suggested does not check for the decimal value of the quantity, but rather it takes the Qty value as a whole.
    As far as I have seen , there are no user exits which can be used to influence the creation of TO line items.  Let me know if u come across any of them, which can be used to modify the system determined TO lines.
    Regards,
    Sandeep

Maybe you are looking for

  • How can I select records from a DB table with intervals?

    Hello,     Suppose my DB table is  having 20 lakh records. I need to fetch 50000(for eg, this number may change ) records intially then the next 50000 records and so on , so that I never get a runtime error "memory low". I can select the first 50000

  • TERADATA and UDConnect object

    dear all, i want to create a datasource which connects to TERADATA and query a table via UDConnect but i'm facing a slight problem here. Under my extraction tab which requires me to input UDC SourceObject, i key in the TERADATA table e.g. TABLE1 and

  • Report Designer - Formatting in paper layout

    Hello, I have been struggling with a request to develop a very detailed report in printed (paper Layout) format. I am OK with the data output, but spending too much time trying to get the graphical formatting to an acceptable level. Does anyone have

  • How I creatat text with hyperlink in application

    hi all, I want to creat some text with hyperlink (it mean when I click to text, it invoke other panel or web...). My program is Application. Can any one tell me how I do it. Pls help me!!!. Thank you verry much

  • Directory server 6.0 gateway won't run

    Hi, I am running IPlanet directory server version 5.0 with Netscape Enterprise server 4.1. I'm trying to upgrade to IWS 6.0, but the directory server gateway won't work. On the browser, I get: Server Error This server has encountered an internal erro