7.19.2010

"SY-UCOMM and OK_CODE in Dialog Program | SAP ABAP Programming

What is the difference between SY-UCOMM and OK_CODE in Dialog Program?

sy-ucomm is for doing the functions what the user wishes to do at that particular event. You use it in menus and other place . this mainly in using

ok_code is generally used in screen as of I have used.  You will define the function in the screen. and you can use it in the main program.

ok_code acts just as a temporary variable that stores the value of sy-ucomm.


When user interacts with the screen elements, the function code that you have assigned is filled in the sy-ucomm field which is turn gets reflected in OK_CODE.

In your ABAP programs, you should work with the OK_CODE field instead of SY-UCOMM. There are two reasons for this: Firstly, the ABAP program has full control over fields declared within it, and secondly, you should never change the value of an ABAP system field. However, you should also always initialize the OK_CODE field in an ABAP program for the following reason:

In the same way that the OK_CODE field in the ABAP program and the system field SY-UCOMM receive the contents of the corresponding screen fields in the PAI event, their contents are also assigned to the OK_CODE screen field and system field SYST-UCOMM in the PBO event. Therefore, you must clear the OK_CODE field in the ABAP program to ensure that the function code of a screen is not already filled in the PBO event with an unwanted value. This is particularly important when the next PAI event can be triggered with an empty function code (for example, using ENTER). Empty function codes do not affect SY-UCOMM or the OK_CODE field, and consequently, the old field contents are transported.
   
read more...

Asset Master Data Upload | SAP FICO | Financial Modules | The Financial Statement Closing Tcodes | LSMW

1. If the change of the field can be put into an algorithm (e.g., enter XYZ as a super number for all assets in class 1234), you can use a mass change rule. You first define the mass change rule in the same way as you would define an asset substitution (IF something, THEN something else), then you go into the mass change transaction, select the right assets, the proper change rule ... and hit Execute.

2. Very often, it is easier to prepare the data in Excel and use transaction AS02 for the upload. Here, I can recommend transaction LSMW - you simulate (and record) the AS02 transaction on one fixed asset master, then follow all the steps proposed by the system (define fixed values, variables, etc.) and finally upload the Excel (.csv). System will automatically generate a batch input for all assets. It may take some time for you if you do it for the first time, but it is the best way if you would otherwise need to define complex algorithms.

So - use option 1 if you have a simple algorithm for many assets, and option 2 if "each case is different" or if you feel more comfortable in Excel than ABAP. Option 2 is simple, but of course takes some time to generate the upload and then run the batch sessions (while option 1 changes everything instantly in a matter of seconds).

Here are the details:

I. To use mass change:

1. First, define a mass change rule in transaction OA02 (Accounting - Financial accounting - Fixed assets - Environment - Mass change rule). For each company code, you can define one rule (or a sequence of them). However, all of them will always be executed at the same time. Therefore, if you need to define different rules for different assets, you will have to do this repeatedly. Technically, this is done in the same way as AA substititution.

2. Once the rule is defined, you need to select assets for mass change. Go to transaction AR01 (Accounting - Financial accounting - Fixed assets - Environment - Worklist - Generate). Enter selection criteria like on any standard AA report, and run Execute. I cannot simulate this now on my system (we do not have AA), but it should ask what you want to do (mass change, mass retirement, etc.) and ask for a name of the worklist (write anything - e.g., Super number change). The system will show you a list of selected assets in a report format. Check it and make sure that it is correct. You may add or remove single assets from this (now cannot tell you how, but it is possible). If you are happy with the list, save it.

3. The last step is execution of the change. Go to transaction AR31 (same path as above), execute the report and if you are happy with the list (same as in step 2), press Save. System will show you a log of change (what went through, which errors occured). You are done.

II. LSMW
LSMW is a transaction, which will let you mass upload almost any other transaction (FB01, FD01, AS91, etc.). You do it in the following way:
1. Enter into transaction LSMW (no menu path), possibly in a development / test system
2. First, define a project, subproject and object (relatively formal task).
3. On the horizontal menu, go to Goto -> Recordings. Click on "Create recording".
4. Enter the name and description of recording (freely definable).
5. I cannot simulate this now in my system, but SAP will ask you about transaction code (AS02) and will take you into the AS02 transaction. In this step, do the change manually. Make sure you "touch" (change / write something) in all fields which you want to update.
6. Once you are done, save the recording and return on the start page of LSMW. Click "Execute".
7. You will see a list of tasks. Do them one by one. They should be relatively simple (and I cannot help you with them). Important is step 3 (maintain source fields) - here you define the columns of your excel (csv) file in the particular order. In step 5 (field mapping and conversion rule), you assign file columns to SAP fields (note that you will see only those fields which you "touched" during recording). You need to go through all the steps. In the end, you get (and run) a batch session.
8. If you did this in a development system, transport the LSMW object (menu Extras - Export project, Extras - Import project). You have to do it via file, not via standard transports of configuration (it is perhaps more simple).

Make sure you test it first in development or quality system!

Fiscal Year Variant

Assuming that you are newly implemention with go live date of Sept 1st 2006 and Fiscal year January - December, what will be the best way?
Would it be better to define a Shortened Fiscal year for Sept-Dec 2006 and then regular Fiscal years OR Define a full Fiscal year for the entire 2006 and future FYs

Normally, the best way is to keep it simple and leave the first year "normal" (12 + 4 months starting January). You convert old data as of August 31 (unless the client requests opening balance as of December 31, 2005 and then monthly movements - I have experienced both options) and then start normal bookings in month 9 on September 1.

We never tried shortened fiscal year in this context and it is surely not needed here. It just adds complexity.

If we create the normal Jan-Dec Fiscal Year for 2006 also, how will we handle the assets when we go live in Oct 2006? Do we load the book value at that time or we load the book value for January 2006 and depreciate in the system for January to September

The ordinary way is to load fixed assets which exist on September 30 (if you go live with AA module on October 1) with trans. AS91.
- First, you need to set in configuration that the last closed fiscal year for legacy data upload is 31.12.2005 and the last period for depreciation will be 9/2006. (Do it in IMG: Financial accounting - Asset accounting - Asset data transfer - Parameters for data transfer - Date specifications)

Within trans. AS91, you enter the following values:
- acquisition value and accummulated depreciation as of 01 January 2006
- all asset movements (acquisitions, retirements, but not ordinary depreciations) between January 1 and September 30 with their respective dates
- already posted depreciation in 2006 until September 30

Then you enter GL movements per month (either you temporarily change the asset reconciliation accounts for direct booking with trans. OAMK, then book with FB01 and finally reset with OAK5, or you book there directly with trans. OASV). This way, your asset accounts (acquisition value and accummulated depreciation) are the same as asset module as of September 30.

You can also let the system recalculate the depreciation from the beginning of the year, but then you may end up with a different value as of September 30 than your legacy system calculated. So, I would not recommend it unless there is no reliable source data. 
read more...

Process Fixed Asset Depreciation | Forecast | Financial Modules | FICO SAP

Every asset transaction immediately causes a change of the forecasted depreciation. However, it does not immediately cause an update of the depreciation and value adjustment accounts for the balance sheet and profit and loss statements. The planned depreciation is posted to the general ledger when you run the periodic depreciation posting run. This posting run uses a batch input session to post the planned depreciation for each posting level for each individual asset as a lump sum amount.

The calculation and scheduling of depreciation, interest and revaluation are automatically controlled by keys in the system, or you can control them manually using a special posting transaction. In both cases, planned depreciation from Asset Accounting must be periodically posted to the corresponding asset and expense accounts of the general ledger. You carry out this posting using a batch input session. In addition to the various depreciation types, interest and revaluation, this batch input session also posts the allocation and writing off of special reserves.

When the system posts depreciation, it creates collective documents. It does not create separate documents for each asset.

Depreciation Posting Run is done via transaction code 'AFAB'.

The program creates batch input sessions for posting depreciation and interest to the G/L accounts in Financial Accounting and/or to Controlling.

Fields Description :-

Company code  : Your Company Code

Fiscal Year   : Your fiscal year

Posting period : Your depreciation period

Reason for posting run (choose one)

Planned posting run  : X (default)

List assets : (tick if you want to see the detail)

Test run : (tick if you run in test mode else untick for production run)

Main asset number : (you can specify certain asset number if you click repeat run or test run)

Note :
Click the execute button if this is a test run.
Click the menu bar -> Program -> Execute in background if this is a production run.

You should get this message :
Background job was scheduled for program RABUCH00 and print out the output.

Release and Process the Batch Input Session in transaction code 'SM35'.

Process Session RABUCH00
X - Display errors only
Additional functions
X - Dynpro standard size

Click the Process button

If there is error, the system will pop up the error message.

Correct the error and recreate the session in transaction 'AFBD'.
read more...

7.11.2010

PP - Controlling data for your Bill of Materials

You define the default values for BOM in OS28. - Based quantity - BOM Status - Size Unit - Var-size item unit You control the Material type allowed for the BOM header in transaction OS24. In transaction OS27, you define the central settings for your BOM management system. This are one-time settings for BOM management, which should not be change after production.

Low date When you create or process BOMs, the default date is the date defined in your system as the earliest processing date (01/01/1900 in the standard system). BOM validity maintenance Tick if want the user to specify a valid-from date when maintaining BOMs. If not tick the BOM created as of the current date or the system low date (1/1/1990). EC management active Tick if you want to make historical changes to BOMs with reference to a change number. (This means that the status of the BOM both before and after the change is stored in the system.) In this step, you only specify whether engineering change management can be used for maintaining bills of material. In transaction OS25, Configure history requirement for BOMs, you define whether you want to make the use of engineering change management a requirement in certain cases. Hist. reqmt variant Use this indicator to control when history requirement applies to new variants or alternatives in a BOM group. Sub-item documentn You use the Sub-item documentation indicator to define whether changes to sub-items are documented. Header Create BOM header with parameter validity TECHINCAL TYPE Mult. BOM inactive Tick if no multiple BOMs can be maintained in this R/3 system. Variant BOM inactive Tick if no variant BOMs can be maintained in this R/3 system BILL OF MATERIAL ITEM BOM item explosion type If you create a BOM item with reference to a change number and change the valid-from date (in the change header or alternative date), then this can change the sequence of validity periods of a BOM item. The indicator BOM item explosion type specifies whether and according to what rules, the system determines a unique change status, when you display, evaluate or change a BOM to a date in the overlap period. Description variable-sized item This indicator controls which text is displayed in BOM processing for a variable-sized item. Repeated effectivity via external item ID This indicator ensures that an item that already exists under an external item ID can be used. General settings Unit 'piece' In the standard system, this field contains a unit of measure for "piece". You can change this unit. This unit is the base unit of measure (BOM header) or the component unit of measure. Base unit of measure for: Equipment BOM Functional location BOM Document structure Standard BOM Component unit of measure for: Text item Document item Non-stock item without material master record CAD active If you want to maintain BOMs from a CAD system, set this indicator. This activates an additional field in the BOM header and BOM item, which tells you whether the BOM header or BOM item was maintained from a CAD system. If you deactivate engineering change management, changes to bills of material are not recorded. The modification parameters defined here apply to all BOM categories. The following settings are made in the standard R/3 System: 1. Validity date maintenance and engineering change management are active. 2. The current system date is the default valid-from date. 3. CAD is active. 4. Explosion type for BOM item: blank.
read more...

When is a Material BOM Not Exploded?

A BOM is not exploded in the following situations:

- No BOM is effective:
-- On the explosion date and in the given area of validity For the given effectivity parameters

- The BOM has a deletion indicator.

- The BOM is a multiple BOM, and has no alternative that matches the lot size for your required quantity.

- No BOM matches the selection criteria of the BOM application you selected.

- This is possible in the following situations, for example:

-- The application does not take all BOM usages into account.
For example, the application only takes BOMs that are relevant to production into account, so a BOM that is relevant to sales and distribution is not exploded.

-- The application selects a specific alternative on the explosion date you require. The material master record supports alternative determination by Explosion date.
If the specified alternative is not valid on the explosion date, the BOM is not exploded.

-- The application takes production versions in the material master record into account, but no production version has a BOM that is valid on the explosion date you require. The material master record supports alternative determination by Production version.
The system only explodes the BOM defined for the production version that matches the alternative and/or usage entered on the explosion date required.

-- The application only takes BOMs with certain status indicators into account.
For example, the application for MRP only explodes BOMs that have at least the status Explosion for MRP.

Further checks:
- Do the proper Scheduling in Routing (Backward/forward). In md61 give the requirement in next month.check your in-house production, planned delivery time in md02 give MRP Control parameter Rexplode BOM and Routing.

- Check BOM explosion data in MRP4 view of material master view ( Individual/Coll data).
read more...

How to link BOM component to storage location? | SAP Production Systems

If you have to issue a component for production order of main item always from a specific storage location (component is stored in multiple storage locations but for production of a top item reservations should be created only on a specific storage loc), where can you provide the link between BOM component and storage Loc??

Is it possible to provide that link in BOM? or while allocating BOM components to routing operations or else where?

You can use the issue storage location field on the MRP 2 screen in the material master

or

You have 3 ways of doing it - not including the material master since the components are stored in multiple locations.

1. BOM item - very flexible but very time consuming to maintain if you have lots of BOM's. In CS02 you can set st. loc. on each component, and SAP will take this st. loc. first.

2. from level above - you can set it up so that whatever st. loc. is the default prod. st. loc on the material master for the level above will be the issue st. loc for the components you choose, if the component exists in that st. loc. - kind of a champagne waterfall effect. If the st. loc. is not maintained on the component, it will take the material master default of the component.

3. using supply area and work center. create supply areas and link them to st. loc's. - then link the supply area to the work center on CR02. Then allocate components to operations going through those work centers.

Note:
Supply Areas are meant to be used in conjunction with Kanban. However you can just use them to link the work center to a storage location. You will never see an inventory balance in MMBE in a supply area. With Kanban you can set up automatic triggers to replenish stock to the supply areas from a main stock location.
read more...

SAP QM in Procurement - An Introduction

The QM component is integrated in crucial phases of the procurement process. It supports the

procurement activities by means of functions such as:

    * Vendor Evaluation
    * Vendor block
    * Vendor Release for requests for quotation and purchase orders
    * Assigning technical delivery terms and quality assurance agreements
    * Certificate processing
    * Status administration of the supply relationships
    * Incoming inspections
    * Goods receipt inspections


If your company purchases materials from external vendors, you can implement the QM in Procurement (QM-PT-RP-PRC) component to support your procurement processes for quality assurance purposes.

If you want to implement the QM in Procurement component, your company must also use the Purchasing (MM-PUR) component. If you require functions for processing goods movements, you must also install the Inventory Management (MM-IM) component.

You can implement the QM in Procurement component as a stand-alone component or together with the Quality Inspection (QM-IM) component. As a stand-alone component, you can use all procurement functions except those for processing goods receipt inspections. To process such inspections, you need the Quality Inspection component. Using the functions of the QM in Procurement component, you can:

  • Manage quality-related information for materials, vendors, and manufacturers in quality info records
  • Release or block vendors and manufacturers
  • Monitor the QM systems of vendors and manufacturers
  • Supply quality documents with requests for quotations and purchase orders
  • Evaluate vendors on the basis of quality
  • Certify vendors or manufacturers that have QM systems implemented, to reduce the inspection requirement
  • Manage and release supply relationships
  • Request that quality certificates be submitted with the delivered goods and monitor the receipt of these certificates
  • Inspect vendor goods at vendor sites (source inspections)
  • Inspect vendor goods upon receipt (goods receipt inspections)
  • Manage the posted goods in inspection stock
  • Block the payment of invoices until the goods have been inspected and accepted
  • Process goods receipt inspections for manufacturer-specific materials
  • Inspect goods that have been externally processed when they are returned in a goods receipt

read more...