Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Outbound file interface in CSV format ( ABAP OO )

Former Member
0 Likes
735

Hello folks,

I am new to the OO ABAP and trying to write outbound interface for couple of HCM tables. It is the piece of cake for me if I do it in regular ABAP but I choose the to it hard way because I want to do it in OO ABAP. I have read several post from Narish . They were great.

Letu2019s get the point , how I will go off writing an outbound interface ..

I have looked the class CL_RSAN_UT_APPSERV_FILE_WRITER and its methods

APPSERVER_FILE_WRITE

CONSTRUCTOR

FREE

OPEN

CLOSE

WRITE

But it seems like I canu2019t use my internal table because u201CI_DATA_TABu201D type in method APPSERVER_FILE_WRITE.

Any help will be appreciated.

Thanks,

UA

Hello folks,

I am new to the OO ABAP and trying to write outbound interface for couple of HCM tables. It is the piece of cake for me if I do it in regular ABAP but I choose the to it hard way because I want to do it in OO ABAP. I have read several post from Narish . They were great.

Letu2019s get the point , how I will go off writing an outbound interface ..

I have looked the class CL_RSAN_UT_APPSERV_FILE_WRITER and its methods

APPSERVER_FILE_WRITE

CONSTRUCTOR

FREE

OPEN

CLOSE

WRITE

But it seems like I canu2019t use my internal table because u201CI_DATA_TABu201D type in method APPSERVER_FILE_WRITE.

Any help will be appreciated.

Thanks,

UA

1 REPLY 1
Read only

naimesh_patel
Active Contributor
0 Likes
445

In order to use the method WRITE or APPSERVER_FILE_WRITE, you need to fill the table TYPE RSANM_FILE_TABLE by concatenating your fields of internal table using the separator (e.g. Horizontal tab, pipe sign, comma) which would be understood by the reader of the file.

Like:


data:  li_data_tab TYPE STANDARD TABLE OF string.
LOOP at itab into wa_tab.
       CONCATENATE wa_tab-field1
                    wa_tab-field2 
       into lwa_file separated by cl_abap_char_utilities=>horizontal_tab.
        APPEND lwa_data_tab TO li_data_tab.
endloop.

Regards,

Naimesh Patel