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

Table maintenance generator Events

Former Member
0 Likes
1,744

Hi Experts,

I am facing the problem with table maintenance generator events.

According to my requirement, I have to validate the data while saving based on KNVV table. Here for some fields there is no foreign key relation. so i had to write the code in the EVENT BEFORE SAVE. In this Event i have used the statement like "select * from KNNVV' and i am validating the data. But the system is giving the message saying that the select statement is not accessable.

Please let me know, How to validate the data based on the table?

Regards,

TMR.

Hi Experts,

I am facing the problem with table maintenance generator events.

According to my requirement, I have to validate the data while saving based on KNVV table. Here for some fields there is no foreign key relation. so i had to write the code in the EVENT BEFORE SAVE. In this Event i have used the statement like "select * from KNNVV' and i am validating the data. But the system is giving the message saying that the select statement is not accessable.

Please let me know, How to validate the data based on the table?

Regards,

TMR.

7 REPLIES 7
Read only

deepak_dhamat
Active Contributor
0 Likes
1,356

Hi ,

tables: KNVV .

select single * from  KNVV
where KUNNR = kunnr
VKORG = vkorg
VTWEG = vtweg
SPART = spart.

if  sy-subrc  = 0 .

table entry is there  .

else .

No entry .

endif.

Which SAP version you are using .

regards

Deepak.

Edited by: Deepak Dhamat on Oct 12, 2011 1:30 PM

Read only

0 Likes
1,356

Hi Deepak,

As you mentioned i have used the same code, even though the system is giving the same messages saying that "statement can not be accessable" .

I am working on ECC 6.0

Regards,

TMR.

Read only

0 Likes
1,356

Hi,

Have you re-activated your function group in SE80 after creating your event form?

If yes, can you paste your exact code over here?

Kr,

Manu.

Read only

Former Member
0 Likes
1,356

Have you entered FORM...ENDFORM statements manually at the include where you're making your select statement?

If I remember it right, they're not automatically entered by system.

Regards

Mauricio

Read only

0 Likes
1,356

Hi,

lol... indeed... I would not tought of such a mistake...;) good catch, mate!

so, as Mauricio said, add the FORM/ENDFORM and don't forget to activate your FG afterwards...

Kr,

Manu.

Read only

0 Likes
1,356

Thx manu!

That FORM..ENDFORM thing in SM30 events already made me very nervous in the past!

BR

Mauricio

Read only

Former Member
0 Likes
1,356

Mauricio Robert is correct..... u have to use FORM.... ENDFORM