cancel
Showing results for 
Search instead for 
Did you mean: 

How to access a Java class from view controller?

Former Member
0 Kudos

Hi All,

I have created a Test.java class file from Navigator view under

Src --> Packages --> com.sap.MyProject.

When I try to access the Test class from view controller,

I getting this error "Test cannot be resolved or is not a type".

How do I fix this?

Thanks

Sundar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I have created a Test.java class file from Navigator view under

Src --> Packages --> com.sap.MyProject.

After this you can goto the context of your View and define the VA goto the type of VA and click on the right side button and go to java native type and type your java file name click you name .

that means the jave file s assigned to VA.

U can utilize thrut that VA.

Thanks,

Lohi.

former_member182372
Active Contributor
0 Kudos

Sundar, I guess "Src --> Packages --> com.sap.MyProject" is the folder structure? Then it should be Src --> Packages --> com --> sap --> MyProject.

Former Member
0 Kudos

Hi Sundar,

Generally speaking, view controller has no differences from other normal Java classes.

It seems that the import statements are not complete.

Just try "CtrlShiftO" to re-organize the imported stuff.

William

Former Member
0 Kudos

Thanks for your reply.

I solved my own.

Former Member
0 Kudos

hi

The Java class shud be visible to your view Controller.

Try This: Inside your view controller implementation , context menu -> source -> organize imports .

regds