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

Read data from Presentation Server

Former Member
0 Likes
821

Greeting to everyone,

Could I know how to read the data from the input file (Check for Student_ID) and retrieve the data from course table when the student_ID match with student_ID from Course table. My input file (text file) layout is as below. Please kindly provide some guide with sample code. Thank you.

<b>Layout of Input File 1</b>

<u>I_file</u>

Student_ID S_Name S_Age

<u>Internal table</u>

<b>Course</b>

Student_ID C_Detail C_mark

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
785

Hi Little,

In this is case you follow the following steps mentioned below

1) Read all the data in the file from the presentation server to internal table

using the function module GUI_UPLOAD..

2) once u receiving the data from file to ur own internal table say i_itab1[], you read it to ur processing internal table say i_itab2[] from i_itab1[] based on your selection conditon..

3) sometime back i used GUI_upload.. so i am searching for tht code if i get i will let u know.. but u can find code for this FM....

But i suggest if u follow the below steps it is not a problem..

if it helps you plz provide reward points,

Regards,

Kali Prasad

4 REPLIES 4
Read only

Former Member
0 Likes
786

Hi Little,

In this is case you follow the following steps mentioned below

1) Read all the data in the file from the presentation server to internal table

using the function module GUI_UPLOAD..

2) once u receiving the data from file to ur own internal table say i_itab1[], you read it to ur processing internal table say i_itab2[] from i_itab1[] based on your selection conditon..

3) sometime back i used GUI_upload.. so i am searching for tht code if i get i will let u know.. but u can find code for this FM....

But i suggest if u follow the below steps it is not a problem..

if it helps you plz provide reward points,

Regards,

Kali Prasad

Read only

Former Member
0 Likes
785

Hi Little,

First populate all the data from text file to internal table throguh GUI_UPLOAD then select data from data base table into other internal table by using forall entreis on the first internal table. Then you will get proper data.

Hope this helps you, reply for queries, Shall post you the updates.

Regards.

Kumar. .

Read only

0 Likes
785

Hi,

Appreciate if you can provide some sample code related, so that I able to understanding more clearly. Thank you.

Read only

Former Member
0 Likes
785

Hi

In this case you can use two function modules..First one is simple 'UPLOAD' and the most prefered one is 'GUI_UPLOAD'...This is the easiest way to upload file from presentation server..If your file is a text file give the parameters as shown in the given example...Put field seperator as ' # ' if it is tab delimited..The internal table shold have the same structure of your file....See the example..Reward all the helpful answers....

START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'C:\test.txt'

  • FILETYPE = 'ASC'

has_field_separator = '#'

  • HEADER =

TABLES

data_tab = it_file

.