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

help! upload data to sap server

Former Member
0 Likes
662

hi,

which function can upload the internal table data to sap server? i need the field separated by tab,not is a string.

please give me some suggestion.thank you !

regards

sophia

5 REPLIES 5
Read only

Rodrigo-Giner
Active Contributor
0 Likes
638

There is no function.

You have to use OPEN DATASET, search in forum por uploading files to application server.

Read only

0 Likes
638

hi.

use "the open dataset" , the field of the internal will concatenated a string .

eg. itab-col1 = 000022

itab-col2 = abcd

itab-col3 = kkll

at sap server ,the text is '000222abcdkkll' ,is can not separated by tab.

how solve this question? ths.

sophia

Read only

0 Likes
638

Easiest way is to create a variable of type C that is the length of your output record and then loop at your itab and do this:

DATA: wa_outstring(100) type c.

CONSTANTS: c_tab TYPE x VALUE '09'.

CONCATENATE itab-col1 itab-col2 itab-col3 into wa_outstring separated by c_tab.

Then write each wa_outstring to your dataset.

Read only

former_member195698
Active Contributor
0 Likes
638

Check the Code within the FM C13Z_FILE_UPLOAD_ASCII but there is no FM for direct download internal table to App server

Read only

Former Member
0 Likes
638

sample code....

OPEN DATASET dsn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

" opens a file for writing; if the file is not thr in the working direct

"ory it will create one with the same name.

LOOP AT itab.

concatenate itab-fname itab-lname itab-place into rec separated by space

.

TRANSFER rec TO dsn.

rec = ''.

ENDLOOP.

CLOSE DATASET dsn.

use

CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB

for getting tab limited file....

Regards

vasu