Application Development and Automation 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: 
Read only

How to calculate usage value through measuring document.

Former Member
0 Likes
1,760

Hi,

While creating Sales Order with reference to a Contract i need to update the usgae value in the Order Quantity ( RV45A-KWMENG ) field (at line item level).

Can you help me calculate usage value through measuring documents for equipment over a period of time.

Is there any function module for the same?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,518

Hi,

You can make use of FM MEASUREM_DOCUM_RFC_SINGLE_001 to create a measuring document for a measuring point of an equipment where you can update the usage values.

Regards,

Ankur Parab

Hi,

While creating Sales Order with reference to a Contract i need to update the usgae value in the Order Quantity ( RV45A-KWMENG ) field (at line item level).

Can you help me calculate usage value through measuring documents for equipment over a period of time.

Is there any function module for the same?

Thanks.

8 REPLIES 8
Read only

Former Member
0 Likes
1,519

Hi,

You can make use of FM MEASUREM_DOCUM_RFC_SINGLE_001 to create a measuring document for a measuring point of an equipment where you can update the usage values.

Regards,

Ankur Parab

Read only

0 Likes
1,518

Thanks for the reply.

I tried the function module MEASUREM_DOCUM_RFC_SINGLE_001 but am not able to achieve much.

well the main prb is : wot is this usage value exactly...i tried to find it out but hope this isn't a field..it needs to be calculated using some values fields maybe...

i came across a function module ALM_ME_EQUIPMENT_GETDETAIL ...but here also...am unable to evaluate USAGE value...

Can u tell somethin regardin the same???

Read only

0 Likes
1,518

While executing the MEASUREM_DOCUM_RFC_SINGLE_001...apart from measuring point it does ask for a counter reading diffrence value...am unable to understand this one...is this the field IMRG-CDIFF..if yes then still if in the function module if i enter a measuring point the corresponding counter reading difference as "X" or " "...still exception occurs...saying..."Value_missing"...

Message :"Enter counter reading or counter reading difference"...

but counter reading is the only value to be calculated..as it is only the usage value (IMRG-CNTRR)..

if possible help me out!!!!

Read only

0 Likes
1,518

Hi,

For getting details of counter reading and other measurement document details use function module

MEASUREM_DOCUM_READ

Pass the document value to parameter MDOCM

For Measurement point details use

MEASUREM_POINT_READ

Regards

Read only

Former Member
0 Likes
1,518

Hi,

To determine the usage value of a an equipment I had followed the following.

From table STPO, check if the material receipted belongs to a standard BOM (STLTY='S')

If yes, record the BOM (STLNR) and the BOM item node number (STLKN)

From PLMZ table, select the task list type (PLNTY), the key for task list group (PLNNR), the group counter (PLNAL), the task list node number for operation (PLNKN), if the record is not flagged for deletion (LOEZ)

From PLFH table, select the object type of the CIM resource (OBJTY), the object id of the resource (OBJID), the usage value (EWVGW) if the record is not flagged for deletion (LOEZ)

From CRVE_A table, select the equipment number (EQUNR)

The result of this selection will be all the tools which can be used for the production of the material receipted.

The measuring point for this or these equipment(s) will be selected from equipment number and EQUI table

The result of this selection will be all the measuring point to update.

Create new measurement document for the selected measurement point (transaction IK11)

Technically go as follows:-

MAT = material receipted

Select STLY, STLNR, STLKN from STPO table where IDNRK='MAT' and STLTY='S'

If results exist

Select STLTY, PLNNR, PLNAL, PLNKN from PLMZ where PLMZ.STLTY=STPO.STLTY and PLMZ.STLNR=STPO.STLNR and PLMZ.STLKN=STPO.STLKN

And PLMZ.LOEZ<>'X'

Select EWVGW, OBJTY, OBJID from PLFH twhere PLFH.STLTY=PLMZ.STLTY and PLFH.PLNNR=PLMZ.PLNNR and PLFH.PLNAL=PLMZ.PLNAL and PLFH.PLNKN=PLFH.PLNKN and PLFH.LOEKZ<>'X'

USAGE=PLFH.EWVGW

Select EQUNR from CRVE_A where CRVE_A.OBJTY=PLFH.OBJTY and CRVE_A.OJBID=PLFH.OBJID

All the equipment number selected at this moment will be called EQUIP in the next steps

EQUIP= Equipment number previously selected

Select OBJNR from EQUI where EQUNR=EQUIP

Select PARNR from IHPA where OBJNR=EQUI.OBJNR

If PARNR = Vend then

Select IMRC_POINT from equi where equnr=equip

All the measuring points selected at this moment will be called MEASP in the next steps

For each MEASP

Insert into IMRG the new increment value (USAGExMAT) in field CDIFF

Remark: the field CDIFF is managed in floating point number, accurate to 8 bytes.

I hope this is useful for you.

Regards,

Ankur Parab

Read only

0 Likes
1,518

Hi Ankur,

First n foremost..thanks a lott for the informative response!!!

All wot u wrote seems good and working...but what if there are no sub material for the Contract with whose reference i had made my Sales Order?? .. the concept of BOM doesnt apply now...but still usage needs to be calculated...

simply...if there arent any results for the query...

Select STLY, STLNR, STLKN from STPO table where IDNRK='MAT' and STLTY='S'

Hopefully m not sounding vague..as m not well versed in this BOM concept!!!

Read only

0 Likes
1,518

Hi,

I am sorry but in this case probably your functional consultant will help you more.

In my case we had a material for which several tools were used to manufacture it.

These were present in the standard bom and I had to calculate the usage of the tool.

You can check with your functional consultant for more details.

Regards,

Ankur Parab

Read only

0 Likes
1,518

..fine...got it..

thanks!!!