cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenating '-' sign to an number field in bw start routine

Former Member
0 Kudos

Hi Friends,

is there any chance to add a minus sign infront of the quantity field in the start routine.

if anyone have ideas please let me know.

Regards,

Ala.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ala,

Different approach (it's often done so in SAP standard modules):

Use all key figures as positives and add another characteristic, like Movement type, according to which you'll distinguish negative and positive movements.

Best regards,

Eugene

Former Member
0 Kudos

This message was moderated.

sap_cohort
Active Contributor
0 Kudos

If you want the number to be reversed just multiply it by -1 in the routine. Good Luck!

Former Member
0 Kudos

try reversing the qty field as suggested by kenneth.

just curious did u have any luck on that assignment of constant value.

Former Member
0 Kudos

Hi kenneth

i am not getting this it is satisfying with my condition.

can you just paste me some sample code so that i can make it out..

yes ravi, i got the assignment of constant value..actually the MODIFY DATA_PACKAGE.

Thanks for your reply...

Former Member
0 Kudos

Hi,

You can also use the 'NEGATIVE' Formula in the transfer rule for that key figure to inverse the sign.

With rgds,

Anil Kumar Sharma .P

(Kindly assign points,if it gives the solution)

Former Member
0 Kudos

Hi

i can not use NEGATIVE formula function because before convert i need to check some conditions.

any idea...

Former Member
0 Kudos

Hi,

Still you can check some conditions and NEGATIVE formula in a single TR.

Ex:

NEGATIVE(Condtion1)

With rgds,

Anil Kumar Sharma .P

Former Member
0 Kudos

Hi Anil,

i agree your answer but i dont want to use the formula i want to use this in my start routine.

so, is there any chance in the start routine..

my code is as follows:

DATA: QTY1(21) TYPE C,

QTY2(21) TYPE C.

if <goods receipts> = 'S'.

qty1 = <quantity>.

concatenate '-' qty1 into qty2.

<quantity> = qty2.

endif.

but it is not giving me the result what i want..

in the output it should look like -50.

guys..give me some idea

kenneth, i was not able to follow ur clue...can u explain me clearly...

Thanks.

Former Member
0 Kudos

Hi,

Use this code:

DATA: QTY1 TYPE N,

QTY2 TYPE N.

if <goods receipts> = 'S'.

qty1 = <quantity>.

QTY2 = -1*QTY1

<quantity> = qty2.

endif.

With rgds,

Anil Kumar Sharma .P

a

Former Member
0 Kudos

Hi Anil

i tried this..but even it is not giving me the correct result..

Former Member
0 Kudos

Ala,

try this and see:

DATA: QTY1 TYPE I,

QTY2 TYPE I.

if <goods receipts> = 'S'.

qty1 = <quantity>.

QTY2 = -1*QTY1

<quantity> = qty2.

endif.

change it to type integer and see.

Message was edited by: ravi raj

Former Member
0 Kudos

Hi ravi,

no luck even with this....

Former Member
0 Kudos

Ala,

the code should work. don't assign length for type i.

data: qty1 type i,

qty2 type i,

quantity type i,

goodsreceipt(1) type c.

if goodsreceipt = 'S'.

qty1 = quantity.

qty2 = qty1 * -1.

quantity = qty2.

endif.

write qty2.

Message was edited by: ravi raj

Message was edited by: ravi raj