QM usage decision error

hi QM gurus,
in tcode QA11 i cannot do the usage decision, it says you have not completed all characteristic.
what shall i do to correct this. can anyone pls give me specific instructions on what to do..
thank you so much.

Hi Eva,
As the error message QC121, you will be not able to see any entry while pressing "F4" to the UD code in QA11, correct. Soooooo.......
You need to created the Codes under code group and then Selected Sets.
Then assign the same to the relevant inspection type then it will work for you.
Follow the steps.
- Run trx Qs51
- Enter '3' in catalog, 3 stands for Usage Decision.
- enter plant, the same plant where the inspection lot is created.
- Put the appropriate numeric / alphanumeric / character for the Identification of the Selected Set.
- Press Enter.
- Enter Short Text
- Set the Status as "Released" for it.
- Press Enter and make sure there is no any error.
- Noe select the line item and double click on the "Selected Set Codes" folder.
- Here Attache the appropriate Code group.Valuate the codes. And Save
Or
Just straightway pick any already created selected set.And assign it to the inspection type per below mentioned steps,.
- reach the customizing path SPRO->Quality Management->Quality Inspection->Inspection Lot Creation->Maintain Inspection Types. Execute.
- Now for the for select your relevant inspection type and assign the selected set to the "UD Selected Set"
- Save.
Now go back to QA11 and press "F4" to the UD code and try to perform UD.
Revert, if it doesn't work.
Shyamal

Similar Messages

  • QM Usage Decision Error : Deficit Batch restricted

    I am unable to reject two batches..it shows 'no inventory exsists for this material'
    Usage Decision TCode gives me the following error:
    Deficit Batch restricted
    Can you please tell me, what might be the probable reason?
    Thanks

    Well.. it's basically telling you it can't find the material in the stock category it is looking for it in.
    So, to resolve this, first find out where the batches really are.
    Get the actual batch numbers from the inspection lots and run MMBE to see where the material is and what the status of the batch is, restricted or unrestricted.
    You must then figure out where is the UD transaction looking for the material?  You can check this by looking in config and the looking at the settings for the inventory posting.  You should see 3 movement types for the reject posting line.  One for QI, one for unrestricted and one for blocked. 
    What you need to do, is a) get the batch inventory into the proper inventory bucket.  This might be as simple as unrestricting the batch. b) if you can't get the material where it needs to be, you might be able to temporarily change the movement type used for the reject postings.  Then change it back to what it should be once you rejected the material.
    Hope this helps.
    Craig

  • Quality Management - Usage Decision error

    Hi all,
    My scenerio is - There is a material ABC which is procured from the supplier. The Quality of the material is 'below standards'. However, material ABC, in Tcode QA11 Usage decision was done as ACC1 (accepted). Since the material ABC is not meeting quality standards, Usage decision is changed to RET1 (Bad Raw Material - Return) using Tcode QA12.
    Now the problem is that when I enter QA11, the system does not allow me to enter as a message appears 'Detailed Info- Usage decision made is disallowed' is showing.
    Please provide me a solution as the material is lying in the unrestricted stock and it has to be returned to the supplier. Also please consider costing implications.
    Thanks in advance

    Cancel the inspection lot in QM using the function to change the usage decision.
    Logistics - Quality management - Quality inspection - Inspection lot - Usage decision - Change with History - Usage decisions - Functions - Cancel lot 
    Reward if cleared and close the thread.

  • Error while doing the Usage Decision in transaction QA32

    Hello Friends,
    While doing the goods receipt for customer returns from customer, system generated a inspection lot with inspection type 06.
    So in QA32 transaction, system is showing that inspection lot, but in same screen, against the column InspPlan: Material, system is not showing any entry.
    Later on after analysis, i found that no inspection plan was assinged to the material, Plant for which that inspection lot was created. When i checked that inpection lot in transaction QA03, in Insp. Specifications tab, agaisnt the Assigned Specification section, system was not showing any entry in fields Group, Group Counter, Plant, Usage.
    And against that inspection lot,status CRTD, PREQ, CHCR are active.
    Because of  which, when user is trying to do the UD against this lot system throwing the error message as Status check error.
    When i checked again i found that status CRTD is throwing the error message.
    Hence friend, i want to do the Usage decision  for that inspection lot than how to do?
    Now user has assigned the material, plant to the inspection plan in QP02.
    Should i go to QA02 transaction, and in Insp. Specification tab, for fields group, group counter, usage, Plant, maintain the values?
    Will this allow me to do the usage decision against the inspection lot which got generated when no inspection plan was assingned to that material, plant?
    Waiting for your valuable inputs.

    For Result Recording and Ud the inspection lot status must be REL as u told ur status is CRTD it Mean Some master
    is missing in inspection lot,generally inspection plan for that u run QA02 enter inspection lot no go to specification tab
    there a button assigned specification there click on that as u click on button u will find that plan for above material copied to lot and it will show u plan detail line group and group counter no.
    then go to next screen Sample if sample management is active and click on sample then system will calculate sample size then save ur lot. it would get Status As REL now ui can enter result or take UD
    for QM setting Refer
    http://sap-questions.blogspot.com/

  • Error message during the usage decision

    Dear Gurus,
    While performing the usage decision in txn  code QA11, i entered the relavant quantities in unrestricted-use.
    Then when i tried to assign the UD code i am getting the following error message.
    "You have no authorization for this catalog entry Message no. QS291"
    But QA11 authorization is already there, apart from that which authorization is required.
    Please give your inputs
    Thanks and Regards
    Hari

    Hi,
    As the error message says Authorisation for Calatalg 3 and the related code group is missing.
    When u get this message just run /nsu53 on your screen so you know which objects are missing. Maintain those vlaues or ask Basis to mainatin these values.
    Regards,
    Nitin

  • AFS-QM Error in stock posting performed by taking Usage decision

    Hi all,
    during stock posting with 105 mov type performed by taking Usage Decision (QA11), I faced with a strange system behavior, described beneath.
    Previuos steps:
    Purchase order creation
    Partial Good receipt performed by MIGO, mov type 103 (Blocked stock from PO)
    Automatic Creation of Inspection Lot
    Error encountered:
    If I take usage decision (QA11) for the inspection lot created, putting the stock checked in Unrestricted Use (correspondant mov type = 105), in the following good receipt (related to the same purchase order), the incoming stock available is less of the real quantity, previously accepted..
    After some checks we understood that with 105 mov type the system doubles the real quantity previoulsy accepted, acting in the following manner:
    Initial PO: 100 PZ
    1° Good receipt: 30 PZ
    (automatic creation of inspection lot)
    If we take a usage decision, posting stock to unrestricted use (mov type 105), in the 2° Good receipt, the quantity available from the same PO is not 70 PZ (100 - 30), but only 40 PZ ! !  (100 - (30 * 2)) = 40
    Please note that it does not occur if we post stock (always 105 mov type) with a MIGO transaction, so we are forced to think that the problem is strictly related to AFS-QM inventory posting, and not to 105 mov type or inbounding process.
    Thanks for your collaboration,
    Regards,
    Ale

    I'm not familiar with the specific apparel and footwear solution but with regards to QM, if you are using the standard SAP delivered stock postings, it should use 105 to accept the material to unrestricted for the GR blocked. 
    I would first use MB51 for the material and batch and review all the material movement documents.  Look at the trail of movements and try to see where the changes happen.
    In your example, what did the unrestricted inventory and GR blocked inventory show as stock levels?
    I'd also check OSS for issues related to AFS/QM.  This is not new functionality in SAP so I would be surprised if this was an actual bug or problem in the system that hasn't been seen before.
    FF

  • Usage Decision BAPI_INSPLOT_SETUSAGEDECISION giving error.

    Hi Experts,
    I want to perform Usage Decision by using this BAPI_INSPLOT_SETUSAGEDECISION after performing Result recording of the Inspection lot. It is giving me error selected set code does not exist or data entered is incomplete.
    Thanks
    Saurabh

    Issue has been resolved
    Thanks

  • Transfer Posting error upon u201CQM Usage Decision with WM HUu201D

    Hello,
    I am switching from the SAP system u201CUsing MIGO with WM (no SU) and Inspection Lot processingu201D to a process using u201CInbound Delivery with WM-HU and Inspection Lot processingu201D.
    For e.g. I have a material with 10 pcs packed in one HU, PGRd and putaway. Inspection Lot is created for the HU containing 10 pcs. I am ideally hoping to do Posting change of 6 pcs to Unrestricted (with underlying mvmt typ 321) and Transfer Posting of 4 pcs to Qty. for Sample usage (with underlying mvmt typ 331).
    In QA11, when I select posting key u201CVMENGE01 To Unrestricted useu201D, I get the error message u201CHandling Unit is locked. No assignment possible. Message No. HUFUNCTIONS007u201D. (I donu2019t have any document open to cause locking).
    When I select posting key u201CVMENGE03 Qty. for Sample usageu201D, I get the error message u201CHandling Unit is locked. No assignment possible. Message No. QHU17u201D.
    Here is the status in u201CInspection Lot Stocku201D tab of QA11.
    u2022     Inspection Lot Qty.: 10 pcs
    u2022     Sample size: 4 pcs
    u2022     Status for u201CHU Transfer Postingu201D is Green
    I am currently doing GR first and then putaway. Though I am open to doing putaway and then do PGR, if that can help, in any way.
    Can anyone please help me with this issue? Please let me know if I need to provide more info. Thanks for your help in advance.

    hi
    I did GR for 10 PCs with serial numbers. During QM, when usage decision, in the tab "Inspection lot stock", I input 8 PCs to the unres, 2 to blocked stock.
    Upon posting, system pops up a Serial Number dialog showing "TF quality to unrest" with No. serial no is 10/8, and a list of 10 serial numbers.
    I select 8 serial to post to unres. But still, the system keeps having error "Exactly 8 serial numbers must be selected (instead of 10)"...
    This error is dur to
    You have selected 28 to U/r & rest you want to put to Block.
    so what system does is by default it will select first U/R qty which is 8.
    While stock posting it is showing 10 Sr numbers.out of which you have to select 8 for U/R.
    so only select those 2 numbers which you want to put to block...Click on delet(bucket)
    now only 8 will remain which you wnat to put to U/R.
    select all 8 and click on ok
    save.
    Rest of the 2 Sr number will automatically move to unrestricted.
    This is how sap in UD works for Sr nos.
    This will solve your problem.
    Regards
    Sujit

  • Calibration: Error while taking Usage Decision (Urgent)

    Hi Gurus,
    I created one test equipment and installed it on some m/c and while doing calibration during usage decision if i reject the equipment it is giving me the error : equipment installed on superior equipment.
    if i accept the usage decision system gives no error.
    and it is customer requirement that their instruments should be installed on some m/c not on functional locations.
    Please suggest the solution
    Regards
    Pankaj

    Hi,
    As per the SAP general process first you need to dismantle sub equipment from superior equipment for taking UD, since it is assigned with superior equipment System wil not allow for taking UD.
    Regards
    Sendil

  • Error during Usage Decision - Not All Physical Samples are valuated

    Hi,
    I am using Sampling Procedure as follows:
    Sampling Type :   Fixed Sample
    Valuation Mode :  Attributive Inspection nonconf. Units
    Inspection Points : Sample Management
    I have assigned the  Inspection Point as  200  and Sample Drawing  Procdure in Inspection Plan Header.
    I have recorded and closed results for 3 samples. During Usage decision the following message shows:
    Not all physical samples are valuated!  Do you want to force inspection completion? 
    This means that Valuation of Inspection points have not updated. I request your help to solve this problem.
    Thanks & Regards
    V.Devaraj

    Hi
    Check the inspection plan, check for all the operation, by double clicking on operation you enter the opertioa details screnn, pls scrol down, you should have a field called VALUATION, select the option "automatic valuation option" .
    try this
    navin

  • Error during usage decision for Test Equipment

    Hi,
    I have completed results recording  for Test Equipment using QE51N (results closed and confirmation completed). When I tried to make usage decision (QA11) for the lot the pop-up message shows as "Not all equipment is valuated! Do you want to force inspection completion. I also noticed that in equipment tab of qa11 code valuation column shows as Not  Valuated.
    I request you to help me to solve this problem.
    Thanks & Regards
    V.Devaraj

    HI,
    You may try changing the valuation mode in IA06. In the inspection characteristic overivew, click on details -> operation, scroll down, you will find Quality management inspection points  -> maintain automatic valuation based on inspection points.
    The changes if made will be effective only for the next inspeciton lots.
    Regards,
    M.M

  • Issue while doing material posting through Usage Decision

    Hi all,
    I have an issue while doing material posting through Usage Decision. Please find below the details.
    Inspection Lot  10000604689
    Material        1730PCPBS.0031
    Batch           QP611097      GQ02
    Out of total qty of 2100 we need to post the following
    To unrestricted use                     2,098
    To sample usage                         2
    Following error appears,
    Deficit of SL Stck.in qual.insp 1,638 NO : 1730PCPBS.0031 62GQ GQ02 QP611097
    Message no. M7021
    Diagnosis
    Shortfall below the specified stock level or quantity amounting to 1,638 NO.
    System Response
    If the message is an error message (E), the above is not allowed.
    If the message is a warning message (W), the system will allow your input, but the warning is intended to prevent you entering a wrong quantity.
    Procedure
    In the case of a warning message, check the quantity entered.
    In the case of an error message, change the quantity or terminate processing.
    I have checked that quantity 2100 of material 1730PCPBS.0031 is in QI stock. Kindly advice what is the issue and why we are getting the error?
    Regards,
    Brijesh

    Hi Brijesh,
    What is the status of inspection lot?
    One of the possibilities I think could be inconsistencies between MM and QM.
    Have a look on SAP note 48815- Checking possible inconsistencies between MM and QM.
    Regards,
    Anand Rao

  • WM - QM usage decision scrap - automatic TO creation

    How can I realize an automatic transfer order processing for the following scenario:
    MIGO Goods receipt posting with reference to PO into quality
    QA11 Usage decision Scrap
    Transfer requirement (WM mtype 551 / IM mtype 553) is being created but although the correct storage type (902 GR area external rcpts) is being determined the system cannot process the transfer order in background since the respective storage bin (dynamic  IM-material document) cannot be determined => error message u201CSystem cannot find source storage binu201D.
    I am able to process the transfer order in foreground successfully. Via u201Cstock figuresu201D (F7) the system is able to determine the respective storage bin (including stock search with inspection lot) correctly so I wonder why this is not being done in the background processing.

    Hi,
    Bin can be determined automatically only based on the strategy (for your case, it's removal strategy) assigned to the storage type in question. For 902, it's a interim storage type without strategy assigned.
    I am afraid you can only manually process the TR in foreground for your scenario. Otherwise, you may consider putting away QI stock from 902 into a normal storage type. You should then be able to process the TR of scrap in background.
    Hope it helps.

  • PP - QM: Reversal of the usage decision

    Hi Gurus,
    We have completed Result Recording using QE51N transaction and Usage decision using QA11. It has posted a stock from QI to Unrestricted use. Now I want to take it back from Unrestricted use to QI. This needs reversal of usage decision (What I think).
    Can you suggest me the proper way of performing the said transaction?
    I will really appreciate your concern.
    Thanks
    Shiv

    R/3 note no.   175842                        14.12.2001           Page 1
         Number              0175842
         Version             0021 from 29.11.2001
         Status              Released for customer
         Set by              SAP AG on 03.12.2001
         Language            EN
         Short text          Inspection lot: Reversal of goods movements from UD
         Administrator       SAP AG
         Component           QM-IM-UD Inspection Lot Completion
         Long text
         Symptom
         Goods movements, which were created from the transactions of the usage
         decision, can no longer be reversed.
         Additional key words
         QA11, QA12, QA14, MBST, MF41
         Inspection lot, usage decision, goods movements, reversal, material
         document
         Cause and preconditions
         Presently, the function is not provided in the standard system.
         Solution
         The function is not provided in the standard system up to and including
         Release 4.6C.
         When you do this bear the following in mind:
         1. Using the attached program corrections, stock transfer postings can
            be reset for the usage decision.If it is possible to post this
            document in the stock management, the inspection lot is also
            corrected and the Quality Management Information System is if
            necessary updated.After the reset has been successfully carried out,
            the inspection lot, related to the stocks, has the status before the
            first stock credit entry.The usage decision is not reset.If, after
            the usage decision, further transfer postings are carried out in the
            stock management which lead to the usage decision transfer postings
            not being able to be reset due to missing availability, these
            postings must be reversed first.
         2. The goods movement is carried out in each case with the reversal
            movement type (document neutral reversal).The original documents are
            not reversed related to the document.This may lead to deviations in
            the accounting caused by valuation.
         3. Resetting postings for materials requiring serial numbers is not
            supported.
         4. With this correction program, you cannot reverse goods movements for
            inpection lots for handling units (HU).
         5. Batch status changes which have possibly been carried out are not
            cancelled.
         6. Batches which have been created in the usage decision during a
            transfer posting are not deleted.The classification of these batches
            is not changed either.
                                                                           Page 2
         7. Within the adjustment posting, in Release 4.x, the reference records
            are also adjusted between the material document and inspection
            lot.This can possibly lead to an incorrect description of the
            reference type when displaying material documents for the inspection
            lot.In Release 3.x, the reference records are deleted in order to
            make sure that individual documents cannot be cancelled several
            times.
         8. The program does not contain any own authorization checks and should
            be used with utmost care and ONLY after a successful test. The
            program should ONLY be applied in exceptions and should not be part
            of the standard procedure.
         9. The logic implemented in the program for the generation of material
            documents or for the update of inspection lot quantities and
            inspection lot status should under no circumstances be be changed as
            this might lead to inconsistent data. Since this is a program that is
            not contained in the standard system, problems that are created as a
            result of the program application can be dealt with as problems that
            have arisen as a result of a customer modification.
         To implement the program, proceed as follows:
         1. Create an executable program and copy the attached source code.Then
            maintain the text for selection parameter PRUEFLOS by transferring
            the Dictionary text.
         2. If you a use a Release < 4.6, you must create the function group
            ZQMB. In this function group, you must create function module
            'ZQMB_QAMB_CANCEL'. Flag the function module as an update function
            module (Start immediately) and include table interface parameter
            'I_QAMB_TAB' (type specification LIKE, reference structure QAMB).
            Afterwards you must include exception 'ERROR_DURING_UPDATE' and
            implement the attached source code.
         3. Use Transaction OMJJ to enter further entries in level 'Allowed
            transactions' (table T158B) for transaction code 'QA11' (Record Usage
            Decision).The movement types for which these entries must be created
            are derived from the system settings for the goods movements for the
            usage decision (table TQ07M):The reversal movement type must be
            determined for every movement type that is entered in table TQ07M
            with the key VMENGE01 - VMENGE09 and the corresponding entry must be
            included in the above-mentioned table.You can use table T156N for
            determining the reversal movement type:You can determine the reversal
            movement type by entering the movement type (BWART) and function code
            (FCODE) ST (BWART_NEXT).For missing entries, the system generates
            error M7096 'Goods movement not possible with mvmt type &'.
         Source code corrections
                                                                           Page 3
         Valid releases
         R/3 Standard        46C - 46D
                             46A - 46B
                             45A - 45B
                             40A - 40B
                             30F - 31I
         Other components
         QM-IM               Quality Inspection
         Reference to related notes
         Number    Short text
         0033924   Cancelling usage decisions
         0048815   Checking possible inconsistencies between MM and QM
                                                                           Page 4
         Assigned correction instructions
    $$----
    $$
    $ Correction Instr.        : 0120024545 0000111772                   $
    $ Software Component       : SAP_APPL   SAP Application              $
    *$----
    $*
    $ Validity    : 40A          SAPKH40A01 - SAPKH40A25                 $
    $             : 40B          All Patches                             $
    $             : 45A          All Patches                             $
    $             : 45B          All Patches                             $
    *$----
    $*
    $ Changes/Objects Not Contained in Standard SAP System               $
    $$----
    $$
         *& Object          FUNC ZQMB_QAMB_CANCEL
         *& Object Header   FUGR ZQMB
         *& FUNCTION ZQMB_QAMB_CANCEL
         *>>>> START OF INSERTION <<<<
           UPDATE QAMB FROM TABLE I_QAMB_TAB.
           IF NOT SY-SUBRC IS INITIAL.
             RAISE ERROR_DURING_UPDATE.
           ENDIF.
         *>>>> END OF INSERTION <<<<<<
         *& Object          REPS RQEVAC50
         *& Object Header   PROG RQEVAC50
         *& REPORT RQEVAC50
         *>>>> START OF INSERTION <<<<
         REPORT RQEVAC50 MESSAGE-ID QA.
         TYPES:
           T_QAMB_TAB  LIKE QAMB  OCCURS 0,
           T_MKPF_TAB  LIKE MKPF  OCCURS 0,
           T_MSEG_TAB  LIKE MSEG  OCCURS 0.
         PARAMETERS:
           PRUEFLOS LIKE QALS-PRUEFLOS OBLIGATORY MEMORY ID QLS.
         DATA:
           G_MSGV1       LIKE SY-MSGV1,
           G_QALS        LIKE QALS,
           G_QALS_LEISTE LIKE QALS,
           G_QAMB_TAB    TYPE T_QAMB_TAB,
           G_QAMB_VB_TAB TYPE T_QAMB_TAB,
           G_MKPF_TAB    TYPE T_MKPF_TAB,
           G_MSEG_TAB    TYPE T_MSEG_TAB,
           G_SUBRC       LIKE SY-SUBRC.
         START-OF-SELECTION.
                                                                           Page 5
           PERFORM ENQUEUE_QALS USING PRUEFLOS
                                      G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_QALS USING PRUEFLOS
                                   G_QALS
                                   G_QALS_LEISTE
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '102'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_LOT USING G_QALS
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             CASE G_SUBRC.
               WHEN 128.
                 G_MSGV1 = 'Material & is serialized'.
                 REPLACE '&' WITH G_QALS-MATNR INTO G_MSGV1.
               WHEN  64.
                 G_MSGV1 = 'Lot & is not stock relevant'.
               WHEN  32.
                 G_MSGV1 = 'Lot &: No stock transferred'.
               WHEN  16.
                 G_MSGV1 = 'Lot & is cancelled'.
               WHEN   8.
                 G_MSGV1 = 'Lot & is archived'.
               WHEN   4.
                 G_MSGV1 = 'Lot & is blocked'.
               WHEN   2.
                 G_MSGV1 = 'Lot & is HU managed'.
             ENDCASE.
             REPLACE '&' WITH PRUEFLOS INTO G_MSGV1.
             MESSAGE ID '00' TYPE 'S' NUMBER '208'
                     WITH G_MSGV1.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_QAMB USING G_QALS
                                   G_QAMB_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_MKPF USING G_QAMB_TAB
                                   G_MKPF_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
                                                                           Page 6
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_MKPF USING G_MKPF_TAB
                                    G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM READ_MSEG USING G_MKPF_TAB
                                   G_MSEG_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CHECK_MSEG USING G_MSEG_TAB
                                    G_QAMB_TAB
                                    G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM CREATE_GOODS_MOVEMENT USING G_QALS
                                               G_MSEG_TAB
                                               G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID 'QA' TYPE 'S' NUMBER '068'
                     WITH PRUEFLOS.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
           PERFORM POST_GOODS_MOVEMENT.
           PERFORM POST_DATA USING G_QALS
                                   G_QALS_LEISTE
                                   G_QAMB_TAB
                                   G_QAMB_VB_TAB
                                   G_SUBRC.
           IF NOT G_SUBRC IS INITIAL.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ELSE.
             COMMIT WORK AND WAIT.
             G_MSGV1 = 'inspection lot &'.
             REPLACE '&' WITH PRUEFLOS INTO G_MSGV1.
             MESSAGE ID '00' TYPE 'S' NUMBER '368'
                                                                           Page 7
                     WITH 'Stock posting reversed for ' G_MSGV1.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
          Form  ENQUEUE_QALS                                             *
          Los sperren                                                    *
         FORM ENQUEUE_QALS USING P_PRUEFLOS LIKE QALS-PRUEFLOS
                                 P_SUBRC    LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           CALL FUNCTION 'ENQUEUE_EQQALS1'
                EXPORTING
                     PRUEFLOS       = P_PRUEFLOS
                EXCEPTIONS
                     FOREIGN_LOCK   = 1
                     SYSTEM_FAILURE = 2
                     OTHERS         = 3.
           P_SUBRC = SY-SUBRC.
         ENDFORM.                               " ENQUEUE_QALS
          Form  READ_QALS                                                *
          Prüflos lesen                                                  *
         FORM READ_QALS USING P_PRUEFLOS    LIKE QALS-PRUEFLOS
                              P_QALS        LIKE QALS
                              P_QALS_LEISTE LIKE QALS
                              P_SUBRC       LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           CALL FUNCTION 'QPSE_LOT_READ'
                EXPORTING
                     I_PRUEFLOS  = P_PRUEFLOS
                     I_RESET_LOT = 'X'
                IMPORTING
                     E_QALS      = P_QALS
                EXCEPTIONS
                     NO_LOT      = 1.
           P_SUBRC = SY-SUBRC.
           IF P_SUBRC IS INITIAL.
             P_QALS_LEISTE = P_QALS.
           ELSE.
             CLEAR: P_QALS,
                    P_QALS_LEISTE.
           ENDIF.
         ENDFORM.                               " READ_QALS
          Form  CHECK_LOT                                                *
                                                                           Page 8
          Prüflos prüfen                                                 *
         FORM CHECK_LOT USING P_QALS  LIKE QALS
                              P_SUBRC LIKE SY-SUBRC.
           DATA:
             L_STAT      LIKE JSTAT,
             L_STAT_TAB  LIKE JSTAT OCCURS 0 WITH HEADER LINE.
           P_SUBRC = 128.
         */Serialized Material
           IF NOT P_QALS-SERNP IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 64.
           ENDIF.
         */BERF
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0203'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF NOT SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 32.
           ENDIF.
         */BTEI & BEND
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0219'. APPEND L_STAT TO L_STAT_TAB. "BTEI
           L_STAT-STAT = 'I0220'. APPEND L_STAT TO L_STAT_TAB. "BEND
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 16.
           ENDIF.
         */LSTO & LSTV
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0224'. APPEND L_STAT TO L_STAT_TAB. "LSTO
           L_STAT-STAT = 'I0232'. APPEND L_STAT TO L_STAT_TAB. "LSTV
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                                                                           Page 9
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF NOT L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 8.
           ENDIF.
         */ARSP & ARCH & REO1 & REO2 & REO3
           CLEAR L_STAT. CLEAR L_STAT_TAB. REFRESH L_STAT_TAB.
           L_STAT-STAT = 'I0225'. APPEND L_STAT TO L_STAT_TAB. "ARSP
           L_STAT-STAT = 'I0226'. APPEND L_STAT TO L_STAT_TAB. "ARCH
           L_STAT-STAT = 'I0227'. APPEND L_STAT TO L_STAT_TAB. "REO3
           L_STAT-STAT = 'I0228'. APPEND L_STAT TO L_STAT_TAB. "REO2
           L_STAT-STAT = 'I0229'. APPEND L_STAT TO L_STAT_TAB. "REO1
           CALL FUNCTION 'STATUS_OBJECT_CHECK_MULTI'
                EXPORTING
                     OBJNR        = P_QALS-OBJNR
                TABLES
                     STATUS_CHECK = L_STAT_TAB.
           IF NOT L_STAT_TAB[] IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 4.
           ENDIF.
         */SPER
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0043'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 2.
           ENDIF.
         */HUM
           CALL FUNCTION 'STATUS_CHECK'
                EXPORTING
                     OBJNR             = P_QALS-OBJNR
                     STATUS            = 'I0443'
                EXCEPTIONS
                     STATUS_NOT_ACTIVE = 2.
           IF SY-SUBRC IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 0.
           ENDIF.
                                                                          Page 10
         ENDFORM.                               " CHECK_LOT
          Form  READ_QAMB                                                *
          QAMBs lesen                                                    *
         FORM READ_QAMB USING P_QALS     LIKE QALS
                              P_QAMB_TAB TYPE T_QAMB_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           CLEAR: P_SUBRC.
           SELECT * FROM QAMB INTO TABLE P_QAMB_TAB
             WHERE PRUEFLOS =  P_QALS-PRUEFLOS
               AND TYP   = '3'.
           P_SUBRC = SY-SUBRC.
         ENDFORM.                               " READ_QAMB
          Form  READ_MKPF                                                *
          Read material document header                                  *
         FORM READ_MKPF USING P_QAMB_TAB TYPE T_QAMB_TAB
                              P_MKPF_TAB TYPE T_MKPF_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           DATA:
             BEGIN OF L_MKPF_KEY_TAB OCCURS 0,
               MBLNR LIKE MKPF-MBLNR,
               MJAHR LIKE MKPF-MJAHR,
             END   OF L_MKPF_KEY_TAB.
           DATA:
             L_QAMB   LIKE QAMB,
             L_MKPF   LIKE MKPF,
             L_TRTYP  LIKE T158-TRTYP VALUE 'A',
             L_VGART  LIKE T158-VGART VALUE 'WQ',
             L_XEXIT  LIKE QM00-QKZ.
           P_SUBRC = 4.
           LOOP AT P_QAMB_TAB INTO L_QAMB.
             L_MKPF_KEY_TAB-MBLNR = L_QAMB-MBLNR.
             L_MKPF_KEY_TAB-MJAHR = L_QAMB-MJAHR.
             COLLECT L_MKPF_KEY_TAB.
           ENDLOOP.
           LOOP AT L_MKPF_KEY_TAB.
             CALL FUNCTION 'ENQUEUE_EMMKPF'
                  EXPORTING
                       MBLNR          = L_MKPF_KEY_TAB-MBLNR
                       MJAHR          = L_MKPF_KEY_TAB-MJAHR
                  EXCEPTIONS
                       FOREIGN_LOCK   = 1
                                                                          Page 11
                       SYSTEM_FAILURE = 2
                       OTHERS         = 3.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ENDIF.
             CLEAR: L_MKPF.
             CALL FUNCTION 'MB_READ_MATERIAL_HEADER'
                  EXPORTING
                       MBLNR         = L_MKPF_KEY_TAB-MBLNR
                       MJAHR         = L_MKPF_KEY_TAB-MJAHR
                       TRTYP         = L_TRTYP
                       VGART         = L_VGART
                  IMPORTING
                       KOPF          = L_MKPF
                  EXCEPTIONS
                       ERROR_MESSAGE = 1.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ELSE.
               APPEND L_MKPF TO P_MKPF_TAB.
             ENDIF.
           ENDLOOP.
           IF NOT L_XEXIT IS INITIAL.
             EXIT.
           ELSE.
             P_SUBRC = 0.
           ENDIF.
         ENDFORM.                               " READ_MKPF
          Form  READ_MSEG                                                *
          MSEGs lesen                                                    *
         FORM READ_MSEG USING P_MKPF_TAB TYPE T_MKPF_TAB
                              P_MSEG_TAB TYPE T_MSEG_TAB
                              P_SUBRC    LIKE SY-SUBRC.
           DATA:
             L_MKPF     LIKE MKPF,
             L_MSEG_TAB LIKE MSEG OCCURS 0 WITH HEADER LINE,
             L_TRTYP    LIKE T158-TRTYP VALUE 'A',
             L_XEXIT    LIKE QM00-QKZ.
           P_SUBRC = 4.
           LOOP AT P_MKPF_TAB INTO L_MKPF.
             CLEAR: L_MSEG_TAB. REFRESH: L_MSEG_TAB.
             CALL FUNCTION 'MB_READ_MATERIAL_POSITION'
                  EXPORTING
                                                                          Page 12
                       MBLNR  = L_MKPF-MBLNR
                       MJAHR  = L_MKPF-MJAHR
                       TRTYP  = L_TRTYP
         */            ZEILB  = P_ZEILE
         */            ZEILE  = P_ZEILE
                  TABLES
                     SEQTAB = L_MSEG_TAB
                EXCEPTIONS
                     ERROR_MESSAGE = 1.
             IF NOT SY-SUBRC IS INITIAL.
               L_XEXIT = 'X'.
               EXIT.
             ELSE.
               APPEND LINES OF L_MSEG_TAB TO P_MSEG_TAB.
             ENDIF.
           ENDLOOP.
           IF NOT L_XEXIT IS INITIAL.
             EXIT.
           ELSE.
         */  XAuto-Zeilen und Chargenzustandsänderung werden gelöscht
             DELETE P_MSEG_TAB WHERE XAUTO NE SPACE
                                  OR BWART EQ '341'
                                  OR BWART EQ '342'.
             P_SUBRC = 0.
           ENDIF.
         ENDFORM.                               " READ_MSEG
          Form  CREATE_GOODS_MOVEMENT                                    *
          Warenbewegung anlegen                                          *
         FORM CREATE_GOODS_MOVEMENT USING P_QALS     LIKE QALS
                                          P_MSEG_TAB TYPE T_MSEG_TAB
                                          P_SUBRC    LIKE SY-SUBRC.
           DATA:
             L_LMENGEZUB LIKE QALS-LMENGEZUB,
             L_LMENGEGEB LIKE QALS-LMENGEZUB,
             L_MBQSS     LIKE MBQSS,
             L_IMKPF     LIKE IMKPF,
             L_IMSEG     LIKE IMSEG,
             L_IMSEG_TAB LIKE IMSEG OCCURS 1,
             L_EMKPF     LIKE EMKPF,
             L_EMSEG     LIKE EMSEG,
             L_EMSEG_TAB LIKE EMSEG OCCURS 1,
             L_MSEG      LIKE MSEG,
             L_MSEG_TAB  LIKE MSEG  OCCURS 1,
             L_TCODE     LIKE SY-TCODE VALUE 'QA11',
             L_TABIX     LIKE SY-TABIX VALUE 1,
             L_XSTBW     LIKE T156-XSTBW.
           CLEAR: P_SUBRC.
                                                                          Page 13
         */QAMB initialisieren
           CALL FUNCTION 'QAMB_REFRESH_DATA'.
         */Kopf füllen
           L_IMKPF-BLDAT = SY-DATLO.
           L_IMKPF-BUDAT = SY-DATLO.
           L_IMKPF-BKTXT = 'Cancellation of QM UD postings'.
         */Ursprüngliche zu buchende Menge merken + inkrementieren
           L_LMENGEZUB = P_QALS-LMENGEZUB.
           L_LMENGEGEB =   P_QALS-LMENGE01
                         + P_QALS-LMENGE02
                         + P_QALS-LMENGE03
                         + P_QALS-LMENGE04
                         + P_QALS-LMENGE05
                         + P_QALS-LMENGE06
                         + P_QALS-LMENGE07
                         + P_QALS-LMENGE08
                         + P_QALS-LMENGE09.
         */Zeilen aufbauen
           L_MSEG_TAB[] = P_MSEG_TAB[].
           LOOP AT L_MSEG_TAB INTO L_MSEG.
             MOVE-CORRESPONDING L_MSEG  TO L_MBQSS.
             MOVE-CORRESPONDING L_MBQSS TO L_IMSEG.
         */  Referenzbeleg übergeben, falls Bestellnummer gefüllt
             IF NOT L_MSEG-EBELN IS INITIAL.
               MOVE: L_MSEG-LFBNR TO L_IMSEG-LFBNR,
                     L_MSEG-LFBJA TO L_IMSEG-LFBJA,
                     L_MSEG-LFPOS TO L_IMSEG-LFPOS.
             ENDIF.
             MOVE L_MSEG-KDAUF          TO L_IMSEG-KDAUF.
             MOVE L_MSEG-KDPOS          TO L_IMSEG-KDPOS.
             MOVE L_MSEG-PS_PSP_PNR     TO L_IMSEG-PS_PSP_PNR.
         */  Umlagerungsfelder setzen
             MOVE:
                 L_MSEG-UMMAT  TO L_IMSEG-UMMAT,
                 L_MSEG-UMWRK  TO L_IMSEG-UMWRK,
                 L_MSEG-UMLGO  TO L_IMSEG-UMLGO,
                 L_MSEG-UMCHA  TO L_IMSEG-UMCHA.
         */  Storno-Beleg setzen
             MOVE: L_MSEG-MJAHR  TO L_IMSEG-SJAHR,
                   L_MSEG-MBLNR  TO L_IMSEG-SMBLN,
                   L_MSEG-ZEILE  TO L_IMSEG-SMBLP.
         */  Falsch gefüllte Felder initialisieren
             CLEAR: L_IMSEG-MBLNR,
                    L_IMSEG-MENGE,
                    L_IMSEG-MEINS.
         */  Bewegungsart lesen
             SELECT SINGLE XSTBW FROM T156 INTO L_XSTBW
               WHERE BWART = L_IMSEG-BWART.
                                                                          Page 14
             IF NOT SY-SUBRC IS INITIAL.
               P_SUBRC = 4.
               EXIT.
             ENDIF.
         */  Werk/Lagerort füllen
             IF P_QALS-STAT11 IS INITIAL.
               IF L_XSTBW IS INITIAL.
                 MOVE P_QALS-LAGORTVORG TO L_IMSEG-LGORT.
               ELSE.
                 MOVE P_QALS-LAGORTVORG TO L_IMSEG-UMLGO.
               ENDIF.
             ENDIF.
             IF L_XSTBW IS INITIAL.
               MOVE P_QALS-WERKVORG TO L_IMSEG-WERKS.
             ELSE.
               MOVE P_QALS-WERKVORG TO L_IMSEG-UMWRK.
             ENDIF.
         */  Zusätzliche Felder
             MOVE P_QALS-MENGENEINH TO L_IMSEG-ERFME.
             "MOVE P_GRUND           TO L_IMSEG-GRUND.
             "MOVE P_ELIKZ           TO L_IMSEG-ELIKZ.
         */  Kennzeichen Storno-Buchung setzen
             MOVE 'X'               TO L_IMSEG-XSTOB.
             MOVE P_QALS-PRUEFLOS   TO L_IMSEG-QPLOS.
             APPEND L_IMSEG TO L_IMSEG_TAB.
             IF P_QALS-STAT11 IS INITIAL.
               ADD      L_IMSEG-ERFMG TO   L_LMENGEZUB.
               SUBTRACT L_IMSEG-ERFMG FROM L_LMENGEGEB.
             ELSE.
               IF     L_IMSEG-KZBEW EQ SPACE
                  AND L_IMSEG-WERKS NE SPACE
                  AND L_IMSEG-LGORT NE SPACE
                  AND L_IMSEG-UMWRK NE SPACE
                  AND L_IMSEG-UMLGO NE SPACE
                  AND L_IMSEG-WERKS EQ L_IMSEG-UMWRK
                  AND L_IMSEG-UMLGO EQ L_IMSEG-UMLGO.
         */      Dummy Buchung bei WE-Sperrbestand & Stichprobe
               ELSE.
                 ADD      L_IMSEG-ERFMG TO   L_LMENGEZUB.
                 SUBTRACT L_IMSEG-ERFMG FROM L_LMENGEGEB.
               ENDIF.
             ENDIF.
           ENDLOOP.
           IF NOT P_QALS-STAT11 IS INITIAL.
         */  Bei WE-Sperrbestand und Stichprobenbuchung Zeilen tauschen
             DO.
               READ TABLE L_IMSEG_TAB INDEX SY-INDEX INTO L_IMSEG.
               IF     SY-SUBRC      IS INITIAL
                  AND L_IMSEG-KZBEW EQ SPACE
                  AND L_IMSEG-WERKS NE SPACE
                  AND L_IMSEG-LGORT NE SPACE
                  AND L_IMSEG-UMWRK NE SPACE
                  AND L_IMSEG-UMLGO NE SPACE
                                                                          Page 15
                  AND L_IMSEG-WERKS EQ L_IMSEG-UMWRK
                  AND L_IMSEG-UMLGO EQ L_IMSEG-UMLGO.
                 IF SY-TABIX NE L_TABIX.
                   DELETE L_IMSEG_TAB INDEX SY-TABIX.
                   INSERT L_IMSEG     INTO  L_IMSEG_TAB INDEX L_TABIX.
                   L_TABIX = L_TABIX + 1.
                 ELSE.
                   L_TABIX = L_TABIX + 1.
                   CONTINUE.
                 ENDIF.
               ELSEIF SY-SUBRC IS INITIAL.
                 CONTINUE.
               ELSE.
                 EXIT.                          "from do
               ENDIF.
             ENDDO.
           ENDIF.
         */QM deaktivieren
           CALL FUNCTION 'QAAT_QM_ACTIVE_INACTIVE'
                EXPORTING
                     AKTIV = SPACE.
         */Buchen
           CALL FUNCTION 'MB_CREATE_GOODS_MOVEMENT'
                EXPORTING
                     IMKPF = L_IMKPF
                     XALLP = 'X'
                     XALLR = 'X'
                     CTCOD = L_TCODE
                     XQMCL = ' '
                IMPORTING
                     EMKPF = L_EMKPF
                TABLES
                     IMSEG = L_IMSEG_TAB
                     EMSEG = L_EMSEG_TAB.
         */QM wieder aktivieren
           CALL FUNCTION 'QAAT_QM_ACTIVE_INACTIVE'
                EXPORTING
                     AKTIV = 'X'.
         */Buchung auswerten
           IF L_EMKPF-SUBRC GT 1.
             IF L_EMKPF-MSGID NE SPACE.
         */    Fehler auf Kopfebene
               MESSAGE ID L_EMKPF-MSGID TYPE 'S'
                       NUMBER L_EMKPF-MSGNO
                       WITH L_EMKPF-MSGV1 L_EMKPF-MSGV2
                            L_EMKPF-MSGV3 L_EMKPF-MSGV4.
               SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
             ELSE.
         */    Fehler auf Zeilenebene (Ausgabe des ersten Fehlers)
               LOOP AT L_EMSEG_TAB INTO L_EMSEG.
                 IF L_EMSEG-MSGID NE SPACE.
                   MESSAGE ID L_EMSEG-MSGID TYPE 'S'
                         NUMBER L_EMSEG-MSGNO
                         WITH L_EMSEG-MSGV1 L_EMSEG-MSGV2
                              L_EMSEG-MSGV3 L_EMSEG-MSGV4.
                                                                          Page 16
                   SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
                 ENDIF.
               ENDLOOP.
             ENDIF.
           ENDIF.
           LOOP AT L_EMSEG_TAB INTO L_EMSEG.
             CALL FUNCTION 'QAMB_COLLECT_RECORD'
                  EXPORTING
                       LOTNUMBER   = P_QALS-PRUEFLOS
                       DOCYEAR     = L_EMKPF-MJAHR
                       DOCNUMBER   = L_EMKPF-MBLNR
                       DOCPOSITION = L_EMSEG-MBLPO
                       TYPE        = '7'.
           ENDLOOP.
         */Sonderkorrektur für Frei-An-Frei & WE-Sperr-An-We-Sperr
           IF NOT P_QALS-STAT11 IS INITIAL.
             IF P_QALS-LMENGE04 EQ L_LMENGEGEB.
               ADD      P_QALS-LMENGE04 TO   L_LMENGEZUB.
               SUBTRACT P_QALS-LMENGE04 FROM L_LMENGEGEB.
             ENDIF.
           ELSEIF P_QALS-INSMK IS INITIAL.
             IF         P_QALS-LMENGE01 GE L_LMENGEGEB
                AND NOT P_QALS-LMENGE01 IS INITIAL.
               ADD      L_LMENGEGEB     TO   L_LMENGEZUB.
               SUBTRACT L_LMENGEGEB     FROM L_LMENGEGEB.
             ENDIF.
           ENDIF.
           CLEAR: P_QALS-STAT34,
                  P_QALS-MATNRNEU,
                  P_QALS-CHARGNEU,
                  P_QALS-LMENGE01,
                  P_QALS-LMENGE02,
                  P_QALS-LMENGE03,
                  P_QALS-LMENGE04,
                  P_QALS-LMENGE05,
                  P_QALS-LMENGE06,
                  P_QALS-LMENGE07,
                  P_QALS-LMENGE08,
                  P_QALS-LMENGE09.
           P_QALS-LMENGEZUB = L_LMENGEZUB.
           IF NOT L_LMENGEGEB IS INITIAL.
             P_SUBRC = 4.
           ENDIF.
         ENDFORM.                               " CREATE_GOODS_MOVEMENT
          Form  POST_GOODS_MOVEMENT                                      *
          Warenbewegung buchen                                           *
         FORM POST_GOODS_MOVEMENT.
           CALL FUNCTION 'MB_POST_GOODS_MOVEMENT'.
                                                                          Page 17
         ENDFORM.                               " POST_GOODS_MOVEMENT
          Form  POST_DATA                                                *
          QM-Daten verbuchen                                             *
         FORM POST_DATA USING P_QALS        LIKE QALS
                              P_QALS_LEISTE LIKE QALS
                              P_QAMB_TAB    TYPE T_QAMB_TAB
                              P_QAMB_VB_TAB TYPE T_QAMB_TAB
                              P_SUBRC       LIKE SY-SUBRC.
           DATA:
             L_STAT        LIKE JSTAT,
             L_STAT_TAB    LIKE JSTAT OCCURS 0,
             L_QAMB        LIKE QAMB,
             L_UPDKZ       LIKE QALSVB-UPSL VALUE 'U'.
         */QAMBs umsetzen (7 = VE-Buchung storniert)
           LOOP AT P_QAMB_TAB INTO L_QAMB.
             L_QAMB-TYP = '7'.
             APPEND L_QAMB TO P_QAMB_VB_TAB.
           ENDLOOP.
         */BERF & BTEI zurücknehmen
           CLEAR L_STAT. CLEAR L_STAT_TAB.
           L_STAT-INACT = 'X'.
           L_STAT-STAT = 'I0219'. APPEND L_STAT TO L_STAT_TAB. "BTEI
           L_STAT-STAT = 'I0220'. APPEND L_STAT TO L_STAT_TAB. "BEND
           CALL FUNCTION 'STATUS_CHANGE_INTERN'
                EXPORTING
                     OBJNR         = P_QALS-OBJNR
                TABLES
                     STATUS        = L_STAT_TAB
                EXCEPTIONS
                     ERROR_MESSAGE = 1.
           IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
           ENDIF.
         */Prüflos aktualisieren
           CALL FUNCTION 'QPL1_UPDATE_MEMORY'
                EXPORTING
                     I_QALS  = P_QALS
                     I_UPDKZ = L_UPDKZ.
           CALL FUNCTION 'QPL1_INSPECTION_LOTS_POSTING'.
           CALL FUNCTION 'STATUS_UPDATE_ON_COMMIT'.
         */QAMB initialisieren
           CALL FUNCTION 'QAMB_REFRESH_DATA'.
                                                                          Page 18
           PERFORM UPDATE_QAMB ON COMMIT.
           P_SUBRC = 0.
         ENDFORM.                               " POST_DATA
          Form  UPDATE_QAMB                                              *

  • The Usage decision cancellation & quantity reversal

    Daer All,
    While cancelling the Goods receipt, system gives the error Deficit of SL Stck.in qual.insp 10 M : 5000017/1 PMT1 RMST as the usage decision of quality lot generated for the goods receipt is done.
    I want to cancel/reverse the usage decision made & the quantity release from the lot to be initialised, so I can cancel the Goods receipt.
    I have applied the Note 175842 & User Exit QEVA0008
    But when I cancel the usage decision in QA11, only the usage decision is cancelled. The quantity which is moved to un-restricted stock after usage decision is not reversed.
    I want to reverse the quantity, so i can cancell the goods receipt.
    Regards,
    Prakash

    Hi Prakash,
    Please note that SAP doesnt provide an option to reverse a UD once its done.
    Now to solve your issue, Since you have already done QA inspection the stock is moved to Un-res.
    So when you cancel the Material/GR document, select the stock type as un-res then system will allow to post the document.
    Regards,

Maybe you are looking for