New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Module Pool Mathematical Calculation in ABAP-SAP


Posted Date:     Total Responses: 0    Posted By: VELU S   Member Level: Gold   Points/Cash: 6   


*&---------------------------------------------------------------------*
*& Module Pool ZPROGRAM1
*&
*&---------------------------------------------------------------------*
*& 01 DEC 2008 - Screens
*& By VELU SHANMUGAM
*&---------------------------------------------------------------------*


INCLUDE ZPROGRAM1TOP . " global Data

* INCLUDE ZPROGRAM1O01 . " PBO-Modules
* INCLUDE ZPROGRAM1I01 . " PAI-Modules
* INCLUDE ZPROGRAM1F01 . " FORM-Routines

*&---------------------------------------------------------------------*
*& Module STATUS_9001 OUTPUT (PBO)
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9001 OUTPUT.
SET PF-STATUS 'OPTIONS'. " To Activate the Menu Tool Baars
SET TITLEBAR 'TITLE'. " To Activate the Screen Title

if sy-ucomm = ' '.


A = 100.
B = 20.
c = 0.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_GENERATE'
* TEXT = ' '
* INFO = ' '
* ADD_STDINF = 'X'
IMPORTING
RESULT = v_ico
* EXCEPTIONS
* ICON_NOT_FOUND = 1
* OUTPUTFIELD_TOO_SHORT = 2
* OTHERS = 3
.
endif.



ENDMODULE. " STATUS_9001 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9001 INPUT (PAI)
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9001 INPUT.
case sy-ucomm.
when 'ADD'.
c = a + b.
Result_text = 'Addition'.
when 'SUB'.
c = a - B.
Result_text = 'Subtraction'.
when 'MUL'.
c = a * b.
Result_text = 'Multiplication'.
when 'DIV'.
c = a / b.
result_text = 'Division'.
when 'CLR'.
clear: a , b , c.
result_text = 'Clearing Fields'.
when 'EXIT'.
result_text = 'Bye'.
leave to screen 0. " Leaves to the Initial Screen where it is called
when 'RAD'.
if r1 = 'X'.
c = a + b.
elseif r2 = 'X'.
c = a - b.
elseif r3 = 'X'.
c = a * b.
elseif r4 = 'X'.
c = a / b.
endif.
when 'CLICK'.
if c1 = 'X' and c2 = 'X'. message 'Both' type 'S'.
elseif c1 = ' ' and c2 = 'X'. message 'Single 2' type 'S'.
elseif c1 = 'X' and c2 = ' '. message 'Single 1' type 'S'.
elseif c1 = ' ' and c2 = ' '. message 'Both unchecked' type 'S'.
endif.
endcase.

if c LE 100.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_CHECKED'
* TEXT = ' '
* INFO = ' '
* ADD_STDINF = 'X'
IMPORTING
RESULT = v_ico
* EXCEPTIONS
* ICON_NOT_FOUND = 1
* OUTPUTFIELD_TOO_SHORT = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
else.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_INCOMPLETE'
* TEXT = ' '
* INFO = ' '
* ADD_STDINF = 'X'
IMPORTING
RESULT = v_ico
* EXCEPTIONS
* ICON_NOT_FOUND = 1
* OUTPUTFIELD_TOO_SHORT = 2
* OTHERS = 3
.
endif.
ENDMODULE. " USER_COMMAND_9001 INPUT
*&---------------------------------------------------------------------*
*& Module Check_Values INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE Check_Values INPUT.
if a > 500 OR
b > 500.

message 'Values Cannot be greater than 500' type 'E'.

endif.

ENDMODULE. " Check_Values INPUT



FLOW LOGIC:

PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.
*
PROCESS AFTER INPUT.
chain.
field: a, b module check_values.
endchain.
MODULE USER_COMMAND_9001.



*&---------------------------------------------------------------------*
*& Include ZPROGRAM1TOP Module Pool ZPROGRAM1
*&
*&---------------------------------------------------------------------*

PROGRAM ZPROGRAM1.

Data: a type i,
b type i,
c type i.

Data : result_text type c length 20.

Data : V_ICO type ICONS-TEXT.

Data : r1,r2,r3,r4,c1,c2.


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: Dynamic < Run Time > Memory Allocation
Previous Project: Screen Programming Project - SAP

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.