02-14-2017 4:16 AM
Requirement:
In co02 T-code- Components overview, If a user clicks any fields the following tcoding has to be triggered.
1.IF user clicks any field and if the material quantity in the field is not back-flushed it must not show any error.
2.If the material quantity is backflushed it must show warning message as "The Material 'matnr, is already back-flushed .
Error:
For the above requirement i created the enhancement with below coding but it is not get triggered while clicking on the field.
Types: begin of str,
AUFNR1 type afko-aufnr,
matnr type aufm-matnr,
bwart type aufm-bwart,
menge type aufm-menge,
end of str.
DATA : AUFNR TYPE Aufm-AUFNR.
get parameter id 'ANR' field aufnr.
data:it1 type table of str,
wa type str,
it2 type table of str,
wa1 type str.
select aufnr matnr bwart menge
from aufm into table it1
where aufnr = aufnr and bwart = 261.
select aufnr matnr bwart menge
from aufm into table it2
where aufnr = aufnr and bwart = 101.
loop at it1 into wa.
Loop at it2 into wa1.
if wa-menge = wa1-menge.
message 'No ERROr' type 'S'.
else.
message ' ERROr' type 'S'.
endif.
endloop.
endloop.
02-14-2017 6:35 AM
If the fields are not defined as hotspot a single click won't trigger anything. Better handle the double-click event/function code.
Regards,
Raymond
02-15-2017 8:23 AM
Hi,
Thanks for the reply,
I defined the event for the same and its working,
Kindly let me know if its possible to show the warning message as
"The material 'matnr' has already backflushed with 'igmng'Quantities.
Here the MATNR & IGMNGis Material no belongs to that line item where we tried to change the quantity,
Is it possible to catch the values from the sructure and show in a message.
Pl refer attached screenshot were we trying to show the message.untitled.png
In attached screen shot if we tried to change the value of the line item 10 the message should be appear as
"The material B has already backflushed with 25 Quantities.
Is it possible.