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: 

sales order item First Date

abdulgaffarmohd
Participant
0 Kudos
5,291

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.

8 REPLIES 8

nabheetscn
Active Contributor
0 Kudos
2,378

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

Former Member
0 Kudos
2,378

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

0 Kudos
2,196

EDATU

Former Member
0 Kudos
2,378

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.

0 Kudos
2,378

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

Fmll_
Explorer
0 Kudos
2,196

Hello community,

Please can we find 1st date in another table, VBAP LIPS LIKP?

i did a sqvi and can't join VBEP

0 Kudos
2,060

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?

0 Kudos
1,926

Thank you, but unfortunately we don't use VBEP table in our plant