Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in control break

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks guys for all your help.

My problem solved.

Cheers,

A