cancel
Showing results for 
Search instead for 
Did you mean: 

Discarding unrequested

Former Member
0 Kudos

Hi,

I have installed the SAP RFC library and SAP4Rails.

Now I want to call one of our RFCs with the name "ZFM_ATLAS_SEARCH_FE"

The definition for the function is:

*"----


""Local Interface:

*" IMPORTING

*" VALUE(IS_FORCE_ATLAS) TYPE /ISDFPS/FORCE_TAB_GIS

*" VALUE(READINESS) TYPE /ISDFPS/READINESS OPTIONAL

*" VALUE(TASK) TYPE ZATLAS_TASK_S OPTIONAL

*" TABLES

*" ET_FORCE TYPE /ISDFPS/FORCE_TAB_GIS

*" ET_IT1000 TYPE /ISDFPS/FORCE_IT1000_TAB

*" ET_IT1950 TYPE /ISDFPS/FORCE_IT1950_TAB

*" ET_IT1952 TYPE /ISDFPS/P1952_T

*" ET_IT1951 TYPE /ISDFPS/FORCE_IT1951_TAB

*" EXCEPTIONS

*" FORCE_READ_ERROR

*" IT1952_READ_ERROR

*" IT1000_READ_ERROR

*" IT1950_READ_ERROR

*" IT1951_READ_ERROR

*"----


So I followed the instructions on Piers' Blog (/people/piers.harding/blog/2006/05/18/ruby-on-rails-with-ajax)

My model class looks like that:

-


require "SAP4Rails"

class Unit < SAP4Rails::Base

#You must define a list of RFCs to preload

function_module :ZFM_ATLAS_SEARCH_FE,

class << self

def list

Unit.ZFM_ATLAS_SEARCH_FE.call()

return Unit2.ZFM_ATLAS_SEARCH_FE.et_force.rows()

end

end

end

-


When I call the list method, I get an error that "et_force" is nil.

So I looked into the trace file, to see what's going on.

There I found the following lines in the response from the server:

***Discarding unrequested T:ET_FORCE

==== Delta 0 7 REG. (dummy entry)

==== Delta 0 7 LOG REJECT LINE 0 INFO 0

***Discarding unrequested T:ET_IT1000

==== Delta 0 8 REG. (dummy entry)

==== Delta 0 8 LOG REJECT LINE 0 INFO 0

***Discarding unrequested T:ET_IT1950

==== Delta 0 9 REG. (dummy entry)

==== Delta 0 9 LOG REJECT LINE 0 INFO 0

***Discarding unrequested T:ET_IT1951

==== Delta 0 10 REG. (dummy entry)

==== Delta 0 10 LOG REJECT LINE 0 INFO 0

***Discarding unrequested T:ET_IT1952

So, why are the tables unrequested and discarded. How I can make the RFC call expose the tables?

Thanks very much in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi - can you try using LIKE instead of TYPE in your table assignments in the interface definition, and see if this makes a difference.

Cheers,

Piers Harding

Former Member
0 Kudos

Thank you for that hint. Currently I do not have the editing rights for that Function Module, but I will see, what I can achieve.

Former Member
0 Kudos

ET_FORCE has a defined type of /ISDFPS/FORCE_TAB_GIS - can you show me what this type looks like ?

Piers Harding.

Former Member
0 Kudos

Ok, the line type of this table is "/ISDFPS/FORCE", which has about 40 fields. I do not see any more information, that might be helpful. Currently I am trying to get permission to create another function with LIKE instead of TYPE.

Regards

Bernd

Former Member
0 Kudos

Hi,

I cannot change the Type Specification to LIKE. The SAP system says "Tables using LIKE may only reference flat structures."

I also want to call another RFC, that has an Export parameter, that seemst to be a a deep structure. When I preload this RFC, I get an error. The trace file contains this line "RfcGetStructureInfoAsTable(ZATLAS_FE_DETAILS_S ) exception UNSUPPORTED_TYPE". In other forums I read, that the description should be requested as RFCTYPE_XMLDATA instead of RFCTYPE_STRUCTURE. Does SAP4Rails / SAP RFC support this?

Kind regards

Bernd

Former Member
0 Kudos

Hello,

me again 😄

I slightlz changed the Export parameter of my second RFC, so that is no longer a deep structure (this won't satisfy me in the end, but for testing it is ok). However no the RFC can be preloaded, but when calling it I get the error from Ruby:

"private method `sub!' called for 0:Fixnum"

It occurs in "C:/INSTAN1/INSTAN1/ruby/lib/ruby/gems/1.8/gems/saprfc-0.35-mswin32/lib/SAP/Rfc.rb:1594:in `chop'"

Any help please?

Bernd

Former Member
0 Kudos

Ok, I solved the last problem on my own. 😄 Seems to be a little bug in the SAP RFC...

Maybe it is useful for anyone else.

Ok, if you get the error

"private method `sub!' called for 0:Fixnum" in line 1594 of [path]/SAP/Rfc.rb

add the following in line 1592 of [path]/SAP/Rfc.rb:

val = val.to_s

Former Member
0 Kudos

Hi -

It occurs to me in this that you are using SAP::Rfc (saprfc) instead of the new sapnwrfc. This will not cope with deep structures at all in the way that you need. You need to switch to using sapnwrfc for this.

you must use sapnwrfc version 0.12 and get the latest version of sap4rails - 0.12.

Cheers,

Piers Harding.

Former Member
0 Kudos

Thank you very much for the answer! This kind of support really rocks!

Actually I have saprfc and sapnwrfc installed, as the download page of sap4rails indicates both as required dependency. The versions I have installed are saprfc 0.35, sapnwrfc 0.12 and sap4rails 0.12.

sap4rails definitely tries to access the SAP RFCs via saprfc, because when I uninstall it, I get an error, that it cannot be accessed.

I am a little bit confused. I read, that the saprfc will not be developed any more and the sapnwrfc will substitute it. But I see, that the latest version of saprfc is from 14-Mar-2007 (and it still has problems, when table fields have a numeric value, instead of a string, the famous line 1594).

How can I tell sap4rails, that it shall use sapnwrf instead of saprfc?

Best regards

Bernd

Former Member
0 Kudos

if you want to use sapnwrfc with sap4rails, you currently have to uninstall saprfc, or it will be overridden.

As for issues with saprfc - if you still want to use, then you can always supply me with patches for problems, so long as you supply a test script to go with it.

Cheers.

Former Member
0 Kudos

Sorry for still bothering with my questions. But I have problems to get sapnwrfc running. As the topic has changed, I will open a new thread, maybe it is useful also for others: