понедельник, 23 ноября 2015 г.

How to setup Price Condition, depending on the configuration (updated 21.12.2015)

Vehicle Management System's master data based on configurable material, where at least colors can be defined.
Here a short "step-by-step" customizing.


1. Keep in mind reference characteristics’ values, you want to involve for pricing. Here two colors (PGU & RHM), which will be additionally charged:

Class – DR
Characteristic – DR_EXTCOLORS
Values – PGU, RHM



2. Define reference characteristic for price conditions, which depend on configuration (separately for SD and MM pricing). T-code CT04, new characteristic CONFIGPRICESD


In Additional Data view point SDCOM - VCOND reference.
!!! You should fill this fields before view "Values".





One time I've got an error 

Field VCOND not found in table SDCOM
Message no. C1024

Don't know the reason, but I've bypassed it through transfer IDOC CHRMAS / CHRMAS05 from other system, then created well..

Specify price characteristics’ values PGU, RHM (same values will be defined as variant conditions further)


3. Attach characteristic CONFIGPRICESD to class DR (t-code CL02):


4. For every value of characteristic CONFIGPRICESD create Variant Conditions (VK30):


5. Define object dependency (type Procedure) CONFIGPRICESD to bind together next objects (t-code CU01):
  • reference characteristic' value (step 1)
  • price characteristics’ values (step 2)


Edit dependency:


 With source code:
 
$self.CONFIGPRICESD = 'PGU' if DR_EXTCOLOR = 'PGU',
 
$self.CONFIGPRICESD = 'RHM' if DR_EXTCOLOR = 'RHM'

For ERP Enhancement Package 8 the syntax is like that (example from other case):

$SELF.CONFIGPRICESD1 = 'B001' IF AEQ_BRAKE1 EQ 'B001',
$SELF.CONFIGPRICESD1 = 'K001' IF AEQ_BRAKE1 EQ 'K001',
$SELF.CONFIGPRICESD1 = 'C001' IF AEQ_TYRES1 EQ 'C001',
$SELF.CONFIGPRICESD1 = 'G001' IF AEQ_TYRES1 EQ 'G001',
$SELF.CONFIGPRICESD1 = 'BR01' IF AEQ_TYRES1 EQ 'BR01',
$SELF.CONFIGPRICESD1 = 'A001' IF AEQ_WHEELS1 EQ 'A001',

$SELF.CONFIGPRICESD1 = 'A002' IF AEQ_WHEELS1 EQ 'A002'


6. Attach created dependency to material (t-code PMEVC)
 
 

Result:



7. Create price conditions for material (VK11):
  • VA00 – absolute value
  • VA01 – percentage value



8. Now, when you create Sales Order with material DRS4D1615DG146 and color PGU, surcharge appears in pricing under condition VA00:



9. Also you can check if variant condition works properly in PMEVC. Select material and push Test (Shift+F8) button. Then select values to simulate pricing and push Pricing (Ctrl+Shift+F7) button. If value's combination  is related to pricing, Net value screen appears (3):


10. Improvement.



Imagine, that you use value PGU in several characteristics, let's say DR_EXTCOLOR and
B1_EXTCOLOR your dependency (step 5) will be like that:

$self.CONFIGPRICESD = 'PGU' if DR_EXTCOLOR = 'PGU' or B1_EXTCOLOR = 'PGU',
$self.CONFIGPRICESD = 'RHM' if DR_EXTCOLOR = 'RHM'

In such cases is better to use Expression "SPECIFIED" to point all characteristics, which could include value 'PGU'. Having that, the dependency (first row) will look much better:

$self.CONFIGPRICESD = 'PGU' if DR_EXTCOLOR SPECIFIED OR B1_EXTCOLOR SPECIFIED

After assignment in PMEVC you will be able to see all characteristics, participated in dependency:

 

The dependency could be assigned to materials in two ways:

  • On material level (only selected materials, one-by-one), or
  • On material's characteristic level (all materials with this characteristic, in-mass). For this way, select any material with characteristic, involved in pricing and assign dependency to this characteristic:





Benefits:
  • you can use the same Reference Characteristic (CONFIGPRICESD) for all color characteristics
  • you can use the same Variant condition (PGU) for whole range of materials
  • the dependency is much better to maintenance 
Here you can see a short video regarding the topic and mass price handling:



вторник, 10 ноября 2015 г.

How to set up ORDERS, ORDRSP, DESADV, INVOIC IDOCs interchange in the same system

In order to prepare IDOCs interaction between two systems, it's better to check them in the same (SAP) system. Here I'll show, which steps you should pass to.

At the beginning I will describe system & document environment.
I'm going to use two organization units Distributor and Manufacturer and four IDOC message types: ORDERS, ORDRSP, DESADV, INVOIC.
Every active step bellow will be highlighted by dark arrow, which also point a direction of IDOC from OUT to IN:

General view:
 
Steps 1-2 (A): IDOC ORDERS ORDERS Purchase order / order
I use Basic type ORDERS05, because only this can transfer material's configuration, which is important for Automotive.



Pre-requisites for Outbound part:
  • XK01 – Create vendor (90500) and attach with SO customer (C40AF00323 – correspondence view, field EIKTO)


  • WE20 – Create Vendor 90500 (Partner type – LI)
  • WE20 – Create Outbound parmtrs. For Vendor 90500 (Partner type – LI) , (othewise error message VN032 Maintain outgoing EDI-connection data for partner 90500)
  • MN04 – Create output type NEU for Vendor (90500)

Pre-requisites for Inbound part:
  • WE20 – Create Inbound parmtrs. For Logical system T90CLNT090 (Partner type – LS)
  • VOE2 - create EDSDC Entry (othewise error message VG204 - VKORG, VTWEG, SPART cannot be determined for customer C40AF00323 , vendor 0000090500)
  • VOE4 - create EDPAR Entry (othewise error message VG140 - Partner number 9000 for customer C40AF00323 , partner function WE does not exist) LVEDAF2J (FM IDOC_INPUT_ORDERS) – for debug message VG140


  • VD51 - Maintain Customer-Material Inforecord (othewise error message VG203 - The material number for item 000010 could not be identified)
  • VD51 - fill text (not only material code for customer-material inforecord) othewise error message no. 00347 Field VBAP-ARKTX (1) is not an input field
Steps 3-4 (B): IDOC ORDRSP Purchase order / order confirmation



Pre-requisites for Outbound part:
  • WE20 – Create Outbound parmtrs. For Customer C40AF00323 (Partner type – KU & SP)
  • VV11 - Create Output Type BA01
Pre-requisites for Inbound part:
  • WE20 – Create Inbound parmtrs. For Logical System T90CLNT090 (Partner type – LS)
  • ME12 – Set up confirmation control key for Purchase Inforecord
Steps 5-6 (C): IDOC DESADV Delivery: Shipping notification


Pre-requisites for Outbound part:
  • WE20 – Create Outbound parmtrs. For Customer C40AF00323 (Partner type – KU & SH)
  • VV21 - Create Output Type LALE
  • WE42 – change for DELS FM to IDOC_INPUT_DESADV1 (othewise error message B1252 - Function module not allowed: BORES_IDOC_INPUT_DESADV1)
Pre-requisites for Inbound part:
  • WE20 – Create Inbound parmtrs. For Logical System T90CLNT090 (Partner type – LS)
Steps 7-8 (D): IDOC INVOIC Invoice/Billing Document


Pre-requisites for Outbound part:
  • WE20 – WE20 – Create Outbound parmtrs. For Bill-To C40AF00323 (Partner type – BP)
  • VV31 - Create Output Type RD00
Pre-requisites for Inbound part:
  • WE20 – Create Inbound parmtrs. For Logical System T90CLNT090 (Partner type – LS)
  • OBCA – Maintain Table T076B, create two records in case you use the same system (othewise error message FD006 - A company code cannot be determined for LS 0000090500)
  • OBCE – Maintain Table T076S (othewise error message FD145 - Program parameters for LS T90CLNT090 9000 have not been set)
  • OBCD - Maintain Table T076M (othewise error message in application log FD008 - Assigning a new tax key for B2 and VAT 18.000 not possible)