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

data transfer in sessions

Former Member
0 Likes
455

. 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?

2 REPLIES 2
Read only

Former Member
0 Likes
412

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.

Read only

manivanna_prabu
Participant
0 Likes
412

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.