Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function module problem

Hi,

i am stuck in problem of creting a function module

FUNCTION zasia_statustkt.

*"----


""Local interface:

*" EXPORTING

*" REFERENCE(TOTALBREAKFIX) LIKE ZASIA_STATUS-STATUS

*" REFERENCE(TOTALENHANCEMENT) LIKE ZASIA_STATUS-STATUS

*" REFERENCE(TOTALPERFORMANCETUNING) LIKE ZASIA_STATUS-STATUS

*" REFERENCE(TOTALNUMBEROFTICKETS) LIKE ZASIA_STATUS-STATUS

*" TABLES

*" ZAIS STRUCTURE ZASIA_STATUS

*"----


DATA: gt_tab LIKE zasia_status OCCURS 0 WITH HEADER LINE.

TYPES: BEGIN OF gty_tab1,

start(3) TYPE n,

uat(3) TYPE n,

wip(3) TYPE n,

gcm(3) TYPE n,

apd(3) TYPE n,

END OF gty_tab1.

DATA: BEGIN OF gty_tab2 OCCURS 0,

MANDT TYPE mandt,

TICKET TYPE zzticket,

STATUS TYPE zzstatus,

SEVERITY TYPE zzseverity,

NAME TYPE zzname,

ISSUETYPE TYPE stceg,

optick type n, "open ticket

utest type n, "under testing

process type n, "in process

gcm type n, "gcm

apd type n, "apd

END OF gty_tab2.

DATA: lv_tot(2) TYPE n,

lv_start(2) TYPE n,

lv_uat(2) TYPE n,

lv_wip(2) TYPE n,

lv_gcm(2) TYPE n,

lv_apd(2) TYPE n.

SELECT * FROM zasia_status INTO TABLE gt_tab.

LOOP AT gt_tab.

lv_tot = lv_tot + 1.

CASE gt_tab-status.

*CASE gt_tab-name.

WHEN 'START'.

lv_start = lv_start + 1.

WHEN 'UAT'.

lv_uat = lv_uat + 1.

WHEN 'WIP'.

lv_wip = lv_wip + 1.

WHEN 'GCM'.

lv_gcm = lv_gcm + 1.

WHEN 'APD'.

lv_apd = lv_apd + 1.

ENDCASE.

ENDLOOP.

SORT gt_tab BY status.

DELETE ADJACENT DUPLICATES FROM gt_tab[] COMPARING status.

LOOP AT gt_tab.

MOVE: gt_tab-TICKET TO gty_tab2-ticket.

MOVE: gt_tab-STATUS TO gty_tab2-status.

MOVE: gt_tab-SEVERITY TO gty_tab2-severity.

MOVE: gt_tab-NAME TO gty_tab2-name.

MOVE: gt_tab-ISSUETYPE TO gty_tab2-issuetype.

APPEND gty_tab2.

ENDLOOP.

LOOP AT gty_tab2.

*CASE gty_tab2-status.

if gt_tab-name = 'INDIA'.

CASE gty_tab2-name.

WHEN 'START'.

gty_tab2-issuetype = lv_start.

move: lv_start to gty_tab2-optick.

WHEN 'UAT'.

gty_tab2-issuetype = lv_uat.

move: lv_uat to gty_tab2-utest.

WHEN 'WIP'.

gty_tab2-issuetype = lv_wip.

move: lv_wip to gty_tab2-process.

WHEN 'GCM'.

gty_tab2-issuetype = lv_gcm.

move: lv_gcm to gty_tab2-gcm.

WHEN 'APD'.

gty_tab2-issuetype = lv_apd.

move: lv_apd to gty_tab2-apd.

ENDCASE.

MODIFY gty_tab2.

endif.

ENDLOOP.

zais[] = gty_tab2[].

UPDATE zasia_status FROM zais.

totalnumberoftickets = lv_gcm + lv_apd + lv_uat." + lv_start.

totalbreakfix = lv_gcm.

totalenhancement = lv_apd.

totalperformancetuning = lv_uat.

ENDFUNCTION.

plz provide me solution for this it is not executed rightly

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question