Automatic reversal of the stock provisioning entry
Hello Experts,
Need your suggestions on the below requirement.....
At every month end BPA or FRA will create a journal entry into SAP for stock provisioning.
At the beginning of next month, the system should automatically reverses the entry made in previous month for stock provisioning.
Now please advice me how to achieve this requirement,
what are the customization settings to be done from FICO side, and what is the data required from the business to fulfill this requirement.
Your suggestions willbe appreciated and rewarded.
Thanks in Advance,
Satya
Edited by: gsnreddy on Nov 18, 2011 11:03 AM
no automatic process available..
need to do it manually only
Similar Messages
-
Using accrual engine for reversal of month end provisions
Hello everyone,
I am working on a requirement to set up accrual engine for automatic reversal of month end provisions (like electricity expense provision at month end which will be reversed on first day of next month).
I understand that accrual engine is meant for handling accruals and deferrals. But having seen the manual option of FBS1 and F.81, I felt there must be an option in the accrual engine also to handle provisions and their reversal. Also, I saw some comments in this forum that using accrual engine it is possible to automatically reverse the postings.
So I set up a test scenario in sandbox client with basic configuration for Manual Accruals (accrual type, methods, object category, number ranges, account determination)
After that I created an accrual object which automatically created an FI document for the provision entry. So far it is fine and working as expected. Now, for reversing the document, I see two options:
1) Reverse entire accrual run; or
2) Reverse the accrual object.
By reversing the accrual object, I was able to post a reversal FI document. I am not sure whether reversal of entire accrual run is right option since SAP help recommends to use this in case wrong key date was used.
But both options require manual execution for reversal.
Am I missing some other option? Is there any other option/setting in the accrual engine where it is possible to set up automatic reversal of a month end provision? Only if this is not feasible, I would look at other solutions (like FBS1+F.81 or FBS1+background job for F.81).
Any inputs/pointers from the learned members will be highly appreciated.
Thanks in advance,
RaghuHello Raghu,
As far as I know, all clients I worked with preferred using "FBS1+background job for F.81" as they found this more flexible (adapt job variant and possible dynamic selection), easy to maintain and well understood by accountants (rather than using accrual type, methods, object category...)
Tamim -
Hi All,
There is one Reveral Document No the one we created manually through F.81.Problem is that Reversal Doc No should have been created automatically and not through F.81. this is for accrual and referral documents
could you Please let me know why those are not posted automatically .
RegardsHi,
The Reversal of the Accrual/ Deferal Entry which is passed by T Code FBS1 will be reversed in the subsequent period with the help of T Code F.81.
The entries selected as per the parameters will be automatically reversed & reversal document will be generated.
Regards,
Amit -
Automatic reversal of journal entry into new posting period
Is there a way to set automatic reversal of a journal entry when creating a JE in the next posting period?
Hi,
I do not think this requirement can be met. There is no automatic reversal of document if it is being posted in the next period.
However, you can write a validation in order to prevent the users to post in next period in GGB0 and assign the same in OB28.
Hope this will solve your issue.
Regards,
Ravi -
Looking to automate the automatic reversal
Currently we use the automatic reversal process for several of our journal entries in Oracle r12. We have them set as auto reversal
Category and then run the auto reversal process that creates the reversing journal entry in the next period.
Is there any way to have this auto reversal process run automatically so that as soon as I upload and post an auto reversing journal entry, it will create and post the reversal in the next period for me? we want to eliminate having to run the process manually and have it all work behind the scenes.
Thanks in advance
Jeff DonahuePlease select all open PO according to the following conditions - select if the PO satisfies any one of the below conditions:
1) Open Quantity is less than 10% of total quantity
2) Delivery date is more than 3 months in the past
3) Delivery completed indicator is set and delivery date is more than 6 months in the past.
Then a manual decision is required. Best is to develop a report which will display the list and user can select and block from the report itself.
Also, the 10%, 3 months, etc values are depending on the customer. You may want to modify these as suitable.
Regards,
Lakshman -
202, 712 Reversal movt type its posting the stock as nested HU
Hi All
I have business scenario where the HUM is active.
i have some stock in the warehouse, i am issuing partial qty in 201 mvt type. then i want to reverse the partial qty and put it back on the same HU. so i am putting it back in another HU and then using LT01 i am putting the new HU as source and Original one which have stock as in Destination.
the stock is getting increased on the original HU, but when u check the HU stock the new HU is posted as nested in the original HU.
where i have found in the storage type config if user exit is active then its behaving like this. If the user exit tick not ticked then the stock is posting on the original HU not as nested.
could you please somebody throw some light if anyone has faced this issue
Regards
ganeshkumarHi,
THe status CHCR indicates that the inspection plan (& the characteristics in the inspection plan) have not been assigned to the inspection lot.
Pl. check whether the inspection plan has been assigned to the lot. This can be checked in Change Inspection Lot transaction (QA02) in tab 'Inspection Specifications'. If the 'Specification Selection' is blank, then the inspection plan has not been assigned to the lot. You can assign the inspection plan to the inspection lot by clicking on 'Task list / spec.' button. System will automatically assign the inspection plan (if unique inspection plan is present in system) or in case of multiple inspection plans you will have to select the plan manually. After the inspection plan has been assigned, you may calculate the sample by selecting button 'Smpl.' in tab 'Sample'. Then save the inspection lot. The status of the inspection lot will change & you will be able to post usage decision.
If your inspection lot does not contain any characteristics, then add the relevant characteristics to the inspection plan & then resent the sample size of the lot in transaction QAC3. After that follow procedure given in above paragraph.
If system indicates that the inspection lot is not present (& you have entered the inspection plan), then check the inspection plan for following points -
1) Inspection plan validity date (should be minimum 1 day before the GRN date)
2) Inspection plan lot size (lot size should fit in the plan lot size)
3) Inspection plan material & plant combination (same as that in inspection lot)
4) Vendor assignment to the plan (If any specific vendor is assigned to the lot then the plan will not be valid for material received from other vendors)
Above should resolve your query.
Regards,
Prashant -
Automatic Generate the PO & service entry
Hi,
I want automatic generate the PO & service entry after create the shipment cost calculation.
Can you explain the configuration?
Useful answers duly rewarded
Regards,
Devendradear Devendra
You need following IMG settings:
1) Check box in 101 movtype customizing
2) Plant shd have been assigned to a standard purchasing org
3) Default document type for the transaction code (MIGO_GR/MIGO/MB01) in purchasing
Others things:
1) Material shd be valuated matl
2) Info record for vendor, material & standard P.org of the plant
3) P.grp in material master
4) GR shd be for stock (not account assigned)
steps :
1. Maintain Auto PO in Material master Purchasing view
2. Select Automatic purchase order in Vendor master- Purchase data
3. Maintain info-record with tax-codes
4. Create a PR through ME51
5. Assign the same in ME57
6. Execute in background using Tcode ME59.
PO will be created automatically.
Hope this helps you.
Reward points if helpful
thanks and regards
ravikant dewangan -
Cancellation of Inventory Transfer did not reverse the stocks
Hi All,
We are using SAP B1 8.82 PL 01. One of our entry in Inventory Transfer was posted wrongly by choosing wrong warehouse. So first I posted the same entry in Test database and cancelled the entry. With the cancellation the stocks were back in the "To Warehouse" from the "From Warehouse". But when I cancelled the original entry in live database the Journal entry is showing as Cancelled but the stocks are still in the "From warehouse".
Please tell me where I went wrong and how I can resolve.
Thanks,
Vineela.Hi Vineela,
Please re-post it as a question thread.
Thanks,
Gordon -
Service entry Sheet was reversed after the invoice as posted and rebooked
Hi..
Service entry sheet was reversed after the invoice as posted and rebooked with final entry marked. The rebook transaction created a different $ amount than the original SES. The difference between the 2 amounts is causing a GRIR out of balance on the PO. MR11 does not indicate a GRIR out of balance.
why did SES rebook a different value?
How can we clean up the GRIR out of balance?
Please help...
MercyThis is a standard SAP procedure.
SAP Note 440942 is helpful to sort this out.
Thanks,
Mercy -
hi all,
how to generate Month end provision entries.
pls give one example .
regards,
supriya thodimela.hi Supriya,
1. Process Depreciation Run
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Depreciation run -> Execute - AFAB
2. Process Investment Grant
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Investment grant - AR11
3. Process Revaluation
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Revaluation for the balance sheet -> Post revaluation - AR29
4. AA Fiscal Year Change
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Fiscal year change - AJRW
5. AA Fiscal Year Close Account Reconciliation
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Year-end closing -> Account reconciliation - ABST2
6. AA Fiscal Year Close
Accounting -> Financial accounting -> Fixed assets -> Periodic processing -> Year-end closing -> Execute - AJAB
7. Produce Asset History Sheet
Accounting -> Financial accounting -> Fixed assets -> Info system -> Reports on Asset Accounting -> Balance Sheet Explanations -> International -> Asset History Sheet
or
Accounting -> Financial accounting -> Fixed assets -> Info system -> Reports on Asset Accounting -> Balance Sheet Explanations -> Country Specifics - various
8. Produce GR/IR Balance Report
Logistics -> Materials Management -> Inventory Management -> Environment -> Balances Display -> List of GR/IR Bals. - MB5S
9. Maintain GR/IR Clearing Account
Logistics -> Materials Management -> Invoice Verification -> Invoice Verification -> Further processing -> Maintain GR/IR acct - MR11
10. Material Revaluations Price Changes (manual)
Logistics -> Materials Management -> Valuation -> Valuation -> Price Determination -> Change price - MR21
11. Material Revaluations Debit/Credit Material
Logistics -> Materials Management -> Valuation -> Valuation -> Price Determination -> Debit/cred. material - MR22
12. Product Costing Material Price Change
Accounting -> Controlling -> Product Cost Controlling -> Product Cost Planning -> Material Costing -> Price Update - CK24
13. Material Ledger Closing
Logistics -> Materials Management -> Valuation -> Actual Costing/Material Ledger -> Periodic material valuation -> Post closing - CKMI
14. Materials Management Closing
Logistics -> Materials Management -> Material Master -> Other -> Close period - MMPV
15. Materials Management Closing Control Posting to Prior Period
Logistics -> Materials Management -> Material Master -> Other -> Allow posting to previous period - MMRV
16. Lowest Value Determination Market Prices
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> Determ. lowest values -> Market prices - MRN0
17. Lowest Value Determination Range of Coverage
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> Determ. lowest values -> Range of coverage - MRN1
18. Lowest Value Determination Movement Rate
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> Determ. lowest values -> Movement rate - MRN2
19. Lowest Value Determination Loss-Free Valuation
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> Determ. lowest values -> Loss-free valuation - MRN3
20. LIFO Valuation
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> LIFO Valuation - Various
21. FIFO Valuation
Logistics -> Materials Management -> Valuation -> Valuation -> Bal. sheet valuation -> FIFO Valuation - Various
22. Physical Inventory Processing
Logistics -> Materials Management -> Physical Inventory - Various
23. Analyze GR/IR Clearing Accounts and Display Acquisition Tax
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Closing -> Regroup -> GR/IR clearing - F.19
24. Define Adjustment Accounts for GR/IR Clearing
IMG -> Financial Accounting -> General Ledger Accounting -> Business Transactions -> Closing -> Regrouping -> Define Adjustment Accounts for GR/IR Clearing - OBYP
25. Print Balance Confirmation
Accounting -> Financial accounting -> A/P or A/R -> Periodic processing -> Closing -> Check/count -> Balance confirmation: Print
or
Accounting -> Financial accounting -> A/P or A/R -> Periodic processing -> Print correspondence -> Balance confirmation -> Print letters - F.17
26. Configure Balance Confirmation
Accounting -> Financial accounting -> A/P or A/R -> Periodic processing -> Closing -> Check/count ->
or
Accounting -> Financial accounting -> A/P or A/R -> Periodic processing -> Print correspondence -> Balance confirmation - F.1B, F.1A
27. Post Individual Value Adjustment
Accounting -> Financial accounting -> Accounts receivable -> Document entry -> Other -> Intern. trans. posting -> Without clearing - F-21
28. Define Account Determination for Flat-Rate Individual Value Adjustment
IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Business Transactions -> Closing -> Valuate -> Valuations -> Define Accounts OBB0
29. Configure Flat-Rate Individual Value Adjustment
IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Business Transactions -> Closing -> Valuate -> Valuations -> SPRO
30. Calculate Flat-Rate Individual Value Adjustment
Accounting -> Financial accounting -> Accounts receivable -> Periodic processing -> Closing -> Valuate -> Further valuations - F107
31. Writing-Off Doubtful Receivables
Accounting -> Financial accounting -> Accounts receivable -> Document entry -> Other -> Intern. trans. psting -> With clearing - F-30
32. Customizing Exchange Rates
IMG -> General Settings -> Currencies - Various
33. Maintaining Exchange Rates
Accounting -> Financial accounting -> General ledger -> Environment -> Current settings -> Enter exchange rates - OB08
34. Customizing Valuation Methods
IMG -> Financial Accounting -> General Ledger Accounting -> Business Transactions -> Closing -> Valuating -> Foreign Currency Valuation -> Define Valuation Methods - OB59
35. Foreign Currency Open Item Valuation
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Closing>>Valuate -> Valuation of Open Items in Foreign Currency - F.05
36. Account Determination for Exchange Rate Differences
IMG -> Financial Accounting -> General Ledger Accounting -> Business Transactions -> Closing -> Valuating -> Foreign Currency Valuation -> Prepare automatic postings for foreign currency valuation - OBA1
37. Regroup Receivables and Payables
Accounting -> Financial accounting -> A/P or A/R -> Periodic processing -> Closing -> Regroup -> Receivables/ Payables - F101
38. Account Determination for Regrouping Receivables and Payables
IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Business Transactions -> Closing -> Regrouping - OBBV, OBBW, OBBX
39. Revalue Foreign Currency G/L Account Balances
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Closing -> Valuate -> Foreign Currency Valuation of Inventory - F.06
40. Posting Accruals/Deferrals
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Closing -> Valuate -> Enter Accrual/Deferral Doc. - FBS1
41. Posting Accrual/Deferral Reversal
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Closing -> Valuate -> Reverse Accrual/Deferral Document - F.81
42. Generate Recurring Entry Posting
Accounting -> Financial accounting -> General ledger -> Periodic processing -> Recurring Entries -> Execute - F.14
REgards
assign the points
Ranjit -
Regarding order reversal without affecting stock
Dear all,
Issue is regarding the prod. order reversal without affecting stock of materials. Scenario is as follows.
I have an order of X matl. year 2011 - this order not yet delivered where as the raw materials has been issued by mb1b (261).
As this order not yet been delivered, it is showing in WIP with value. KKAX.
Afterwards user created second order and completed too. Now previous order reamined open without confirmation.
For removing ths order from WIP, we can reverse the 261 movement in current date, but it will also revert the raw matl. stock alongwith values to unrstricted.
Where as finance peoples doesnt want thew same.
Also as del. qty. is not 0, we cant apply del. flag too.
Please suggest the appropriate way to remove the previous order from wip without affecting the stock of materials.
Dont want to do changes in table entry also.
with best regards,
Manish.Hi,
Thanks boss.
It is working now correctly.
The issue is the i_mvtit-XSTOB should be equal space in case of Goods issue while incase of Reversal it should be equal to X.
Thanks for ur efforts.
I had awarded you points.
Thanks a lot.
Thanks & Regards,
Rayeez. -
Inter company STO-how to reduce the stock where no physical stock is kept in receiving plant
Dear All,
I am facing one issue. Suppose if there are two plants belongs to two company codes A & B.Plant A is in TN & Plant B is in AP (both belongs to two different states). Plant B is the place where no physical stock is kept, it is a place where JJ form & other documents are given to the vehicle to move it to other state. From there it ll move to end customer.
In plant A stock reduce-- inventory credit
COGS----Debit
In plant B stock increase=---Inventory debit
GR/IR--credit
Now my problem is in plant B no stock is kept, my client wants to reduce the inventory automatically without any manual entry (since no stock in plant B)
Can i use MB1A to reduce the stock automatically & what would be the actual entry for that. How to offset the other account which is getting debited against inventory?.
Regards
Subbu.Hi,
It seems to be a combined scenario of third party and inter company STO scenario, where you want to send the send the stock directly to your customer. Standard SAP doesnt support the third party scenario for a vendor assigned to the plant. The standard design is well explained in the note: 1918552 - Third Party Purchase in Cross Company STO: error 06769
If you dont want to update the stock in the receiving plant, use a consumption account assignment category (like K) in the intercompany STO, so that the stock will be directly consumed. But one question - how do you map the goods issue to the customer and the outgoing excise invoice? Could you please share the details.
Regards,
AKPT -
Automatic PO at the time of GR
For Automatic PO at the time of GR when I want to assign the Plant to stanadrd Purchasing Organisation I am not able to do it. I am not able to make any entries.
Any guide?
RegardsFor automatic PO at the time of GR following are the prerequisites:
1) In Customizing
a) Auto PO generation must be activated in Mov. Typ 101 & 161
b) The plant for which GR is entered must be assigned to standard Pur. Org.
c) Default Document type for PO must be specified in GR ( MB 01)
2) Application - Front end side
a) material must be valuated material
b) Purchasing Info record must exist for vendor , material & standard Pur Org.
c) Conditions in Info Recors must be valid.
d) Applicable for stock items & not consumable items
e) You cannot enter any movement in GR block stock
f) Material Master & vendor master recors must.
If you ensure all above settings then it is possible to have auto PO during GR.
If you finds above details useful , please reward points,
Vivek Maitra -
Hi all,
can any one suggest how to do provisional entries for vendors in every month in SAP standard best practices way.
my client is booking vendor invoices through MM module. and they are using account assignment category F in the PO, to charge off the expenditure of PO value, when the GRN is made.
i mean to say that is the material, which is purchasing through the PO is non stockable item, it has to be written off to the expenditure GL account, when the GRN is made
hence by every month end there are some GRNs were not made even they received the goods for the same, because of PO is not prepared. so in that month before preparing the MIS they used to create some provision entries for which the actuval cost should go through GRN.
the entry is like
debit GL (Actuval GL)
credit GL (Monthly Provision GL)
on 1st of subsequent month they will reverse the above entry
in this case we are not able to get these provision entries in our vendor due date analysis report, hence those entries were not hitting to the vendors
so i want to know the standard way of doing provision entries in SAP, which should adequate the requirement of capturing the same in my vendor due date analysis......
thanks in advance, hence this a current issue.
SRINUHi all,
can any one give reply to my threat
since it was a serious issue
Srinu -
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
ShivR/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 *
Maybe you are looking for
-
Wrong album covers can't be deleted
Hi I have stubborn wrong album covers that can't be changed or deleted in my itunes library / covers view. The Info-> Artwork view is ok! They only show up in the covers flow.. Fixes tried: delete artwork. replace artwork, add artwork, move song to d
-
Safari 5.1.7 (6534.57.2) is taking a long time to open
For the past week or so, I've been having difficulties with my Safari browser opening in a timely manner. It takes at least 30 seconds to one minute to load. I've looked on different forums and people mention deleting com.apple.Safari.plist or upda
-
Error in the configuration for sap logon tickets
Hi Forum, I use Tcode crmd_order_bp to see the BP cockpit and the error message displays as <b>Error in the configuration for SAP logon tickets</b> But if I click "Yes", system displays cockpit. How can I avoid this error. Thanks in advance Regards S
-
Maint. Status problem for View in ABAP Dictionary
Hello, guys. I have a problem with a configuration in my Maintainence View in the ABAP Dictionary. I have a maintainence view in my abap dictionary, When i go to the tab "Maint. Status" there, and want to change the "Data Browser/Table View Maint." f
-
Why is my updates tab showing an update for a game that i have never bought?
also, why does it show a random apple id that surely isn't mine? added a screenshot, maybe that can help.