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

dynamic columns in file

Former Member
0 Likes
1,155

hi,

my requirement is to upload file from presentation server.

that file is .txt file.

the file contains field names in the first row and from second row actual data will be..

if the columns of the file interchanges the program shuld work as it is..i.e based on the field name we hav to move that value under that field name to the corresponding work area......

how to do it?

can any one help me in this....

hi,

my requirement is to upload file from presentation server.

that file is .txt file.

the file contains field names in the first row and from second row actual data will be..

if the columns of the file interchanges the program shuld work as it is..i.e based on the field name we hav to move that value under that field name to the corresponding work area......

how to do it?

can any one help me in this....

7 REPLIES 7
Read only

Former Member
0 Likes
1,013

Hi,

Refer to this blog.

Amresh

Read only

0 Likes
1,013

can we use if statement inside split command?

Read only

Former Member
0 Likes
1,013

Hi,

Do as I have explaine.

1) Upload the contents of the flat file in your application server into your internal table. The internal table structure must contain a single field of string type.

2) After getting the contents of the flat file into internal table. Use subsrting operation to segrigate the values that is the field name and its values.

Assign the internal table to a Field Symbol of Table Type say <TAB>.

FIELD-SYMBOLS: <fs1>.

Loop at <TAB> assigning <fs>.

Assign component 'F1' of structure <fs> to <fs1>.

wa_struct-F1 = <fs1>.

Assign component 'F2' of structure <fs> to <fs1>.

wa_struct-F2 = <fs1>.

.

.

.

append wa_struct to it_struct.

clear wa_struct.

endloop.

Hope this helps you.

Murthy.

Read only

0 Likes
1,013

is there any possibility to use case statement with the function module TEXT_CONVERT_XLS_TO_SAP

let itab be the table into which the xl data is coming..

i.e based on column can we move data like

case col-name

when indicator.

wa_input-poind = itab -poind.

when company code.

wa_input-bukrs = itab-bukrs.

endcase.

append wa_input to it_input.

Read only

Former Member
0 Likes
1,013

Hi.

No need to keep the field name in first row,remove it and use with actual data.

Regards.

Jay

Read only

0 Likes
1,013

my requirement is if the fields get interchanged in the file,then also corresponding data shuld be moved to corresponding work area based on the field name.

Read only

0 Likes
1,013

Hi,

I have the same requirement as yours. If you have solved your problem , Please let me know the solution.

Thanks and regards,

Parvatha Reddy