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

programming in abap

Former Member
0 Likes
821

hi all,

as i am new to abap can anyone explain me how to start programming in abap ie a small classical report.

thanks in advance,

chandana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
796

Basically reports are used to read database and represent the results in lists.

Reports are collections of processing blocks that the system calls depending on events.

We can use reports to evaluate data from database tables.

Reports are stand alone programs and controlled by events.

A report itself never creates events

steps in report:

Processing the selection screen

Reading the database

Evaluating the data and creating lists

Outputting a list.

1st u write simple logics, after that u can enhance the code as step by step.

please reward if helpful.

any doubts plz ask .

regards,

chandu

7 REPLIES 7
Read only

Former Member
0 Likes
796

Hi,

See the following link.

http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/index.htm

Regards,

Jagadish

Read only

Former Member
0 Likes
796
Read only

Former Member
0 Likes
797

Basically reports are used to read database and represent the results in lists.

Reports are collections of processing blocks that the system calls depending on events.

We can use reports to evaluate data from database tables.

Reports are stand alone programs and controlled by events.

A report itself never creates events

steps in report:

Processing the selection screen

Reading the database

Evaluating the data and creating lists

Outputting a list.

1st u write simple logics, after that u can enhance the code as step by step.

please reward if helpful.

any doubts plz ask .

regards,

chandu

Read only

Former Member
0 Likes
796

fetch the data from any db table into a itab.

such as

define a itab and wa.

select field1,field2..... into table itab form dbtab.

loop at itab ito wa.

write : wa-field1,wa-field2,.......

endloop.

gives a simple report...

Read only

Former Member
0 Likes
796

Hi Chandana,

TABLES : mara.

*- Selection Screen
SELECT-OPTIONS : s_matnr FOR mara-matnr.

*- Creation of Internal table
DATA : BEGIN OF t_mara OCCURS 0 ,
        matnr LIKE mara-matnr,
        ersda LIKE mara-ersda,
        ernam LIKE mara-ernam,
        mtart LIKE mara-mtart,
END OF t_mara.

*- Selecting the data from table for the given selection
SELECT matnr ersda ernam mtart FROM mara
   INTO TABLE t_mara
    WHERE matnr IN s_matnr.

*- Display the values 
LOOP AT t_mara.
  WRITE:/ t_mara-matnr,
          t_mara-ersda ,
          t_mara-ernam ,
          t_mara-mtart .
ENDLOOP.

Read only

Former Member
0 Likes
796

Hi Chandana!!

Try small programs

like

report zdeepika_fibonacci.

parameters : n

type i.

data: a,c type i value 0,

b type i value 1.

do n times.

c = a + b .

a = b.

b = c.

write: / c.

enddo.

report zdeepika_icons.

data: wa_icon type icon.

select * from icon into wa_icon.

write : / wa_icon-id.",wa_icon-name,wa_icon-I_MEMBER,wa_icon-button.

endselect.

try this link it gives many solved examples of ABAP programming

http://www.sapdev.co.uk/reporting/reportinghome.htm

kindly reward points if helpful.

Read only

Former Member
0 Likes
796

Hi,

Please refer the following program. It covers all the events in a report.

REPORT zsample.

tables : zpldet ,zplrv .

data : begin of itab occurs 4,

plno like zpldet-plno,

ptype like zpldet-ptype,

pname like zpldet-pname,

pns like zpldet-pns,

end of itab.

data : begin of jtab occurs 4,

plno like zplrv-plno,

rid like zplrv-rid,

ptype like zplrv-ptype,

stno like zplrv-stnr,

end of jtab.

selection-screen : begin of block b1 with frame title text-001.

select-options planenum for zpldet-plno.

parameters planenam like zpldet-pname.

selection-screen : end of block b1.

initialization.

planenum-low = '111'.

planenum-high = '999'.

append planenum.

start-of-selection.

select plno ptype pname pns from zpldet into table itab where plno in planenum.

loop at itab.

write : itab-plno, itab-ptype,itab-pname, itab-pns.

endloop.

*top-of-page.

*write: / 'CLASSICAL REPORT'.

*end-of-page.

*write: / 'END OF LIST'.

loop at itab.

format hotspot on.

write : / itab-plno.

hide : itab-plno.

format hotspot off.

write : itab-ptype,itab-pname, itab-pns.

endloop.

top-of-page.

write : / 'Plane details based on planenumber'.

at line-selection.

case sy-lsind.

when '1'.

select plno rid ptype stnr from zplrv into table jtab where plno = itab-plno.

loop at jtab.

format hotspot on.

write : / jtab-plno.

format hotspot off.

write : jtab-rid, jtab-ptype, jtab-stno.

skip 1.

endloop.

when '2'.

write: / 'End of list'.

endcase.

top-of-page during line-selection.

write : / 'Cancellation of this plane number'.

Please reward points if helpful.