Item category determination

1. On sales document:

Document type

+

Item category group

+

Usage

+

High level Item Category

2. On delivery document:

    it is copied from sales document

or

    Delivery Document type

+

Item category Group

+

Usage

+

High level Item Category

Iterm categories in SAP SD

This SAP SD functionality is providing us possibility to consider and process same material in different way. Regarding our business process, we can use one material as a relevant for delivery/billing whereas other material can be used only as a text element on documents.

SAP system provide large number of standard item categories. If they are not suitable for our business process we can create Z item categories and adjust them to our need.

Important item categories are:

AFN – Inquiry

AGN – Quotation                           

TAN – Standard order                               STANDARD ITEM CATEGORIES

REN – Returns order

G2N – Credit memo

L2N – Debit memo

AFNN – free item inquiry

AGNN – free item quotation                           FREE OF CHARGE ITEM CATEGORIES

TANN – free item sales order

AFTX – free item inquiry

AGTX – free item quotation                            TEXT ITEM CATEGORIES

TATX – text item in order

SPRO location for defining item categories is: 

And it provide us with large set of possible customizing options:

1. Item type – functionality which define how item category behave in sales document(for delivery, pricing, tax…).

Possible values are: standard item, value item, text item, packaging item, material not relevant, packaging item.

2. Completion rule – in this field we define conditions which must be fulfilled in order to complete item on sales document.

Possible values are:

               Not relevant for completion

A             Item is completed with the first reference

B             Item is completed after full quantity has been referenced

C             Item is completed after the target qty is fully referenced

D            Item is referenced via contract release

E             Item is completed after full target value is referenced

3. Special stock – If you need to separately manage certain stock (for example, consignment stock) of a material, the stock type in question is defined using this indicator.

4. Billing relevance – it determine if billing will be related to order or delivery.

5. Billing plan type – it determines how billing is done on billing dates. Possible values are:

  • Periodic billing –  whole amount will be billed on each billing plan date
  • Milestone billing – amount will be billed on individual billing plan dates as a fix amount or percentage of amount

6. Billing block – system can automatically propose billing block which can be removed manually.

7. Pricing – with value X system will automatically carry out pricing. On other hand for text items system do not need to carry out pricing and this field should stay blank.

8. Statistical value – if there is a need to copy item values to header level we will use blank. Otherwise, No cumulation options should be used

9 – Business item – If this option is checked, that means we allowed item data to be different that header data. For example, payment terms can be different on item level.

10. Sched.Line Allowed – it depends on business process we want to customize. This option should be checked if in our process we have items that should be delivered. Otherwise, if we have text items or items at credit memo request we do not need to check this option.

11. Item Relev.for Dlv – if we need text or value item on delivery this option should be checked. That means item will be copied from sales order to delivery but just as a information, not item for delivery purposes.

12. Returns –  if our item/process is return item, this option should be checked.

13. Relevant for weight/volume – by checking this option we say that system should calculate weight and volume of our item.

14. Credit active – if credit control should be done this option must be checked.

15. Determine Cost – when this option/requirement is checked system calculate cost by applying appropriate condition type.

1. Automatic batch determination – if you enter material which is handled in batches on sales document and that material got item category which has this indicator, system will atomatically determine batch which align with customer’s requirements.

2. Rounding permitted – if this option is checked rounding quantity values in sales order is permitted.

First, rounding is defined in rounding profile and these profiles can be assigned in material master or customer-material info record.

3. Order qty = 1 – we can limit order quantity for every item to 1.

4. RBA control – in this field we control if SAP APO can proceed with a rules based ATP check (RBA) for all items which have our item category and how substitutions are handled by RBA.

1. Incompletion Proced. – this field is used to assign incompletion procedure. Incompletion procedure is used to check relevant fields and if they are not fulfilled system will pop up them in incompletion log.

2. PartnerDetermProced. – you can define partner determination procedure on customer master record, sales document type and item category.

First system checks customer master and if there is a defined partner procedure system will assign that procedure to sales document. If not system will check other two places (sales document type and item category) and assign partner determination procedure from data entered there.

3. TextrdetermProcedure – they are defined in VOTXN transaction and assigned to item level.

4. Item Cat.Stats.Group – used in Logistics information system to determine which data will be updated.

5. Screen Weq. Grp – determine which screen will be visible in concrete transaction. You can make difference between for example inquiry and sales order transaction.

6. Status profile – there are systems and user defined statuses. We cannot change or enhance anything related to system statuses but we can create our own statuses based on our processes. Status profiles are defined in OK02 and can be assigned to document type or item category.

7. Create PO Automatic. – depending on your business scenario, if you check this option system will create purchase requisition and order when you save sales order.

1. Config. Strategy – with this functionality you can set a group of controls in one strategy and these controls can be done automatically or during configuration.

2. Mat. Variant Action – define how system will react in situation when existing configuration is used as a stockable type.

3. ATP material variant – Specifies whether the system should run an ATP check for the material variants.

4. Structure scope – with this option we decide how BOM is processed in a sales order.

5. Application – is used as a determination of alternatives in the different organizational areas within a company.

1. Value contract matl – material entered here is used and copied to value contract item. This material is used as a value contract item control for concepts derived from material master (statistical updates, divisions…).

2. Contract Release Ctrl – how system will react when value of order extends target value of value contract item. Possible options are:

•´ ´ No response if target value is exceeded

•A   Warning if target value is exceeded

•B   Error message if target value is exceeded

•C   First time target value is exceeded, permitted with warning

•D   As for ‘A’ but value contract is not blocked

1. Repair procedure – important customizing task for sub-items. Here you can assign repair procedure which handles how sub-items are created in repair orders.

Every repair procedure consists of stages(registration, technical analysis…) and actions(repairing, replacement…).

Item category determination is explained here.

How to add new field in field catalog / pricing condition table

Depending on your need you can add new field in:

1. KOMK communication structure – fields at header level

2. KOMP communication structure – fields at item level

KOMG structure include both previously mentioned structures.

Step 1: in transaction SE11, open KOMPAZ structure and after that find appropriate Z append where you want to add new field. In our case we will do a double click on ZTV_KOMPAZ append and inside it add new field:

Our newly created field is:

Field name: zz_cond_text

Data element: LTEXT72

Domain: TEXT72


Finally we will activate our ztv_kompaz structure and kompaz.

Step 2: Newly created field must be added to field catalog. SPRO path is:

Sales and Distribution à Basic Functions à Pricing à Pricing Control à  Define Condition Tables àConditions: Allowed fields

Step 3: Create condition table. SPRO location is:

Sales and Distribution à Basic Functions à Pricing à Pricing Control à  Define Condition Tables àCreate condition tables

In order to create new table on next screen we must assign table number and press enter:

System will open new screen with all available fields on right part. We need to find our newly created field an double click in order to select it. After selecting all needed fields press generate button.

Step 4: Depending on a field purpose (header or item level) we need to implement code for that field in include:  MV45AFZZ, user exit:

  • USEREXIT_PRICING_PREPARE_TKOMK
  • USEREXIT_PRICING_PREPARE_TKOMP

Example of code: MOVE MATA-MTART to KOMP-MTART

Listing and exclusion in SAP SD

Listing and exclusions is used on sales order documents to control which materials should(listing, inclusion) or should not be sold to customers(exclusion).

Before you create combinations for listing and exclusions it is mandatory to finish some customizing activities.

First, we need to go to SPRO on next location:

Customizing activity 1:

These are standard defined condition types:

You can create your own Z types for your purposes.

In field AS you put access sequence defined in menu item:

For access sequence you need to create one or more access records:

Access data depends on condition table and fields defined in that table. In standard one we use Customer/Material and condition table 001.

Fields menu item is like on picture bellow:

If you want to create different conditions for listing and exclusion you can create your own condition table and use different fields. Customizing can be done on next two SPRO items:

Next step is to maintain Procedure:

You can use standard ones like in picture bellow or create your own procedures:

For every procedure you need to create steps and assigne them condition types:

Condition types are defined previously on meny item:

Last step in customizing is to assign listing and exclusion procedures to your sales document types.

For example, J3AS document type have A00001 procedure for listing and B00001 procedure assigned for exclusion.

After these customizing activities we can go to trasactions:

and create, for example, one exclustion record.

On selection screen we choose exclusion procedure:

and press enter. System will open available key combinations for selected exclusion procedure B001.

Press Enter and on next screen you can input customer, validity period for exclusion and list of materials for which you want to be excluded.

How to create BP in SAP (customer, vendor…)

In S4/HANA business partner concept is used to gather all relevant parties (customer and vendor transactions, employees, organizational units…) involved in business transactions with or within our company, under one master data concept. All of them are opened as a Business partner.

BP tcode is used for all operations on business partners – create/modify/view business partners.

User can choose between three options in order to create business partner:

              a. Person

              b. Organization

              c. Group

Step 1: In our case we will create BP-Organization. Press Organization button.

Firstly, we will create general business partner – role Business Partner (Gen.).

Choose BP grouping which determines our internal classification of our business partners. BP number range is defined by BP grouping. For example, grouping can be: domestic-main, domestic-others, finance institutions, state institutions…

Next we want to fulfill basic data under General business partner role and data are:

1. Tab Address, field Name

2. Tab Address, field Search term

3. Tab Address, section Standard address

4. Tab Address, section Communication

These data are basic ones. After that we need to save our BP and system will give us BP number:

Step 2: For same business partner create new role FLCU00 FI Customer. First, press edit button:

After that choose BR role: FLCU00 FI Customer and press Create on pop up window:

For this role we need to enter next data:

1. Tab Identification, field External BP Number – that can be a business partner number from one of company’s legacy systems.

2. Tab Status, archiving and locking data:

Here you can mark your BP if it needs to be blocked or marked as archieved.

Step 3: Enter Company code data by clicking on company code button:

Choose company code for which you want to enter data and press enter:

You shoud fulfill next data:

1. Tab Customer: Account Management, field Reconciliation acct – Reconciliation accounts are G/L accounts to which postings are made automatically whenever a business transaction is entered on a subledger account

2. Tab Customer: Payment Transactions, field Payment terms

3. Tab Customer: Status, posting block and deletion blocks

Step 4: Create BP with new business role FLCU01 Customer. Choose FLCU01 Customer in BP role dropdown menu and press Create:

Press Sales and Distribution button in order to fulfill SD related data to our BP:

First important data to enter is Sales area:

you can enter specific sales area or choose it by clicking on button Sales areas. You can choose it only if you previously created BP sales and distribution data for that sales area.

When you enter sales area press enter in order to open fields bellow.

You need to enter:

1. Tab Orders, field Sales district – geographically defined area for sales activities.

2. Tab Orders, Customer group – Identifies a particular group of customers (for example, wholesale or retail) for pricing or generating statistics.

3. Tab Orders, Currency – here we can enter primary currency but it can be changed on sales documents.

4. Tab Orders, Price group – A group of customers with same pricing requirements

5. Tab Orders, pricing procedure – Determines which pricing procedure the system should apply when you create a sales document for the customer.

6. Tab Shipping, field Delivery priority – from this plant goods will be delivered to our customer

7. Tab Shipping, field Order Combination – Indicates whether you are allowed to combine orders during delivery processing

8. Tab Shippjng, field Delivery plant – shipping strategy for delivering goods to the customer. If this field stayed blank it will be determined from material master.

9. Tab Shippjng, field POD-relevant – This indicator controls proof of delivery (POD) processing

10. Tab Shipping, field POD-timeframe – Time period in days in which a proof of delivery is expected from the recipient

11. Tab Shipping, Partial delivery section – with this options we decide if order is delivered in a single delivery or partially

12. Tab Billing, field Invoicing dates – represent calendar which is important to schedule of billing dates for the customer.

13. Tab Billing, field Incoterms – Internationally used trading terms that comply with the standards established by the (ICC). This data can be entered directly on sales document if this field stay blank.

14. Tab Billing, field Incoterms location

15. Tab Billing, field Payment terms – important data which reflects on due date. This data can be entered directly on sales document if this field stay blank.

16. Tab Billing, field Account Assignment Group – Combination of account assignment group from material master and customer reflects on income code from chart of accounts.

17. Tab Billing, field Tax classification – Specifies the tax liability of the customer.

18. Tab Partner functions – enter all relevant partner functions in this tab or directly on sales document.

19. Tab Additional data – Enter customer groups which specifies a customer-defined group of customers.

20. Tab Status – in this section you can enter blocking indicatiors for sales, delivery or billing document. Also you can mark this master record for specific sales area for deletion.

PP/DS – PM integration (downtimes)

For production planning and scheduling it is crucial to include downtime hours. Usually, downtime hours are preventive maintenance hours or equipment failures. Beside that, problems with working force or material availability can have influence on downtime hours but these situations can be solved with other PP/DS functionalities.

Integration prerequisites:

  1. Basic plant maintenance customizing and master data
    1. PM order customizing
    1. Master data
      1. Function location
      1. Equipment
      1. PM work center
  2. Assign production work center to PM equipment or function location

3. Create PM order with function location/equiplement on which you assigned PP work center. Also, we need to populate SystCond. field on PM order with value 0 – not in operation.

4. In PM order operation tab enter operation and duration times

Check downtime/PM orders on resource:

You can see PM orders in tcode /SAPAPO/RES01, tab Downtimes.

Check downtime in detail scheduling planning board:

Transaction for detail scheduling is: /SAPAPO/CDPS0. On selection screen enter planning version, planning period and resources/products.

Create downtime manually in resource master data

Go to /SAPAPO/RES01 transaction, enter your resource/work center and press execute on selection screen. Next, go to Downtime tab and enter these data:

You can enter short description and final step is to save. If you go to detail scheduling board you will see dark grey square on date 23.06.2022 between 10 and 12am.

How to create SD condition table (tcode VK11/VK12/VK13)

Step 1. Process before creating condition table is to see if you need any additional fields which are not included in existing field catalog. How to create new field and include it in field catalog is described here.

Step 2. Create condition table in SPRO location (or tcode VOK0):

then

double click on fields on right side if you want to add them to your newly created table:

last step is to activate table.

Step 3. After table creation there is a process of creating condition types and after that making a link between condition type and condition tables based on functionality called access sequence. First we will create condition type in SPRO location:

and after that we need to create access sequence in SPRO location:

You can create new access (relevant for pricing) based on copying existing one or by choosing New entries:

Select access sequence and in meny press Accesses. Then press New entries button to assign your condition table:

If there is additional condition for this access you can choose or implement requerement on this access.

Also if you check Exclusive option, that means that system will stop searching for new access sequences if this one is fulfilled.

After finishing with accesses customizing select row and press Fields in left menu:

System will show all fields from your condition table and in this screen you can manipulate with them and defini which of them will be used(ATyp) in access, with which value(Spec.Val.Source) and how (priority).

How to add Z field to IW38

If you want to add newly created Z field to IW38 alv report list follow theese steps:

Step 1: Add new field to CI_AUFK structure. Go to SE11 tcode, enter CI_AUFK in Data type field and press Change button:

Step 2: At the end of list enter your field and assing data element for your field:

Step 3: Activate CI_AUFK structure. Click on Activate button in tool bar.

Step 4: Go to SMOD transaction, enhancement IWO10018 and press Test button:

Step 5: Double click on first function exit:

and on next screen double click on:

In editor you need to type this kind of code for your field:

MOVE SAP_CAUFVD_IMP-ZZPSP2TEXT TO CI_AUFK-ZZPSP2TEXT.

and at the end this line:


MOVE-CORRESPONDING COCI_AUFK_IMP TO AUFK.

Last step is to activate!

Step 6: Go back and double click on second function exit:

and on next screen double click on:

In editor add this line of code for your field name:

MOVE CI_AUFK-ZZPSP2TEXT TO COCI_AUFK_EXP-ZZPSP2TEXT.

Activate and go back.

Step 7: Next step is to add same field to RIHAUFK_LIST structure. Go to SE11 tcode, press RIHAUFK_LIST in Data type field and press display:

IF there is any Z append you can add field into it or you can create new append:

In our case we have Z append structure:

and we will do a double click on ZRIHAUFK_LIST. Inside we can see all Z fields which are added to list. We will go to the end of list, press change button and add our Z field name and data element:

Last step is to activate append structure.

Step 8: With previous steps we created and added field to IW38 structure. Last step is to create abap logic for our  field. We can do it in program:

Press Display and go to code line:

ENHANCEMENT-SECTION     riaufk20_23 SPOTS es_riaufk20.

Double click on riaufk20_23 and go to Enhancem. Implementations tab.

If you find Z enhancement point you can check it and implement your code there.

If not you need to create your enhancement point. You need to display same program RIAUFK20 in SE38 tcode. Press Edit, then Enhancement Operations and finally Show implicit enhancement options:

Then go to the RIAUFK20_10 enhancement point and create your Z enhancement point. Fist press Enhance button in tool bar and click on line where you want to implement enhancement point:

and press button create:

Choose Code:

and implement your code inside this enhancement point.

For my Z field code is:

DATA: index TYPE i,
      lv_tplnr LIKE viaufks-tplnr.
CLEAR: index, lv_tplnr.
  LOOP AT object_tab.
    index = sy-tabix.

      SELECT SINGLE tplnr
      FROM viaufks
      INTO lv_tplnr
      WHERE aufnr = object_tab-aufnr.
        IF sy-subrc = 0.
          SELECT SINGLE ZZITO_PSP2 ZZITO_PSP2TEXT
          FROM iflot
          INTO (object_tab-zzpsp2, object_tab-zzpsp2text )
          WHERE tplnr = lv_tplnr.
        ENDIF.

            MODIFY OBJECT_TAB INDEX index.
        CLEAR: lv_tplnr.
  ENDLOOP.

Step 9: We have finished all tasks and that means that we can see our field and data in IW38 report. Go to IW38, enter selection options input parameters, execute and in ALV list add field to your variant.

Create custom number range – SNRO transaction

If you need custom number range in your Z programs (example: sales documents generation, counter for other documents…), it can be done through SAP tcode SNRO(number range).  

Step 1: Go to SNRO transaction

Step 2: Enter a name for your custom number range and press Create button

Step 3: Enter number range short text(1. on picture bellow) and long text(2. on picture bellow).

Then you need to set domain for your number object(3. on picture bellow). It means to define number lenght for your interval. In our example we have contracts and because of that we use EBELN domain. We could use NUMC10 data element also for contracts.

% warning field(4. on picture) is used to set a parameter which will be used to warn us if number range extend percentage we put in this field. If you put 10% and number range is between 1 and 100, system will warn you at 90.

No rolling field(5. on picture) – if this field is checked number range will not start from the beggining if it comes to the end first time.

Step 4: In customizing tab you can enter a transaction from which your number range can be called directly.

Step 5: Next we need to create number range by clicking on button:

Then we click on:

We can define first range 01, from 1 to 9999.

If we want to create next rage we can do it by clicking on:

and now we can enter range 02, from 10000 to 19999:

Last step is to Save ranges and go back to save whole range. Then system will ask to store a range in request.

Step 6: We can test our range using a BAPI – NUMBER_GET_NEXT.

We need to enter one of our ranges(01 or 02) in field NR_RANGE_NR, enter a number range name in field OBJECT (ZCONTRACTS) and quantity which means how many numbers we want to generate using BAPI and from our range.  

When we press execute we will get first available number from our range:

Same bapi we can use in our code in order to ger numbers from our ranges.