ME_PROCESS_REQ_CUST

in method PROCESS_ACCOUNT, how to get the PR's item data as in EBAN/mereq_item internal table

Hello Esther
IM_ACCOUNT_REF is available at SAP release >= ECC 6.0.
Perhaps the following coding may be helpful:
METHOD if_ex_me_process_req_cust~process_account.
* define local data
  DATA: lo_account    TYPE REF TO cl_po_accounting_handle_mm,
        lt_items      TYPE mmpur_models,
        ls_item       TYPE mmpur_model_type,
        lo_item       TYPE REF TO cl_req_item_proxy_mm,
        ls_data       type mereq_item.
  lo_account ?= im_account.
  CALL METHOD lo_account->get_items
*    EXPORTING
*      im_items_with_error =
*      im_enq_err_mat      =
*      im_enq_err_con      =
    IMPORTING
      ex_items            = lt_items.
  LOOP AT lt_items INTO ls_item.
    lo_item ?= ls_item-model.
    ls_data = lo_item->if_purchase_requisition_item~get_data( ).
  ENDLOOP.
ENDMETHOD.
Regards
  Uwe

Similar Messages

  • Warning message in me_process_req_cust badi - check method

    Hi all,
    I have implement me_process_req_cust badi and I want to give a warning message in check method. But it doesnt work. When I change the message type to E instead of W, it works. How can I give a warning message in check method? I will be very happy if you help me..
    Thanks...

    Thanks, but it didn't solve my problem. I still can't see my message..

  • Warning messages from ME_PROCESS_REQ_CUST  method CHECK

    Hello All,
    I am facing below mentioned issue with BADI ME_PROCESS_REQ_CUST
    1: how can we issue warning messages from BADI ME_PROCESS_REQ_CUST method CHECK?
    2: Check method is called twice if I click on check button in ME52N.
    Thanks

    HI  ,
    You can  use  Below 
    include mm_messages_mac. "useful macros for message handling
    if  ur condition   .
    mmpur_message_forced 'W' 'ME' '083' text-001 '' '' ''.
    endif.
    text-001  : text element   for your description  .
    BUt Warning Message will not keep the screen on error page  .  it will be  better  to use   'E' for error   if you want 
    mmpur_message_forced 'E' 'ME' '083' text-001 '' '' ''.
    regards
    Deepak.
    Edited by: Deepak Dhamat on Oct 21, 2011 8:20 AM

  • Need to stop posting a line item in PR using BADI ME_PROCESS_REQ_CUST

    Hi All,
    I have a requirement to check the combination of the GLaccount and project and if the combination is not allowed i need to show an error message and to stop the user from saving the Purchase Requisition.
    For this i have coded in BADI ME_PROCESS_REQ_CUST in PROCESS_ACCOUNT method.
    the badi is triggered and the error message is also shown but it is not stopping the user from saving the Purchase Requisition.
    i want to know how to invalidate a line item as we do in PO by calling item->invalidate( ) method.
    i couldnt find any method like that in the ME_PROCESS_REQ_CUST BADI.
    Please anyone of us let me know how to invalidate a line item of a purchase requesition.
    Thanks,
    Srinath S

    Hello Srinath
    Looking at the signature of interface method PROCESS_ACCOUNT it becomes obvious that you cannot stop processing of the PO requisition here.
    You need to implement your validations in method CHECK because here you have a CHANGING parameter CH_FAILED (Nomen est Omen!!!).
    Regards
      Uwe

  • Need code for BADI ME_PROCESS_REQ_CUST

    dear experts,
       I have the below requirement.
    I have to create a new tab for location in Purchase requistion transaction.That i Did.
    I want to insert the data from location field to EBAN-ZSTAND(new field to be created in EBAN).
    I want to save the data in EBAN when i will press save button after selecting the location code.
    please give the code suggestion for BADi ME_PROCESS_REQ_CUST for saving the data into
    the location code (EBAN-ZSTAND).
    Thanks,
    Pilot

    Hi,
    get the item data ....
         *DATA : lt_item TYPE MEREQ_ITEM,
                       ls_item liek line of it_item*
             CALL METHOD im_item->GET_DATA
               RECEIVING
                 RE_DATA = lt_item .
    you will get the data in lt_item.. table
    Thanks,
    Shailaja Ainala.

  • How to get header data in ME_PROCESS_REQ_CUST

    Hi all,
    how to get header data in badi ME_PROCESS_REQ_CUST-process_item

    Isn't it available in the parameters of the method that you are tyring to write.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • BADI - ME_PROCESS_REQ_CUST- G/L Accounts Error Message

    Hi guys,
    I have a problem regarding autodeterminating G/L Accounts.
    I used BADI ME_PROCESS_REQ_CUST with Method: PROCESS_ACCOUNT.
    For setting the G/L Account I used:
                ls_accounting-sakto  = ls_ctrlacc_b-sakto.
                ls_accountingx-sakto = 'X'.
                CALL METHOD im_account->set_exkn
                  EXPORTING
                    im_exkn = ls_accounting.
                CALL METHOD im_account->set_exknx
                  EXPORTING
                    im_exknx = ls_accountingx.
    The problem is in ME52N (changing mode) when i change the G/L Account and after the BADI Logic, a still receive the transaction error "Enter a G/L Account" which will disappear if i press enter again.
    So ...i need in my BADI Logic , at one point (G/L Account is not initial) to erase from the Message Stack that error.
    How do I do that using data and methods from this BADI method: PROCESS_ACCOUNT?
    Thanks a lot.

    I solve this problem by doing :
    CALL METHOD cl_message_handler_mm=>get_handler
            IMPORTING
              ex_handler = lref_msg.
    CALL METHOD lref_msg->remove_all.
    mmpur_message_force  'E' 'ME'  '083' text-003 '' '' ''.
    Now, I don't know how to set cursor on matkl field
    Any opinions?

  • Need sample code for Using BADI ME_PROCESS_REQ_CUST

    Dear all,
    Initially my requirement is to Validate the Document Type of Purchase Request ion as per material.
    I have created a implementation for BADI : ME_PROCESS_REQ_CUST .
    im new to OOPS-ABAP, so pls send *sample code for how to use these methods PROCESS_ITEM,
    like declarations, assignment of data into internal table  for further validation*.
    Regards,
    NIranjan.G

    Hi,
    get the item data ....
         *DATA : lt_item TYPE MEREQ_ITEM,
                       ls_item liek line of it_item*
             CALL METHOD im_item->GET_DATA
               RECEIVING
                 RE_DATA = lt_item .
    you will get the data in lt_item.. table
    Thanks,
    Shailaja Ainala.

  • SE18 -- BADI : ME_PROCESS_REQ_CUST

    HI gurus
    I have a question regarding the subscreen capabilities in the BADI : ME_PROCESS_REQ_CUST.
    I can see the tab "subscreen" and the fields "call program" , "scr.no.", subscreen area and Desciption. Do anyone know what funtion this is and how I can use this one?
    Thanks
    Alex

    This is used to create your own screens in Enjoy Pur.reqs. You can define your own screen there by adding fields to relavent tables and fetch data. Similar to adding a customer sub screen/screen to vendor master or customer.
    Search forum for adding subscreen to pur req's or vendor master or customer master. The process similar to all of them.

  • BAPI ME_PROCESS_REQ_CUST - invalidate item

    Dear SAP,
    We are using BADI BAPI ME_PROCESS_REQ_CUST and pretend to flag parameter re_valid as mmpur_rule_invalid, on the method PROCESS_ACCOUNT
    or PROCESS_ITEM.
    According to note  Note 611175 - ME_PROCESS_REQ_CUST: Documentation, we must use method is_valid, but the parameter re_valid has type returning.
    How can we invalidate the document item?
    Thanks in advance,
    Maria João rocha

    Try setting BROKEN_RULES.
    Sample code.
      DATA: lv_object    TYPE REF TO object,
                  lv_attrib      TYPE string.
      FIELD-SYMBOLS: <fs1> TYPE ANY.
        lv_attrib = 'MY_STATE->BROKEN_RULES'.
        ASSIGN lv_object->(lv_attrib) TO <fs1>.
        SET BIT 2 OF <fs1>.
    George Centino

  • Confused with ME_PROCESS_REQ_CUST PROCESS_ITEM

    Hi All,
    I'm using ME_PROCESS_REQ_CUST PROCESS_ITEM and check to validate a line item.
    Lets say i have 2 line items
    I entered line item 1 and hit enter then i'm getting the custom messge that i put in process_item and in this method i'm setting a global variable
    w_ch_failed = 'X'.
    now i keyed line item 2 details and hit enter then i'm getting the custom messge that i put in process_item and in this method i'm setting a global variable
    w_ch_failed = 'X'. " Which is already set to 'X' because of line item 1
    Now i fixed the line item 2 and the value is reset of w_ch_failed = ' '.
    Now i'm saying in check method
    MOVE w_ch_failed TO CH_FAILED.
    1) My problem is that i'm able to post the Purchase Req even though the line item 1 has an error because w_ch_failed is blank because of correct line item 2
    Below is my code
    PROCESS_ITEM
      include mm_messages_mac.
      DATA : L_ITEM TYPE MEREQ_ITEM.
      DATA : MARA TYPE MARA.
      clear : l_item,mara.
      data :lv_obj         TYPE REF TO object,
            lv_attr        TYPE string,
            lv_aktyp       TYPE aktyp.
      FIELD-SYMBOLS : <fs_lcl> TYPE ANY.
      check im_count = 1.
      CALL METHOD IM_ITEM->GET_DATA
        RECEIVING
          RE_DATA = L_ITEM.
      check l_item-werks = 'XYZ'.
    SELECT SINGLE  FROM MARA INTO MARA WHERE MATNR = L_ITEM-MATNR AND
                                    KPSTAT = 'XYZ'.
    IF SY-SUBRC EQ 0.
      IF L_ITEM-MATKL IS INITIAL.
    mmpur_message_forced 'E' '00' '398' 'Item ERROR' l_item-BNFPO.
       w_ch_failed = 'X'.
    else.
      clear w_ch_failed.
        ENDIF.
    ENDIF.
    CHECK METHOD
    MOVE w_ch_failed TO CH_FAILED.
    Thanks
    David

    You need to remember FAILED status for each item. You should do that by creating a internal table with EBELP and FAILED status.
    READ lt_checks assigning <lfs_check> with key ebelp = im_curr_ebelp.
    if sy-subrc eq 0.
      clear <lfs_check>-failed.  " if its good item
    *  <lfs_check>-failed = 'X'. " if its not a good item
    else.
      append initial line to lt_Checks assigning <lfs_check>.
      <lfs_check>-ebelp = im_Curr_ebelp.
      clear <lfs_check>-failed.  " if its good item
    *  <lfs_check>-failed = 'X'. " if its not a good item
    endif.
    In method CHECK, read this table with any FAILED = 'X', if found, set the CH_FAILED.
    read table lt_checks transporting no fields with key failed = 'X'.
    if sy-subrc eq 0.
      CH_FAILED = 'X'.
    endif.
    Regards,
    Naimesh Patel

  • How to display Warning messages in BADI ME_PROCESS_REQ_CUST?

    Hi,
    I have implemented BADI ME_PROCESS_REQ_CUST and coded necessary logic according to my requirement in Method  PROCESS_ITEM.
    On a certain condition , I need to display a Warning message.
    I have written the code as follows:--
    message w001(00) with 'XYZ'.
    It didnt work.
    Then, I included the message in message class ZPBS, and coded as follows.
    message w012(zpbs).
    But, still it didnt work..
    Can u guys please guide me what I need to do?
    Thanks,
    Shivaa....

    Hello Shiva
    Have a look at method PO_READ of class CL_PO_HEADER_HANDLE_MM.
    METHOD po_read.
      INCLUDE mm_messages_mac.
      DATA: l_po_number TYPE ekko-ebeln.
      IF im_po_number NE space.
        l_po_number = im_po_number.
      ELSE.
        l_po_number = po_number.
      ENDIF.
    * authority check on transaction code disabled
    * If called via CALL TRANSACTION, this check is already done by basis
    * (see note 358122)
    * restriction of T-code authority check to Enjoy only
      IF for_bapi IS INITIAL.
    * tcode authorization
        IF NOT im_tcode IS INITIAL.
          CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
            EXPORTING
              tcode  = im_tcode
            EXCEPTIONS
              ok     = 0
              not_ok = 1
              OTHERS = 2.
          IF sy-subrc NE 0.
            MESSAGE e172(00) WITH im_tcode INTO gl_dummy.
            mmpur_message_forced 'E' '00' '172' im_tcode '' '' ''.
            ex_result = mmpur_no.
            CALL METHOD set_state( im_state = c_available ).
            EXIT.
          ENDIF.
        ENDIF.
      ENDIF.
    Add the include MM_MESSAGE_MAC to you method and set the message using macro MMPUR_MESSAGE_FORCED.
    I am not sure whether the warning will indeed be displayed while changing an item but it should be displayed when checking the purchase requisition and presumably when saving it.
    Regards
       Uwe

  • How to find table structure for IM_ITEM in badi ME_PROCESS_REQ_CUST

    Dear Experts,
    How i can find table structure for IM_ITEM in badi ME_PROCESS_REQ_CUST.

    Hi Ganesh,
    double click the method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM
    double click TYPE REF TO IF_PURCHASE_REQUISITION_ITEM
    select get_data and click parameters
    here you can find the structure mereq_item.
    This is the process to find the structure....:-)

  • Field control through ME_PROCESS_REQ_CUST

    Hello
    My customer has requested field control for certain fields on the Requisition Item. The scenario is that we are using 4.70, ME51N we have a button that we press to open up an external catalog. Data is then brought back from the external catalog. The customer, in this instance, wants certain fields to be display only.
    I am wondering if this sort of screen control can be done via BADI ME_PROCESS_REQ_CUST - method FIELDSELECTION_ITEM.
    Has anyone had any experience with this? I cannot find any documentation on this BADI nor the method.
    Kind Regards,
    Louise

    You can only use this BADI for customer defined fields. It will not allow you to change standard fields.

  • Prb display error message while creating PR at ME51n in ME_PROCESS_REQ_CUST

    Hi All,
    I have this requirement to check the cost center availability in PR screen (ME51n).
    If cost center in the Account assignment tab is not empty, display error message  and not able to create the PR.
    With my code below, it doesn't triggered the error message and PR created.
    Could anyone help?
    METHOD if_ex_me_process_req_cust~process_account.
    DATA: w_account_ref TYPE exkn.
    w_account_ref = im_account_ref->get_data( )
    IF w_account_ref-kostl IS NOT INITIAL.
      MESSAGE e303(ME) WITH text-001 w_account_ref-kostl text-002.
    ENDIF.
    ENDMETHOD.
    Thank you.
    SW

    Hi,
    You have to use definition MMPUR_MESSAGE 'E'  ME 303   text-001 w_account_ref-kostl text-002.
    This will throw the error during check and save instead of message e303(me) .
    Hope it helps.
    Sujay
    Edited by: Sujay Venkateswaran Krishnakumar on Oct 5, 2010 2:54 PM

  • Badi ME_PROCESS_REQ_CUST Sample Code required for changing the values

    Dear Friends,
    I am new to the Badi technology. We would like to populate/change the standard field values, (Purchasing group) during Purchase Requisition creation/change.
    Method --> PROCESS_ITEM.
    I tried the following code, but system blnaks out all the field values entered during PR creation.
    Appreciate, if you could provide me some sample code which can be of help.
    Reg
    Kumar
    Sample code----
    METHOD if_ex_me_process_req_cust~process_item .
    DATA: k_mereqitem          TYPE mereq_item,
            om_data              type mereq_item,
            om_datax             type mereq_itemx,
        k_mereqitem = im_item->get_data( ).
        check im_count = 1.
        if k_mereqitem-bsart = 'ST' and
           k_mereqitem-loekz = ' '.
        om_data-pstyp = '5'. " assign default item category code
        om_data-bnfpo = k_mereqitem-bnfpo.
        om_data-WERKS = k_mereqitem-WERKS.
        om_datax-pstyp = 'X'.
        call method im_item->set_datax
             exporting im_datax = om_datax.
        call method im_item->set_data
             exporting im_data =  om_data.
        endif.
    ENDMETHOD.

    Hi Kumar,
    i have not a special solution for your case, but i use this BADI with great effort
    As my comments in example are in german lg. i explain in short words what i do:
    X) define data
    1) select data from base item
    1a) header-data
    1b) item data (easy)
    1c) accounting data
    2+3) check field values, post warning message + mostly change values + sometimes set cursor focus on field
    Have a look and give me some points if my example increased your BADI knowledge
    regards
    Jörg
    METHOD if_ex_me_process_po_cust~process_item .
    * Business-Add-Inn ME_PROCESS_PO_CUST
    * Jörg Sauterleute - 23.12.2005
    * Ablauf:
    * 1. Datenbschaffung
    * 2. Feldänderungen prüfen + Warnung ausgeben
    * 3. Feldinhalte prüfen + evtl. ändern u. Hinweis ausgeben
      DATA: ls_mepoitem TYPE mepoitem,
            ls_mepoheader TYPE mepoheader,
            ls_mepoaccounting TYPE mepoaccounting.
    * Interfacereferenz auf <if_purchase_order_mm>
      DATA: header_obj TYPE REF TO if_purchase_order_mm.
    * Interfacereferenz auf <if_purchase_order_account_mm> über Tabelle
      DATA: it_accountings TYPE purchase_order_accountings, "Tabelle
            accounting_obj TYPE purchase_order_accounting.
    * Include für Ausgabe von Meldungen
    * im BAdI ME_PROCESS_PO_CUST niemals ABAP-Statement MESSAGE verwenden!
      INCLUDE mm_messages_mac.
    * Hilfsvariablen
      DATA: h_change_mepoitem TYPE c,
            h_text TYPE string.
      IF sy-sysid = 'HLT'. break sau. ENDIF.
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 1. Datenbeschaffung
    * Kopfdaten
      header_obj = im_item->get_header( ).
      ls_mepoheader = header_obj->get_data( ).
    * Positionsdaten
      ls_mepoitem = im_item->get_data( ).
    * Kontierungsdaten (Accounting) über Tabelle it_accountings
      it_accountings = im_item->get_accountings( ).
    * ...IF eingebaut, weil sonst später Abbruch, wenn sy-subrc <> 0
      IF NOT ls_mepoitem-knttp IS INITIAL.
        LOOP AT it_accountings INTO accounting_obj.
          ls_mepoaccounting = accounting_obj-accounting->get_data( ).
        ENDLOOP.
      ENDIF.
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 2. Daten prüfen -> Warnmeldung
    * Feld Empfänger (Kontierung) prüfen -> Warnmeldung
      IF ls_mepoheader-ekorg = '1000' AND
         ls_mepoheader-bsart = 'IB'.
        IF NOT ls_mepoitem-knttp IS INITIAL.
          CASE ls_mepoheader-ekgrp.
            WHEN '500' OR '501'.
              IF NOT ls_mepoaccounting-wempf IS INITIAL.
                mmpur_metafield mmmfd_recipient.       "Warenempfänger - Cursor setzen
                mmpur_message_forced 'I' 'ME' '303' text-011 '' '' ''.
    * Warnmeldung wieder aus Protokoll entfernen.
                IF ls_mepoaccounting-wempf IS INITIAL.
                  mmpur_remove_messages_by_id ls_mepoaccounting-id.
                  mmpur_business_obj_id ls_mepoaccounting-id.
                ENDIF.
              ENDIF.
            WHEN OTHERS.
              IF ls_mepoaccounting-wempf IS INITIAL.
                mmpur_metafield mmmfd_recipient.       "Warenempfänger - Cursor setzen
                mmpur_message_forced 'W' 'ME' '303' text-010 '' '' ''.
              ENDIF.
    * Warnmeldung wieder aus Protokoll entfernen.
              IF NOT ls_mepoaccounting-wempf IS INITIAL.
                mmpur_remove_messages_by_id ls_mepoaccounting-id.
                mmpur_business_obj_id ls_mepoaccounting-id.
              ENDIF.
          ENDCASE.
        ENDIF.
      ENDIF.
    * Ende Feld Empfänger (Kontierung) prüfen -> Warnmeldung
    * Ende test
    * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * 3. Positionsdaten prüfen/ändern -> setzen
      CLEAR: h_change_mepoitem,
             h_text.
    * Kennzeichen Wareneingang prüfen/ändern
    * Belegart 'NB' immer mit "Wareneingang" wegen Log. Rechnungsprüfung
    * Belegart 'IB' immer ohne "Wareneingang" weil Einsatz Workflow
    * (Kennzeichen 'WEPOS' setzen/nicht setzen)
      IF NOT ls_mepoitem-knttp IS INITIAL.
        CASE ls_mepoheader-bsart.
          WHEN 'NB'.
    * Prüfung ob gesetzt
    * Wenn nicht, dann setzen und Daten übergeben
    * Cursor auf Metafeld (aus Typgruppe MMMFD) für Fehlerbehandlung
            IF ls_mepoitem-wepos IS INITIAL.
              ls_mepoitem-wepos = 'X'.
              h_change_mepoitem = 'X'.
    *           im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-001.
              mmpur_metafield mmmfd_gr_ind .       "WE-Kennzeichen - Cursor setzen
    *           message erst später ausführen!
    *           mmpur_message_forced 'I' 'ME' '303' text-001 '' '' ''.
            ENDIF.
          WHEN 'IB'.
    * Prüfung ob nicht gesetzt
    * Wenn doch, dann entfernen und Daten übergeben
    * Cursor auf Metafeld (aus Typgruppe MMMFD) für Fehlerbehandlung
            IF NOT ls_mepoitem-wepos IS INITIAL.
              ls_mepoitem-wepos = ' '.
              h_change_mepoitem = 'X'.
    *            im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-002.
              mmpur_metafield mmmfd_gr_ind .       "WE-Kennzeichen - Cursor setzen
    *           message erst später ausführen!
    *           mmpur_message_forced 'I' 'ME' '303' text-002 '' '' ''.
            ENDIF.
        ENDCASE.
      ENDIF.
    * Ende Kennzeichen Wareneingang prüfen/ändern
    * Kennzeichen aut. WE-Abrech. (Rechnung) prüfen/ändern
    * (für autom. Gutschriftsverfahren Verpackungseinkauf)
    * Kreditordaten
      DATA: it_lfm1 TYPE TABLE OF lfm1,
            wa_lfm1 TYPE lfm1.
      IF ls_mepoheader-ekorg = '1000' AND
         ls_mepoheader-bsart = 'NB'   OR
         ls_mepoheader-bsart = 'KA'.
        IF ls_mepoitem-xersy IS INITIAL AND
           ls_mepoitem-umson IS INITIAL.                    "kostenlose Lieferung
          SELECT * FROM lfm1 INTO CORRESPONDING FIELDS OF TABLE it_lfm1
                   WHERE lifnr = ls_mepoheader-lifnr AND
                         ekorg = ls_mepoheader-ekorg.
          IF sy-subrc = 0.
            READ TABLE it_lfm1 INTO wa_lfm1 INDEX 1.
            IF wa_lfm1-xersy = 'X'.
              ls_mepoitem-xersy = 'X'.
              h_change_mepoitem = 'X'.
    *          im_item->set_data( EXPORTING im_data = ls_mepoitem ).
              h_text = text-005.
              mmpur_metafield mmmfd_ers.       " Kennz. aut.WE-Abrechnung - Cursor setzen
    *            message erst später ausführen!
    *            mmpur_message_forced 'I' 'ME' '303' text-005 '' '' ''.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Kennzeichen aut. WE-Abrech. (Rechnung) prüfen/ändern
    * Kennzeichen WE-bezogene Rechnungsprüfung (Rechnung) prüfen/ändern
    * (für autom. Gutschriftsverfahren Verpackungseinkauf)
    * Kreditordaten bereits deklariert
    *  DATA: it_lfm1 TYPE TABLE OF lfm1,
    *        wa_lfm1 TYPE lfm1.
      IF ls_mepoitem-knttp IS INITIAL.
    * nicht anwenden bei kontierten Bestellungen
        IF ls_mepoitem-pstyp = 0.
    * nicht anwenden bei gefülltem Positionstyp (z.B. 'L' = Lohnbearbeitung, Preis 0,00 EUR)
          IF ls_mepoheader-ekorg = '1000' AND
             ls_mepoheader-bsart = 'NB'   OR
             ls_mepoheader-bsart = 'KA'.
            IF ls_mepoitem-webre IS INITIAL AND
               ls_mepoitem-umson IS INITIAL.                    "kostenlose Lieferung
              SELECT * FROM lfm1 INTO CORRESPONDING FIELDS OF TABLE it_lfm1
                       WHERE lifnr = ls_mepoheader-lifnr AND
                             ekorg = ls_mepoheader-ekorg.
              IF sy-subrc = 0.
                READ TABLE it_lfm1 INTO wa_lfm1 INDEX 1.
                IF wa_lfm1-webre = 'X'.
                  ls_mepoitem-webre = 'X'.
                  h_change_mepoitem = 'X'.
    *          im_item->set_data( EXPORTING im_data = ls_mepoitem ).
                  h_text = text-006.
                  mmpur_metafield mmmfd_gr_based_iv.   "WE-bezogene RP - Cursor setzen
    *            message erst später ausführen!
    *            mmpur_message_forced 'I' 'ME' '303' text-006 '' '' ''.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Kennzeichen WE-bezogene Rechnungsprüfung (Rechnung) prüfen/ändern
    ** Kennzeichen Auftragsbestätigungspflicht prüfen/ändern
    ** (bisher nur Natec)
    ** Infosatzdaten (Konditionen) deklarieren
    ** Verweis of Tabelle mit Kopfzeilen immer mit TYPE TABLE OF
    *  DATA: it_ekomd TYPE TABLE OF ekomd,
    *        wa_ekomd TYPE ekomd.
    *  IF ls_mepoheader-ekorg = '1300' AND
    *     ls_mepoheader-bsart = 'NB'   .
    *    CALL FUNCTION 'ME_GET_INFORECORD_CONDITIONS'
    *      EXPORTING
    *        i_ekorg = ls_mepoheader-ekorg
    *        i_esokz = '0'                                       " '0' = NB
    *        i_infnr = ls_mepoitem-infnr
    *        i_lifnr = ls_mepoheader-lifnr
    *        i_matkl = ls_mepoitem-matkl
    *        i_matnr = ls_mepoitem-matnr
    *        i_werks = ls_mepoitem-werks
    *      TABLES
    *        tekomd  = it_ekomd.
    *    SORT it_ekomd BY datbi DESCENDING.
    *    READ TABLE it_ekomd INTO wa_ekomd INDEX 1.
    *    CASE ls_mepoheader-ekorg.
    *      WHEN '1300'.
    **     Anforderung Natec: wenn Infosatz-Kondition
    **       a)  leer o. nicht gültig  => AB setzen, wenn fehlt
    **       b)  älter       2 Monate  => AB setzen, wenn fehlt
    **       c)  nicht älter 2 Monate  => AB entfernen, wenn gesetzt
    **     Hilfsvariablen
    *        DATA: h_vgldat   TYPE sy-datum.   " Vergleichsdatum
    *        DATA: h_ergebnis TYPE c.
    **     Alter der Infosatzkondition ermitteln.
    *        CALL FUNCTION 'CCM_GO_BACK_MONTHS'
    *          EXPORTING
    *            currdate   = sy-datum
    *            backmonths = '002'
    *          IMPORTING
    *            newdate    = h_vgldat.
    *        IF wa_ekomd-datbi < sy-datum OR    " gefunden Kondition nicht gültig oder
    *           wa_ekomd-datbi IS INITIAL.      " keine Kondition gefunden
    *          h_ergebnis = 'a'.
    *        ENDIF.
    *        IF wa_ekomd-datab < h_vgldat.
    *          h_ergebnis = 'b'.
    *        ENDIF.
    *        IF wa_ekomd-datab > h_vgldat.
    *          h_ergebnis = 'c'.
    *        ENDIF.
    **       Prüfung ob nicht gesetzt
    *        IF ls_mepoitem-kzabs = ' ' AND
    *                  h_ergebnis = 'a' OR
    *                  h_ergebnis = 'b' .
    *          ls_mepoitem-kzabs = 'X'.
    *          h_change_mepoitem = 'X'.       "Merker setzen, geändert wird am Schluss
    **               im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-003.
    **               message erst später ausführen!
    **               mmpur_message_forced 'I' 'ME' '303' text-004 '' '' ''.
    *        ENDIF.
    **       Prüfung ob gesetzt
    *        IF ls_mepoitem-kzabs = 'X' AND
    *           h_ergebnis        = 'c' .
    *          ls_mepoitem-kzabs = ' '.
    *          h_change_mepoitem = 'X'.       "Merker setzen, geändert wird am Schluss
    **               im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-004.
    **               message erst später ausführen!
    **               mmpur_message_forced 'I' 'ME' '303' text-003 '' '' ''.
    *        ENDIF.
    *    ENDCASE.
    *  ENDIF.
    ** Ende Kennzeichen Auftragsbestätigungspflicht prüfen/ändern
    * Bestell-/Bestellpreis-Mengeneinheit prüfen/setzen
      DATA: h_txz01 TYPE mepoitem-txz01.   " Materialkurztext
      IF   ( ls_mepoheader-ekorg = '1000' OR
             ls_mepoheader-ekorg = '1500' ) AND
             ls_mepoheader-bsart = 'IB' AND
         NOT ls_mepoitem-knttp IS INITIAL.
    * Vergleichen ob eingegebene Mengeneinheit in Kurztext "avisiert"
        CONCATENATE '(' ls_mepoitem-meins ')' INTO h_txz01.
        IF ls_mepoitem-txz01 CS h_txz01.
          IF NOT ls_mepoitem-meins IS INITIAL.
            mmpur_metafield mmmfd_unit .       "Steuer-Kennz. - Cursor setzen
            mmpur_message_forced 'W' 'ME' '303' 'ME' ls_mepoitem-meins
                                                     text-031 ''.
          ENDIF.
    * sonst standarmäßig 'LE' setzen wegen Problemen bei Obligo
        ELSE.
          IF NOT ls_mepoitem-meins = 'LE'.
            ls_mepoitem-meins = 'LE'.
            ls_mepoitem-bprme = 'LE'.
            h_change_mepoitem = 'X'.
    *      im_item->set_data( EXPORTING im_data = ls_mepoitem ).
            h_text = text-030.
            mmpur_metafield mmmfd_unit .             "Steuer-Kennz. - Cursor setzen
    *      message erst später ausführen!
    *      mmpur_message_forced 'I' 'ME' '303' text-030 '' '' ''.
          ENDIF.
        ENDIF.
      ENDIF.
    * Ende Bestell-Mengeneinheit prüfen/ändern
    * Steuerkennzeichen prüfen/setzen (für EK-Gruppe 500,501)
      IF ls_mepoheader-ekorg = '5000' AND
         ls_mepoitem-matnr IS INITIAL.
        CASE ls_mepoheader-ekgrp.
          WHEN '500' OR '501'.
            IF ls_mepoitem-mwskz IS INITIAL.
              ls_mepoitem-mwskz = 'V4'.
              h_change_mepoitem = 'X'.
    *    "      im_item->set_data( EXPORTING im_data = ls_mepoitem ).
    *          h_text = text-020.
    *          mmpur_metafield mmmfd_tax_code .       "Cursor Steuer-Kennz.
    *    "      message erst später ausführen!
    *    "      mmpur_message_forced 'I' 'ME' '303' text-020 '' '' ''.
            ENDIF.
        ENDCASE.
      ENDIF.
    * Ende Steuerkennzeichen prüfen/ändern
    * zu 3.
    * zum Schluss noch die geänderten mepoitem-xxxx setzen
    * + gleiche Meldungen (I ME 303) ausgeben
      IF h_change_mepoitem = 'X'.
        im_item->set_data( EXPORTING im_data = ls_mepoitem ).
      ENDIF.
      IF NOT h_text IS INITIAL.
        mmpur_message_forced 'I' 'ME' '303' h_text '' '' ''.
      ENDIF.
    * Ende Daten prüfen/ändern -> setzen
    ENDMETHOD.                    "IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM

Maybe you are looking for

  • Cannot download anything. Get 203 error

    I just downloaded Mozilla Firefox. It gives me a 203 error everytime I try to install any download. I like a google tool bar and Alexa tool bar displayed. I have these with Internet Explorer and would like to have them with Firefox as well in order t

  • Purchasing Document Type (Purchase Order and Contract)

    Dear all; I have created two different PO  document type in development Server .I have transferd sandbox for further testing ,There i hve change the number range interval status to "0" after that I have created a PO with new document type in the sand

  • User defined record types in package header

    hi. is there a way in sql developer to view just the record type names? for example, i have: TYPE my_rec_type_1 IS RECORD(...); TYPE my_rec_type_2 IS RECORD(...); TYPE my_rec_type_3 IS RECORD(...); and all i want to see is a list showing my_rec_type_

  • Lost Playbook - best course of action

    Suffice it to say, I lost my Playbook....it was strong password protected, and I lost it around a month ago.  No attempts have been made to download apps in the app store, and I cannot think of a way that someone would be able to figure out the passw

  • Batch create multiple files in a script

    I have 130,000 gif files I want to convert to pdf.  I can only batch convert about 1,500 at a time, acrobat will bomb out if I do more.  Is there a script I can use to process all my files ? Thanks, Alex