2012 Jan 25 7:46 AM
Hi all,
when ever customer changes the first date they need a pop saying the date has been modified please check it.
can any one tell me when ever SO item level first date is changed any user-exit available to POP-UP the message.
Regards,
Abdul gaffar.
2012 Jan 25 8:18 AM
Hi Abdul,
Can you please provide which fields are we here talking about..? How to navigate to that screen. Will be good if you provide techical name of field.
Nabheet
2012 Jan 25 8:25 AM
Hi ,
check user exit program MV45AFZZ==>subroutine --> userexit_save_document_prepare.
and search in SDN to get some sample codes....make sure it wont create any performance issues...
regards
Prabhu
2024 Apr 04 2:06 PM
2012 Jan 25 8:27 AM
The sales document item "First date" is stored in VBEP-EDATU on the first schedule line (i.e., VBEP table where POSNR = item number and ETENR = 0001).
You can make a check in user exit userexit_check_vbap in MV45AFZB.
We did similar thing in our system and it is working fine, let me access it and give you sample coding.
2012 Jan 25 8:36 AM
Hello Abdul,
In the below sample coding we compare first date from VBEP in databse with the changed first date on screen.
It is a better idea to put the below coding in a separate INCLUDE and include it inside the userexit_check_vbap form. That way MV45AFZB will have less coding clutter and also in future only the include needs to be changed without needing to lock MV45AFZB (so that more than one project can work on changes to MV45AFZB).
Also remember that popups break BDC's and background jobs, so any popups that you show during sales order processing should also contain checks so that they only trigger in foreground mode with dialog users (sy-batch IS INITIAL - not background job AND sy-binpt IS INITIAL - not batch input AND usr02-ustyp = 'A' - only dialog user AND rv45a-docnum IS INITIAL - order not created through IDoc)
DATA: lv_edatu TYPE vbep-edatu,
lv_ustyp TYPE usr02-ustyp.
* Sales document is in change mode
IF t180-trtyp = charv.
* Get the user type
SELECT SINGLE ustyp INTO lv_ustyp
FROM usr02
WHERE bname = sy-uname.
* Trigger the popup for only dialog user during online processing
IF sy-batch IS INITIAL AND sy-binpt IS INITIAL AND lv_ustyp = 'A' AND rv45a-docnum IS INITIAL.
* Get first date from database
SELECT SINGLE edatu INTO lv_edatu
FROM vbep
WHERE vbep~vbeln = vbap-vbeln AND
vbep~posnr = vbap-posnr AND
vbep~etenr = '0001'.
* Retrieve the first schedule line from screen that is not deleted
CLEAR ls_xvbep.
LOOP AT xvbep INTO ls_xvbep
WHERE vbeln = vbap-vbeln AND
posnr = vbap-posnr AND
etenr = '0001' AND
updkz NE chard.
EXIT.
ENDLOOP.
* If screen first date different from first date in databse show popup
IF lv_edatu NE ls_xvbep-edatu.
"Show popup
ENDIF.
ENDIF.
ENDIF.
To the above poster, it is not better to user userexit_save_document_prepare as this is triggered only during save and many items may have changed. userexit_check_vbap on the other hand triggers for each item that is changed, then and there.
Best regards,
Vishnu Tallapragada
2024 Apr 04 2:05 PM
Hello community,
Please can we find 1st date in another table, VBAP LIPS LIKP?
i did a sqvi and can't join VBEP
2024 Apr 19 8:12 AM
Someone say it before "The sales document item "First date" is stored in VBEP-EDATU on the first schedule line."
so why you can not join VBEP?
2024 May 03 8:57 AM
Thank you, but unfortunately we don't use VBEP table in our plant