***********************************************************************
* AUTO DISALLOWED BACK POSTING TO PREVIOUS PERIOD
***********************************************************************
REPORT ZBDCMMRV.
TABLES: MARV.
* Batch Input Name
PARAMETERS P-BTCHSN(12) DEFAULT 'MMRVCHANGE'.
* Company Code
PARAMETERS P-BUKRS LIKE MARV-BUKRS.
* Auto / Manual run the Batch Input Program
PARAMETERS P-RUN AS CHECKBOX DEFAULT 'X'.
* INTERNAL TABLE FOR DATA
DATA: BEGIN OF ULTAB OCCURS 50,
BUKRS LIKE MARV-BUKRS, "Company Code
END OF ULTAB.
* INTERNAL TABLE FOR BATCH INPUT DATA
DATA: BEGIN OF IPUTTAB OCCURS 50.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF IPUTTAB.
* INTERNAL TABLE FOR BATCH INPUT ERROR MESSAGE.
DATA: BEGIN OF MESSTAB OCCURS 50.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
DATA: C_TAXKM LIKE MG03STEUER-TAXKM VALUE '1',
W-LINE-NO TYPE I.
REFRESH ULTAB.
SELECT * FROM MARV WHERE BUKRS = P-BUKRS.
ULTAB-BUKRS = MARV-BUKRS.
APPEND ULTAB.
ENDSELECT.
* CHECK WHETHER TABLE IS EMPTY
IF ULTAB[] is initial.
WRITE: / 'TABLE EMPTY'.
ENDIF.
* Create Batch session
PERFORM CRE-BATCH-SESS.
** LOOP TABLE TO CREATE SCREEN INPUT
SORT.
LOOP AT ULTAB.
REFRESH IPUTTAB.
PERFORM SCREEN1.
PERFORM SCREEN2.
PERFORM PRN_ULTAB.
PERFORM CLOSE-SESS.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
* END OF MAIN PROGRAM
FORM SCREEN1.
* SCREEN #1: INITAL SCREEN FOR MAINTAINING SOURCE LIST
CLEAR IPUTTAB.
IPUTTAB-PROGRAM = 'SAPMM03Y'.
IPUTTAB-DYNPRO = '100'.
IPUTTAB-DYNBEGIN = 'X'.
APPEND IPUTTAB.
* MMRV ENQUIRY BY COMPANY CODE
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'MARV-BUKRS'.
IPUTTAB-FVAL = ULTAB-BUKRS.
APPEND IPUTTAB.
ENDFORM.
***********************************************************************
* FORM : SCREEN1 *
***********************************************************************
FORM SCREEN2.
* MODIFY SCREEN IN MMRV
CLEAR IPUTTAB.
IPUTTAB-PROGRAM = 'SAPMM03Y'.
IPUTTAB-DYNPRO = '110'.
IPUTTAB-DYNBEGIN = 'X'.
APPEND IPUTTAB.
* UNTICK ALLOWED POSTING TO PREVIOUS PERIOD
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'MARV-XRUEM'.
IPUTTAB-FVAL = ' '.
APPEND IPUTTAB.
* DISALLOWED BACKPOSTING GENERALLY
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'MARV-XRUEV'.
IPUTTAB-FVAL = 'X'.
APPEND IPUTTAB.
* Specify that we are now done with this screen (Save it with F11)
CLEAR IPUTTAB.
IPUTTAB-FNAM = 'BDC_OKCODE'.
IPUTTAB-FVAL = '/11'.
APPEND IPUTTAB.
ENDFORM.
***********************************************************************
* FORM : CLOSE-SESS *
* DESCRIPTION : CLOSE THE SESSION *
***********************************************************************
FORM CLOSE-SESS.
* closing the session.
IF P-RUN = 'X'.
* Auto run the Batch Input Program
CALL TRANSACTION 'MMRV'
USING IPUTTAB
MODE 'E'
UPDATE 'S'
MESSAGES INTO MESSTAB.
ELSE.
* Maual run the Batch Input Program
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MMRV'
TABLES
DYNPROTAB = IPUTTAB.
ENDIF.
ENDFORM.
***********************************************************************
* FORM : PRN-ULTAB *
* DESCRIPTION : PRINT OK TABLE *
***********************************************************************
FORM PRN_ULTAB.
WRITE: / ULTAB-BUKRS.
W-LINE-NO = W-LINE-NO + 1.
WRITE: ' RECORD# ', W-LINE-NO.
ENDFORM.
***********************************************************************
* FORM : CRE-BATCH-SESS *
* DESCRIPTION : CREATE BATCH SESSION *
***********************************************************************
FORM CRE-BATCH-SESS.
** Create BTCI session **
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = P-BTCHSN
USER = SY-UNAME
KEEP = 'X'.
ENDFORM.
Sunday, June 22, 2008
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(324)
-
▼
June
(80)
- Setting Cross-company transaction
- Inventory Beginning Balances
- Variances between material and account of stock wh...
- Planned Delivery Time as Workdays
- Physical Inventory Item Class
- Physical Inventory Process
- What is A, B, C and D Indicator for a material for...
- Valuation Category
- MBST: Reversal of cleared items in FI
- Difference Between Cancellation and Reversal
- Automate the opening of MM periods
- Allow/Disallowed Backposting of Inventory Posting
- Movement Error - Posting Only Possible Between
- Re-Open The Previous Period
- Process Of Imported Material With Excise
- Difference for Stock Transfer and Transfer Posting
- Creating The Stock Transfer Order
- IDoc Procedures in SAP MM
- SAP MM Configuration How to do?
- Mass Change Material Group In Materials Master
- Change Base Unit of Measure using SAP MM
- MM Process Flow
- mySAP Certification - Criteria For Application
- SAP MM Certification Sample Questions for Material...
- SAP MM Self Test Questions
- General Test of SAP MM Knowledge
- SAP Material Management MCQ
- My SAP MM Certification Experience
- Auto Disallowed Back Posting to Previous Period
- Meaning of Archiving Residence Time
- How to use "me98" to delete PO from system complet...
- Deletion of Vendor Consignment Records
- Deletion of Info Record
- Changing the Material Valuation Types MM Archiving
- Price Control V or S in material type
- SAP Split Valuation for Materials
- Creation of same Material Code in Different Compan...
- One Storage Location for Two Different Plant MM Ar...
- Control the Number Range Intervals for Material Ma...
- MM - Control the Output Format of your Material Nu...
- MM - Controlling the Fields in Material Master
- Maintain the user default settings when creating M...
- SAP MM Inventory - Allow Negative stocks
- Difference between Client , Purchasing Org , Plant...
- SAP Solution Manager
- SAP MM Consignment
- SAP MM Basic Functions
- Total number of Purchasing Documents by Purchasing...
- Purchase Order History Mass Display
- Mass Select and Print Material Master Changed History
- Report to display 12 weeks forecast, Yesterday Sto...
- Conventional Versus Logistic Invoice Verification
- Important Accounts for Invoice Verification
- No tax information during consignment Settlement
- SAP MM - Consignment Process - Settlement
- Use of Invoice Plan in SAP
- SAP LIS - Wrong figures in Logistics Information S...
- List of standard Reports in MM
- Project Status set to TECO
- List of RA caculated values
- Stop Commitments Before Release Of Projects
- What is WBS element?
- Aggregate POC Calculation
- Dynamic Selection on Report Not Working
- PS Substitutions
- Progress Analysis to measure EVA
- Sequence Of Operations To Get EVA
- Milestones
- Project profile
- Capacity Planning in PS module; Calendar like in M...
- Project System Status -Deletion Flag Active
- Set the number range for Deliveries
- Set the default start variant for VL10
- Adding additional fields to Delivery Due List
- Checking Fields with Incompletion procedures for D...
- Exclude inventory in Storage Locations during Deli...
- Avoiding delivery creation when items quantity are...
- SAP WMS - Decentralized Warehouse Management Syste...
- SAP Customizing Picking Output
- HR Interview Questions Frequently Asked
-
▼
June
(80)
No comments:
Post a Comment