‎2006 Jun 13 12:48 PM
hi pal!!!
in one of my pgm i am calling user exit...
where in i am checking the authority..
of the user to delete the sales order....
its like tht in the exit there is one include pgm which has condition to check the authority..
but when i do the syntax check i find tht my first stmt in the include is not accessible... due to tht i m not able to activate my pgm...
my include is like this....
*--
IF old_fcode = 'LOES'. "delete
AUTHORITY-CHECK OBJECT 'Y17_SD_DEL'
ID 'VKORG' FIELD xvbak-vkorg
ID 'VTWEG' FIELD xvbak-vtweg
ID 'SPART' FIELD xvbak-spart
ID 'AUART' FIELD xvbak-auart
ID 'ACTVT' FIELD '06'.
IF sy-subrc NE 0.
MESSAGE a079(/rb17/yv) .
ENDIF.
ENDIF.
Help will be rewarded with points...
My pgm b4 calling this include is like this...
**********************************************
Enhancement 0051
If delete mode check *********************************************
CALL FUNCTION '/RB17/Y_SCHECK_MODIF'
EXPORTING
objnam = 'MV45AFZZ'
aendnr = '000051'
IMPORTING
modaktiv = modaktiv.
IF modaktiv = 'J'.
INCLUDE /rb17/y_v_delete_authority_che.
ENDIF.
whenevr i get Modaktiv = J my pgm will go to the include..
One more thing system has been upgraded , recently..
can there could be any problem...
thanx in advance..
‎2006 Jun 13 12:53 PM
Hi srinivasa,
U can directly activate the include don't go for syntax check..
Regards,
Nagaraj
‎2006 Jun 13 12:58 PM
Hi Nagaraj,
If i try to directly activate it then also i am getting the same error..
Thanks & regards,
Srinivas
‎2006 Jun 13 1:03 PM
I don't think you can have includes in conditions.
Regards,
ravi
‎2006 Jun 13 1:15 PM
Hi ravi
It is possible to iniclude depending upon some conditions..
Thanks & Regards,
Srinivas
‎2006 Jun 13 1:35 PM
Hi Srini,
If you are calling in the include program from inside a Function Exit then try activating the total Function Exit in SE80 and then see if the code is getting activated or not.
The error is may be also due to passing value into the include program, i mean it does not find any calling program to execute and then gives the error that the code lines are not accesable as Include program by itself is not executable..........
Hope that helps
Anirban
‎2006 Jun 13 1:51 PM
Hello Srinivas,
I don't c any issue as I tried it on my side...
This is what I did.. I had one user exit EXIT_SAPMM06E_005 which has an include ZXM06U30. Now I am trying to call this include in my main program
if sy-subrc = 0.
include ZXM06U30.
endif.
This way the code does go into the include part.
Only one question the main program which has your include should be active.
‎2006 Jun 13 1:54 PM
Hi srinivasa,
Is the main program is activated?
Regards,
Nagaraj
‎2006 Jun 14 5:42 AM
Hi All,
I tried to activate in se80 then also it is giving the same error. and my main program is active, Its sap standard program.
Regards,
Srini
‎2006 Jun 14 5:45 AM
take the 'activate anyway' option and see if that solves it.
‎2006 Jun 14 5:49 AM
Srinivas,
When u try to activate the include, if you get an error, click activate anyway.
Then go to the main program, activate it. If you get an error there, then there is an error somewhere. Post that error in the forum so that we can be of some help.
Thanks,
‎2006 Jun 14 5:59 AM
Hi Naren,
I activated that include by taking activate anyway option, and also i tried to activate in my main program
but it is giving the same error..
error is like below..
Syntax error in Source code /RB17/Y_V_DELETE_AUTHORITY_CHE Line 5
Statement is not accessible
Thanks & Regards.
Srini
‎2006 Jun 14 6:03 AM
Srinivas,
You said you are calling the user-exit in your custom program?
R u checking whether whether that user exit is active or not before calling it.
There should be a fm which checks whether an exit is active or not.
Because i dont see anything wrong in your include code. R u using all the authorization fields in that auth. object.
Thanks,
Message was edited by: Naren Somen
‎2006 Jun 14 6:08 AM
Hey Srinivas,
I dont see any reason why you kept the authorisation statement in the include.
In the main program you are passing the include in the if condition which is wrong.
Remove that include and substitute the code in the include there in the IF condition.
Thanks,
‎2006 Jun 14 6:34 AM
Hi Naren,
That user exit is active. I have to keep authorization object or any other stamtements regarding user exit thats the way we do. i have done many user exits like this. i have not faced the problem like this..
Thnks & Regards,
Srini
‎2006 Jun 14 6:50 AM
Hi Srini,
I think the problem is somewhere else in your program. Comment out the include and see if you still get a syntax error.
*IF modaktiv = 'J'.
*INCLUDE znrw_inc.
*ENDIF.
‎2006 Jun 14 7:11 AM
Hi Neil,
When i comment that include and activate, then everything works fine. if i uncomment that include then i will get this problem..
Thanks & Regards,
Srini
‎2006 Jun 14 7:15 AM
just to eliminate things try creating a local include and using that just with:
IF old_fcode = 'LOES'. "delete
AUTHORITY-CHECK OBJECT 'Y17_SD_DEL'
ID 'VKORG' FIELD xvbak-vkorg
ID 'VTWEG' FIELD xvbak-vtweg
ID 'SPART' FIELD xvbak-spart
ID 'AUART' FIELD xvbak-auart
ID 'ACTVT' FIELD '06'.
IF sy-subrc NE 0.
MESSAGE a079(/rb17/yv) .
ENDIF.
ENDIF.
‎2006 Jun 14 7:17 AM
Srinivas,
Is the include there in the user-exit? If yes, then I dont think you can pass the include in the if condition. You should call the user-exit which will execute the include.
And before calling the user-exit...check the user exit whether it is active or not using the fm MODX_FUNCTION_ACTIVE_CHECK.
Thanks,
Message was edited by: Naren Somen
‎2006 Jun 14 7:43 AM
Hi Naren,
See the follwing code, depending upon condition we can insert include.
Enhancment 0051 is the exit in which i am getting problem..
**********************************************************
Enhancement 001
**********************************************************
CALL FUNCTION '/RB17/Y_SCHECK_MODIF'
EXPORTING
objnam = 'MV45AFZZ'
aendnr = '000004'
IMPORTING
modaktiv = modaktiv.
IF modaktiv = 'J'.
INCLUDE /rb17/yv_mv45afzz.
ENDIF.
**********************************************************
Enhancement 010
**********************************************************
CALL FUNCTION '/RB17/Y_SCHECK_MODIF'
EXPORTING
objnam = 'MV45AFZZ'
aendnr = '000010'
IMPORTING
modaktiv = modaktiv.
IF modaktiv = 'J'.
INCLUDE /rb17/yv_mv45aots.
ENDIF.
**********************************************************
Enhancement 013
Additional checks on Qty/No of lines during Sales Order creation
**********************************************************
CALL FUNCTION '/RB17/Y_SCHECK_MODIF'
EXPORTING
objnam = 'MV45AFZZ'
aendnr = '000013'
IMPORTING
modaktiv = modaktiv.
IF modaktiv = 'J'.
INCLUDE /rb17/yv_mv45achk.