Exit to update table MCHB

Hi All
Do we have any exits where we can change the entries in table MCHB the CHARG filed while posting material document.
Thanks in advance
Suresh

Hi,
I think there is no Append Strucutre provided for this table.
So, we cant modify the table this way.
Can i know the transaction for these Batch Stocks.
So that we can find the exits for that transaction and we can modify the CHARG field.
Reward if helpful.
Best Wishes,
Chandralekha
Edited by: Chandralekha on Jul 8, 2008 12:16 PM

Similar Messages

  • How to find which are the user exits that updating z table.

    There was a question posted by someone else which said:
    I have a z table. my requirement is to find the user exits that update the value to this table?
    but my requirement is to get only those user exits that update my z table.
    Before that question was rejected, it got 5 replies which made me think that this tip is worth sharing.
    So the steps are:
    Do a where-used list search from SE11
    Click on Search Range button at bottom
    Type UPDATE (you can also add Insert, Delete etc to select-option) to ABAP Key Words field
    Say No to the popup that asks whether to include Fields of the Table
    Result will show relevant programs with code snippets doing static Update on that custom table.

    EWK1 would be too performance heavy in this case. It scans the source code to get the result.
    You can however, download the list of programs given in where-used list, and give that as limiting condition in EWK1 or some other code scanning utility.
    Using my method, where-used list of table is taken from database tables, and then code scanning is done only on the that list, not on entire Z* programs.
    Try it yourself to notice the speed difference.

  • User - exit for STKO table (PCSD0003). How to update customer field.

    Hello,
    I made a user - exit for STKO table.
    It works like a formula field - calculate total weights of the specification components.
    But there is a problem!
    When I add new components  into my specification  or change them, my customer field is now calculated.
    I always need to click a Customer tag and explode a user subscreen. Is there any way to sort the problem out?
    I want to recalculate my customer field every time I change components?

    Hi,
    There is a specific user-exit for delivery-creation/delivery processing/change delivery status.
    the program name is MV50AFZ1. Inside this exit, there is a particular sub-routine called as
    FORM USEREXIT_MOVE_FIELD_TO_LIPS.
    endform.
    May be probably you can try this. This also needs an access key for changing the SAP standard program.
    Another way is you can use the BADI : LE_SHP_DELIVERY_PROC
    This BADI influences processing of delivery data, during creation and changing of deliveries at specific points described in the interface. The BAdI methods enable you to read, write, determine, delete, and save your own delivery-related data, and to change the standard delivery data.
    Lakshminarayanan.
    P.S. Mark all helpful answers for points

  • Creating a better update table statement

    Hello,
    I have the following update table statement that I would like to make more effecient. This thing is taking forever. A little background. The source table/views are not indexed and the larger of the two only has 150k records. Any ideas on making more effecient would be appreciate.
    Thanks.
    Ryan
    Script:
    DECLARE
    V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
    V_EID_DOE     DATE;
    V_EID_POE     SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
    V_EID_APPR_DATE DATE;
    V_CASE_CIV_ID     SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
    V_CASE_DOE     DATE;          
    V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
    V_CASE_APPR_DATE           DATE;
    V_CASE_DEPART_DATE           DATE;
    V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
    V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
    CURSOR VALID_CIV_ID_FROM_EID IS
         SELECT EID.SUBJECT_KEY,
              TO_DATE(EID.PROCESS_ENTRY_DATE),
              EID.POINT_OF_ENTRY,
              TO_DATE(EID.APPREHENSION_DATE),
              DACS.CASE_EID_CIV_ID,
              TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
              DACS.CASE_CODE_ENTRY_PLACE,
              TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
              TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
              DACS.SBI_UPDATE_STEP,
              DACS.SBI_CIV_ID
         FROM SBI_EID_W_VALID_ANUM_V EID,
    SBI_DACS_CASE_RECORDS DACS
    WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
         BEGIN          
              OPEN VALID_CIV_ID_FROM_EID;
    SAVEPOINT A;
              LOOP
                   FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE, V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;     
    DBMS_OUTPUT.PUT_LINE('BEFORE');
                   EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
    DBMS_OUTPUT.PUT_LINE('AFTER');
              UPDATE SBI_DACS_CASE_RECORDS
    SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
    WHERE V_CASE_CIV_ID IS NOT NULL
    AND V_CASE_CIV_ID <> 0;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
    WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE
                   AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
                   UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
         UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE <> V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
    WHERE V_SBI_UPDATE_STEP = 0
                   AND V_EID_POE = V_CASE_POE
                   AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
    UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
    WHERE V_SBI_UPDATE_STEP = 0
         AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
              UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
    WHERE V_SBI_UPDATE_STEP = 0
    AND V_EID_DOE = V_CASE_DOE
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;          
                   UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
    WHERE V_SBI_UPDATE_STEP = 0
    AND V_EID_DOE = V_CASE_DOE
                   AND V_EID_POE = V_CASE_POE;
              UPDATE SBI_DACS_CASE_RECORDS
              SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
                   SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
    WHERE V_SBI_UPDATE_STEP = 0
    AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
                   AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;     
              END LOOP;
              CLOSE VALID_CIV_ID_FROM_EID;
         COMMIT;
         END;     
    -----Thats it. Thanks for your help.
    Ryan

    Please use [ code] or [ pre] tags to format code before posing:
    DECLARE
         V_EID_CIV_ID SBI_EID_W_VALID_ANUM_V.SUBJECT_KEY%TYPE;
         V_EID_DOE DATE;
         V_EID_POE SBI_EID_W_VALID_ANUM_V.POINT_OF_ENTRY%TYPE;
         V_EID_APPR_DATE DATE;
         V_CASE_CIV_ID SBI_DACS_CASE_RECORDS.CASE_EID_CIV_ID%TYPE;
         V_CASE_DOE DATE;
         V_CASE_POE SBI_DACS_CASE_RECORDS.CASE_CODE_ENTRY_PLACE%TYPE;
         V_CASE_APPR_DATE DATE;
         V_CASE_DEPART_DATE DATE;
         V_SBI_UPDATE_STEP SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP%TYPE;
         V_SBI_CIV_ID SBI_DACS_CASE_RECORDS.SBI_CIV_ID%TYPE;
         CURSOR VALID_CIV_ID_FROM_EID IS
              SELECT EID.SUBJECT_KEY,
               TO_DATE(EID.PROCESS_ENTRY_DATE),
               EID.POINT_OF_ENTRY,
               TO_DATE(EID.APPREHENSION_DATE),
               DACS.CASE_EID_CIV_ID,
               TO_DATE(DACS.CASE_DATE_OF_ENTRY,'YYYYMMDD'),
               DACS.CASE_CODE_ENTRY_PLACE,
               TO_DATE(DACS.CASE_DATE_APPR,'YYYYMMDD'),
               TO_DATE(DACS.CASE_DATE_DEPARTED,'YYYYMMDD'),
               DACS.SBI_UPDATE_STEP,
               DACS.SBI_CIV_ID
              FROM SBI_EID_W_VALID_ANUM_V EID,
               SBI_DACS_CASE_RECORDS DACS
              WHERE DACS.CASE_NBR_A = EID.ALIEN_FILE_NUMBER;
    BEGIN
         OPEN VALID_CIV_ID_FROM_EID;
         SAVEPOINT A;
    LOOP
         FETCH VALID_CIV_ID_FROM_EID INTO V_EID_CIV_ID, V_EID_DOE,
              V_EID_POE,V_EID_APPR_DATE,V_CASE_CIV_ID, V_CASE_DOE,
                   V_CASE_POE,V_CASE_APPR_DATE,V_CASE_DEPART_DATE,V_SBI_UPDATE_STEP,V_SBI_CIV_ID;
         DBMS_OUTPUT.PUT_LINE('BEFORE');
         EXIT WHEN VALID_CIV_ID_FROM_EID%FOUND;
         DBMS_OUTPUT.PUT_LINE('AFTER');
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_CASE_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 1
         WHERE V_CASE_CIV_ID IS NOT NULL
          AND V_CASE_CIV_ID <> 0;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 2
         WHERE V_SBI_CIV_ID IS NULL AND V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE
             AND V_EID_APPR_DATE = V_CASE_DEPART_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 3
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 4
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE
            AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
             AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4 ;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 5
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE <> V_CASE_POE
            AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 6
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_POE = V_CASE_POE
           AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 7
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_APPR_DATE = V_CASE_APPR_DATE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 8
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
            AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 9
         WHERE V_SBI_UPDATE_STEP = 0
          AND V_EID_DOE = V_CASE_DOE
           AND V_EID_POE = V_CASE_POE;
         UPDATE SBI_DACS_CASE_RECORDS
          SET SBI_DACS_CASE_RECORDS.SBI_CIV_ID = V_EID_CIV_ID,
           SBI_DACS_CASE_RECORDS.SBI_UPDATE_STEP = 10
         WHERE V_SBI_UPDATE_STEP = 0
          AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) > -4
           AND (V_EID_APPR_DATE - V_CASE_APPR_DATE) < 4;
    END LOOP;
    CLOSE VALID_CIV_ID_FROM_EID;
    COMMIT;
    END;Peter D.

  • User Exit to update user status at VA01/VA02

    Hi Expert
    Please help identify any User Exit to update User Status stored in tables (JSTO/JEST), at time of sales order (Business Object 2032) creation / change.
    Requirement is to set check mark on a specific user status in case of a material master is missing HTS code.
    Regards-Aamir

    Hi,
    If your requirement is to set the check the HTS field in the material master, you can make the field as Mandatory without which the  Material cant be saved
    You can make this field mandatory in OMS9 transaction code with field status as 89 and the field is MARC-STAWN
    Please revert if you need more details
    regards,
    santosh

  • User exit to update extended segment in idoc for va01

    Hi Experts,
    I am working on Outbound IDOC interface for VA02 and VA01
    I am using ORDERS05 IDOC type
    i want to create one custom segment
    and i want to fill that custom segment
    but i am not able to find user exit to update this custom segment
    please help.

    Akshay,
    I think you want to send order response for the orders created via Va01 or edited by Va02
    To do this steps are:-
    1) Use FM IDOC_OUTPUT_ORDRSP to send order response (ORDERS05)
    2) Find the function exits in this Fm using search string as " Call Customer-function".
    3) Use include in the exits to write code to append new segments to the IDOC. Look for the Tables parameter in the Exits which are of structure type EDIDD. Insert new Segment details in this table and your IDOC will be generated with required values.
    Hope this helps!!
    Harry

  • User exit to update Vendor Confirmation in ME22N

    Hi,
    I am adding a subscreen at the header level using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST. This new sub screen at the header level will have fields like confirmation category, delivery date..etc., and a push buttom called 'CONFIRM'. When the user selects the line items to be confirmed and clicks the 'CONFIRM' button the data from the customer subscreen should be copied to the item details(in Confirmations tab).
    The problem is with the confirmation tab. I need an user exit to update this. When the PO is saved confirmation should be created and EKES table should be updated.
    Any useful information will surely be rewarded
    Thanks in advance
    Antony.

    Hi
    Following enhancements are available....
    Transaction Code - ME22N                    Change Purchase Order
    Exit Name           Description
    AMPL0001            User subscreen for additional data on AMPL
    LMEDR001            Enhancements to print program
    LMELA002            Adopt batch no. from shipping notification when posting a GR
    LMELA010            Inbound shipping notification: Transfer item data from IDOC
    LMEQR001            User exit for source determination
    LMEXF001            Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001            Customer-Specific Source Determination in Retail
    M06B0001            Role determination for purchase requisition release
    M06B0002            Changes to comm. structure for purchase requisition release
    M06B0003            Number range and document number
    M06B0004            Number range and document number
    M06B0005            Changes to comm. structure for overall release of requisn.
    M06E0004            Changes to communication structure for release purch. doc.
    M06E0005            Role determination for release of purchasing documents
    ME590001            Grouping of requsitions for PO split in ME59
    MEETA001            Define schedule line type (backlog, immed. req., preview)
    MEFLD004            Determine earliest delivery date f. check w. GR (only PO)
    MELAB001            Gen. forecast delivery schedules: Transfer schedule implem.
    MEQUERY1            Enhancement to Document Overview ME21N/ME51N
    MEVME001            WE default quantity calc. and over/ underdelivery tolerance
    MM06E001            User exits for EDI inbound and outbound purchasing documents
    MM06E003            Number range and document number
    MM06E004            Control import data screens in purchase order
    MM06E005            Customer fields in purchasing document
    MM06E007            Change document for requisitions upon conversion into PO
    MM06E008            Monitoring of contr. target value in case of release orders
    MM06E009            Relevant texts for "Texts exist" indicator
    MM06E010            Field selection for vendor address
    MM06E011            Activate PReq Block
    MMAL0001            ALE source list distribution: Outbound processing
    MMAL0002            ALE source list distribution: Inbound processing
    MMAL0003            ALE purcasing info record distribution: Outbound processing
    MMAL0004            ALE purchasing info record distribution: Inbound processing
    MMDA0001            Default delivery addresses
    MMFAB001            User exit for generation of release order
    MRFLB001            Control Items for Contract Release Order
    Hope this helps to solve ur problem....
    <b>do reward if useful....</b>
    regards
    dinesh

  • User exit for updating delivery block of Sales order before Delivery

    Hi  Folks,
    Need to have an user exit for updating Delivery Block indicator for a Sales order Before creating its delivery
    I have got an exit in Program SAPMV45A
    MV50AFZ1
    FORM USEREXIT_REFRESH_DOCUMENT.
    that hits before processing the delivery block fro delivery (Correct me if i m wrong with this )
    Now i want now how to change the Delivery Block indicator of Sales order in that exit
    any FM available ?
    Thanks n regards
    Sonal...

    Hi  ,
    How did you solved this issue?
    I am having similar scenario in which while pressing the save button  delivery block should update if multiple schedule line exist.
    Tried by two different approaches in various user exit without any success.
    AFAIK we have two ways to achieve this functionality.
    1) Count the no of rows in vbep. If greater than 1 then multiple schedule line exist and we can assign the value to VBAK-LIFSK(delivery block) as per our requirement.
    This is not correct. If there are two line items both with single schedule line . This case total no lines in vbep will 2 and above condition will true which is incorrect.
    2) There is a indicator for multiple schedule line (VBAPD-EPMEH , xvbap-epmeh ) if it is check then multiple schedule line exist and we can assign the value to VBAK-LIFSK(delivery block) as per our requirement.
    If I write code in USEREXIT_SAVE_DOCUMENT_PREPARE.
    Multiple schedule line indicator is not populate so can not use 2nd approach.
    If I write code in  USEREXIT_SAVE_DOCUMENT it of no use as vbak is updated before reaching this user exit.
    If I write code in USEREXIT_MOVE_FIELD_TO_VBAK as this user exit is also called while pressing the enter key for this I have use
    the condition of fcode but it also fails in some condition.
    If fcode eq 'SICH'.
    Read table xvbap with key epmeh = 'X'.
    IF SY-SUBRC = 0.
    VBAK-LIFSK = '03'.
    Else.
    VBAK-LIFSK = ' '.
    Endif.
    Endif.
    Please help me to get the desired functionality working for all cases.
    1) One line item with multiple schedule line                                              
    2) Two line item with multiple schedule line                                             
    3) One line item having one schedule line and second one having multiple
    4)Two line item both with single schedule line.

  • Does table MCHB (batch stocks) contain both valuated and non valuated stock

    Hello
    Does table MCHB (batch stocks) contain both valuated and non valuated stock?
    Is it possible that material has both valuated and non valuated stock for the same plant and storage location?
    Thanks

    Hi ,
    Most of your queries has been answered by Jurgen.
    1)Does valuated or non valuated is linked with valuation type? yes ..if the material is valuated then only there is valuation type.It is used for split valuation .
    2)Where can I see whether material is valuated on plant or not?
    to check the valuation level IMG >Enterprise Structure>Definition>Logistics - General>Define valuation level
    and to check value and quantity updation at plant level check
    IMG >Logistics - General>Material Master>Basic Settings>Material Types-->Define Attributes of Material Types
    3)Case1
    I want material A to be valuated at the plant without split valuation
    Case
    I want material B to have 0 value at plant
    go as Jurgen has recommanded in the previous post . for material B used different material type which is not valuated at that plant .
    Regards,
    Anupam

  • VA02 user exit - cannot update append structure field in XVBAP/VBAP

    Hi Guys,
    I am currently using one of the many user exits in updating XVBAP to update the VBAP sap table in VA02.
    However I am encountering a problem when updating a customized append structure field. When I change the value of the append structure field only it doesnt update in VBAP upon save event. Only when I also change a sap standard field (ARKTX) the append structure gets updated.
    Is there a way to resolve this wherein even if I just XVBAP-<append structure field> only ... the corresponding field in VBAP gets updated?
    THanks guys and hope to hear from you soon.

    Hi,
    Which userexit subroutine are you using to move the append structure field values to the XVBAP table?  Are you having the user enter values on a screen during VA02 for the append structure fields, or are you setting those values within the code when the user saves?  For the purposes of this response, I will assume you are not having the user enter the values, and that (from what you have described) you are using subroutine userexit_move_field_to_vbap. 
    While userexit_move_field_to_vbap sounds logical at first, you should be aware that this subroutine (which is called at the end of module vbap_fuellen) may only be called when one of the chain fields (in the flow logic of the VA02 screen) is changed.  If you search for all the calls of module vbap_fuellen in screens of SAPMV45A, you will see that most of them have a list of chain fields with "on chain-request" logic.  Since your append structure fields will not be listed in the flow logic of the standard VA02 screen, changing one of the append structure fields alone would not trigger the PAI module vbap_fuellen.  Of course, changing a standard VBAP field (ARKTX was your example) could trigger the vbap_fuellen module (as long as it was one of the chain fields) which would consequently trigger the userexit_move_field_to_vbap subroutine.
    You may want to consider trying USEREXIT_SAVE_DOCUMENT_PREPARE.  Please explain further if I have misunderstood your question. 
    Anyone else out there have any ideas?  Does my analysis make any sense?
    Best Regards,
    Jamie

  • Updating Table Columns Dynamically

    Hi Everybody,
    I have created the following procedure to update table columns, which are having 'N/A' to Null.
    PROCEDURE PRC_UPDATE_NA_TO_NULL (p_owner all_tables.owner%TYPE, p_table_name all_tables.table_name%TYPE DEFAULT NULL)
    IS
    TYPE tc_ref_cursor IS REF CURSOR;
    v_tc_ref_cursor tc_ref_cursor;
    TYPE nt_column_name IS TABLE OF all_tab_cols.column_name%TYPE;
    v_nt_column_name nt_column_name;
    v_table_name all_tables.table_name%TYPE;
    v_set_str VARCHAR2(4000);
    v_where_str VARCHAR2(4000);
    v_sql_stmt VARCHAR2(4000);
    BEGIN
    IF p_table_name IS NOT NULL THEN
    OPEN v_tc_ref_cursor FOR
    SELECT a.table_name
    FROM all_tables a
    WHERE a.owner = UPPER(p_owner)
    AND a.table_name = UPPER(p_table_name)
    ORDER BY a.table_name;
    ELSE
    OPEN v_tc_ref_cursor FOR
    SELECT a.table_name
    FROM all_tables a
    WHERE a.owner = UPPER(p_owner)
    ORDER BY a.table_name;
    END IF;
    LOOP
    DBMS_OUTPUT.PUT_LINE('Processing Owner : '||UPPER(p_owner)||'....');
    FETCH v_tc_ref_cursor INTO v_table_name;
    EXIT WHEN v_tc_ref_cursor%NOTFOUND;
    SELECT b.column_name
    BULK COLLECT INTO v_nt_column_name
    FROM all_tab_cols b
    WHERE b.owner = UPPER(p_owner)
    AND b.table_name = UPPER(v_table_name)
    AND b.nullable = 'Y'
    ORDER BY b.column_id;
    IF v_nt_column_name.LAST > 0 THEN
    DBMS_OUTPUT.PUT_LINE('Updating '||v_table_name||'....');
    FOR i IN v_nt_column_name.FIRST .. v_nt_column_name.LAST
    LOOP
    v_set_str := v_set_str||v_nt_column_name(i)||' := NULL, ';
    v_where_str := v_where_str||v_nt_column_name(i)||' = '||'''N/A'''||' OR ';
    END LOOP;
    v_set_str := RTRIM(TRIM(v_set_str),',');
    v_where_str := RTRIM(TRIM(v_where_str),'OR');
    v_sql_stmt := 'UPDATE '||v_table_name||' SET '||v_set_str||' WHERE '||v_where_str;
    EXECUTE IMMEDIATE v_sql_stmt;
    -- EXECUTE IMMEDIATE 'UPDATE '||v_table_name||' SET '||v_set_str||' WHERE '||v_where_str;
    -- EXECUTE IMMEDIATE 'UPDATE :1 SET :2 WHERE :3' USING v_table_name, v_set_str, v_where_str;
    COMMIT;
    v_set_str := NULL;
    v_where_str := NULL;
    DBMS_OUTPUT.PUT_LINE('Finished Updating '||v_table_name||'....');
    END IF;
    END LOOP;
    DBMS_OUTPUT.PUT_LINE('Process Over....');
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    DBMS_OUTPUT.PUT_LINE(SQLCODE||':'||SQLERRM);
    END;
    The problem I am facing is that the Execute Immediate statement is not working. I have used the Execute Immediate statement in 3 different ways given in the above procedure, but none of them works and the error comes to the Exception section.
    Kindly let me have your solutions.
    Thanks in advance,
    MAK

    This approach can be dangerous. You are currently trying to update all columns in the tables to null if any of the columns are 'N/A'. Your query does not exclude external tables which may not be updatable. Your other query does not exclude data types that can not include 'N/A' such as number. You might want to move your commit outside the loop as you may end up committing partial updates.
    You might try to capture the SQL that you are generating;
    create table t(col2 varchar2(4000));Then in your package;
    insert into t values(v_sql_stmt);
    -- EXECUTE IMMEDIATE v_sql_stmt;

  • To update table data

    create or replace procedure SP_MIS_LEDGER_ON_DEMAND_V2
    as
    var_date1 date;
    VAR_STARTDATETIME DATE;
    VAR_ENDDATETIME DATE;
    -- VAR_EXECUTE_FOR_DATE DATE;
    -- VAR_STATEMENT VARCHAR2(4000);
    VAR_ELAPSEDTIME VARCHAR2(50);
    VAR_INTRIMSTATUSID NUMBER;
    CURSOR c1 IS
    select DISTINCT ta.accountid,day PROCESSDATE,(NVL(payment,0))PAYMENT,0 TOTALDUE,0 CURBILL, NVL(srf,0)SRF,NVL(sbpnt,0)sbpnt,NVL(srv,0)SRV,NVL(sbf,0)SBF,NVL(SBV,0)SBV,NVL(EF,0)EF,NVL(EV,0)EV,NVL(TSRV,0)TSRV,NVL(tsub,0)TSUB,NVL(teqe,0)TEQE,NVL(DT,0)DT,NVL(A.dep,0)RDEP,NVL(B.DEP,0)PDEP,NVL(pnt,0)PNT,NVL(eqp,0)EQP,NVL(dtr,0)DTR,NVL(drf,0)DRF,NVL(unadj,0)UNADJ from
    (select DISTINCT day ,accountid
    from
    syntblmaccount, tblmtime where yyyy=2010)ta,
    (SELECT accountid,
    SUM(srfee)srf,
    SUM(srvat)srv,
    SUM(subfee)sbf,
    SUM(subvat)sbv,
    SUM(eqefee)ef,
    SUM(eqevat)ev,
    SUM(ttlsrv)tsrv,
    SUM(ttlsub)tsub,
    SUM(ttleqe)teqe,
    SUM(dep)dep,
    SUM(dt)dt,trunc(FROMDATE)FROMDATE
    FROM VWDT_V6
    group by accountid, trunc(FROMDATE)
    )a,
    (SELECT accountid,
    SUM(pnt)pnt,
    SUM(subpnt)sbpnt,
    SUM(eqpnt)eqp,
    SUM(dep)dep,
    SUM(DEPTRANSFER)dtr,
    SUM(DEPREFUNDED)drf,
    SUM(unadj)unadj,trunc(paymentdate)paymentdate
    FROM vwkt_v4
    GROUP BY accountid,trunc(paymentdate)
    )b,
    (SELECT ACCOUNTID accountid,TRUNC(createdate)CREATEDATE, SUM(totalamount)PAYMENT
    from syntbltcreditdocument
    where CREDITDOCUMENTTYPEID IN ('CDT01','CDT04')
    group by accountid,TRUNC(createdate))credit
    where ta.accountid=a.accountid(+)
    and ta.accountid=b.accountid(+)
    and ta.accountid=credit.accountid(+)
    and ta.day=a.FROMDATE(+)
    and ta.day=credit.createdate(+)
    and ta.day=b.paymentdate(+)
    and ta.day =to_date('01-MAY-2010','DD-MON-YYYY');
    BEGIN
    SELECT MAX(PROCESSDATE) INTO VAR_DATE1 FROM MIS_LEDGER_DETAIL_TEST;
    SELECT SYSDATE INTO VAR_STARTDATETIME FROM DUAL;
    SELECT SEQ_PRC_STATUS.NEXTVAL INTO VAR_INTRIMSTATUSID FROM DUAL;
    FOR c1_rec IN c1
    LOOP
    EXIT WHEN c1%NOTFOUND;
    UPDATE MIS_LEDGER_DETAIL_tEST A
    SET A.PAYMENT=c1_rec.payment,
    A.TOTALDUE=c1_rec.TOTALDUE,
    A.CURBILL=c1_rec.CURBILL,
    A.SRF=c1_rec.srf,
    A.SBPNT=c1_rec.sbpnt,
    A.SRV=c1_rec.srv,
    A.SBF=c1_rec.sbf,
    A.SBV=c1_rec.sbv,
    A.EF=c1_rec.ef,
    A.EV=c1_rec.ev,
    A.TSRV=c1_rec.tsrv,
    A.TSUB=c1_rec.tsub,
    A.TEQE=c1_rec.teqe,
    A.DT=c1_rec.dt,
    A.PDEP=c1_rec.Pdep,
    A.RDEP=C1_REC.RDEP,
    A.PNT=c1_rec.pnt,
    A.EQP=c1_rec.eqp,
    A.DTR=c1_rec.dtr,
    A.DRF=c1_rec.drf,
    A.UNADJ=c1_rec.unadj
    where A.accountid=c1_rec.accountid
    and A.processdate=C1_REC.processdate
    and a.processdate =to_date('01-MAY-2010','DD-MON-YYYY');
    END LOOP ;
    commit;
    SELECT SYSDATE INTO VAR_ENDDATETIME FROM DUAL;
    SELECT CAST(VAR_ENDDATETIME AS TIMESTAMP) -
    CAST(VAR_STARTDATETIME AS TIMESTAMP) INTO VAR_ELAPSEDTIME
    FROM DUAL;
    INSERT INTO LedgerStatusSummary (StatusID, ProcedureName, STARTDATETIME, ENDDATETIME, LastExecutionDate,NextExecutionDate,LastModifiedDate,TIMETAKEN,Procedurestatus) VALUES
    (VAR_INTRIMSTATUSID,'SP_MIS_LEDGER_ON_DEMAND',VAR_STARTDATETIME,VAR_ENDDATETIME,TRUNC(VAR_DATE1),TRUNC(VAR_DATE1)+1,VAR_STARTDATETIME, VAR_ELAPSEDTIME,'MENUAL');
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END SP_MIS_LEDGER_ON_DEMAND_V2;
    i have 9830 data in MIS_LEDGER_DETAIL_tEST table ... i am updating table data but it is taking more time to update for 01-may-2010 it is not completing execution in 15 min so i abort it...
    how to write update query....?? please guide me...
    Thanks in advance
    exec SP_MIS_LEDGER_ON_DEMAND_V2

    Why do you need a cursor or a loop at all? What in your statement can not be accomplished with a simple UPDATE TABLE?
    But if you do require a loop, I don't see it, then use BULK COLLECT and FORALL statements
    http://www.morganslibrary.org/reference/array_processing.html
    And replace this:
    SELECT SYSDATE INTO VAR_STARTDATETIME FROM DUAL;
    with this:
    VAR_STARTDATETIME := SYSDATE;

  • How is the table MCHB populated?

    Dear SDNers,
    Need your input on how the table MCHB gets populated?
    for ex. when i create material master mm01 and save, material gets created and an entry is made in master table.
    Similarly, how /what tcode is processed to update the table MCHB.
    I am looking for field CLABS, as to how this is getting populated.
    Effort by me:
    I looked at the where used list for the table mchb and was able to locate a standard report RM07KO01- Stock consistency check. In this there is an include RM07KOF4  which contains perform update_mchb.
    I am not able to locate the code as to where this table is getting values populated from.
    Am i being right in my search ? if not please guide me.
    Regards,
    SuryaD.

    Hi Surya,
    As Suhas said..
    It is being updated while any Goods Movement happens...
    There are various T-Codes for it..
    MIGO
    MB1A
    MB1B etc etc
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Program or  exit/BAdi for table DVER (Material Consumption for MRP Area)

    Hi,
    I want to update table DVER (Material Consumption for MRP Area).
    Please suggest if any program or  exit/BAdi.

    Check these function modules:
    CONSUMPTION_EXI_MAT_PLA_PE_DB
    CONSUMPTION_READ_FOR_MM_DB
    CONSUMPTION_REF_MAT_PLA_PE_DB
    DVER_GENERIC_EXIS_MATNR
    DVER_GENERIC_EXIS_MATNR_DB_PER
    DVER_GENERIC_READ_MATNR_PLA_PE
    DVER_GET_BILD
    DVER_SET_DATA
    DVER_SET_SUB
    A badi/user exit is triggerred when a standard transaction is run.Let me know if you want to update the table when a std. transaction is executed and the transaction code.

  • "Error in updating Table J_1iexchdr"

    Hi ,
    When I am creating the excise invoice, It's terminated the program and gives the following error
    "Error in updating Table J_1iexchdr"
    What can be the reason?
    Regards
    Prem

    Hi prem
    Look if these threads can help
    RG23C Update Problem
    Problem in SAP Script
    billing document not creating
    return delivery
    ************Reward points if usefull**************

Maybe you are looking for