‎2010 Nov 19 7:08 AM
Hi Gurus,
I am trying to create one condition value routine in which I am passing xkwert = ( wa_vbap-cmpre * komp-mglme ) / 1000.
The condition works fine at item level where I get condition value as desired but at the header level, where it should show sum for all line items, it is showing 0. When I debugged, I found that somewhere in standard program, where it sums for line item, it is changing to negative and that is why it is getting zero but I was not able to correct it.
I am writing the code as follows.
DATA: wa_tab TYPE c LENGTH 1000,
I_VBAP TYPE STANDARD TABLE OF VBAP,
lv_komv like xkomv,
WA_VBAP TYPE VBAP.
FIELD-SYMBOLS <f1> TYPE ANY TABLE.
UNASSIGN <f1>.
wa_tab = '(SAPMV50A)XVBAP[]'.
ASSIGN (wa_tab) TO <f1>.
IF sy-subrc = 0.
i_vbap[] = <f1>.
ENDIF.
READ TABLE i_vbap INTO wa_vbap WITH KEY posnr = komp-kposn.
IF sy-subrc = 0.
xkwert = ( wa_vbap-cmpre * komp-mglme ) / 1000.
CLEAR wa_vbap.
ENDIF.
CLEAR: I_VBAP,
lv_komv.
What should I do? please help.
Regards,
Manish
‎2010 Nov 24 9:04 AM
I found the solution.
If xkwert is initial.
xkwert = gkomv-xkwert.
endif.
Regards,
Manish