Application Development 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: 

regarding external file updation

Former Member
0 Kudos
66

update the values from external file to custom table zmzab.

structure of zmzab is werks, GJAHR, LETZTZUG .

first i have used the

parameters : datei(400).

OPEN DATASET datei FOR INPUT IN TEXT MODE ENCODING DEFAULT .

READ DATASET datei INTO eing.

MOVE-CORRESPONDING eing TO zw.

here it is moving values from eing for all plant.requirement is that based on select-option for werks we have to move values from eing to ZW.eing is a structure having fields werks matnr.

how to hande this .

6 REPLIES 6

Former Member
0 Kudos
45

You can not update the file it will replaced by new updated file.

Regards,

swarup

Former Member
0 Kudos
45

write as :

OPEN DATASET datei FOR INPUT IN TEXT MODE ENCODING DEFAULT .

READ DATASET datei INTO eing.

if eing-werks in s_werks.

MOVE-CORRESPONDING eing TO zw.

endif.

Former Member
0 Kudos
45

File on the application server would be tab delimited or csv or fixed length file.

Upload the contents of file into an internal table.

Structure of internal table should be such to hold each field.

Eg: CSV file

Record: Plant,material,material type

Open dataset...

read dataset....

split eing at ',' into wa_tab-plant

wa_tab-material

wa_tab-type.

append wa_tab to itab.

....

As a result itab will have all the details.

Now filter out the records for itab based on selction criteria.

Reward if useful.

0 Kudos
45

eing is a structure not an internal table

former_member195383
Active Contributor
0 Kudos
45

declare a work area of type of eing say wa_eing.

suppose u have the plant as parameter of ur selection screen.

OPEN DATASET datei FOR INPUT IN TEXT MODE ENCODING DEFAULT .

READ DATASET datei INTO eing.

after this write.....

loop at eing into wa_eing where wa_eing-werks eq pa_PLANT1.

append wa_eing to Zw.

endloop.

Hope it helps...

Reward points..if useful...

Former Member
0 Kudos
45

upload the contents of file into individual field of internal table.

Let's say :

File: CSV

Record in file: werks, matnr, mtart, customer

Open dataset...

read dataset....

split eing at ',' into wa_tab-werks

wa_tab-matnr

wa_tab-mtart

wa_tab-customer.

append wa_tab to itab.

As a result ITAB will be having individual fields of file. then delete the records of itab based on selection criteria.

reward if useful.