Skip to Content
0
Mar 02, 2006 at 01:12 PM

Need help changing this ABAP XI Proxy sample code to fit what I'm doing

21 Views

Hello, everyone! 😊 I've been googling and searching through the SDN forums for the past day trying to find the answer on my own. I found some sample code, but after a lot of unsuccessful trial-and-error in SAP, I'm hoping someone out there can help me out.

I am working on an outbound interface with a colleague. She is doing the "XI" portion of the interface, and I am doing the ABAP Proxy. What I'm doing is relatively straight-forward: I'm reading data from SAP, putting it into an internal table, and it's the data in that table that needs to go back to XI. Each record in my internal table represents one person (PERNR). The fields represent data that will eventually become separate record types that we'll send off-site to another system.

Sample record contains data for:

<Record 01><Record 02><Record 03><Record 04 "A"><Record 05 "A"><Record 04 "B"><Record 05 "B">

Record 04 and Record 05 exists twice because a person might have just a record 04/05 for "A", just a record for 04/05 for "B", or records for both. In any event, if situation "A" occurs, they have an 04/05 record. If situation "B" occurs, they have an 04/05 record for that as well.

Here's the sample code I plucked from SDN:

&----


*& Report ZBLOG_ABAP_PROXY

*&

&----


*&

*&

&----


REPORT zblog_abap_proxy.

DATA prxy TYPE REF TO zblogco_proxy_interface_ob.

*

CREATE OBJECT prxy.

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

.

CATCH cx_ai_system_fault .

DATA fault TYPE REF TO cx_ai_system_fault .

CREATE OBJECT fault.

WRITE :/ fault->errortext.

ENDTRY.

Here's the class, structures, and tables generated for me to use from XI:

  • Class: ZXI_CO_OB_HRBN_PURDUE_STD_LTD

  • Struc: ZXI_DT_PURDUE_RECORD01

  • Struc: ZXI_DT_PURDUE_RECORD02

  • Struc: ZXI_DT_PURDUE_RECORD03

  • Struc: ZXI_DT_PURDUE_RECORD04

  • Struc: ZXI_DT_PURDUE_RECORD05

  • Struc: ZXI_DT_PURDUE_STD_LTD

  • Struc: ZXI_MT_HRBN_PURDUE_STD_LTD

  • Table: ZXI_DT_PURDUE_RECORD01_TAB

  • Table: ZXI_DT_PURDUE_RECORD02_TAB

  • Table: ZXI_DT_PURDUE_RECORD03_TAB

  • Table: ZXI_DT_PURDUE_RECORD04_TAB

  • Table: ZXI_DT_PURDUE_RECORD05_TAB

Ok, I know where to plug in the Class (that's what my "prxy" reference variable will reference). I was told structure ZXI_DT_PURDUE_STD_LTD includes the structures for the 5 record type (01 thru 05) above it.

I think I'll have to loop thru my internal table, populating the above stuff. I feel like the "MT" structure above will be the "it" table in the example based on another example I saw, but is that true? I've had tables generated for each of the 5 record types. The sample SDN code is a simple one, of course, and I feel like I'm so close to figure this out -- I think I have the pieces, I just don't know how to put them together.

Can someone tell me what my processing should look like. It can be simple pseudocode, as long as it references those "XI" items above. Thanks so much, folks -- points will be awarded for all helpful information. 😊