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

interface file structure

Former Member
0 Likes
401

hi

i am developing an interface

the file need to be come in below format

"NAMEu201D,u201Du201D,u201D654321u201D,u201Du201D,u201D87654321u201D,u201Du201D,u201DBANK CITY NAMEu201D,u201DGBu201D

seperated by ,

and every field must be in between " "

regrads

sachin.

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
356

Look at function module [SAP_CONVERT_TO_CSV_FORMAT|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=converttocsv+format&adv=false&sortby=cm_rnd_rankvalue].

Regards

Read only

MarcinPciak
Active Contributor
0 Likes
356

Try simply concatenating your fields into one string field (you must also include all qoutation marks in it) i.e.


data: field1(4) type c value 'NAME', 
        field2(6) type c value '654321',
        ...
        result_field type string.

perform concat_with_qoute_marks using field1.
perform concat_with_qoute_marks using field2.
perform concat_with_qoute_marks using field3.
perform concat_with_qoute_marks using field4.

form concat_with_qoute_marks using field type c.
    data: part_result type string.

    concatenate '"' field '"' into part_result.   "field like  "field"

    concatenate result_field part_result into result_field separated by ','.  " "field", "field2",....
endform.

This should help

Regards

Marcin