Sample ABAP program for Updating notepad file data to Internal table and Sending it to Application server

 *--Structure type

TYPES: BEGIN OF TY_STD,

RONO TYPE C LENGTH 4,

NAME1 TYPE C LENGTH 20,

GEN TYPE C LENGTH 6,

FEES TYPE C LENGTH 10.

END OF TY_STD.




*--Header line and internal table

DATA WKA TYPE TY_STD.

DATA INT_TAB TYPE TABLE OF TY_STD.

*--Application server files are known as "Datasets"

*--here "fname" is the Dataset

DATA FNAME TYPE C LENGTH 40 VALUE "StudentsInfo.txt".

*--Convert notepad file data into internal table

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:Documents and SettingsAdministratorDesktopstudents.txt'

HAS FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = INT_TAB.

*--Sending data to Application Server

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT INT_TAB INTO WKA.

TRANSFER WKA TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

Comments

Popular posts from this blog

Domains and Data Elements

How to update exchange rates via process chain in BW