07-14-2006 3:32 PM
Hi,
I have a doubt in my outbound file report.
1. Plant field is used in select options and for different plant separate file should be downloaded into application server.
This is how i have made one file
CONCATENATE
c_path "file path
c_qm " 'QM'
c_underscore "underscore
c_results " 'RESULTS'
s_werks "plant
sy-datum+4(2) "system date
sy-datum+6(2)
sy-datum+0(4)
c_underscore
c_ext "file extension
how to make different files.Which internal table should i loop into.
2.I have to update custom database table with the data in the internal table i_update.
Work Area for Z_DATADOWNLOAD table
DATA: l_wa_update TYPE zdata_download.
l_wa_update-prog_name = g_repid.
l_wa_update-plant = s_werks.
l_wa_update-last_run_dt = g_sysdate.
l_wa_update-last_run_tm = g_systime.
Update the Date and time in ZDATA_DOWNLOAD table with current value.
MODIFY zdata_download FROM l_wa_update.
How to update the table for multiple files.
Regards,
Simran
07-14-2006 3:37 PM
Hey,
First you need to define an internal table of type T001W to select all the plants as per the user input on the selection screen.
Eg. Select WERKS from T001W into ITAB where werks in s_werks.
After this select continue with the processing using ITAB.
-Kiran
*Please reward useful answers
07-14-2006 3:36 PM
07-14-2006 3:37 PM
Hey,
First you need to define an internal table of type T001W to select all the plants as per the user input on the selection screen.
Eg. Select WERKS from T001W into ITAB where werks in s_werks.
After this select continue with the processing using ITAB.
-Kiran
*Please reward useful answers
07-14-2006 3:39 PM
Hi,
Check this :
loop at s_werks.
-
take s_werks-low
endloop.
Regards
Appana
07-14-2006 4:00 PM
data : begin of it_t001w,
werks type t001w-werks,
end of it_t001w.
s_werks is your plant select-options.
select werks
into it_t001w
from t001w
where werks in s_werks.
IT_T001W now will have all valid plants entered in select-options by the user.
now loop thru this it_t001w, use it_t001w-werks for your work.
<b> LOOP AT IT_T001W.</b>
CONCATENATE
c_path "file path
c_qm " 'QM'
c_underscore "underscore
c_results " 'RESULTS'
<b>IT_T001W-werks "plant</b>
sy-datum+4(2) "system date
sy-datum+6(2)
sy-datum+0(4)
c_underscore
c_ext "file extension
<b>into v_filename</b>
ENDLOOP.
regards
srikanth.
Message was edited by: Srikanth Kidambi
07-14-2006 4:13 PM
Hi Srikanth.
Your suggestion is helping me here.
But the issue that still remains is,
if i am retrieving data from the custom table which has fields ( program name,plant,last run date,last run time)
i will not get those plants which have no date and time
However the requirement is last run date and time are blank then
last run date = sy-datum - 1
last run time = sy-uzeit
Pls help me in this.
Actually i'm very new to this field and not gtg the logic.
Regards,
Simran
07-14-2006 4:42 PM
Hi,
Check this code :
append all the values into final internal table i_update for all the plants selected into the internal table i_t001w.
at end update data to z-table with i_update internal table
Code :
-
clear : i_update.
refresh : i_update.
loop at i_t001w.
l_wa_update-prog_name = g_repid.
l_wa_update-plant = i_t001w-werks.
if not g_sysdate is initial.
l_wa_update-last_run_dt = g_sysdate.
else. "if date blank
l_wa_update-last_run_dt = sy-datum - 1.
endif.
if not g_systime is initial.
l_wa_update-last_run_tm = g_systime.
else. "if time blank
l_wa_update-last_run_tm = sy-uzeit.
endif.
append i_update.
endloop.
IF NOT i_update[] is initial.
MODIFY zdata_download FROM table i_update.
endif.
Regards
Appana
07-14-2006 4:12 PM
hi,
it seems to be your first problem is solved. please explain bit more your 2nd question to help you.
regards
srikanth