Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

pricing conditions in ME21N(abaper job)

$
0
0

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.

 

1.jpg

 

NOW SELECT THE RELAVANT ONE(IN OUR CASE PRICING)


2.jpg


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


3.jpg

 

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)

 

4.jpg

 

 

 

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


5.jpg

 

 

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


6.jpg

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


7.jpg

 

Click on Save.

 

Testing the Requirement:


     

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

                            

          Now go to ME21N

8.jpg

 

Select purchase orders

 

9.jpg

 

10.jpg

 

Click on execute

 

11.jpg

 

Click on adopt. Now observe the marked areas

 

12.jpg

 

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

 

       13.jpg

 

 

 

 







 

 

 




Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>