on 2024 Jul 10 5:55 PM
Trying to access ST03 related data through RFC 'SWNC_COLLECTOR_GET_AGGREGATES' when connecting with .Net Connector 3.1.
IRfcFunction rfcFunction = rfcRepository.CreateFunction("SWNC_COLLECTOR_GET_AGGREGATES");
rfcFunction.SetValue("COMPONENT", "TOTAL");
rfcFunction.SetValue("PERIODTYPE", 'D');
rfcFunction.SetValue("PERIODSTRT", new DateTime(2024, 07, 07));
rfcFunction.Invoke(_destination);
At execution, getting following exception:
SAP.Middleware.Connector.RfcTypeConversionException
HResult=0x80131600
Message=FIELD READDIRTI of STRUCTURE SWNCAGGEXTSYSTEM (SETTER): cannot convert Byte[] into BCD[13:0]
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
Inner Exception 1:
RfcTypeConversionException: Cannot convert byte[] of length 455 into a BCD of length 13
The data structure 'SWNCAGGEXTSYSTEM' in error message is actually associated with the table ' EXTSYSTEM' consumed by this RFC. Not sure what data is being transferred to this table and how to prevent this run time error.
I can execute this RFC successfully in SAP GUI from transaction 'se37' with same set of input parameter and can retrieve data from output table 'Times'.
The only data i'm interested to retrieve from this RFC is tcode and total #of dialog steps executed, with each step that is available from output table 'Times'. This RFC returns a lot of other data which is not of interest to me. Is there any other RFC to extract required data without overhead of extracting other statistical data?
I found another RFC named 'SWNC_GET_WORKLOAD_STATISTIC' which also return similar set of data as 'SWNC_COLLECTOR_GET_AGGREGATES'. Interestingly, i'm not seeing any error when using this RFC form client machine and was able to get required data from table 'Times'.
Request clarification before answering.
A test against my backend system works ok. But the difference seems to be: in my case, the FM only returns 13000 lines for table "WBC", but zero lines for table "EXTSYSTEM". Most probably in your case, the FM also returns some lines in table "EXTSYSTEM", and NCo does not know how to interpret this data correctly.
If this is the case, then there are two possibilities:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"3.1.0.42" is not really the version... This is only the "Assembly Version", which we keep constant over all 3.1.x versions, so that the Microsoft .NET Runtime accepts all patch levels as "compatible".
The real version can be seen in the "File Version" field. Please make sure that this shows "3.1.4.3", which is currently the latest version. (Can be downloaded as "3.1.4 Hotfix 3" from the NCo download page.)
> but i'm surprised that no one else had reported this issue yet!
You need to know, that the ABAP DDIC (like the rest of the ABAP language) has grown historically and allows some pretty "pathologic" corner cases. If you look at the definition of SWNCAGGEXTSYSTEM, you will see that it is indeed a really strange structure. Basically it is a vector with one "un-named" field, and the contents of this field is a structure with 46 fields...
We do have some pretty pathologic test cases in our test-suite, but we cannot test all the possible thousands of exotic corner cases that ABAP developers around the globe can cook up in the ABAP DDIC... So even though NCo3 has first been released in 2012 and is used in thousands of applications, I am not surprised that there may still be some strange corner cases that NCo cannot decode correctly...
This is standard RFC. Shouldn't be all internal table and/or structure are initialized by RFC itself? How a table can be initialized before calling RFC through .Net connector? To initialize, should i need something like
rfcFunction.SetValue("EXTSYSTEM", XYZ )
where XYZ is an instance of 'SWNCAGGEXTSYSTEM' data structure contained by RFC. It means i've to create a proxy object for 'SWNCAGGEXTSYSTEM' and then proxy for each object used by this structure. There are more than 25 tables associated with this RFC and should i create proxy for each table? This does not make sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.