cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data in to application server

Former Member
0 Kudos

Hi All,

In lsmw I need to test some data.That program will take only application server files.I need to upload one(Tab delimmitted file ) and test.Here I am trying to upload tab delimitted text file to application server.How can I upload tab delimitted file in to application server.

I have taken one itab and uploaded data from presentation server.Now i am trying to put that itab data in to a file at application server along with tab.

Next I am trying to put that data in to application server file.What can I do to store data as it is like tab delemitted text file in presentation server.

I need to store fields to be stored along with tab.

How can I do it?

Regards

Vijaya P

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

U can store the file as a tabdelimited file in application server by separating fields of itab by '#' symbol.

U can upload the file by the open dataset and transfer dataset statements in the application server.

U can declare a variable like this

data:c_tab type c

value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

use this field as a separator of fields like

open dataset p_file for <i/p> in text mode.

if sy-subrc = 0.

loop at itab.

concatenate itab-fld1 itab-fld1 .... into v_text

separated by c_tab.

transfer v_text to p_file.

endloop.

close dataset p_file.

Thanks,

Vamsi.

Former Member
0 Kudos

hi,

Use Open dataset and close dataset statements for loading the file into application server / from application server

<b>OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING}

IN {TEXT/BINARY} MODE</b>

OPEN DATASET P_UNAME FOR INPUT IN TEXT MODE.

IF SY-SUBRC = 0.

CLOSE DATASET P_UNAME.

DELETE DATASET P_UNAME.

ENDIF.

OPEN DATASET P_UNAME FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC <> 0.

MESSAGE E039 WITH

'Message'.

ENDIF.

LOOP AT ITAB_OUT.

PERFORM ZYIR008_TRANSFER_DATASET USING 'C'

P_UNAME

ITAB_OUT SY-INDEX.

ENDLOOP.

CLOSE DATASET P_UNAME.

Regards,

Santosh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vijaya,

There is option for specifying delimeter in LSMW ; 7th Step specify file ;

hope it may help you.

Regards

Manoj B gupta

Message was edited by: Manoj Gupta

Former Member
0 Kudos

Vijaya,

For testing purpose you can always move the file from Presentation server to app server using CG3Z transaction.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hi ,

While using Cg3z system is asking for source and target file.So I am givi spurce file name c:\sampledata.txt and source as \temp\source1.txt

when i click on upload button system is showing an information that source1.txt can't open.

How can I overcome this problem

please answer.

Regards

Vijaya

Former Member
0 Kudos

Hi p vijaya,

1. I think u have given in the reverse way.

2. in the FIRST INPUT field,

(source file on front end)

give

c:\sampledata.txt

3. and in the second field

( Target file on application server)

give as \temp\source1.txt

(file name along with path is case sensitive

in case of application server)

<b>4. to check the full path,

u can use AL11 tcode.

the path can be for eg.

/usr/sap/DEV/SYS/gen/dbg/abc.txt</b>

regards,

amit m.