Skip to Content
avatar image
Former Member

Return values to the proxy structure , incompatible Error in report ?

Hi Friends ,

Our scenario is ABAP proxy to File . I have tested the sample scenario using the following link.

<i><b>ABAP Proxy to File</b></i>

/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy

It is working fine. It is sending data with one structure like

<b>

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_EmpProfileMsg_OB xmlns:ns0="urn:AbapProxyTest">

<Empno>a101</Empno>

<EmpName>ragha</EmpName>

<DepartmentName>mis</DepartmentName>

</ns0:MT_EmpProfileMsg_OB></b>

but, our requirement is to send multiple values . like

<ns0:MT_EmpProfileMsg_OB xmlns:ns0="urn:AbapProxyTest">

<ROW>

<Empno>a101</Empno>

<EmpName>ragha</EmpName>

<DepartmentName>mis</DepartmentName>

</ROW>

<ROW>

<Empno>a102</Empno>

<EmpName>VENDRA</EmpName>

<DepartmentName>mis</DepartmentName>

</ROW>

</ns0:MT_EmpProfileMsg_OB></b>

While i was generating the proxy it is generating it has generated th follwing

<b>Class</b> ZECCSPPCO_MI_ECC_SPP_OB Proxy Class (Generated)

<b>Structure</b> ZECCSPPDT_ECC_TO_SPP_IB Proxy Structure (Generated)

<b>Structure</b> ZECCSPPDT_ECC_TO_SPP_IB_ROW Proxy Structure (Generated)

<b>Structure</b> ZECCSPPMT_ECC_TO_SPP_IB Proxy Structure (Generated)

<b>Table Type </b>ZECCSPPDT_ECC_TO_SPP_IB_RO_TAB Proxy Table Type (Generated)

-


With reference to the blog 1387 ,we are using this code as reference , but this is for one set of data , we need for multiple structutre what to do

&----


*& Report ZBLOG_ABAP_PROXY

*&

&----


*&

*&

&----


REPORT zblog_abap_proxy.

DATA prxy TYPE REF TO zblogco_proxy_interface_ob.

*

CREATE OBJECT prxy.

<b>DATA it TYPE zblogemp_profile_msg.

TRY.

it-emp_profile_msg-emp_name = 'Sravya'.

it-emp_profile_msg-empno = '80101'.

it-emp_profile_msg-DEPARTMENT_NAME = 'NetWeaver'.

CALL METHOD prxy->execute_asynchronous

EXPORTING

output = it.

commit work</b> .

CATCH cx_ai_system_fault .

DATA fault TYPE REF TO cx_ai_system_fault .

CREATE OBJECT fault.

WRITE :/ fault->errortext.

ENDTRY.

-


<b><i>My question is</i></b>

1. While we are assigning the values for Multiple rows . It is showing as Type mis match error .

<b> Can you please explain as how to pass value to structure and reutrn the values to create file ?</b>

Regards.,

Shyam

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 24, 2007 at 04:22 AM

    Hi Shyam,

    >>our requirement is to send multiple values ................

    for that u try thiscode and see..........

    DATA prxy TYPE REF TO ZECCSPPCO_MI_ECC_SPP_OB Proxy Class.

    CREATE OBJECT prxy.

    DATA:M_EMP TYPE ZECCSPPMT_ECC_TO_SPP_IB,

    I_EMP TYPE TABLE OF ZEMPDETAILS, //create a table in SE11 in the name ZEMPDEATILS

    W_EMPD TYPE ZEMPDETAILS,

    W_EMP TYPE ZECCSPPDT_ECC_TO_SPP_IB_ROW,

    S_EMP TYPE ZECCSPPDT_ECC_TO_SPP_IB,

    T_EMP TYPE ZECCSPPDT_ECC_TO_SPP_IB_RO_TAB.

    SELECT * FROM ZEMPDETAILS

    INTO CORRESPONDING FIELDS OF TABLE I_EMP.

    LOOP AT I_EMP INTO W_EMPD.

    W_EMP-emp_name = W_EMPD-enp_name.

    W_EMP-empno = W_EMPD-empno.

    W_EMP-DEPARTMENT_NAME = w_EMPD-DEPARTMENT_NAME.

    APPEND W_EMP TO T_EMP.

    ENDLOOP.

    S_EMP-EMPLOYEE = T_EMP.

    M_EMP-MT_SRC_FILE2ABAP_CLIENT_PROXY = S_EMP.

    TRY.

    CALL METHOD prxy->execute_asynchronous

    EXPORTING

    output = M_EMP.

    commit work.

    CATCH cx_ai_system_fault .

    DATA fault TYPE REF TO cx_ai_system_fault .

    CREATE OBJECT fault.

    WRITE :/ fault->errortext.

    ENDTRY.

    Regards

    preetha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2007 at 07:19 PM

    Hi,

    Firstly, make sure that the proxy is generated for Outbound Interface (in Integration Repository) having a structure with cardenality which is not 1..1. This means that the structure can support a repeated values.

    Secondly, in ABAP code of proxy report, make sure that the data type declared for itab and work area are same as that of line type of generated class in proxy.

    Hope this would solve your problem. If it doesnt, let me know. I would supply a piece of code for the same.

    Thanks,

    Bhavish

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Bhavish Bhatia ,

      Thanks for your reply .As per your reply

      <i>make sure that the proxy is generated for Outbound Interface (in Integration Repository) having a structure with cardenality which is not 1..1. This means that the structure can support a repeated values.</i>

      Yes , proxy is generated for Outbound Interface for n..n . If i use test Proxy (F8) with generated xml data data. For sample it is passsing 2 set of records and it is successfully created the File .

      Can you please provide the Sample code. We are facing the problem like incompatible to output like that.

      Regards.,

      Shyam