10-12-2008 12:37 PM
Hi guys,
I'm a beginner in ABAP and wanted to know how to write a control break statement for an internal table and also wanted to know if there is a function module that can give me TIME in HH:MM AM/PM (12 hours clock).
Please let me know where i can find control break statement for internal tables with good examples.
Thanks in advance.
Cheers,
Arun
10-12-2008 12:49 PM
Hi,
There are many control break statements in ABAP used for internal tables (You can use the regular control break statements too, but these are exclusively for Internal Tables ).
Few of them to be named are
AT FIRST
AT LAST
AT NEW
AT END OF
ON CHANGE OF...
The best guide for you will be the F1 help for these statements. Just write these statements in the ABAP editor and press F1. The documentation is enough to help you write a comrehensive code.
Also please make use of the transaction ABAPDOCU Where there are examples given which you can execute and check for yourself.
and regarding the FM for converting Hour format to AM PM format.
You can use the following code.
Data : w_time type sy-uzeit,
w_ampm(2) type c.
w_time = sy-uzeit ( current app server time ).
if w_time+0(2) GE 12.
w_time = w_time - 43200 ( 12 hours converted to seconds)
w_ampm = 'PM'.
else.
w_ampm = 'AM'.
endif.
write: w_time, w_ampm.
Eg : if the time now is 16:00
it will show 4:00 PM.
Regards,
Pramod
10-12-2008 12:44 PM
Hi,
Check below:
http://help.sap.com/abapdocu/en/abap_docu.htm
Click on below path to get the control statements help path from the above link
ABAP Keyword Documentation u2192 ABAP - By Theme u2192 Process Internal Data u2192 Internal Tables u2192 Processing Statments for Internal Tables u2192
AT - itab
Regards
Shiva
10-12-2008 12:49 PM
Hi,
There are many control break statements in ABAP used for internal tables (You can use the regular control break statements too, but these are exclusively for Internal Tables ).
Few of them to be named are
AT FIRST
AT LAST
AT NEW
AT END OF
ON CHANGE OF...
The best guide for you will be the F1 help for these statements. Just write these statements in the ABAP editor and press F1. The documentation is enough to help you write a comrehensive code.
Also please make use of the transaction ABAPDOCU Where there are examples given which you can execute and check for yourself.
and regarding the FM for converting Hour format to AM PM format.
You can use the following code.
Data : w_time type sy-uzeit,
w_ampm(2) type c.
w_time = sy-uzeit ( current app server time ).
if w_time+0(2) GE 12.
w_time = w_time - 43200 ( 12 hours converted to seconds)
w_ampm = 'PM'.
else.
w_ampm = 'AM'.
endif.
write: w_time, w_ampm.
Eg : if the time now is 16:00
it will show 4:00 PM.
Regards,
Pramod
10-15-2008 4:16 PM