Application Development and Automation 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: 
Read only

ABAP Program : Ultimo ??

Former Member
0 Likes
1,278

Dear All,

I am new to ABap and learning by seeing some sample programs.

I could understand some basic programs but Here I am stucked up, Can Anybody help me.

data : Ultimo type d.

ultimo = sy-datum.

ultimo+6(2) = '01'. 'What this statment is doing'

ultimo = ultimo - 1.

write ultimo.

please take some time and Suggest me,

Also let me know some good material for ABAp,

Thanking you.

Regards

Venkat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
901

Hi,

ultimo+6(2) = '01'. 'What this statment is doing'

The date will have dd,mm and yy components, This statement is setting the dd (DATE) to the first day of the month.

ultimo = ultimo - 1.

After getting the first day of the month, this is setting subtracting a day from that, that means now the month will have the last day of the previous month.

Regards,

Ravi

Note : Please close the thread, if the question is answered

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
901

Hi Venkat,

ultimo+6(2) = '01'. 'What this statment is doing'

it changes current day (21 for today date) to '01'.

Check this link for learning ABAP.

http://cma.zdnet.com/book/abap/index.htm

Hope this will help to start with.

Regards,

Ferry Lianto

Read only

LucianoBentiveg
Active Contributor
0 Likes
901

"Ultimo" mean "Last one" in Spanish.

If sy-datum EQ '20060421', that statement convert to '20060401'.... may be he must call "Primero" (Spanish for "First One")....

Don´t forget reward points.

Regards

Read only

Former Member
0 Likes
901

ata : Ultimo type d.

ultimo = sy-datum.

ultimo+6(2) = '01'. 'This statement setting the last two digits of ultimo to 01

before this statement the ultime =20060421 and after this statement the

ultimo = 20060401

ultimo = ultimo - 1. 'subtract date by 1 means to last day of previous month

write ultimo

Read only

Former Member
0 Likes
902

Hi,

ultimo+6(2) = '01'. 'What this statment is doing'

The date will have dd,mm and yy components, This statement is setting the dd (DATE) to the first day of the month.

ultimo = ultimo - 1.

After getting the first day of the month, this is setting subtracting a day from that, that means now the month will have the last day of the previous month.

Regards,

Ravi

Note : Please close the thread, if the question is answered

Read only

0 Likes
901

Hello Ravi, Ferry, peluka and Singh,

I am very happy to receive your replies,

Now it is clear for me, Thank you

I will award points to all of you,

Thanking you.

Regards

Venkat

Read only

Former Member
0 Likes
901

Venkat,

In order to prevent yourself from becoming yet another "hack" in this field, please get some formal training in ABAP (from SAP, preferrably).

BC400 is wonderful, "starter" class.

Some general classes in Database design, program structuring, and operating systems would also be very beneficial.