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

get the file from app server

Former Member
0 Likes
1,075

hi experts,

can anybody tell about how to download the file from app server to presentation server..

and

how to validate data which is present there in app server

thank in advance.

chandra

hi experts,

can anybody tell about how to download the file from app server to presentation server..

and

how to validate data which is present there in app server

thank in advance.

chandra

8 REPLIES 8
Read only

Former Member
0 Likes
1,035

Hi,

Use GUI_DOWNLOAD Fm.

Thanks,

Deepti

Read only

Former Member
0 Likes
1,035

HI..,

CG3Y is the transaction code.. to copy an application server file directly on to the presentations server...

To get the file from the presentation server to your program you have to use the GUI_UPLOAD function module !!

Please do remember to close the thread when ur problem is solved !! reward all helpful answers !!

regards,

sai ramesh

Read only

Former Member
0 Likes
1,035

Hi

Use the Tcodes

CG3Y or CG3Z

or use the OPEN DATASET concept..

READ..

TRANSFER..

Reward points for useful Answers

Regards

Anji

Read only

0 Likes
1,035

hi Anji Reddy,

thanks for your answer.

can you plz tell how to validate the data which is there in app server

thanks in advance,

chandra

Read only

Former Member
0 Likes
1,035

HI,

THIS MIGHT HEALP YOU OUT

OPEN DATASET 'CHAN.TXT' FOR INPUT IN TEXTMODE ENCODING DEFAULT.

DO

READ DATASET 'CHAN.TXT' INTO ITAB.

IF SY-SUBRC EQ 0.

APPEN ITAB.

CLEAR ITAB.

ELSE EXIT

ENDIF.

ENDDO.

CLOSE DATASET 'CHAN.TXT'.

LOOP AT ITAB

WRITE ; ITAB-MATNR,ITAB-MTART.

ENDLOOP.

Read only

Former Member
0 Likes
1,035

Hi, Use below sample Code

  • Open a file

OPEN DATASET <file name> FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc <> 0.

give error message

ELSE.

DO.

  • Read a file

READ DATASET <file name> INTO <variable>.

IF sy-subrc <> 0.

EXIT.

ENDIF.

  • Append record to internal table

SPLIT <string varibable> AT <delimiter> INTO <internal table-field name1>

<internal table-field name2>

..

..

..

APPEND <internal table>.

ENDDO.

  • Close a file

CLOSE DATASET <file name>.

IF sy-subrc <> 0.

give error message.

ENDIF.

ENDIF.

ENDIF.

Above code will read data from Application server to internal table then you can use

FM GUI_DOWNLOAD to create file on presentation server.

Regards,

Digesh Panchal

Read only

Former Member
0 Likes
1,035

Hi,

Use OPEN_DATASET to open the file in the Application Server.

READ_DATASET to read the file in the Application Server using textmode option.

Append the contents to an internal table in your code and then

CLOSE_DATASET to close the file in the Apllication Server.

Then, use function module GUI_DOWNLOAD to pass the internal table to a file in your Presentation Server.

Regards,

Sangeeta.

Read only

Former Member
0 Likes
1,035

HI

To open a file on the application server, use the OPEN statement as follows:

Syntax

OPEN DATASET <dsn> [Additions].

This statement opens the file <dsn>. If you do not specify any additions for the mode, the file is opened in binary mode for reading. SY-SUBRC returns 0 if the system opens the file. Otherwise, SY-SUBRC is set to 8.

You enter the filename <dsn> either as a literal or as a field containing the actual name of the file. If you do not specify a path, the system opens the file in the directory in which the R/3 System is running on the application server. To open a file, the user under which the R/3 System is running must have the requisite authorizations at operating system level.

Filenames are platform-specific. You must therefore use file- and pathnames that conform to the rules of the operating system under which your R/3 System is running. However, you can also use logical filenames to ensure that your programs are not operating system-specific. For further information, refer to Using Platform-Independent Filenames.

DATA FNAME(60).

FNAME = '/tmp/myfile'.

OPEN DATASET 'myfile'.

OPEN DATASET FNAME.

This example works as long as your R/3 System is running under UNIX. The program opens the file "myfile" in the directory in which the R/3 System is running, and also opens the file "myfile" in directory "/tmp". However, you would have to change the filename for other operating systems. For example, for OpenVMS, you could write the following:

FNAME = '[TMP]myfile.BIN'

OPEN DATASET 'myfile.BIN'.

Reward.

regards,

Jay