‎2006 Feb 02 5:02 PM
Hi,
I put the below code in USEREXIT_MOVE_FIELD_TO_KOMKD
<b>TABLES : KOTD011, KOTD001.
DATA V_KNUMH like KOTD001-KNUMH.
select single KNUMH from KOTD011 into V_KNUMH where matnr = VBAP-MATNR
IF SY-SUBRC = 0 .
MESSAGE s901(VU)."Material substitution Exist
else.
MESSAGE s902(VU)." Material substituion Not exist
endif.</b> It's working fine. But this message is still displaying after cursor moved to another input field (that's to get another Material number in Va01).
I want to display this message only " <i>When i give value to material number in VA01 & press enter message should come, after that cursor goes to Quanity field give value & press enter cursor should move to next line to get another material number, this time message should not display."</i>
In which userExit i need to put this code? Am i putting code in wrong place??
‎2006 Feb 02 5:46 PM
hi,
you code is fine the USEREXIT also correct just put one more condiation as
data : v_matnr like VBAP-MATNR
if v_matnr ne VBAP-MATNR.
v_matnr = VBAP-MATNR
write your code.
enfif.
this will work fine just check it let me know .
‎2006 Feb 02 6:01 PM
The correct place to put you code would be at USEREXIT_MOVE_FIELD_TO_VBAP
In there the field SVBAP-TABIX is 0 when the line item is created and greater than 0 (normally 1) when the line item is changed.
Just put your code between
<b><b>IF SVBAP-TABIX EQ 0.</b></b> and
<b>ENDIF.</b>
‎2006 Feb 02 6:12 PM
‎2006 Feb 02 6:22 PM
No it's also not working. Exactly i need when i put value in Material line item then press enter warning message will come as "Enter quanity". before that message i should display my message. Also once after i put value for Quantity & press enter cursor will go to next item level to get input next material, that time my message should not display.
i tried both code but no effect. It's working same as my first code.......
please guide.........
-subha
‎2006 Feb 02 7:00 PM
‎2006 Feb 02 7:06 PM
Unless you are in a version higher than 4.6C (my current version, haven't work in higher versions) this should work. Might help if your code is the first thing on the VBAP userexit since other check might interfere.
Try this
IF SVBAP-TABIX EQ 0.
<your message>
ENDIF
That is: without the database read, and we can take it from there.
‎2006 Feb 02 8:06 PM
I tried but still it's not working B'cos The SAP standard message for Enter Quantity(warning message VU 001) is Overlapping my message. So it's not coming to display when i give value to Material number & press enter. Also it's still displaying once cursor moved to next item level ....
-subha
‎2006 Feb 02 8:32 PM
Hi Subha,
Use the USEREXIT_CHECK_VBAP routine in program MV45AFZB which Sharad had suggested and the code would be like this...
TABLES : KOTD011, KOTD001.
DATA V_KNUMH like KOTD001-KNUMH.
select single KNUMH from KOTD011 into V_KNUMH where matnr = <b>XVBAP-MATNR</b>
IF SY-SUBRC = 0 .
MESSAGE s901(VU)."Material substitution Exist
else.
MESSAGE s902(VU)." Material substituion Not exist
endif.Pls see if this helps...
Thanks,
Renjith
‎2006 Feb 02 8:44 PM
I haven't tried this out, but perhaps changing your message type from 'S' to 'I' will resolve the problem with warning message VU001.
If the warning message is being sent after the success message (but prior to the next screen being displayed) then the success message (which is intended for the next screen) will not be displayed. This is because only one of the messages can be shown on the next screen, and if the 'W' message was sent after the 'S' message then warning message VU001 will win out over the 'S' message.
Again, this is just an off-the-cuff hunch. Good luck!
Regards,
James Gaddis
‎2006 Feb 02 9:20 PM
I need to display message like S type b'cos if i give message type as I then Popup will come. this should not come....
-subha
‎2006 Feb 02 9:46 PM
I wonder if a warning 'W' type message might work for you, or would your message simply be overtaken by the SAP warning as it is with the 'S'? A warning would not give a popup unless the user configures their SAPGUI to do so. Since I cannot get the registration key for changing the user-exit code on my test system, I'm left with only guessing (sorry)...
Regards,
Jamie
‎2006 Feb 02 10:03 PM
That too not wanted. b'cos if i give warning message then It will ask for User additional enter key press to proceed further. This too my user don't want......??????
That's why i don't know how can i achieve this without touching standard card. B'cos if i give S message then it's overlapping by Sap standard warning message (Enter Quantity).
any ideas??????
‎2006 Feb 02 10:24 PM
Sounds like you have to keep track of each line item and only display the message once (unless the material number has changed).
How about creating an internal table in MV45ATZZ
data: begin of zz_itab occurs 0,
posnr type posnr,
matnr type matnr,
end of zz_itab.Refresh the table for each order in MV45AFZA in
USEREXIT_REFRESH_DOCUMENT
refresh zz_itab.In whichever user exit you do your code in, only check once unless the material number has changed
read table zz_itab with key posnr = vbap-posnr.
* record found
if sy-subrc = 0.
* check if material has changed
if zz_itab-matnr <> vbap-matnr.
*.... do your message code
* save new material number
zz_itab-matnr = vbap-matnr.
modify zz_itab index sy-tabix.
* else - already done- no message.
endif.
else.
* record not found
* add material
zz_itab-posnr = vbap-posnr.
zz_itab-matnr = vbap-matnr.
append zz_itab.
*.... do your message code
endif.This is a hack... did not check syntax. Should use a TYPE instead of BEGIN OCCURS.
The user exit should be restricted as well..
transaction code (VA01, VA02), orders only (VBAK-VBTYP), sales organization (VBAK-VKORG), etc....
‎2006 Feb 02 11:45 PM
Subha,
You have opened numerous threads around this project.
Not sure that you are prepared for a project of this complexity...
Did you speak to your manager about getting help?
‎2006 Feb 02 7:14 PM