Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help in control break

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

Tags:
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question