Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Please Help - 0 values query

Former Member
0 Likes
592

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

3 REPLIES 3
Read only

Former Member
0 Likes
547

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

Read only

0 Likes
547

I changed it to

DATA: v_fkimg(13) TYPE c

but 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?

Read only

0 Likes
547

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