cancel
Showing results for 
Search instead for 
Did you mean: 

R/3 to XI

Former Member
0 Kudos

Hi,

I have a requirement as below:

On my R/3 system, there is an abap program which writes the file to the local file system.

I want XI to pick up that file and write it to some where else. For this I can use file to file scenario.

But the issue is, after that abap program writes the file to the local, I want it to invoke the XI interface to pick the file.

I was trying to use Proxy to File scenario, but in that case the ABAP program should send the file to XI. But I want my abap program to just write the file to file system and then trigger XI which should be able to pick up the file.

Can anybody help me on how to accomplish this requirement.

Thank you

MLS

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Thanks Nilesh. I will try this out and let you know the result.

Former Member
0 Kudos

Hi Laxmi

Why dont you use Proxy to FIle and deliver the file to both the places where R/3 was delivering and where you want to deliver the file.

You can pass the data from internal table and can have a generic structure at PI side. using this you can have target and filename whichever you would like to use for variable substitution

proxy code given above will work

Thanks

Gaurav

Former Member
0 Kudos

Thanks so much Nilesh.

Can you give me a sample code on ABAP side of how you did this?

Thanks

Former Member
0 Kudos

This is a sample code which I used for testing .....

types: begin of tt_itab,

data type string,

end of tt_itab.

data: lt_itab type table of tt_itab.

data: gw_itab type tt_itab.

data: lt_row type zcl_string_tab.

data : l_string type string.

----


  • Local Variables

----


data: lv_filename type string, "Filename & path where file is stored

lv_string type string, "String for holding data

lv_tabix type sy-tabix. "Table Record Number

*Outbound Proxy declarations

DATA:

lv_out TYPE zcl_mt_budget_in,

lv_bacs_payments TYPE REF TO zcl_co_mi_budget_ob,

lv_fname TYPE rlgrap-filename.

data : lt_string_data type standard table of zst_budget_query initial size 0.

data : lw_string_data type zst_budget_query.

do 10 times.

lw_string_data-row = '121231242357488568957kfvgdghfjasfgas8453675347q34567vhjvsdfhf7rwt5r6735374'.

append lw_string_data to lt_string_data.

enddo.

lv_out-mt_budget_in-details-row = lt_row.

lv_out-mt_budget-details-row = l_string.

lv_out-mt_budget_in-header-file_name = 'Query333444_.txt'.

CREATE OBJECT lv_bacs_payments.

TRY.

CALL METHOD lv_bacs_payments->execute_asynchronous

EXPORTING

output = lv_out.

CATCH cx_ai_system_fault.

ENDTRY.

Hope this will help.

Nilesh

Former Member
0 Kudos

I thought so....ugh!!!

I can use proxy to file. But the problem is, I have hundred different files with different structures...

For eg: File1 is like below:

100,"test data1", 300

200,"test data2", 400

Now File2 is like below:

5248.98, DB, USD, 50000, "wwww"

4677.34, TN, USD, 60000, "xxxx"

Like wise I have hundred different files. Well, I dont want to create hundred different interfaces in XI to do that.

What can I do? I am just a rookie in XI so need your suggestions.

Former Member
0 Kudos

You dont need to create 100 different structure. :).. if you want to replicate data as it is while creating target file.

Pass data as a internal table of string and recreate them as it is.

Let me know if you need more details. I have done this in few interfaces.

NIlesh

Former Member
0 Kudos

Thanks for your quick reply.

I can use external controlled adapter but again my requirement is different.

After the ABAP program writes it to the file system, I want it to send the source directory and target directory as parameters to XI in the payload, so that on XI I can use variable substitution and can dynamically get the source directory from where to pick up the file and target directory of where to write the file.

Can we do this at all?

Former Member
0 Kudos

>>dynamically get the source directory from where to pick up the file

Not possible.

Thanx

Aamir

Former Member
0 Kudos

Laxmi,

Best option would be using outbound proxy to pass information to XI. Also you can pass on target file directory and name as well.

Nilesh

Former Member
0 Kudos

Oops... I understood it in other way.

Former Member
0 Kudos

Hi Laxmi,

Check out this blog...XI - Event based message triggering with dependencies

Hope this will help.

Nilesh

Former Member
0 Kudos

>>after that abap program writes the file to the local, I want it to invoke the XI interface to pick the file.

You can control adapter externally by sending a HTTP request from a program to activate/de-activate the adapter.

Search for "Control adapter externally" in the blogs section in SDN.

Thanx

Aamir