‎2007 Feb 15 9:46 AM
I am currently doing some work on zero billed quantity items on invoices (i.e VBRP-FKIMG). I am trying to NOT print any items which have been zero picked.
The code in my SapScript to check if the value is zero is as follows:
DEFINE &V_VALUE& :=&VBDPR-FKIMG(T)&
DEFINE &V_CHECK& := ''
PERFORM CHECK IN PROGRAM Z_ZERO
USING &V_VALUE&
CHANGING &V_CHECK&
ENDPERFORM
and the Z_ZERO program is as follows:
REPORT Z_ZERO.
FORM check TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: v_fkimg TYPE vbrp-fkimg.
READ TABLE in_par WITH KEY 'V_VALUE'.
CHECK sy-subrc = 0.
v_fkimg = in_par-value.
READ TABLE out_par WITH KEY 'V_CHECK'.
CHECK sy-subrc = 0.
IF v_fkimg IS INITIAL.
out_par-value = 'X'.
MODIFY out_par INDEX sy-tabix.
ENDIF.
ENDFORM.These works fine for most invoices but occasionally we seem to be getting quantities like 0,000 which is 0 but the code is short dumping at v_fkimg = in_par-value. We added in the (T) part on the SapScript to get rid of the commas when the figure was over 1,000 but itdoesn't seem to be happeningm for 0,000 values.
Can anyone shed any light on this matter, as I am finding it hard to de-bug or replicate in DEV as it only happens very rarely.
Kind Regards
Carly
‎2007 Feb 15 9:56 AM
Hi,
Try by Changing the declaration of V_fkimg TYPE vbrp-fkimg to CHAR field of 13 .
Generally In_par and Out_par will take CHAR Data types only.
Regards,
Anji
‎2007 Feb 15 10:13 AM
I changed it to
DATA: v_fkimg(13) TYPE cbut this now doesn't pass normal 0.000 values through. V_VALUE is 0.000 but when it gets to v_fkimg = in_par-value, the v_fkimg field just stays blank.
Any ideas?
‎2007 Feb 15 11:00 AM
You can try this --
data: v_dec(13),
v_mantissa(3),
v_amount2(16).
parameters: v_amount like VBRP-FKIMG.
move v_amount to v_amount2.
split v_amount2 at '.' into v_dec v_mantissa. (Separator will depend on user parameters though)
You can then check on v_dec variable for non zero value.
Meena