Application Development and Automation 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: 
Read only

Quotation approval Status Modification

Former Member
0 Likes
552

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
468

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

2 REPLIES 2
Read only

Former Member
0 Likes
469

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

Read only

0 Likes
468

Hi,

This was very helpful.

I will modify it according to my requirement.

Thanks