2007 Aug 29 12:55 PM
Hi friends,
i have one function module which converts the number of Seconds into TIME format( HH:MM:SS)..
the function module name is :MONI_TIME_CONVERT
for this we need to give the seconds as input.. that function module will convert those and it will give the out put..
how can we define as variables.. and can u give me the code for using this FM..
how many variables can we decalr.. and how..?
regards
Babu
2007 Aug 29 1:01 PM
Hi BABU,
example code:
data: hh like sy-tabix, gg like SWL_PM_CVH-DURATION.
move 30 to hh.
CALL FUNCTION 'MONI_TIME_CONVERT'
EXPORTING
ld_duration = hh
IMPORTING
LT_OUTPUT_DURATION = gg
.
write:/ gg.
Reward if useful.
Regards,
Sachin
2007 Aug 29 12:56 PM
Hi Babu,
Use the Pattern Button that is available in the ABAP Editor (SE38). After clicking the Pattern Button you shall be asked for the function module name. Enter the name of the Function module and press enter. Inside your editor the code for that function module call gets generated. You need to just call the function module using the parameters that is defined in the function module code.
<b>Reward points if this helps,</b>
Kiran
2007 Aug 29 12:57 PM
go to se37.write name of the function module and click on display.
declare ur varaibles according to the types of import and export parameters variables.
2007 Aug 29 12:59 PM
hi ,
that i know in se37 checking.. but i want to use the same thing in my program..
for that what can write additinally.. along with the calling of that function module..
i means.. import and export parameters..
and how can define the variables for giving import and export ...
regards
Babu
2007 Aug 29 1:01 PM
Hi Babu,
Check out my message in detail that is posted above,
Kiran
2007 Aug 29 12:59 PM
Hi,
pass the No of seconds in LD_DURATION
and you get out put in LT_OUTPUT_DURATION in hours.
Copy paste the program below
<b>data: lv_in type sytabix,
lv_out type SWL_PM_CVH-DURATION.
lv_in = '76'. "76 seconds output should be 1 hrs 16 minutes
CALL FUNCTION 'MONI_TIME_CONVERT'
EXPORTING
ld_duration = lv_in
IMPORTING
LT_OUTPUT_DURATION = lv_out
.
write lv_out.</b>rewards if useful,
regards,
Nazeer
2007 Aug 29 1:01 PM
Hi BABU,
example code:
data: hh like sy-tabix, gg like SWL_PM_CVH-DURATION.
move 30 to hh.
CALL FUNCTION 'MONI_TIME_CONVERT'
EXPORTING
ld_duration = hh
IMPORTING
LT_OUTPUT_DURATION = gg
.
write:/ gg.
Reward if useful.
Regards,
Sachin
2007 Aug 29 1:11 PM
hi sachin can i use.. parametrs statement insted of moving the data directly.. user needs to ener the value..
regards
Babu
2007 Aug 29 1:37 PM
Hi Babu,
You can use parameters instead of data variables in your code. Just write parameters statement instead of data statement in your report and pass this parameter to ld_duration.
Check this code.
<b>PARAMETERS: P_HH LIKE SY-TABIX.</b>
DATA: gg like SWL_PM_CVH-DURATION.
CALL FUNCTION 'MONI_TIME_CONVERT'
EXPORTING
<b>ld_duration = P_HH</b>
IMPORTING
LT_OUTPUT_DURATION = gg.
write:/ gg.
Thanks,
Vinay