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: 

How to display -ve amount in a z-table??

Former Member
0 Kudos
149

From table BSEG I have to pick up the amounts for hkont = 22500000000 for all the BELNR present in BKPF and insert the values in another z-table z_ven_inv. This HKONT has posting for 40 as well as 50... that means all the amounts of 40 have to be added & then all the amounts with 50 needs to be subtracted to balance the amount againt that HKONT (GL account).

My issue is the the table z_ven_inv shows all the rows for HKONT 2250000000 for that document. It does not have the field BSCHL. How can I show a -ve value in table z_ven_inv ??

Below is the example of a document from FB03:-

31 89000 2,288.00-

31 89000 1,519.00-

31 89000 1,494.50-

31 89000 1,797.60-

Total :- 7,099.10-

40 2250000000 2,288.00

40 2250000000 1,562.40

50 2250000000 43.40-

40 2250000000 1,494.50

40 2250000000 1,797.60

Total :- 7,099.10

The z_ven_inv table shows the values

2,288.00

1,562.40

43.40

1,494.50

1,797.60

How do I show that 43.40 is a -ve amount ??

Thank You,

SB.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
110

Can you not change the table to include either BSCHL or SHKZG which will tell you whether the amount is positive or negative?

10 REPLIES 10

Former Member
0 Kudos
110

Change the domain for the amount field in the Z table to allow negative values.

rob

Former Member
0 Kudos
111

Can you not change the table to include either BSCHL or SHKZG which will tell you whether the amount is positive or negative?

0 Kudos
110

Hi SB,

To add onto Rob' suggestion..

In SE11 display your Z Table> Double click on the data element against the Amount field> Double click on the Domain-->In the Outout Characteristics block, click the Sign checkbox & activate the Domain.

Regards,

Suresh Datti

0 Kudos
110

Hi Srinivas,

This table is then used by some other team to produce output reports for the end users... so only I am not sure if BSCHL is required by their team .... Can you suggest something else ?? I want to try all possibilities at my side before asking the other team to change ...

Thank You,

SB.

0 Kudos
110

Hi Suresh,

Thanks for the ellaborate explanation I did the change in my z-table but in the program I am writing z_ven_inv-wrbtr = t_bseg-wrbtr... How do I code to say that change the amount in z_ven_inv to -ve sign where t_bseg-bschl = 50 ??

Thanks a lot for your help.

SB.

0 Kudos
110

make use of Debit /Credit indicator ?

0 Kudos
110

<i>How do I code to say that change the amount in z_ven_inv to -ve sign where t_bseg-bschl = 50 ??</i>

multiply by -1

Raja

0 Kudos
110

BSEG-BSCHL can have a lot more values than '40' or '50'. I would look at the debit credit indicator. So:


IF t_bseg-SHKZG = 'H'.
  z_ven_inv-wrbtr = t_bseg-wrbtr * -1.
ELSE.
  z_ven_inv-wrbtr = t_bseg-wrbtr.
ENDIF.

(You may want to display the amounts with the opposite sense.)

Rob

0 Kudos
110

Hi,

I am not getting the radiobutton display where I can award the answers that helped me solve my problem... Please tell me what should I do ??

Thank You,

SB.

0 Kudos
110

looks like the points system is down. check back later to reward points and close the thread.

Regards

Raja