‎2009 Jan 29 7:28 PM
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
‎2009 Jan 29 7:43 PM
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
‎2009 Jan 29 7:43 PM
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
‎2009 Jan 29 8:50 PM
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
‎2009 Jan 29 8:53 PM
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..
‎2009 Jan 29 7:44 PM
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.
‎2009 Jan 29 8:01 PM
Hi,
Proceed with Mubeen ahmed answer.
Its correct approach. Try it.
Give correct syntaxes for that ok.
Thanks & Regards
VSR