2006 Nov 24 4:02 AM
. In ABAP program, how do u access data that exists on a presentation server adn data that exists on an application server?
. what has to be done to the packed fields before submitting to a BDC session?
. In ABAP program, how do u access data that exists on a presentation server adn data that exists on an application server?
. what has to be done to the packed fields before submitting to a BDC session?
2006 Nov 24 4:11 AM
Use GUI_UPLOAD to get data from a presentation server.
Use OPEN DATASET to get data from a application server.
In BDC, it is better to declare all data types as character type.
2006 Nov 24 4:18 AM
Hi ,
Let me say, The data what you mane resides in a text file
For presentaion server :
use GUI_DOWNLOAD - To download the data from SAP to File in the
presenation server
use GUI_UPLOAD - To upload the data from the file which is on the
desktop to the SAP
For Application server :
You can use
<b>The following program shows how you can write internal tables into a file:</b>
( Application server to file ) myfile is the file name which resides on the application server , Please visit AL11 Tcode )
DATA FNAME(60) VALUE 'myfile'.
TYPES: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
TYPES ITAB TYPE LINE OCCURS 10.
DATA: LIN TYPE LINE,
TAB TYPE ITAB.
DO 5 TIMES.
LIN-COL1 = SY-INDEX.
LIN-COL2 = SY-INDEX ** 2.
APPEND LIN TO TAB.
ENDDO.
OPEN DATASET FNAME FOR OUTPUT.
LOOP AT TAB INTO LIN.
TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
OPEN DATASET FNAME FOR INPUT.
DO.
READ DATASET FNAME INTO LIN.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE: / LIN-COL1, LIN-COL2.
ENDDO.
CLOSE DATASET
-
<b>For writing the data to the application server file</b>
DATA FNAME(60) VALUE 'myfile'.
DATA: TEXT1(12) VALUE 'abcdefghijkl',
TEXT2(5),
LENG TYPE I.
OPEN DATASET FNAME FOR OUTPUT IN BINARY MODE.
TRANSFER TEXT1 TO FNAME.
CLOSE DATASET FNAME.
OPEN DATASET FNAME FOR INPUT IN BINARY MODE.
DO.
READ DATASET FNAME INTO TEXT2 LENGTH LENG.
WRITE: / SY-SUBRC, TEXT2, LENG.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET FNAME.
Update if you have doubt
Reward me if you get the useful information.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |