2007 Oct 04 2:53 AM
Hi Experts,
One simple question, pls. clarify ma that,
In the process of VA01-Sales Order creation, I need to do not allow to create/save that doc. if PO#, MATNR, Batch r already existing in DB! in this case, I need to write logic in SAPMV45A, I found the corresponding User exit, so, I wanna insert my code as INCLUDE my_prog_code.
So, to write INCLUDE, Is it just like Report prog.? like, SE38>my_name>create--->Type->INCLDE selection?
Or any other things I hv to consider, to write a INCLUDE?
thanq
2007 Oct 04 2:58 AM
Include is simply an pogram, but is non executable directly from SE38, except that the Attibute type should be an INCLUDE porgram.
regd ur requirement :
i suppose you should not be writing your code in a seperate in include in the program SAPMV45A, but where as you should be writing in the MV45AFZZ include of the main program SAPMV45A.
What i meant is you should be writing the code or include in the MV45AFZZ inlcude of the program SAPMV45A
Hope i did not confuse you.
Regards
Gopi
2007 Oct 04 2:58 AM
Include is simply an pogram, but is non executable directly from SE38, except that the Attibute type should be an INCLUDE porgram.
regd ur requirement :
i suppose you should not be writing your code in a seperate in include in the program SAPMV45A, but where as you should be writing in the MV45AFZZ include of the main program SAPMV45A.
What i meant is you should be writing the code or include in the MV45AFZZ inlcude of the program SAPMV45A
Hope i did not confuse you.
Regards
Gopi
2007 Oct 04 3:23 AM
thanq,
ur right, i forget to mention, its FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
in MV45AFZZ. I mean, I will put my_include_name in FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
also, i forget to mention that, I need check ACTIVE sales orders in DB, in that case ONLY, will have to throw ERROR meesage!
thanq.
Message was edited by:
Srikhar
2007 Oct 04 2:59 AM
That is correct way to create an INCLUDE program. Just make sure that you correctly call the routines in the user exit and give reference of this program.
Here is a pseudo logic.
FORM USEREXIT_MOVE_FIELD_TO_VBAK.
perform validate_DATA(<your include program name>).
ENDFORM.
Your code for routine VALIDATE_DATA will be placed in the include program.
Message was edited by:
Ashish Gundawar
2007 Oct 04 3:25 AM
thanq,
ur right, i forget to mention, its FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
in MV45AFZZ. I mean, I will put my_include_name in FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
also, i forget to mention that, I need to check ACTIVE sales orders in DB, in that case ONLY, will have to throw ERROR meesage!
thanq.