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

about uploading into application server

Former Member
0 Likes
556

hi,

i have a flat file with different record types in the sense

first line will be a file header

second line will be a invoice header

third line will be a invoice item

fourth will be a Invoice Item Tax Lines

and at last there will be file trailer

under second line the third and fourt line may or may not repeat

but the thing is file we have different fields for the different lines

so my question is how can we catch that flat file in the internal table

means what are the fields to be declared

can anyone pls help me.

thanks and regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
516

Hi

You can simply use the TCODE

<b>CG3Z</b>

for copying the contensts of your local file to Application server.

Reward points if useful

Regards

Anji

4 REPLIES 4
Read only

Former Member
0 Likes
517

Hi

You can simply use the TCODE

<b>CG3Z</b>

for copying the contensts of your local file to Application server.

Reward points if useful

Regards

Anji

Read only

0 Likes
516

HI ANJI,

thank you very much for giving such a wonderful suggestion and information.

i have sent a thread again if you can please help me out in that matter

thanks and regards,

md.ibrahim

Read only

dev_parbutteea
Active Contributor
0 Likes
516

HI,

first declare a structure and an internal table in the format you expect the file to contain data.

then use

where p_logic is the path of file from selection screen

w_nom = p_flogic.

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

logical_filename = w_nom

parameter_1 = w_numlot1

IMPORTING

file_name = w_fichier

EXCEPTIONS

file_not_found = 1

OTHERS = 2.

Data: wa type tt_erreur,

len type i.

OPEN DATASET w_fichier FOR input IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.

do.

READ DATASET w_fichier INTO ws_file.

IF sy-SUBRC = 0.

APPEND ws_file TO wt_file.

else.

exit.

ENDIF.

enddo.

ENDIF.

CLOSE DATASET p_flogic.

Read only

Former Member
0 Likes
516

Hi Ibrahim,

when i understand you right in your flat-file are several record-type.

insert in your flat-file an ident-field.

fill this for example with 1 for for header 2 for invoce etc.

upload the flat-file in an internal table with no structure.

loop at this table and check if the ident is 1 then put it an other table

for header, if 2 put it an the internaltable for invoice etc.

hope it helps.

Regards, Dieter