Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulate the exchange rate in Purchase Order (background)

former_member215739
Participant
0 Kudos

Dear SAP Community,

I've been searching a lot about the topic exchange rate in purchase order but can't find the information matched my requirement. I would be very grateful, if you could give me an advise (Point awarded).

The requirement is: "in the purchase order, the user should have the possibility to choose the exchange rate type they want. The system will take the exchange rate according to this type (not type M)."

When I debug the standard process in ME21N, I find the following point, where the exchange rate is determined with Function "READ_EXCHANGE_RATE".

Before I have to modify or create implicite enhancement point, I would like to ask you:

1) I see the line bapi_exit_when_filled whurs gs_headerx --> what is this line? can we use it?

2) The Function "Read_exchange_rate" is called here, but the exchange rate type is not exported. Therefore the defaul value M is taken. Is there a possibility, that we can enter the exchange rate type somewhere?

3) Is there any other possible solution for this requirement?

Thank you very much for your support.

Best regards,

Thanh

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

You could also consider using BAdI ME_PROCESS_PO_CUST method PROCESS_HEADER to force rate (Also don't change the rate at every call of the method, e.g. compare get_data and get_previous_data and only calculate when no previous data or in case of change of date or currency code for example)

Regards,
Raymond

0 Kudos

Hi Raymond,

Many thanks for your comment.

However, there are 2 problems when manipulating exchange rate using process_header:

1) When I enter the new rate in process_header, this new value is not shown(refreshed) in the dynpro / screen of ME21N. On the dynpro, the old value still shows. It will cause confusion: difference between the value the user is seeing and the value in the background.

And when the user enters his rate on the screen, my rate in the background has no effect anymore...

2) changing the exchange rate in process_header, all the line item values are not automatically translated to my manipulated rate.

It's strange, that until now, I can find any thread with a concret solution, how the exchange rate in ME21N is manipulated...

Best regards,

Thanh

former_member215739
Participant
0 Kudos

Hi Jürgen,

thank you very much for modify my Tag. I was trying to tag with MM or Exchange rate, but it didn't allow me to.

I will try again when posting the next thread.

In addition, I'm wondering, why the email notification doesn't work anymore. Earlier, I was always notified via mail, when someone replies to my thread, but now I don't get any notification.

Thanks and best regards,

Thanh

raymond_giuseppi
Active Contributor
0 Kudos

Before I forget (again) the 'bapi_exit_when_filled wkurs gs_headerx' is related to BAPI (rate parameter comes from BAPI,POHEADERX-EXCH_RATE set to 'X') so no use in transaction.