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

Error in Syntax

Former Member
0 Likes
1,961

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....

*--


INCLUDE /RB17/Y_V_DELETE_AUTHORITY_CHE *--


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..

19 REPLIES 19
Read only

former_member404244
Active Contributor
0 Likes
1,811

Hi srinivasa,

U can directly activate the include don't go for syntax check..

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,811

Hi Nagaraj,

If i try to directly activate it then also i am getting the same error..

Thanks & regards,

Srinivas

Read only

0 Likes
1,811

I don't think you can have includes in conditions.

Regards,

ravi

Read only

Former Member
0 Likes
1,811

Hi ravi

It is possible to iniclude depending upon some conditions..

Thanks & Regards,

Srinivas

Read only

former_member480923
Active Contributor
0 Likes
1,811

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

Read only

Former Member
0 Likes
1,811

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.

Read only

former_member404244
Active Contributor
0 Likes
1,811

Hi srinivasa,

Is the main program is activated?

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,811

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

Read only

0 Likes
1,811

take the 'activate anyway' option and see if that solves it.

Read only

0 Likes
1,811

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,

Read only

Former Member
0 Likes
1,811

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

Read only

0 Likes
1,811

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

Read only

0 Likes
1,811

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,

Read only

Former Member
0 Likes
1,811

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

Read only

0 Likes
1,811

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.

Read only

Former Member
0 Likes
1,811

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

Read only

former_member186741
Active Contributor
0 Likes
1,811

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.

Read only

0 Likes
1,811

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

Read only

Former Member
0 Likes
1,811

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.