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

Application Server Question

former_member188001
Active Participant
0 Likes
601

Hello all,

I have data in an internal table. I want to write that data to application server and read the data back. Can you please suggest the best approach to go for that. Currently, the code I have written is

CONCATENATE '/ifr/' sy-sysid '/dtd/' g_date g_time '.TXT' INTO g_file.
OPEN DATASET g_file FOR APPENDING IN BINARY MODE MESSAGE g_msg_text.

When I go into Al11 and see the data, I see that each character is seperated by #. I dont think this is a good way of writing data to Apps Server.

Regards,

Salil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi Salil,

May be your file is a tab delimited file.

Download data to Application server:

Use Transfer statement.

OPEN DATASET ......................

LOOP AT ITAB IN TO WA_ITAB.

TRANSFER WA_ITAB TO FILENAME.....

ENDLOOP.

CLOSE DATASET....

Reading data from Application server:

Use Read statement.

OPEN DATASET......

DO.

READ DATASET FILENAME INTO WA_ITAB.

IF SY-SUBRC EQ 0.

APPEND WA_ITAB TO ITAB.

ELSE.

EXIT.

ENDIF.

ENDDO.

Please check syntax of OPEN DATASET, CLOSE DATASET, TRANSFER & READ DATASET.

I just gave an overview.

Mubeen

5 REPLIES 5
Read only

Former Member
0 Likes
583

Hi Salil,

May be your file is a tab delimited file.

Download data to Application server:

Use Transfer statement.

OPEN DATASET ......................

LOOP AT ITAB IN TO WA_ITAB.

TRANSFER WA_ITAB TO FILENAME.....

ENDLOOP.

CLOSE DATASET....

Reading data from Application server:

Use Read statement.

OPEN DATASET......

DO.

READ DATASET FILENAME INTO WA_ITAB.

IF SY-SUBRC EQ 0.

APPEND WA_ITAB TO ITAB.

ELSE.

EXIT.

ENDIF.

ENDDO.

Please check syntax of OPEN DATASET, CLOSE DATASET, TRANSFER & READ DATASET.

I just gave an overview.

Mubeen

Read only

0 Likes
582

Hi Mubeen,

Thanks for the response. I would like to know whether, I should Open the Dataset in Text Mode/Binary Mode ? and should I create the file with .TXT Extn or with .CSV etc.

Regards,

Salil

Read only

0 Likes
582

mode is upto you... if some one is consuming.. ask them which type and which mode they want... if its just lieing in the APP server.. it will be ur call..

Read only

amit_khare
Active Contributor
0 Likes
582

Data which you see throiugh is how it resides in the memery with UNIX box.

When you download it to windows system or vies in the appropriate editors, it will come in proper format.

Read only

Former Member
0 Likes
582

Hi,

Proceed with Mubeen ahmed answer.

Its correct approach. Try it.

Give correct syntaxes for that ok.

Thanks & Regards

VSR