Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Hi every one,

REQUIREMENT 1:

                  i have a requirement in ME21N(Po create)  pricing is determined as per the condition records maintained by our mm consultant but now he is asking for ZPCR he maintained value 09 in condition records but he asked to check the Material Master record( MBEW-VERPR by passingMBEW-BWKEY == EKPO-WERKS and MBEW- MATNR = MATNR ) and in that also if the price is mentioned let's say 100 then it should replace the value 9 and if not found then i need to display the value maitained in condition record.

REQUIREMENT 2:

                in ME21N  if one condition type  ex: ZPCR is exist then other condition type ZDTY  should not appear and if ZPCR is not exist then ZDTY can exist for the material which is mentioned in line item( if the condition type ZDTY maintained for it) .

GO TO : VOFM and click on REQUIREMENTS.

NOW SELECT THE RELAVANT ONE(IN OUR CASE PRICING)



GO TO LAST AND ENTER THE REQUIREMENT NUMBER EX: 986.


Then click on enter it will ask you the access key enter the access key then continue.by default two form routines are created.

Now place the cursor after the form name and click on insert from the application toolbar. Now write your custom code with in the insert(all above is just exit)

data:v1 type mbew-verpr.
**************************REQUIREMENT1*****************************************
* this select query is used to fetch the price if maintained in master record.
SELECT SINGLE VERPR FROM MBEW INTO V1 where matnr = komp-matnr and bwkey = komp-werks.
if v1 is not INITIAL.
read table tkomv[] INTO tkomv with key kschl = 'PB00'.
IF SY-SUBRC = 0.
tkomv
-kbetr = v1.
modify TABLE tkomv.
ENDIF.
endif.
*************************REQUIREMENT2******************************************
read table tkomv[] with key kschl = 'PB00' TRANSPORTING NO FIELDS.
if sy-subrc = 0.
delete tkomv[] where kschl = 'SKTO'.
endif.

NOW GO TO SPRO

SAP REFERENCE IMG ---------> MATERIAL MANAGEMENT ------------> PURCHASING ----------> CONDITIONS ------->DEFINE PRICE DETERMINATION PROCESS -------> DEFINE CALCULATION SCHEMA


Now find the relavant procedure which is active( and select it and click on control data


now enter the requirement that you created (ex: 986) as shown below.


Click on Save.

Testing the Requirement:


     

        A)     With Out Requirement: remove the requirement from the above screen and save.

                            

          Now go to ME21N

Select purchase orders

Click on execute

Click on adopt. Now observe the marked areas

B)     With Requirement: now add the requirement(ex: 986) in procedure and save it.now observe the difference.

      









2 Comments