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: 

Enhancement COPA0005 : to bring alternative UOM to COPA

Former Member
0 Kudos

Hi ,

 

The requirement is to get "PC" in COPA for all 3* sold materials when sold unit is not equal to "PC" .

The alt UOM is maintained in MM , like SET =PC ; NO =PC ; KG =PC

I took the following steps to catch alt UOM in COPA :

1. created VV111 value field in COPA , which is automatically converted to Characteristic VV111_ME . The original sold qty in COPA is KWSVME .

2. as this can't be addressed through customization ( KE4U / KE4M / KE4MS ) or by derivation ; enhancement COPA0005 is activated .

3. the details of include : EXIT_SAPLKEII_001 & EXIT_SAPLKEII_002

 

data : tumren like marm-umren,
tumrez
like marm-umrez.
loop at t_accit.
if t_accit-meins ne 'PC' and
t_accit
-matnr between '000000000003000000'
and '000000000003999999'.
select single umren umrez
into (tumren, tumrez)
from marm
where matnr = t_accit-matnr
and meinh = 'PC'.
if sy-subrc eq 0.
* t_accit-meins = 'PC'.
t_accit
-menge = tumren * t_accit-menge / tumrez.
* vv111_me = 'PC'.
modify t_accit.
endif.
endif.

endloop.

The technical person (ABAPer) I'm working with , is having no clue why the Alternate UOM is not flowing to COPA even after writing this code . I'm basically a Controlling consultant . Please help us by pointing out what is missing in that code .

Your response will be highly appreciated .

Regards

Indranil

1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos
  • Check the actual value of MEINH in internal format (should be 'ST' (Stück in German) and not 'PC' (English).
  • Don't use table MARM, but use FM MD_CONVERT_MATERIAL_UNIT to convert material quantiy.

Regards,

Raymond