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: 

How could i know, Screen field value has been changed or not In Me22N.

former_member196331
Active Contributor
0 Kudos

Hi.

I am facing one problem.My Requirement is  In me22N down payment field is available.  Down payment amount is entering the user partially.

Means Suppose In Me21n document total is  50000.00 . First time while adding they entered  5000.00  , Renaming Balance is 45000.00.

So, i need to validate the down payment every time user save the document. I can able validate the records the problem is.

Total amount  50000.00.

1st time  5000.00

2nd time  30000.00

3rd time  15000.00

Down payment is completed,  Now User is login into the Screen i did some changes in the other fields.  And saving the Document.

Actual amount is  50000.00  already posted. but last 3rd time amount 15000.00  is showing in me22n. the coding  part is thinking again user has entered 15000.00  for down payment.    500000+15000 > Actual amount 50000.00 Error message is triggering.   But last 15000.00  Actually user has not entered.  i.e Previous Transaction amount.

So, My questions is I open me22n. i did some changes in down payment. before saving the records how could i know whether the field has been changed or not. Any idea.

If your answer is compare the database value of the po in the data base. I hope this is wrong.

4000.00 I was entered and saved, Again i open the me22n this time also 4000.00  i was entered, So,  Changes has done. So, i can not compare screen values to the Database values. Need valuable suggestions.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Use BAdI ME_PROCESS_PO_CUST, in the methods PROCESS_HEADER or CHECK, you have access to header

  • Get (current screen PAI) value with IM_HEADER->GET_DATA, to previous (last PBO) value with GET_PREVIOUS_DATA and database value with GET_PERSISTENT_DATA. (MEPOHEADER-DPAMT)
  • With IM_HEADER->GET_ITEMS you get the list of items, and for each item you can get history with <ITEMS>-ITEM->GET_HISTORY.

So now reformulate your requirement (90%) and code it (10%).

Regards,

Raymond

6 REPLIES 6

former_member235395
Contributor
0 Kudos

Hi NewB,

Remember that down payment amount can be done using  F-47, F-48, F-54 tcodes. If it has done with ref. to PO then it will dispaly in the PO history, checkEKBE Table.

Regards,

0 Kudos

HI, Thanks for your reply. I can able to track how much amount  they had posted. But how could i validate it.

raymond_giuseppi
Active Contributor
0 Kudos

Use BAdI ME_PROCESS_PO_CUST, in the methods PROCESS_HEADER or CHECK, you have access to header

  • Get (current screen PAI) value with IM_HEADER->GET_DATA, to previous (last PBO) value with GET_PREVIOUS_DATA and database value with GET_PERSISTENT_DATA. (MEPOHEADER-DPAMT)
  • With IM_HEADER->GET_ITEMS you get the list of items, and for each item you can get history with <ITEMS>-ITEM->GET_HISTORY.

So now reformulate your requirement (90%) and code it (10%).

Regards,

Raymond

0 Kudos

Hi, Thanks for your reply.

I checked it , yesterday.

Main what i need is . I need to get dpmat, I hope it is coming, in header using bapi po_cust.

But i need to capture NETWR. but NETWR IS not available in Header.

So, i tried to get the value from item level Qty* unit price.

the main problem is the code is triggering when ever any changes in particular line only.I need total lines.

loop total_lines.

totalqty = totalqty + line_item-netwr.

endloop.

How many lines , that many lines qty and price should be multiple and Get it.

But only cursor is at which line that line only it is triggering.

0 Kudos

As I already wrote MEPOHEADER-DPAMT is there (I already checked it when I activated LOG_MMFI_P2P)

To get total, two (not exclusive) solutions

  • When a change is input on item PROCESS_ITEM is triggered, from the item you can get header (GET_HEADER) and from header every line (GET_LINES) so you can loop.
  • Use CHECK (which is always trigger during SAVE) as described in my first answer

Regards,

Raymond

0 Kudos

ok.