Wednesday 28 September 2016

Identify changed data on screen in Web dynpro ABAP

AT times we require to check whether the editable fields are actually changed in value by the user or not.AS we all know that the values in the web dynpro component are stored in the context via nodes and attributes, there is a way to acheive this without much of coding. This documents gives the step by step procedure for the same.

The component here has a node which in turn has an attribute associated with it.

The purpose of this attribute is to bind it with an input field, now we will create the layout after creating this node in the context.

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

The layout of view is as below

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

On the click of this button we will be checking whether user has entered something in the input field or not, this can be modified as a “SAVE” button on screen wherein we can now check whether user has actually entered something or not or user has actually entered a new value here or not.

For this We will Enable the context change log in the WDDOINIT of component controller, please note that since the node was created in the component controller we write the code in WDDOINIT of the component controller, in case this was declared in view the below code has to be written in WDDOINIT of the view.

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

create a method in component controller , here its named as “GET_CHANGE_LOG” and code as below. this method will be called from the view.

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

The table IT_LIST will have values when the field is changed from the previous value else that would be “INITIAL”.

Below are the test results:

Execute the application and press the button without entering any value

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

The internal table IT_LIST would be having no enteries.

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

Now enter some value in the input field and press the button

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

This time the internal table would have an entry as the context value was changed from previous held blank value

UI Web Dynpro ABAP, All SAP Modules, SAP Tutorials and Materials

Friday 16 September 2016

Pricing procedure Steps and Details in SAP MM

What is Pricing procedure?


The main concept of pricing procedure is combination of different type charges, like Gross price, freight, discount, surcharges etc etc.

We use pricing procedure to determine these all conditions into one procedure, where we can find the sub-total for net amount.

To understand pricing procedure we have to comfortable with these below things:

1. Condition Table

2. Access Sequence

3. Condition Type

4. Condition Record.

5. Schema Group

6. Calculation Schema

7. Schema Determination

Let’s discuss about all these points in details.

1. Condition Table


It’s a table where we can save the all fields with the combination for individual condition record. Suppose if I use Plant as condition table, then the condition record will be created for plant only.

We can use many fields in one condition tables.

2. Access Sequence


The main concept of Access sequence is, it searches condition record for condition type from condition table.

One access sequence contains many condition tables.

Suppose we maintain 4 condition tables in one access sequence. Then when a condition type will be searching for condition record via this access sequence, the access sequence will allow to search only this 4 condition tables.

3. Condition Type


In simple term, condition type is used for different type of charges. Like gross price, discount, freight, rebate etc etc.

Suppose we purchase a material for price 10, we get a discount of price 2. Then the price 10 will be going to a condition type and the price 2 will be going to another condition type.

4. Condition Record


Condition record contains the record which is maintained against condition table with regards to condition type.

It can be fetched via access sequence and condition type.

Suppose we maintain a condition record against condition table (vendor) with regards to condition type. Then whenever the vendor used this condition type, the condition record will be fetched.

5. Schema Group


It’s assigned to our vendor and Purchase Organization, It helps the vendor and purchase organization to choose pricing procedure.

One schema group will be assigned to vendor and one schema group will be assigned to Purchase organization. With this combination, system will fetch the pricing procedure.

6. Calculation Schema


Here we maintain sequence for the pricing calculation, like gross price, discount, rebate, surcharges etc. Here we maintain the calculation for all condition types and group together all required condition types for our pricing procedure.

7. Schema Determination


Here we maintain the pricing procedure for purchasing document. We maintain calculation schema combination of per each vendor – schema group and each purchase organization – schema group.

In general, below image will give the concept how a condition type will search for the condition records :

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Configurations:


Step 1 : Maintain Condition Table

T-code M/03 or Path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Maintain Condition Table-Create condition table.

The initial screen will be appear for create condition table.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Give the new condition table no. You can use old condition table number as reference. To give reference just give the old condition table number in below “copy from condition table”.

Note: As per standard SAP, they give the entire condition table for general business requirement. If any condition table doesn’t fulfill your requirement, then you can create new condition table. Please use between 501 to 999 as condition table.

Now press enter

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

You can see the left side will be blank in initial screen, Right side will be always filled. Just double click on the right side field which you can add for this condition table.

When you double click the field the field will be blue colour and the field is appear in left side.

As we can see the 1 field I have selected in this condition table.

Save your data.

You can change the option as per your business requirement. For more details for these options, just press F1 on these option, you will find sap help doc.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Step 2: Maintain Access Sequence

T-code M/07 or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Access Sequences.

The initial screen will appear.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

You can create a new access sequence or maintain the condition table in existing access sequence (depend on your business process)

If you want to create then click New Entries. (Or you can use copy reference, Just select the access sequence and press Copy as…)

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Enter your Access Sequence and give the description and also you can choose Access category.

Then select the AS and double click on Accesses

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Click on New Entries

Enter the access number, condition table and if required the give routing number and Exclusive.

If you tick exclusive indicator, then if valid condition record found then system will stop searching after the first.

Choose as per your requirement.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Then select the line item and click on the fields (left side) to activate the condition table in access sequence. You do not need to do anything here, just double on the fields and go back. If you will not do that, then your condition table will be not accessible. You can add more condition table (s) on this access sequence.

Save your data.

Step 3: Maintain Condition Type

T-code M/06 or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Condition Types-Define Condition Type

The initial screen will be appear 

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

As for gross price SAP default maintain as PBXX for time independent condition and PB00 for time dependent condition.

Time Independent condition is use with validity period, which can be differ as validity period (we use it in info record, RFQ, Contract, SA(as per configuration for document type)).

So we don’t need to create new condition type for gross price, although you can create your own starting with Z.

Assign you newly created access sequence to the gross price condition type (I have maintain in for PBXX)

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Here you can find all types of condition type like as freight, discount, rebate, cash discount etc. If it can fulfill your requirement, then no need to create new condition type. If doesn’t the go for New Entries.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Here I have maintain ZCAH as discount, I give condition class A, Calculation type A, Plus/Minus X-Negative

(Note: Not required to maintain like that, you can maintain as per your requirement.)

As per this way please create other condition types as per your requirement (which will be used in Pricing Procedure)

Save you data.

Step 4: Maintain Calculation Schema

T-code M/08 or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Calculation Schema

This is very very important part in pricing procedure.

Here we give the calculation for all condition types.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Here also you can find the SAP default calculation schema, you can also use one of them as your pricing procedure. Although you can create new calculation schema as per your requirement.

Just click on New Entry. (or you can copy old schema and can modify yourself. then select copy as…)

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Give the name and description for new procedure.

Then Select this procedure and press Control (in left side)

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

You can see a lots of option there, You can read all option help which is provide by SAP (Just select the portion and press F1)

Maintain PBXX as gross price in step 1, counter 1, leave the from and to blank, Subtotal will be value 9-Copy values to KOMP-BRTWR (gross value).

Maintain other condition types as per your requirement.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

I have maintained ZCAH and ZCAS, I have used from 1, it means it will calculate the value against Gross Price (PBXX)

I have used Total Discount amount, from 7 to 9, It shows the total discount value (Total of ZCAH and ZCAS)

At last I have used TOTAL AMOUNT, It shows net value for this pricing procedure.

Step 5: Maintain Schema Group for Vendor

T-code OMFN or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Schema Group-Schema Groups: Vendor

Just click on New Entries and enter the Schema Grp Vndr and give the description.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Here I have maintained Z1.

Step 6: Maintain Schema Groups for Purchasing Organizations

T-code OMFM or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Schema Group-Schema Groups for Purchasing Organizations

Just click on the new entries and enter the Schema GrpPOrg and description.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Here I have maintained ZMM1.

Step 6: Assign Schema Group to Purchasing Organization

T-code OMFP or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Schema Group-Assignment of Schema Group to Purchasing Organization

Here find your Purchase Organization, and assign Schema GrpPOrg to Purchase organization.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Step 7: Maintain Schema Determination

T-code OMFO or path SPRO-IMG-MM-Purchasing-Conditions-Define Price Determination Process-Define Schema Determination-Determine Calculation Schema for Standard Purchase Orders

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Step 8: Assign Schema group to Vendor

When you are going to create a vendor from XK01 in purchasing data you will find “Schema Group, Vendor”

Here assign the schema group which you have created on step 5.

You can also maintain it on existing vendor via XK02.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Step 9: Maintain Condition Record

T-code MEK2

Maintain the condition record against the key combination.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Save your data.

Finally all configurations has been done.

Now see the result.

Create PO with this purchase organization and with this vendor.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

We can see the my new pricing procedure is working perfect.

We can use this in SA.

Just we have to configure this for document of schedule agreement.

Go to path SPRO-IMG-MM-Purchasing-Scheduling Agreement-Define Document Types

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Just un-tick Time Dep. Condition for SA document type.

Then Create SA for this vendor and purchasing organization.

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

This is called time independent condition. You can also use this pricing procedure for RFQ. But Contract and Info record will be always time dependent condition.

Time Independent conditions are not dependent on time. It hasn’t any validity period, that means it will be always same for all time. The above settings are for time independent condition. Whenever you will use time independent condition, then you need to do these above settings.

Time dependent conditions are always time dependent. It has the validity period. You can use more than one price for the same condition record with different validity period, so that system will change it automatically as per the validity period.

I think I do not need to explain anything more about the differences Time dependent condition and Time Independent condition because there are many discussions already there for the differences.

You can use either time dependent or time independent for Schedule Agreement and Request For Quotation but you can only use time dependent condition for Contract and Info record and for Purchase Order, you need to always use time independent conditions.

For time dependent settings, you just need to set the up the condition type, Access sequence, Condition table and Calculation schema. Schema group is not needed for the time dependent condition.

We can also maintain the fixed discount for particular vendor.

Suppose one of my vendors gives me material as 5 % discount for all material.

We can maintain it in condition record.

Go to MEK2

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

Click on Supplement Condition. Maintain there your condition type for ZCAH as 5.

You can see the default 5% discount has been automatically arrived in PO or SA.

You can only able to see these condition types which is associated with the condition type which you have entered at the first screen and it will be your gross condition type.

To add some more condition type, you need to add these condition types in the associated calculation schema. To find the calculation schema which is associated with the gross condition type, you need to go to M/06 and you will find the calculation schema as below:

SAP MM, SAP Module, SAP Learning, SAP Live, SAP Modules, Tutorial and Certification, SAP Certifcations

You can add your condition type in this calculation schema in t-code M/08. Then your condition type will be visible for time dependent condition (MEK1) or Info record or Contract.