Skip to Content
avatar image
Former Member

Quotation approval Status Modification

Hi,

I need to do quotation approval based on some conditions, where i can write the code for quotation approval.

if possible tell me the code.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 05:17 AM

    If you looking for VA21

    check this include MV45AFZZ.

    write in below routine

    USEREXIT_SAVE_DOCUMENT

    to read the status of APPROVALS

    CALL FUNCTION 'STATUS_READ'

    EXPORTING

    CLIENT = SY-MANDT

    objnr = V_OBJNR

    • ONLY_ACTIVE = ' '

    IMPORTING

    • OBTYP =

    • STSMA =

    STONR = V_STONR

    • TABLES

    • STATUS =

    EXCEPTIONS

    OBJECT_NOT_FOUND = 1

    OTHERS = 2.

    change the status.

    CALL FUNCTION 'STATUS_CHANGE_EXTERN'

    EXPORTING

    client = sy-mandt

    objnr = V_OBJNR

    user_status = 'E0001'

    SET_CHGKZ = 'X'

    EXCEPTIONS

    OBJECT_NOT_FOUND = 1

    STATUS_INCONSISTENT = 2

    STATUS_NOT_ALLOWED = 3

    OTHERS = 4.

    IF SY-SUBRC = 0.

    COMMIT WORK.

    ENDIF.

    I hope these two function module will work for your case

    Add comment
    10|10000 characters needed characters exceeded