cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Proxy - R/3 to 3rd Party via XI CAUGHT cx_ai_system_fault

Former Member
0 Kudos

I am trying to get ABAP Proxy to work (I've been following blog from Ravi )

In my situation I have a list of data I want transferred from SAP R/3 to a 3rd Party System via XI - using ABAP Proxy.

When I debug my Triggering ABAP I can see that it builds my simple internal table correctly but when it does the

CALL METHOD prxy->execute_asynchronous

EXPORTING

output = mytableofdata.

commit work.

It gets an exception that is

CAUGHT cx_ai_system_fault

CX_ROOT INTERNAL_SOURCE_POS Structure: flat & not charlike

Here is the ABAP Trigger I have in R/3

REPORT  ZINFOR_TRIGGER_OPEN_POPR_PROXY.

DATA prxy TYPE REF TO ZINFOR_CO_MI_OA_OPEN_POPR_FROM.
*
CREATE OBJECT prxy.
DATA it TYPE  ZINFOR_MT_OPEN_POPR.


DATA lines type ZINFOR_DT_OPEN_POPR_LINES.
LINES-PRODUCT_CODE = 'PAULIE'.
lines-plant = '6666'.
APPEND LINES TO IT-MT_OPEN_POPR-LINES.
LINES-PRODUCT_CODE = 'PAULIE'.
lines-plant = '7777'.
APPEND LINES TO IT-MT_OPEN_POPR-LINES.



TRY.

    CALL METHOD prxy->execute_asynchronous
      EXPORTING
        output = it.
     commit work.

  CATCH cx_ai_system_fault .
    DATA fault TYPE REF TO cx_ai_system_fault .
    CREATE OBJECT fault.
    WRITE 😕 fault->errortext.
    WRITE 😕 fault->CX_ROOT.
ENDTRY.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello ,

DATA it TYPE ZINFOR_MT_OPEN_POPR

Can you check the type of the table, is the same used in the method output parameter type.

Regards.

Sreeni.

Former Member
0 Kudos

Hi,

Put the below data inside TRY as shown below and then check if it works. Also check all the data type compatability.

> TRY.

> DATA lines type ZINFOR_DT_OPEN_POPR_LINES.

> LINES-PRODUCT_CODE = 'PAULIE'.

> lines-plant = '6666'.

> APPEND LINES TO IT-MT_OPEN_POPR-LINES.

> LINES-PRODUCT_CODE = 'PAULIE'.

> lines-plant = '7777'.

> APPEND LINES TO IT-MT_OPEN_POPR-LINES.

>

>

> CALL METHOD prxy->execute_asynchronous

> EXPORTING

> output = it.

> commit work.

>

> CATCH cx_ai_system_fault .

> DATA fault TYPE REF TO cx_ai_system_fault .

> CREATE OBJECT fault.

> WRITE 😕 fault->errortext.

> WRITE 😕 fault->CX_ROOT.

> ENDTRY.

Regards,

Sarvesh

Former Member
0 Kudos

No that is not the problem.

Seems to be coming from the R/3 call using the CL_PROXY_FRAMEWORK XI_CALL_OUTBOUND

xi_call_outbound( ).

Is there something I need in R.3 to allow it to talk with XI ? (the SPROXY works but am I missing something else?

Former Member
0 Kudos

Hi,

The problem is in declaring the fault data type. You need to declare it in the very begining of your report e.g..

DATA fault TYPE REF TO cx_ai_system_fault .

CATCH cx_ai_system_fault INTO fault .

CREATE OBJECT fault.

WRITE 😕 fault->errortext.

WRITE 😕 fault->CX_ROOT.

ENDTRY.

Regards,

Sarvesh

Former Member
0 Kudos

No that is not the problem.

Somebody must have done such a simple example as per Ravi's Blog...? What am I missing...there must be some setting in R/3 that I need ?

Former Member
0 Kudos

HI,

Here is the original code which is running in my system. Compare with your code..

In my opinion you have some data type mismatch, check it again.

DATA: lcl_system_fault TYPE REF TO cx_ai_system_fault.

DATA:
      lcl_payment_terms TYPE REF TO ZXI_ERNCO_MIOUT_PAYMENT_TERMS,
      ls_out TYPE ZXI_ERNMT_PAYMENT_TERMS_TEST,
      ls_mess TYPE ZXI_ERNDT_PAYMENT_TERMS_TEST,
      ls_head TYPE ZXI_ERNTSTDT_HEAD,
      ls_data type ZXI_ERNDT_ITEM,
      lt_data type table of ZXI_ERNDT_ITEM.


move: 'Hello'       to ls_head-FIELD1,
          'And'        to ls_head-field2,
          'How r u'   to ls_head-field3.

ls_mess-HEADER = ls_head.
ls_mess-DATA = lt_data.
ls_out-MT_PAYMENT_TERMS_TEST = ls_mess.
 
CREATE OBJECT lcl_payment_terms.
  
TRY.
      CALL METHOD lcl_payment_terms->execute_asynchronous
        EXPORTING
          output = ls_out.

      COMMIT WORK.

    CATCH cx_ai_system_fault INTO lcl_system_fault.
      WRITE:/ 'Error: ', lcl_system_fault->errortext.
  ENDTRY.

Regards,

Sarvesh

Former Member
0 Kudos

I don't think so but I will check this yet again.

I do think it is something missing for R/3 to get to XI. When I debug down into this ABAP Trigger

I can see that is stops when attempt to get Business System...this is deep within the PROXY Framework in the method XI_PROXY_ROUTING.

SLD_API_EXCEPTION

CALL FUNCTION 'LCR_GET_OWN_BUSINESS_SYSTEM'

IMPORTING

bs_key_name = business_system

EXCEPTIONS

no_business_system = 1

no_rfc_destination = 2

no_landscape_directory = 3

illegal_arguments = 4

communication_error = 5

ld_error = 6

sld_api_exception = 7

OTHERS = 8.

Then it will CALL METHOD cl_proxy_runtime_errors=>raise_proxy_exception

It may be that I need to have the R/3 TCP/IP SM59 Destination SAPJ2EE working ? The connection test on this in SM59 in R/3 does not work.

Could this be why ?

Edited by: Paulie Seikmayt on Oct 20, 2008 9:38 PM

Former Member
0 Kudos

Well not very much sure about it, but you can comment the code for function module "LCR_GET_OWN_BUSINESS_SYSTEM" and use the business system name as a hardcoded value wherever it is required and then try.