USEREXIT_SAVE_DOCUMENT_PREPARE
Author Archives: jiteshdua
Product Hierarchy
Tcodes – OVSV, V/76
Define Product Hierarchies
In this step, you define product hierarchies which you can use for statistical analysis or pricing, for example, or you can change their structure. The product hierarchy groups materials by combining different characteristics. Each characteristic is represented by a specific product hierarchy level.
Example
A product hierarchy can be structured as follows:
-
- Level Example Description
-
- 1 00001 Electrical appliances
-
- 2 00002 Household appliances
-
- 3 00000003 Wet appliances
In this example, a dishwasher belongs to product hierarchy 000010000200000003.
Standard settings
In the standard system, the product hierarchy consists of up to 3 levels. The first and second levels have 5 digits and the third level has 8. The maximum number of digits is 18 and the maximum number of levels is 9.
You can define hierarchy nodes at the individual levels of the product hierarchy.
From the initial screen you can branch to the following steps:
- Product hierarchy structure
- In the Data Dictionary, you can change the structure of the product hierarchy (e.g. the number of levels).
- Data entry/display
- Here you define the display of the product hierarchy and the format of the accompanying text.
- Product hierarchy
- Here you define your product hierarchies.
- Field catalog for pricing
- Here you make fields of the product hierarchy structure available for use in pricing.
- Field catalog for the Logistics Information System
- Here you make fields of the product hierarchy structure available for use in the Logistics Information System.
Actions concerning the product hierarchy structure
Structuring the product hierarchy
The product hierarchy can be structured via DDIC structure PRODHS. In the standard system, a product hierarchy can be created with up to three levels. The individual levels can contain the following number of digits:
Level number of allowed digits
1 5
2 5
3 8
This can be changed as of Release 3.0, where it is possible to extend the maximum number of levels to 9.
If you want to change the standard setting of PRODHS, e.g. you want to change the number of levels, proceed as follows:
- 1. Create an appropriate domain in the Data Dictionary (type CHAR with the required length).
- 2. Assign these domains to the standard data elements PRODH1, PRODH2, …, PRODH9.
- Please note that you should use these standard data elements.
- 3. Change the structure PRODHS by creating or deleting fields with reference to the data elements.
- Choose ZZPRODHN as field name, where n is the position of the field in the structure PRODHS.
Example
You want to change the structure of the product hierarchy from 5/5/8 digits to 5/5/5/3. Proceed as follows:
Create the following domains:
ZPRODH3 with length 5, category CHAR,
ZPRODH4 with length 3, category CHAR,
Change structure PRODHS:
-
- Strucutre PRODHS in the standard system:
-
- Structure Fields Data element Category Length
-
- PRODHS ->
-
- PRODH1 PRODH1 CHAR 5
-
- PRODH2 PRODH2 CHAR 5
-
- PRODH3 PRODH3 CHAR 8
-
- Changes according to example:
-
- Structure Fields Data element Category Length
-
- PRODHS ->
-
- PRODH1 PRODH1 CHAR 5
-
- PRODH2 PRODH2 CHAR 5
-
- PRODH3 PRODH3 CHAR 5
-
- ZZPRODH4 PRODH4 CHAR 3
Note
The structure PRODHS and the data elements PRODH1, …, PRODH9 are only provided by SAP with Release 3.0 and can be changed by the customer from this point onwards.
Conversion routines for INPUT/OUTPUT
The product hierarchy can be assigned to a conversion routine. The name of the conversion routine is PRODH. The output template can be defined in Customizing (see below).
The separators used in the template are not allowed for maintaining the product hierarchy nodes.
Example:
If the template is _____/_____/__________
The symbol “/” cannot be used when maintaining the product hierarchy nodes. In this case, the following entry would not be allowed: 123456/79012345678
Text concatenation
The description of a product hierarchy can be determined via concatenation, if required.
Proceed as follows:
- 1. Determine the node preceding the current node
- 2. Concatenate the description of the subsequent node with the description from the preceding node.
The text concatenation is valid for the entire product hierarchy, the concatenated text has a length of 20. Text concatenation can be activated/deactivated in Customizing (see below).
Note
Make sure during text concatenation that the text of the product hierarchy does not come from table T179T. In this case function module RV_PRODUKTHIERARCHIE_TEXT_GET is available.
Allowed symbols for product hierarchy nodes
If you have stored a template for the conversion routine, the separators in the template are not allowed.
Actions concerning data entry/display
You can make two settings regarding the layout of the product hierarchy and the format of the product hierarchy text:
- 1. Enter a template for displaying the product hierarchy. This template defines the length of the individual levels and the separators.
- Note that the character used to separate the levels in the template cannot be used in the product hierarchy nodes.
- 2. The description of a product hierarchy node can be determined by concatenation if required.
- If you activate text concatenation, the text for one level is added to the description of the higher level and then output. The text of the first level appears at the beginning followed by the text of the second and third levels. Text concatenation applies to the complete product hierarchy. The concatenated text can have a maximum of 20 characters.
- Do not activate text concatenation if you only want to issue the description of the hierarchy levels created for these levels when the product hierarchy was defined.
Actions concerning the product hierarchy
The product hierarchy can be freely defined and include up to three levels. The SAP System checks the entry in the field product hierarchy during master data maintenance and copies it to the SD document. The separators used in the template cannot be used in the product hierarchy.
Note
Via a matchcode you can search specifically for material master records with a product hierarchy.
Analyze the product hierarchies in your organization and define their representation in the SAP System.
- 1. Assign a characteristic value to the individual levels of your product hierarchy: a 5-character value to levels 1 and 2, and an 8-character value to level 3. The level number is determined automatically.
- A product hierarchy node encompasses a characteristic value of a maximum of 18 characters.
- 2. Enter a description for the product hierarchy.
Actions concerning the field catalog for pricing
The product hierarchy can be used for functions in pricing. Then the fields of the product hierarchy structure must be entered into the field catalog for pricing.
Enter the fields of the product hierarchy in the field catalog.
Actions concerning the field catalog for Logistics Controlling
The product hierarchy can be used for statistical analyses in the Logistics Information System. The fields of the product hierarchy structure must then be entered in a field catalog for the Logistics Information System.
Enter the product hierarchy in a field catalog. You can refer to field catalog ‘VPHI’, which displays the standard settings.
*Courtsey – SAP help
How Pricing flows
1. The system determines the pricing procedure according to information defined in the sales
document type and the customer master record.
2. The pricing procedure defines the valid condition types and the sequence in which they
appear in the sales order. In the example, the system takes the first condition type (PR00) in
the pricing procedure and begins the search for a valid condition record.
3. Each condition type in the pricing procedure can have an access sequence assigned to it. In
this case, the system uses access sequence PR00. The system checks the accesses until it
finds a valid condition record. (Although you cannot see this in the diagram, each access
specifies a particular condition table. The table provides the key with which the system
searches for records).
4. In the example, the first access (searching for a customer-specific material price) is
unsuccessful. The system moves on to the next access and finds a valid record.
5. The system determines the price according to information stored in the condition record. If a
pricing scale exists, the system calculates the appropriate price. In the example, the sales
order item is for 120 pieces of the material. Using the scale price that applies to quantities
from 100 pieces and more, the system determines a price of USD 99 per piece.
The system repeats this process for each condition type in the pricing procedure determines a
final price.
One Line Item per invoice
There is a standard routine provided by SAP for this. We just need to assign routine 6 at (copy control delivery to billing) data transfer VBRK/VBRP and maintain TVKO_MAXBI (Max no. of line items in invoice) = 1.
Purpose
This is an example of a data transfer routine. FORM routines for data transfer allow you to fine tune the transferred fields during the copying process. This requirement is used to limit the number of line items allowed in any single billing document.
Example
In some countries there are government regulations that state that there is a limit as to the maximum number of lines that can be in any single invoice document. In order to insure that this regulation is adhered to, this requirement can be assigned to the billing item category and the appropriate limits maintained in configuration.
Procedure – Define a max number of line items in the IMG and then force an automatic split based on this using a copy control routine, email me if you have any problems, details are below.
IMG
Sales & Distribution>Billing>Billing Documents>Country Specific Features>Maintain Maximum Number of Billing Items
Enter the country code creating billng document and the Max allowed number of billing items (note problem is on the FI side so I’d advise 450 items or less).
In the copy control routine from your Delivery Doc or Sales Doc to your billing type at item category level enter the following code to force a split based on the max number of items you’ve defined. Adjust to suit any other internal requirements. This is SAP standard and works fine.
*———————————————————————*
* Data transfer for delivery related billing *
*———————————————————————*
*———————————————————————*
* FORM DATEN_KOPIEREN_633 *
*———————————————————————*
* —> VBAK Order header KUAGV View Sold-to *
* VBAP Order item KURGV View Payer *
* VBKD Business data order KUREV View Bill-to *
* LIKP Delivery header KUWEV View Ship-to *
* LIPS Delivery item *
*———————————————————————*
DATA: BEGIN OF ZUK2,
MODUL(3) VALUE ‘006’,
VTWEG LIKE VBAK-VTWEG,
SPART LIKE VBAK-SPART,
VGBEL LIKE VBRP-VGBEL,
BILLNO LIKE TVKO-MAXBI,
END OF ZUK2.
DATA: BEGIN OF J_1B_SIZE_SPLIT2 OCCURS 0,
KUNRG LIKE VBRK-KUNRG,
KUNAG LIKE VBRK-KUNAG,
ZTERM LIKE VBRK-ZTERM.
INCLUDE STRUCTURE ZUK2.
DATA: ITEMNO LIKE TVKO-MAXBI.
DATA: END OF J_1B_SIZE_SPLIT2.
DATA: J_1B_SIZE_COPY2 LIKE J_1B_SIZE_SPLIT2.
*———————————————————————*
* FORM DATEN_KOPIEREN_633 *
*———————————————————————*
* This is a clone of routine 003. *
* It will ensure that *
* *
* — one billing document can only have one reference document *
* — the sum of item volumes will not exceed the amount *
* specified in the number of billing doc. items for the *
* sales organization (TVKO-MAXBI) *
*———————————————————————*
FORM DATEN_KOPIEREN_633.
CLEAR: VBRK-EXPKZ, VBRK-EXNUM.
VBRK-BZIRK = SPACE.
VBRK-KDGRP = SPACE.
VBRK-KONDA = SPACE.
VBRK-REGIO = SPACE.
VBRK-PLTYP = SPACE.
* If maximum number of billing items active
IF NOT TVKO-MAXBI IS INITIAL.
* Get billing doc. item number split data
READ TABLE J_1B_SIZE_SPLIT2
WITH KEY KUNRG = VBRK-KUNRG
KUNAG = VBRK-KUNAG
ZTERM = VBRK-ZTERM
VGBEL = VBRP-VGBEL.
IF SY-SUBRC <> 0.
CLEAR J_1B_SIZE_SPLIT2.
MOVE-CORRESPONDING VBRK TO J_1B_SIZE_SPLIT2.
MOVE-CORRESPONDING VBRP TO J_1B_SIZE_SPLIT2.
ENDIF.
* Check number of billing items against max. defined by tvko-maxbi
IF J_1B_SIZE_SPLIT2-ITEMNO < TVKO-MAXBI.
J_1B_SIZE_SPLIT2-ITEMNO
= J_1B_SIZE_SPLIT2-ITEMNO + 1.
ELSE.
J_1B_SIZE_SPLIT2-BILLNO
= J_1B_SIZE_SPLIT2-BILLNO + 1.
J_1B_SIZE_SPLIT2-ITEMNO = 1.
ENDIF.
* Store actual billing document counter and item counter
READ TABLE J_1B_SIZE_SPLIT2 INTO J_1B_SIZE_COPY2
WITH KEY KUNRG = VBRK-KUNRG
KUNAG = VBRK-KUNAG
ZTERM = VBRK-ZTERM
VGBEL = VBRP-VGBEL.
IF SY-SUBRC = 0.
MODIFY J_1B_SIZE_SPLIT2
TRANSPORTING ITEMNO BILLNO
WHERE KUNRG = VBRK-KUNRG
AND KUNAG = VBRK-KUNAG
AND ZTERM = VBRK-ZTERM
AND VGBEL = VBRP-VGBEL.
ELSE.
APPEND J_1B_SIZE_SPLIT2.
ENDIF.
* Add billing doc. number to split criteria
ZUK2-BILLNO = J_1B_SIZE_SPLIT2-BILLNO.
ENDIF.
* End of billing document split by number of allowed items
ZUK2-VTWEG = VBAK-VTWEG.
ZUK2-SPART = VBRP-SPART.
IF KURGV-PERFK = SPACE.
ZUK2-VGBEL = VBRP-VGBEL.
ENDIF.
VBRK-ZUKRI = ZUK2.
VBRK-KUNAG = VBRK-KUNRG.
ENDFORM.
Strategy group
SAP has predefined the following strategy groups:
- 83: Assembly processing with network, account assignment category E (assignment to sales document. A network with network type PS05 (header assignment) is created.
- 85: Assembly processing with network/project, account assignment category D (assignment to project). A network with network type PS04 (activity assignment) is created.
In both cases, the system automatically creates a network with network type PS04.
Recommendation
Do not change the default settings that SAP provides in Customizing. You can use these defaults to set up your own strategy groups, requirement types etc. and specify other network types or other settings for the availability check.
Note
- When values are missing from the sales order item, such as the plant, the system cannot determine the requirements type which means that it also cannot create a network from the sales order.
- In order to have the scheduled dates in the network be copied into the sales document as confirmed dates, you must have maintained scheduling parameters for network type PS04 and PS05 in Customizing.
Keep this in mind when you define your own network types.
- Among the scheduling parameters to be maintained, you should set the indicator reconcile basic dates.
You must set this indicator if you want the system to copy the scheduled dates into the basic dates and then pass them on to the sales order as confirmed dates.
Useful Tcodes
Customer
XD01 Create Customer (Centrally)
XD02 Change Customer (Centrally)
XD03 Display Customer (Centrally)
XD04 Customer Changes (Centrally)
XD05 Block customer (centrally)
XD06 Mark customer for deletion (centr.)
XD07 Change Customer Account Group
XD99 Customer master mass maintenance
XDN1 Maintain Number Ranges (Customer)
Vendor
XEIP Number range maintenance: EXPIMP
XK01 Create vendor (centrally)
XK02 Change vendor (centrally)
XK03 Display vendor (centrally)
XK04 Vendor Changes (Centrally)
XK05 Block Vendor (Centrally)
XK06 Mark vendor for deletion (centrally)
XK07 Change vendor account group
Sales Order
VA00 Initial Sales Menu
VA01 Create Sales Order
VA02 Change Sales Order
VA03 Display Sales Order
VA05 List of Sales Orders
VA07 Compare Sales - Purchasing (Order)
VA08 Compare Sales - Purchasing (Org.Dt.)
Inquiry
VA11 Create Inquiry
VA12 Change Inquiry
VA13 Display Inquiry
VA14L Sales Documents Blocked for Delivery
VA15 Inquiries List
Quotation
VA21 Create Quotation
VA22 Change Quotation
VA23 Display Quotation
VA25 Quotations List
VA26 Collective Processing for Quotations
Contract
VA41 Create Contract
VA42 Change Contract
VA42W Workflow for master contract
VA43 Display Contract
VA44 Actual Overhead: Sales Order
VA45 List of Contracts
VA46 Coll.Subseq.Processing f.Contracts
Item Proposal
VA51 Create Item Proposal
VA52 Change Item Proposal
VA53 Display Item Proposal
VA55 List of Item Proposals
VA88 Actual Settlement: Sales Orders
Delivery (Outbound)
VL00 Shipping
VL01 Create Delivery
VL01N Create Outbound Dlv. with Order Ref.
VL01NO Create Outbound Dlv. w/o Order Ref.
VL02 Change Outbound Delivery
VL02N Change Outbound Delivery
VL03 Display Outbound Delivery
VL03N Display Outbound Delivery
VL04 Process Delivery Due List
VL06 Delivery Monitor
VL06C List Outbound Dlvs for Confirmation
VL06D Outbound Deliveries for Distribution
VL06F General delivery list - Outb.deliv.
VL06G List of Oubound Dlvs for Goods Issue
VL06I Inbound Delivery Monitor
VL06IC Confirmation of putaway inb. deliv.
VL06ID Inbound Deliveries for Distribution
VL06IF Selection inbound deliveries
VL06IG Inbound deliveries for goods receipt
VL06IP Inbound deliveries for putaway
VL06L Outbound Deliveries to be Loaded
VL06O Outbound Delivery Monitor
VL06P List of Outbound Dlvs for Picking
VL06T List Outbound Dlvs (Trans. Planning)
VL06U List of Uncheckd Outbound Deliveries
VL08 Confirmation of Picking Request
VL09 Cancel Goods Issue for Delivery Note
VL10 Edit User-specific Delivery List
VL10A Sales Orders Due for Delivery
VL10B Purchase Orders Due for Delivery
Customer management
FD01 Create Customer (Accounting)
FD02 Change Customer (Accounting)
FD02CORE Maintain customer
FD03 Display Customer (Accounting)
FD04 Customer Changes (Accounting)
FD05 Block Customer (Accounting)
FD06 Mark Customer for Deletion (Acctng)
FD08 Confirm Customer Individually(Actng)
FD09 Confirm Customer List (Accounting)
FD10 Customer Account Balance
FD10N Customer Balance Display
FD10NA Customer Bal. Display with Worklist
FD10NET Customer Balance Display
FD11 Customer Account Analysis
FD15 Transfer customer changes: send
FD16 Transfer customer changes: receive
FD24 Credit Limit Changes
FD32 Change Customer Credit Management
FD33 Display Customer Credit Management
FD37 Credit Management Mass Change
Pricing
V/03 Create Condition Table (SD Price)
V/04 Change Condition Table (Sales pr.)
V/05 Display Condition Table: (Sales Pr.)
V/06 Condition Categories: SD Pricing
V/07 Maintain Access (Sales Price)
V/08 Conditions: Procedure for A V
V/09 Condition Types: Account Determin.
V/10 Account Determination: Access Seqnc
V/11 Conditions: Account Determin.Proced.
V/12 Account Determination: Create Table
V/13 Account Determination: Change Table
V/14 Account Determination: Display Table
BOM
CS00 BOM Menu
CS01 Create Material BOM
CS02 Change Material BOM
CS03 Display Material BOM
CS05 Change Material BOM Group
CS06 Display Material BOM Group
CS07 Allocate Material BOM to Plant
CS08 Change Material BOM - Plant Alloc.
CS09 Display Allocations to Plant
CS11 Display BOM Level by Level
CS12 Multilevel BOM
CS13 Summarized BOM
CS14 BOM Comparison
CS15 Single-Level Where-Used List
CS20 Mass Change: Initial Screen
CS21 Mass Material Change: Initial Screen
CS22 Mass Document Change: Initial Screen
CS23 Mass Class Change: Initial Screen
CS25 Archiving for BOMs
CS26 BOM deletion
CS27 Retrieval of BOMs
CS28 Archiving for BOMs
CS31 Create class BOM
CS32 Change class BOM
CS33 Display class BOM
CS40 Create Link to Configurable Material
CS41 Change Material Config. Allocation
CS42 Display Material Config. Assignment
CS51 Create standard BOM
CS52 Change standard BOM
CS53 Display standard BOM
CS61 Create Order BOM
CS62 Change Order BOM
CS63 Display Order BOM
CS71 Create WBS BOM
CS72 Change WBS BOM
CS73 Display WBS BOM
CS74 Create multi-level WBS BOM
CS75 Change multi-level WBS BOM
CS76 Display multi-level WBS BOM
CS80 Change Documents for Material BOM
CS81 Change Documents for Standard BOM
CS82 Change documents for sales order BOM
CS83 Change documents for WBS BOM
CS84 Change documents for class BOM
CS90 Material BOM Number Ranges
CS91 Number Ranges for Standard BOMs
CS92 Number Ranges for Sales Order BOMs
Reports
Go to t-code SARP and select SD01 as a reporting Key. You will get
reporting menu tree for SD. All LIS reports are standard SD and logistics reports. Any report starting with “MC**” will be a standard LIS report. e.g. MCSI,MCTG, MCTE etc.
Determinations of various things
Pricing Procedure = Sales Area + Dopp + Cupp
Item Category = SD type + Item Category group + Higher level itcat + Usage
Shipping Point = Plant + Shipping Conditions + Loading group
Schedule line = Item Category + MRP type
Requirement Class = Itcat + MRP Type + Reqty + Rule
Create a Query
Procedure:
1. go to SQ03 – Create a User grp with ZSAMBIT
2. go to SQ02 – Create a Infoset – 2 options 1. logical database for general output and if u want a customized output then go for table joins.
Start with specifying a table name like VBAP and further joins other tables which has common field links like how ABAPers join tables for the Report.(Provided u know the technical)
3. Again go to SQ03 – Click on assign user & infoset, here u can assign SAP User ID so that those users can view or change ur query and also u need to assign the infoset u hve created in SQ02.
4. SQ01 create a Query – choose the User grp and here u can choose the fields depending on the list u want in your report
Assign more than 999 Ship-to’s to a Sold to party
Due to the 999 entry restriction we cannot maintain more than 999 ship to party in the sold to customer master data, to overcome this problem we have implemented a workaround, We don’t maintain the ship to party in the sold to party customer data , but we maintain the sold to party in the Ship to customer master data. Hence while entering the Sales order, business is supposed to enter the ship to party field and we expect the sold to party to be determined. This doesn’t happen in the standard way so our plan is to use the partner determination user exit to get the Sold to party master data. I understand that in order to use the partner determination user exit EXIT_SAPLV09A_003 we need to make some changes in the configuration of partner determination procedure as well (source X, Y or Z in partner determination procedure, transaction VOPA). Is there any other changes required which needs to be done.