2007 Jun 28 7:34 AM
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
2007 Jun 28 7:36 AM
2007 Jun 28 7:37 AM
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
2007 Jun 28 7:38 AM
Hi
Use the Tcodes
CG3Y or CG3Z
or use the OPEN DATASET concept..
READ..
TRANSFER..
Reward points for useful Answers
Regards
Anji
2007 Jun 28 12:01 PM
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
2007 Jun 28 7:43 AM
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.
2007 Jun 28 7:56 AM
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
2007 Jun 28 8:13 AM
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.
2007 Jun 28 8:16 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |