c# - Adding variable watch shows field but compiling doesnt like the field? -
i have pull data erp system (sap) in c#. without going details sap (i'm sure wouldn't want know it). i'm calling remote function within c# , working i'm having strange issue. 1 of functions have call in sap c# called bapi_user_get_detail. in c#:
s.bapi_user_get_detail("no","10217502", out address, out alias, out companyname, out defaults, out islocked, out lastmodified, out logondata, out ref_user, out snc, out uclass, ref activegroups, ref addcomrem, ref addfax, ref addpag, ref addprt, ref addrfc, ref addrml, ref addsmtp, ref addssf, ref addtel, ref addtlx, ref addttx, ref adduri, ref addx400, ref extidhead, ref extidpart, ref groups, ref parameter, ref parameter1, ref profiles, ref return0, ref systems, ref uclasssys); console.writeline(companyname._company); console.readline();
sap requires these fields quite normal code. need pull 1 of out
arguments within function. namely argument company
after execute procedure should have value inside of company
field , watch shows right here:
the issue i'm having notice _company has value need cannot companyname._company
(visual studio doesnt this). if in watch shown above displays correctly. gives me company name. how watch shows value correctly. must doing simple in c# incorrectly.
edit
err looks sort of error due protection level in sap..i wonder how can expose this...
from can see explanation that _company
private field. why not accessible directly code. watch window uses reflection (or similar technique) members including private , protected.
edit:
if sap made private reason. if want pick value out anyway can try this
companyname.gettype().getfield("_company", bindingflags.nonpublic).getvalue(companyname);
Comments
Post a Comment