Go on link..

link us with ...

Monday, December 13, 2010

classical report using message output

*&---------------------------------------------------------------------*
*& Report ZTR_DEMO_REPORT3 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZTR_DEMO_REPORT3 .


TYPES : BEGIN OF ST_EMP ,

EMP_NO LIKE YEMP-EMP_NO ,
EMP_NAME LIKE YEMP-EMP_NAME,
CITY LIKE YEMP-CITY ,

END OF ST_EMP .


DATA : WA_EMP TYPE ST_EMP .

DATA : IT_EMP LIKE Sorted TABLE OF WA_EMP WITH UNIQUE KEY emp_no.

WA_EMP-EMP_NO = '00001'.
WA_EMP-EMP_NAME = 'XYZ'.
WA_EMP-CITY = 'Mumbai'.

append wa_emp to it_emp.

BREAK-POINT.

WA_EMP-EMP_NO = '00002'.
WA_EMP-EMP_NAME = 'PQR'.
WA_EMP-CITY = 'Navi-Mumbai'.

append wa_emp to it_emp.


WA_EMP-EMP_NO = '00003'.
WA_EMP-EMP_NAME = 'PQR'.
WA_EMP-CITY = 'Navi-Mumbai'.

append wa_emp to it_emp.

BREAK-POINT.

*WA_EMP-EMP_NO = '00005'.
*WA_EMP-EMP_NAME = 'PQR'.
*WA_EMP-CITY = 'Navi-Mumbai'.
*
*INSERT INTO YEMP VALUES wa_EMP.
*

WA_EMP-EMP_NO = '00007'.
WA_EMP-EMP_NAME = 'LLL1'.
WA_EMP-CITY = 'kolkata'.

append wa_emp to it_emp.

*UPDATE YEMP from wa_emp.

modify yemp from wa_emp.


IF SY-SUBRC EQ 0 .

LOOP AT IT_EMP INTO WA_EMP.

WRITE :/5 WA_EMP-EMP_NO ,
20 WA_EMP-EMP_NAME ,
45 WA_EMP-CITY .

ENDLOOP .

skip 2.

write :/5 'Record is updated Sucessfully !!!' .

ENDIF.

BREAK-POINT.

DELETE FROM YEMP where EMP_NO EQ '00001' .



*write : /5 'Query is not executed'.
*MESSAGE I000(ZMSG).

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)