Application Development 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: 

Problem in table

Former Member
0 Kudos

Dear All,

I created one table.In that there are there quantity fields(of type Kmenge).Lets say A,B,C.

Here C = A - B.

Now the problem ,whenever C is negative and saved in table then if i am trying to see the data from SM30 then it is showing dump.

In the dump it is saying that C has negative sign and conversion error occured during displaying data on the screen.

Please let me know how to solve this.

7 REPLIES 7

former_member194669
Active Contributor
0 Kudos

Hi,

The datatype Kmenge is of type CHAR 1. ??

aRs

Former Member
0 Kudos

Hi,

You should check data element and domain of field C. If you get this message, that means that the domain of this field doesn't support negative amount.

Regards,

Nicolas.

Former Member
0 Kudos

You should use data element which supports negative values..

Regards

Pradeep

Former Member
0 Kudos

Hi..

You have to keep a check in module pool of maintenance view whether field A is less than field B.

If field A is less than B then, you should throw an error message.

If A is greater than or equal to B then only you should do subtraction.

e.g.


MODULE process INPUT.
  IF ztab_prax1-a GE ztab_prax1-b.
    ztab_prax1-c = ztab_prax1-a - ztab_prax1-b.

  ELSE.
    MESSAGE 'Plz input A greater than or equal to B.' TYPE 'E'.
  ENDIF.

ENDMODULE.                 " process  INPUT

and in the screen flow logic use this module as:


  LOOP AT extract.
    MODULE liste_init_workarea.
<b>
    CHAIN.
      FIELD ztab_prax1-a .
      FIELD ztab_prax1-b .
      MODULE process ON CHAIN-REQUEST.
    ENDCHAIN.
</b>
    CHAIN.
      FIELD ztab_prax1-a .
      FIELD ztab_prax1-b .
      FIELD ztab_prax1-c .
      MODULE set_update_flag ON CHAIN-REQUEST.
    ENDCHAIN.
    FIELD vim_marked MODULE liste_mark_checkbox.
    CHAIN.
      FIELD ztab_prax1-a .
      MODULE liste_update_liste.
    ENDCHAIN.


  ENDLOOP.

Reward if useful

Regards Prax

Former Member
0 Kudos

Please do the change in datatype of C field from INT1 to INT4 ...

" INT1

-> 1-byte integer, integer number <= 255

" INT4

-> 4-byte integer, integer number with sign

So your negative data in the C field will reffer to the datatype a INT4 which can avoid giving the Dump . and have the check box of sign . ok it will solve your problem .....

reward points if it is usefull ....

Girish

Former Member
0 Kudos

Hi,

I think, the data element you used is not allowing any - values. Try using DMSHB data element.

Thanks,

Sriram.

Former Member
0 Kudos

I have used one currency field in custom table and it works great.

I used data element WRBTR and domian WERT7 ,You can refer like this.

Thanks

Seshu