cancel
Showing results for 
Search instead for 
Did you mean: 

How to define the size of a EVS as 0(null)

Former Member
0 Kudos

Hi,

Actually in my project I have done 3 fields

1.firstdate

2.Lastdate

3.Absence Type(EVS which hold the data from BAPI)..

When I select firstdate and lastdate it is calculating and it is showing the no of days by clicking of a action..and when selction of some conditoin(like some sickleave it should show medical check box otherwise not)...

Everything is working fine..

1.selcting of date (FD and LD)and selecting of that EVS(Sickleave)it is coming the output..

2.selcting of date (FD and LD)and selecting of that EVS(other kind of leave )it is coming the output

but my problem is that without selcting the EVS field when i select(FD and LS)it is showing null pointer Exception..here I have to select the EVS Feild..but it should not be like this....all are indepent ..so here I have to check the size of a EVS Field. as null...but it is not supporting in NWDS..Is there other way..

public void onActionfullday(I created one action)(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionfullday(ServerEvent)

wdThis.wdGetCustContLeaveReqController().Bapi1(wdContext.currentContextElement().getAbsent_From(),wdContext.currentContextElement().getAbsent_To(),"CH","CH");

if(wdContext.nodeBapi_Working_Days().size()>0 ){

wdContext.nodeBapi_Working_Days().moveFirst();

wdContext.currentContextElement().setAbsdays(wdContext.currentBapi_Working_DaysElement().getWorking_Days());

if(wdContext.currentContextElement().getAbs_Type().equals("Accident")||wdContext.currentContextElement().getAbs_Type().equals("Accident 25 %")||wdContext.currentContextElement().getAbs_Type().equals("Accident 50 %")||wdContext.currentContextElement().getAbs_Type().equals("Sickness 25 %")||wdContext.currentContextElement().getAbs_Type().equals("Sickness 50 %"))

{

wdContext.currentContextElement().setMedical_visible(WDVisibility.VISIBLE);

}

else

{

wdContext.currentContextElement().setMedical_visible(WDVisibility.NONE);

}

without selecting absence type and selecting of the FD and LD i should get the result boz these two fields are not dependent of each other.......

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197348
Active Contributor
0 Kudos

Hi Suman,

if your problem is to avoid null pointer exception for EVS, before executing RFC you can check (wdContext.node<EVS>.current<EVS>element!=null). then you can populate a message for warning the user to enter EVS field.

and stop executing RFC.

thanks

Siva