2008 Feb 18 8:14 AM
my present programe is creating file in the application server i got a requirement that the file need to be created in the application server separately for each and every plant, know the file is creating for all plants in the application server, any suggestion how to compare the plants and create the files separetly in appli server.
2008 Feb 18 8:46 AM
if it is a itab..
use AT NEW WERKS.
The dynamically create your file name and place it.
my present programe is creating file in the application server i got a requirement that the file need to be created in the application server separately for each and every plant, know the file is creating for all plants in the application server, any suggestion how to compare the plants and create the files separetly in appli server.
2008 Feb 18 8:46 AM
if it is a itab..
use AT NEW WERKS.
The dynamically create your file name and place it.
2008 Feb 18 9:15 AM
DATA:WK_string TYPE STRING.
DATA:Wk_EXT(4) TYPE C value '.xls'.
DATA:WK_path TYPE STRING.
LOOP AT ITAB.
AT NEW WERKS.
concatenate '/METERID/' ITAB-werks Wk_EXT into wk_path.
CONDENSE wk_path.
open dataset WK_path for output in text mode encoding default.
if sy-subrc <> 0.
write:'ERROR while opening dataset !!!!!!'.
EXIT.
endif.
concatenate 'Part No' 'Description'
into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
condense wk_string.
transfer wk_string to WK_path.
ENDAT.
CLEAR wk_string.
CONCATENATE ITAB-MATNR itab-maktx into wk_string
separated by cl_abap_char_utilities=>horizontal_tab.
transfer wk_string to WK_path.
at end of werks.
clear wk_path.
close dataset p_pfile.
endat.
Hope this meets ur req...
2008 Feb 18 9:23 AM
Sorry i made a mistake...
DATA:WK_string TYPE STRING.
DATA:Wk_EXT(4) TYPE C value '.xls'.
DATA:WK_path TYPE STRING.
LOOP AT ITAB.
AT NEW WERKS.
concatenate '/METERID/' ITAB-werks Wk_EXT into wk_path.
CONDENSE wk_path.
open dataset WK_path for output in text mode encoding default.
if sy-subrc 0.
write:'ERROR while opening dataset !!!!!!'.
EXIT.
endif.
concatenate 'Part No' 'Description'
into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
condense wk_string.
transfer wk_string to WK_path.
ENDAT.
CLEAR wk_string.
CONCATENATE ITAB-MATNR itab-maktx into wk_string
separated by cl_abap_char_utilities=>horizontal_tab.
transfer wk_string to WK_path.
at end of werks.
clear wk_path.
close dataset WK_path. "<----
endat.
endloop.
2008 Feb 18 11:03 AM
cl_abap_char_utilities=>horizontal_tab.
what is the use of this statement kesu.
2008 Feb 18 11:10 AM
This will just place the values in different columns in excel sheet or notepad file ( in the column seperator or tab seperator)
2008 Feb 18 8:53 AM
Hello,
You can easily distinguish the plants ina Itab.
Sort Itab by werks.
data: wa like itab.
loop at itab.
wa = itab.
at new werks.
open data " Here give a file name for every plant.
"transfer to file
" CLose Dataset
endat.
endloop.
Hope this will solve ur issue.
Cheers,
Vasanth
2008 Feb 18 9:04 AM
Rocky,
After you get all the data into final internal table.
LOOP AT i_final.
AT NEW plant.
OPEN DATASET v_datset FOR OUTPUT IN
TEXTMODE.
your logic here
CLOSE DATSET v_datset.
ENDAT
TRANSFER your same plant data to file.
ENDLOOP.
Note: for each fine name add your plant name.So that there will not no over writting of files.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |