2008 Jun 26 10:59 AM
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 .
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 .
2008 Jun 26 11:02 AM
You can not update the file it will replaced by new updated file.
Regards,
swarup
2008 Jun 26 11:03 AM
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.
2008 Jun 26 11:06 AM
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.
2008 Jun 26 11:23 AM
2008 Jun 26 11:10 AM
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...
2008 Jun 26 11:13 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |