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

Creating INCLUDE, just like REPORT prog.?

Former Member
0 Likes
693

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

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
651

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

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

4 REPLIES 4
Read only

gopi_narendra
Active Contributor
0 Likes
652

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

Read only

0 Likes
651

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

Read only

Former Member
0 Likes
651

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

Read only

0 Likes
651

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.