cancel
Showing results for 
Search instead for 
Did you mean: 

Remote function alternate works and fails

Former Member
0 Kudos

Hello everybody,

I am dealing with a weird problem related to a remote-enabled function module. The function hits a web service provided by a government entity (it is the Argentinean tax authority AFIP). The problem is that when I execute the function, from SE37, it fails the first time, then I go back and execute it again and the second time it works fine. Then the cycle repeats: fail, works, fail, works.

It looks like the problem is in the connection, but I can only tell that because the name of the exception in the FM is COMMUNICATION_ERROR.

Additional info:

- This problem happens in a QA environment.

- In the production environment it works just fine

- I checked the requested RFC destination in SM59 in both environments and they are set the same, except for one uses the PRD server and the other one the test server as Gateway Host.

Does anyone have an idea where I can start looking at? Are these errors logged somewhere, any extra configuration I should be checking, anything might help.

If you need additional information please let me know.

Thank you very much for your help!

Federico

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello all:

Finally we discovered what was wrong with this. It had nothing to do with SAP, the problem was in the remote function. After restarting the application server it all started to work well.

Thanks for your time.

Federico

Answers (4)

Answers (4)

iaki_vila
Active Contributor
0 Kudos

Hi Federico,

I have a little doubt about your scenario, are you using a PI like middleware or you are consuming the webservice directly from the ERP?.

You have detected the problem, in the quality system perhaps the endpoint has data with any error. If you have a PI you can use it to detect what data is format incorrect (or with format that you don't know that it could reach your system) and to try to check all weird situation before the response arrives to the RFC.

Also you can try to avoid the float type and to use an easy string, later you can transform the value to float inside ABAP. From my point of view is better to do all transformations inside PI, because this is one of the main usage of PI. You could think about to use the abap proxy communication instead of RFC, this technology has several advantages that RFC being more supportable.

Summing up, check the data in PI monitoring and try to prepare the data thinking in all possible situations.

Regards.

Former Member
0 Kudos

Hello Iñaki,

We are not using PI. So I believe it is configured directly to the outside.

I wrote a little test program that invokes the RFC with exactly the same code as in my quality environment, and it works fine. Then it must be a configuration issue in quality.

I will continue to look into the SOA MANAGER.

Thanks,

Federico

Former Member
0 Kudos

Hi, I have some extra information. But unfortunately I could not perform the tests you suggested. I could not find the connection in SOA MANAGER, is there any other place where this can be configured?

What I have found now is that when the RFC is executed from within my main program (not directly in SE37) I get an "ABAP runtime Error" dump. The message in the dump says:

What happened?

    The structures use in a Remote Function Call have different data layouts

    on the RFC client-side and the RFC server-side. They cannot be converted

    into one another.

Error analysis

    A data error occurred when executing a Remote Function Call.

    The length of one of the fields is incorrect.

    Length of source field... 5

    Length of target field .. 8

   Data type of field....... 7

   (Data type 0=C, 1=D, 2=P, 3=T, 4=X, 6=N, 7=F, 8=I)


So it now looks like an interface problem. From the data field type (F) I can infer what parameter is about but I am not sure and I am not entitled to change the program to test as it's someone else development. The main program call looks like this:

     DATA: w_monctz TYPE float.

    CALL FUNCTION 'Z_FEXGETPARAM_CTZ'
      DESTINATION 'AFIP_WSFEX'
      EXPORTING
        cuit_emisor         = cuit
        mon_id              = pe_fex_cae_h-moneda_id
      IMPORTING
        mon_ctz             = w_monctz


As you can see the only thing declared as Float is the variable w_monctz. If I check the function 'Z_FEXGETPARAM_CTZ' definition, parameter mon_ctz is declared as DEC 9 with 6 decimal places. Do you think this might be causing the issue?

This is getting really confusing... let me know if you need clarification.

Thanks!!

Federico

allamudi_loordh
Active Participant
0 Kudos

Hi Federico,

Just take the url from Soap receiver channel try trigger the data from Soap ui tool and see if any difference in response that you are getting... this is primary check.. later on this you can decide...where the problem and all.

thank you.

Regards,

loordh.

Former Member
0 Kudos

Hi Federico,

Primarily it seems that there is some issue with the RFC connection you are using.

Please give some more details/logs of the issue.

Thanks,

Kalyan