User Exit in ME51N: EXIT_SAPLMEREQ001 Problem with header

Hello together,
I am using EXIT_SAPLMEREQ001 and EXIT_SAPLMEREQ003 to change custom fields in the item. But i have the following problem:
When I call IM_REQ_ITEM->get_data(  ) in EXIT_SAPLMEREQ001 it has always the BSART 'NB' and not the
one the user has chosen. It seems that it has always the state from the start of the programm where the default for BSART is "NB"

User Exit
PR -
MEREQ001
PO -
MM06E004  Control import data screens in purchase order
MM06E005  Customer fields in purchasing document
ME_PROCESS_PO_CUST (BADi)
Hope the above helps.
Regards,
Vivek

Similar Messages

  • Formula Variable with User Exit....Problem

    Hi
      My requirment is to create a Formula Variable on User Exit that will give me Current Cal Year...so that i can use that vale in Formulas
    Created Formula Variable with processing Type Customer Exit single Value,Mandator and Unchecked the Variable input ready
    The below code in CMOD
    WHEN 'XXXXXXX'.
    Year  = sy-datum(4).
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = Year.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND l_s_range TO e_t_range.
    But when i execute the query i am getting the below error
    No value could be determined for variable xxxxxxx.
    Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET
    Diagnosis
    This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
    Termination message BRAIN 632 appears:
    Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
    WHAT WRONG I AM DOING...please update me

    Use the code:
    WHEN 'XXXXXXX'.
         IF i_step = 2.
              Year = sy-datum(4).
              CLEAR L_S_RANGE.
              L_S_RANGE-HIGH = Year.
              L_S_RANGE-SIGN = 'I'.
              L_S_RANGE-OPT = 'EQ'.
              APPEND l_s_range TO e_t_range.
         ENDIF.
    Let me know, if it is work or not!
      - Balajee Kannan

  • MIRO - User Exit during SAVE: Read items & Update header

    Hi there!
    During MIRO after pressing save...
    I search for an user-exit or BAdI, to READ ITEM DATA and UPDATE HEADER DATA (XBLNR) after SAVE but before UPDATE.
    I have searched this forum, but with no luck. Many more then me seem to have the same problem. The most common answer have been to try BAdI INVOICE_UPDATE, but that BAdI only give READ access and NO UPDATE, so no luck there..
    To summarize all my searching here and findings... I list all exits I have tested...
    User-Exits
    LMR1M001 User exits in Logistics Invoice Verification
    LMR1M002 Account grouping for GR/IR account maintenance
    LMR1M003 Number assignment in Logistics Invoice Verification
    LMR1M004 Logistics Invoice Verification: item text for follow-on docs
    LMR1M005 Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006 Logistics Invoice Verification: Process XML Invoice
    MRMH0001 Logistics Invoice Verification: ERS procedure
    MRMH0002 Logistics Invoice Verification: EDI inbound
    MRMH0003 Logistics Invoice Verification: Revaluation/RAP
    MRMN0001 Message output and creation: Logistics Invoice Verification
    BADI - When saving in MIRO the following BAdI were passed...
    PPA_CUST_BADI
    /CCIS/FICLRDC_ENH
    INVOICE_UPDATE  << only read no update
    ME_DP_CLEARING
    AC_DOCUMENT
    FI_LIMIT_PROCESS
    AC_QUANTITY_GET
    FMRE_BUS_PROCESS
    EXIT_XFMPRI_001
    CO_DOCUMENT_INFO
    INVOICE_UPDATE (method change_before_update ) << only read no update
    MRM_RANSACT_DEFAULT
    MRM_HEADER_DEFAULT
    Other BAdI's
    MRM_HEADER_CHECK - Bara ingående värden för kontroll
    MRM_HEADER_DEFAULT - Tyvärr sätter bara XBLNR precis när man går in i MIRO...dvs för tidigt.
    MRM_ERS_HDAT_MODIFY  - EJ anropad...
    Would be greatful for any ideas on this matter...
    Best regards
    Henrik

    Hello Henrik,
    In BADI INVOICE_UPDATE there are 3 methods CHANGE_AT_SAVE, CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE.
    Of these CHANGE_AT_SAVE is called before INSERT / UPDATE statements are executed. We can use this to update RBKP-XBLNR.
    We can't use CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE methods as they are called after INSERT / UPDATE statements are executed and before COMMIT.
    You can update RBKP-XBLNR through INVOICE_UPDATE~CHANGE_AT_SAVE method using call stack technique like below. You can replace 'VALUE' in the below code with the value based on your calculation using other variables like s_rbkp_new, ti_rseg_new etc.
    method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE.
      DATA: lv_name_xblnr(30) TYPE c VALUE '(SAPLMRMP)RBKPV'.
      FIELD-SYMBOLS: <fs_rbkpv> TYPE mrm_rbkpv.
      ASSIGN (lv_name_xblnr) TO <fs_rbkpv>.
      IF <fs_rbkpv> IS ASSIGNED.
        <fs_rbkpv>-xblnr = 'VALUE'.
      ENDIF.
    endmethod.
    Best regards,
    Vishnu Tallapragada

  • Having problem with header(location)

    I want to have a visitor to a site agree to some terms before being allowed to access a page.  There is no logon so the approval is only for the current session.
    If we call the page with the terms (and the agree button) "portal.php" and the page with the data "gallery.php", the logic is the user goes to gallery.php where there is a check to see if the visitor agreed to the terms.  If not, their redirected to portal.php to do so.
    The code on gallery.php is:
    <?php
    session_start(); 
    if (!isset($_SESSION["agree"]))
        header( 'location: http://localhost/myweb/portal.php' );  Using a local test server
    ?>
    If the Session variable "agree" has not been set, the user is redirected.
    The code on portal.php is:
    <?php
        if ($_POST)
            $_SESSION["agree"] = "Yes";
            header( 'location: http://localhost/myweb/gallery.php'' );
    ?>
    If the code is coming from the "I Agree" button, the Session "agree" variable is set to "Yes" and the visitor directed back to the gallery.php page.
    When I go to the gallery.php page, I get the message that the page isn't redirecting properly.
    The php code on both pages occurs before the DOCTYPE or any other html.
    Any ideas?

    Gallery sends to portal and the I Agree in portal appears to send back to gallery (shows in url display) but nothing is displayed.
    Is this the code on your gallery page?
    <body>
    <h1>XXXXX</h1>
    </body>
    </html>
    If you have in fact gone back to the gallery page, you should certainly see that.
    I should have mentioned that the test php files (...gallery_murray and ...portal_murray) appear to work fine.  What I did next was to copy the php from those two files to copies of the production versions (with appropriate changes to the header file names).  Those new test php files are ...gallery_header and ...portal_header.
    http://www.myspatialhome.org/ATL_counter_gallery_header.php
    Gallery gets to portal and I Agree gets to gallery but nothing is displayed.  Looking at the source there's nothing generated.  I'm assuming this is not a problem with the header php you helped with but something happening later in the gallery php file.
    This is the gallery code down to the doctype.  Minus the php at the beginning that does the header (like in the gallery_murray file), the code works.
    <?php
    if (!isset($_SESSION)) session_start();
    ?>
    <?php
    if (!isset($_SESSION["agree"]))
    { header( "Location: http://www.myspatialhome.org/ATL_counter_portal_header.php" );
    exit();
    ?>
    <?php
    require_once('Connections/atlas.php');  // NOTE: Also may require change in href for detail
        if (!function_exists("GetSQLValueString"))
            function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
                if (PHP_VERSION < 6)
                    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
                $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
                switch ($theType)
                    case "text":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;   
                    case "long":
                    case "int":
                    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
                    break;
                    case "double":
                    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
                    break;
                    case "date":
                    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
                    break;
                    case "defined":
                    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
                    break;
                return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];  // Get the current URL for hrefs
    // New group code
    mysql_select_db($database_atlas, $atlas);
    $groups = mysql_query("SELECT * FROM tblMapGroups ORDER BY DispSeq ASC");  // Get the group records
    $row_groups = mysql_fetch_assoc($groups);
        if (!$_GET)
            $selectGroup = $row_groups['MapGroupID'];  // First time through; set initial default group
        else $selectGroup = $_GET['groupselect'];  // Otherwise use GET to retrieve the submit button chosen
    mysql_data_seek($groups, 0);  // Reset to first record for Form loop
    // End new group code
    // Select map records
    $query_maps1 = "SELECT * FROM tblMaps";
    $query_maps2 = "ORDER BY tblMaps.MapGroup, tblMaps.Area, tblMaps.Community, tblMaps.DispSeq ";
    $query_maps = sprintf("%s WHERE MapGroup ='%s' %s", $query_maps1, $selectGroup, $query_maps2);
    $maps = mysql_query($query_maps, $atlas) or die(mysql_error());
    $row_maps = mysql_fetch_assoc($maps);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  • User Exit EXIT_SAPLMGMU_001 doesn't work with all MM views

    Hello,
    I'm using user exit EXIT_SAPLMGMU_001 in MM02/MM01 tcode to check if valuation class is correctly filled and i've a problem when i select all views for material. In MM02, when i select Accounting View, i can make the validation because in user exit, structure wmbew is filled, but if i select all views, only structure wmara is filled, all others structure are empty.
    does anyone can help me in this?
    Thanks

    HI
    CHECK WITH THESE USER EXITS
    MGA00001 Material Master (Industry): Checks and Enhancements
    MGA00002 Material Master (Industry): Number Assignment
    MGA00003 Material Master (Industry and Retail): Number Display
    Hope this helps !!!
    Cheers
    Alfred

  • BADI-User exit required for updating Purchase order header field -IHREZ

    Hello All,
    We have requirement in our business to update the purchase order header field "our reference" EKKO-IHREZ with some text field. We need a BADI/user exit that can be used for updating this field . We have checked the BADI ME_PROCESS_PO_CUST and unfortunately we are not able to use this BADI as it getting triggered in enjoy SAP transactions ME21N , ME22N etc. We are not creating the purchase order manually and we are using ME59N for creating Purchase order . Hence we are looking for some user exit/BADI that can be used in ME59N for updating the purchase order header field IHREZ.
    Thanks in advance for your immediate response .
    With regards,
    Joseph Anand B

    TRY using the exist u2022     EXIT_SAPLME59_001
    You can also later on add this field by BAPI_PO_CHANGE

  • User Exit: Saving data in Production Order Header Long Text

    Hi PP Gurus,
    Can any one let me know which user exit can be used to save some data in the Long Text of Production Order Header.
    We try PPCO0007, it works well on ECC, but my client's system version is 4.7, it does not work.
    In 4.7 version, is there any other User Exit or BADI can be used to comply with this requirement?
    It's quite common requirement, hope someone can help me. Thanks.
    Best regards,
    Sun Qiang

    Hi All,
    Thank for your reply.
    After saving the text using 'SAVE_TEXT' function module and commiting it you need to update the 'ltext' field in AUFK table.
    SELECT SINGLE * INTO wa_aufk FROM aufk WHERE aufnr EQ '000012345678'.
    wa_aufk-ltext = 'D'.
    MODIFY aufk FROM wa_aufk.
    It works in Enhancement PPCO0007.
    This call can be closed. Thanks.
    BR
    Qiang

  • Error Message, user exits, and editing disabled problem.

    HEllo I recently had an assignment where I have to create a user exit with an error message. I had no problems with the error message but after an error occurs, with this line:
    <b>  MESSAGE ID 'ZSD' TYPE 'W' NUMBER '002'.</b>
    the fields have become disabled and there seems to be no way to enable the fields for changing. Is there a way to fix this. Thanks people and take care!

    Oh, TYPE E,  when issuing an error message, all fields are disabled unless you tie it to a field or group of fields.  This is commonly done by using the CHAIN...ENDCHAIN statements in the PAI of the screen.  Do you have access to this?  I assume that you are issueing the message from within a MODULE, right?  You are probably calling this module in the PAI flow logic of the screen.  You will need to do something like this.
    Here P_BUKRS is the screen field and CHECK_BUKRS is the module where you are checking the value and issuing the error message.  Using the CHAIN, you can tie other fields to the check so that they are also enabled when the error message is issued.
    CHAIN.
    field p_bukrs module check_bukrs.
    ENDCHAIN.
    Regards,
    Rich Heilman

  • BADI user exit at me51n or me21n

    Hi,
    i need badis or user exit while creating Purchase order requisition(me51n) or purchase order purchase order(me21n).
    What i am trying to do is that the cost center should be provided while the user enters other data.
    And the cost center will be composed of based on some criteria and it will be available while user entering data.
    Thanks.

    Hello
    In both cases you should use the "CUST" version of the BAdI because the other ones are "SAP-internal":
    ME_PROCESS_PO_CUST
    ME_PROCESS_REQ_CUST
    For both BAdIs you will find plenty of sample codings with the ABAP Development forums.
    Regards
      Uwe

  • User exit or BADI for PGI with blank movement type

    Hello,
       Am looking for a BADI or user exit which can throw a pop message based on certain checks. The BADI LE_SHP_GOODSMOVEMENT doesn't help because it is not called if the movement type is blank on the delivery (a particular delivery item category in our case).
       USER_EXIT_SAVE_DOCUMENT_PREPARE cannot be used as it is called in update task(?) and can interfere with rest of the processing.
       So which user exit or BADI can I use. Pop message is required after hitting the PGI button on VL02N screen. Access to LIKP, LIPS, VBPA and VBUK is required inside the exit/BADI code for the validations.
    Thanks,
    Rajesh

    Hi Rajesh,
    I have validated  multiple condition in the USEREXIT_SAVE_DOCUMENT_PREPARE   with socndition and I don't have any problem for update  task thing.
    Thi user exit  update only internal table not databse table . once this perform run after that system run for update  to another subroutine USEREXIT_SAVE_DOCUMENT. for updating record in database.
    If you need this run only only for PGI then  please add condition as I mention earlier, it will be work.
    Regards,
    Prasenjit

  • Urgent: User Exit (ZXM06U02) have some problem in coding.

    Hi All,
    This is regarding the user exit,
    The present issue is.
    When sending the PO to supplier portal, the outbound IDOC segment does not get populated properly. The text format ‘=’ is again converted to space in ECC 6.0 which was not the case with 4.5B.
    This is an upgrade issue as the function module used to format text ‘FORMAT_TEXTLINES’ is completely different in ECC 6.0. The entire code of this function module in 4.5B has been commented in ECC 6.0 and new code has been implemented which splits the text and inserts spaces while formatting as shown below.
    This issue can be resolved by implementing a customer exit which gets called after standard SAP populates the IDOC. It requires implementing custom code to remove the unwanted spaces inserted by standard SAP for text id F07. Hence after SAP completes its processing to populate the IDOC, the text would be processed further to remove unwanted spaces before actually sending the IDOC out from SAP R/3.
    Thus this upgrade issue resolution requires R/3 development,
    <b>I write the code in exit include ZXM06U02</b>:
    Coding part:
    DESCRIBE TABLE int_edidd LINES tabix.
    READ TABLE int_edidd INDEX tabix.
    IF int_edidd-segnam = 'E1EDPT2'.
       CLEAR E1EDPT1.
       CLEAR E1EDPT2.
    Check whether its higher level segment E1EDPT1 has F07 in field E1EDPT1-TDID
    by looking back internal table int_edidd
       w_tabix = tabix - c_1.
       w_i = tabix - c_1.
       DO w_tabix times.
         READ TABLE int_edidd INDEX w_i.
         IF int_edidd-segnam = 'E1EDPT1'.
           MOVE int_edidd-sdata TO E1EDPT1.
           EXIT.
         ENDIF.
         w_i = w_i - 1.
       ENDDO.
       IF E1EDPT1-TDID = 'F07'.
         READ TABLE int_edidd INDEX tabix.
         MOVE: int_edidd-sdata TO e1edpt2.
      Remove unwanted Space(s) in field E1EDPT2-TDLINE
         CONDENSE E1EDPT2-TDLINE.
         MOVE E1EDPT2 TO int_edidd-sdata.
         MODIFY int_edidd INDEX tabix.
       ENDIF.
    ENDIF.
    <b></b>
    But the code statement 'CONDENSE E1EDPT2-TDLINE.' does not work for removing space.
    i did not understand why the code is not working properly.
    Could any one please explain how write the code for condense the text with out spaces ASAP.
    Thanks,
    sridhar

    "Condense" will leave one space between words by default... so you may want to add "no-gaps" on the end i.e. "CONDENSE E1EDPT2-TDLINE no-gaps." to eliminate all spaces between the words.
    Jonathan

  • User Exit for ME51N Transaction

    Hi folks,
         I have a requirement regarding ME51N Tocde. If the user enters the internal order number in ME51N, while creating Purchase Requisition, the corresponding cost center should be displayed in the cost center field by default. I have found one user exit which will be useful for this. I wrote the code and feteched the Cost Center value in the exit EXIT_SAPLMEREQ_005. But i dont field any paramet for sending the Cost center value here. Could any body suggest me how to proceed now...How can i display the cost center value, using this Exit....
                         Thanks in advance,
                          Shyam.

    Hi Shyam,
    You can find the user exit using the following method:
    1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.
    2. In 'Display' mode, go to 'Methods' tab.
    3. Double click the method 'Get Instance' to display it source code.
    4. Set a breakpoint on 'CALL METHOD cl_exithandler=>get_class_name_by_interface'.
    5. Then run your transaction ML81N.
    6. The screen will stop at this method.
    7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.
    Hope this solves your query.
    Regards,
    Saumya

  • User exit for ME51n

    HI All,
    In ME51n/ME52n when the user clicks F4 help for Purchasing Group and selects one Pgroup then Material group is populated  automatically.I searched all the user exits and BADIs for ME but am not able to find how this is getting popualted.Can anyone plz let me know how this is happening?
    Thanks,
    Rakesh.

    Hi rakesh,
    Review OSS note 408017 for code samples
    use this program,
    REPORT YSMOD2
    SELECTION TEXTS : INPUT1 ----> Enter search term for Trxn.
                      INPUT2 ----> Enter type of exit
    REPORT YSMOD2 .
    TABLES: MODSAP, MODACT, TSTC.
    PARAMETERS: INPUT1 LIKE TSTC-TCODE DEFAULT ' ',
                INPUT2 LIKE MODSAP-TYP DEFAULT ' '.
    DATA: SEARCH1(6),
          SEARCH2(3),
          SEARCH3 LIKE MODSAP-MEMBER.
    DATA : FIRST_ROW VALUE 'Y'.
    CONCATENATE: '%' INPUT1 '%' INTO SEARCH1,
                 '%' INPUT2     INTO SEARCH2.
    SELECT * FROM TSTC WHERE TCODE LIKE SEARCH1.
      FIRST_ROW = 'Y'.
      CHECK TSTC-PGMNA NE SPACE.
      CONCATENATE '%' TSTC-PGMNA '%' INTO SEARCH3.
      SELECT * FROM MODSAP WHERE TYP LIKE SEARCH2
                           AND MEMBER LIKE SEARCH3.
        SELECT SINGLE * FROM MODACT WHERE MEMBER = MODSAP-NAME.
        IF FIRST_ROW EQ 'Y'.
          WRITE: /0 TSTC-TCODE, 6 TSTC-PGMNA, 16 MODSAP-NAME, 32 MODSAP-TYP,
                                           45 MODSAP-MEMBER, 70 MODACT-NAME.
          FIRST_ROW = 'N'.
        ELSE.
    WRITE: /16 MODSAP-NAME, 32 MODSAP-TYP, 45 MODSAP-MEMBER, 70 MODACT-NAME.
        ENDIF.
        CLEAR : MODSAP, MODACT.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        WRITE : /0 TSTC-TCODE, 6 TSTC-PGMNA, 30 'No exits found'.
      ENDIF.
      CLEAR TSTC.
    ENDSELECT.
    END-OF-SELECTION.
      CLEAR: SEARCH1, SEARCH2, SEARCH3.
    thanks,
    nagendra

  • User Exit for Production Order confirmation with CO15

    Hi All,
    what User Exit I should use when validating batch when we do Production Order confirmation with CO15.
    Not when we create or release a Production Order.
    Will reward,
    mindaugas
    Edited by: Mindaugas Kazlauskas on Jan 30, 2008 5:03 PM

    Hi
    The Follwing Userexits available:
        Transaction Code - CO15                     Enter Production order Confirmation
    Enhancement/ Business Add-in            Description
    Enhancement
    CONFPP01                             
      PP order conf.: Determine customer specific default values
    CONFPP02                               
      PP order conf.: Customer specific input checks 1
    CONFPP03                              
       PP order conf.: Cust. specific check after op. selection
    CONFPP04                             
        PP order conf.: Customer specific input checks 2
    CONFPP05                               
       PP order conf.: Customer specific enhancements when saving
    CONFPP06                               
       PP Order Confirmations: Actual Data Transfer
    CONFPP07                               
       Single Screen Entry: Inclusion of User-Defined Subscreens
    CONFPS01                              
       PS confirmation: Determine customer specific default values
    CONFPS02                               
      PS confirmation: Customer specific input checks 1
    CONFPS03                             
        PS confirmation: Customer specific check after op. selection
    CONFPS04                              
       PS confirmation: Customer specific input checks 2
    CONFPS05                              
       PS confirmation: Customer specific enhancements when saving
    CONF0001                               
      Enhancements in order confirmation
    CONFPI01                              
       Process order conf.: Calculate cust.specific default values
    CONFPI02                               
       Process order confirmation: Customer spec. input checks 1
    CONFPI03                              
       Process order conf.: Cust. spec. check after op. selection
    CONFPI04                               
       Process order conf.: Customer specific input checks 2
    CONFPI05                              
       Process order conf.: Cust. spec. enhancements when saving
    CONFPI06                              
      Process order confirmation: Actual data transfer
    CONFPM01                             
        PM/SM order conf.: Determine cust. specific default values
    CONFPM02                             
        PM/SM order confirmation: Customer specific input checks 1
    CONFPM03                               
    PM/SM order conf.: Cust. spec. check after op. selection
    CONFPM04                              
       PM/SM order conf.: Customer specific input check 2
    CONFPM05                              
       PM/SM order conf.: Cust. specific enhancements when saving
    If it is helpful rewards points.
    Regards
    Pratp.M

  • User exit for billing to change vbrk header data  on SAVE

    Hi
          I need to change vbrk header data on save in vf01
          transaction, can some one send me the user exit,
          also code if possible.
          I have tried out RV60AFZZ it is entering the exit
          but if i modify vbrk fields it does not get
          reflected.
    Thanks & Regards
    Abhimanyu.L

    Have a look in include RV60AFZC
    => maybe you can use form USEREXIT_FILL_VBRK_VBRP.

Maybe you are looking for