Skip to Content
0
Former Member
Sep 08, 2010 at 10:24 AM

user exit in ob28

60 Views

DATA : BEGIN OF T_BSIK OCCURS 0,

UMSKZ TYPE BSIK-UMSKZ,

SHKZG TYPE BSIK-SHKZG,

WRBTR TYPE BSIK-WRBTR,

END OF T_BSIK.

DATA : BEGIN OF T_BSAK OCCURS 0,

UMSKZ TYPE BSAK-UMSKZ,

SHKZG TYPE BSAK-SHKZG,

WRBTR TYPE BSAK-WRBTR,

END OF T_BSAK.

DATA : BEGIN OF T_EKBE OCCURS 0,

EBELN TYPE EKBE-EBELN,

BEWTP TYPE EKBE-BEWTP,

WRBTR TYPE EKBE-WRBTR,

SHKZG TYPE EKBE-SHKZG,

END OF T_EKBE.

DATA : BEGIN OF T_EKPO OCCURS 0,

EBELN TYPE EKPO-EBELN,

NETWR TYPE EKPO-NETWR,

END OF T_EKPO.

CLEAR W_WRBTR_BSIK.

CLEAR W_WRBTR_BSAK.

CLEAR W_WRBTR_BSAK1.

CLEAR W_WRBTR_BSAK2.

CLEAR W_WRBTR_EKBE.

CLEAR W_WRBTR_ALL.

CLEAR W_WRBTR_EKPO.

SELECT UMSKZ SHKZG WRBTR INTO TABLE T_BSIK FROM BSIK WHERE EBELN = BSEG-EBELN

AND BUKRS = BKPF-BUKRS AND UMSKZ = 'F'.

LOOP AT T_BSIK WHERE SHKZG = 'H'.

W_WRBTR_BSIK = W_WRBTR_BSIK + T_BSIK-WRBTR.

ENDLOOP.

SELECT UMSKZ SHKZG WRBTR INTO TABLE T_BSAK FROM BSAK WHERE EBELN = BSEG-EBELN

AND BUKRS = BKPF-BUKRS AND UMSKZ <> 'F'.

LOOP AT T_BSAK WHERE UMSKZ <> ''.

IF T_BSAK-SHKZG = 'H'.

W_WRBTR_BSAK = W_WRBTR_BSAK + T_BSAK-WRBTR.

ELSEIF T_BSAK-SHKZG = 'S'.

W_WRBTR_BSAK1 = W_WRBTR_BSAK1 + T_BSAK-WRBTR.

ENDIF.

ENDLOOP.

W_WRBTR_BSAK2 = W_WRBTR_BSAK - W_WRBTR_BSAK1.

SELECT EBELN BEWTP WRBTR SHKZG INTO TABLE T_EKBE FROM EKBE WHERE EBELN = BSEG-EBELN AND BEWTP IN ('Q','E').

LOOP AT T_EKBE.

IF T_EKBE-SHKZG = 'H'.

W_WRBTR_EKBE = W_WRBTR_EKBE + T_EKBE-WRBTR.

ELSEIF T_EKBE-SHKZG = 'S'.

W_WRBTR_EKBE1 = W_WRBTR_EKBE1 + T_EKBE-WRBTR.

ENDIF.

ENDLOOP.

W_WRBTR_EKBE2 = W_WRBTR_EKBE1 + W_WRBTR_EKBE.

SELECT EBELN NETWR INTO TABLE T_EKPO FROM EKPO WHERE EBELN = BSEG-EBELN AND BUKRS = BKPF-BUKRS.

W_WRBTR_ALL = W_WRBTR_BSIK + W_WRBTR_BSAK2 + W_WRBTR_EKBE2 + BSEG-WRBTR.

LOOP AT T_EKPO .

W_WRBTR_EKPO = W_WRBTR_EKPO + T_EKPO-NETWR.

ENDLOOP.

IF W_WRBTR_ALL > W_WRBTR_EKPO.

B_RESULT = B_FALSE.

ELSE.

B_RESULT = B_TRUE.

ENDIF.

i have used this code for exit in ob28 for transaction code f-47. but when i use the t-code f-47 the system is going very slow.how can i improve the performance. plz any one advice me.