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: 

Access changes of a Purchase Order through a Requirement Output Control

Former Member
0 Kudos

Hello everyone,

When a user changes a Purchase Order (ME22N), I must compare the saved purchased order's items with the previous version of those items to determine if an output must be produced or not.

I do this through the Requirement Output Control (VOFM) for application EF in form KOBEV_903 for Include RV61B903.

Here is my question: How can I compare the changed Purchase Order items with the items before the changes?

- I searched the available global variables, but I can't find "before changes" tables or variables.

- I searched these forums and cannot find a similar question.

Any help is welcome, thank you.

5 REPLIES 5

vijaymanikandan
Contributor
0 Kudos

Hi

CDHDR and CDPOS will have the change history of the PO. Infact you can also use EKPO since you have not yet saved the items. It again depends on what data you want to compare.

Regards

Vijay V

Edited by: Vijay Venkataraman on Feb 21, 2012 5:29 PM

0 Kudos

Thank you Vijay, you made me realize that EKPO does not contain the new data yet.

Unfortunately, the new data just entered by the user is what I want to compare the existing data with, so CDHDR and CDPOS will not help me much.

Is there a way to access the new data that is not saved yet?

0 Kudos

Hi

There will be a temporary structure called as XEKPO or something like this. I am not in front of the system but try with some variables like xekpo or yekpo in the program.

Br

Vijay V

0 Kudos

I hoped to see a structure like XEKPO, but unfortunately I do no see one.

The only structure that seems to have useful data is XNAST or the field MSG_OBJKY (that contains the Purchase Order Number)

Did I missed something?

0 Kudos

Here is how I managed to meet that requirement.

In include ZXM06U41 of the EXIT_SAPMM06E_016 (CMOD), I exported the table TEKPO to memory:

EXPORT tekpo TO MEMORY ID 'MY_TEKPO'.

and in include RV61B903 of my Output Requirement (VOFM) I could retrieve it and compare it to the purchase order in the database:

IMPORT TEKPO TO lt_ekpo FROM MEMORY ID 'MY_TEKPO'.

* My comparison routine is here