cancel
Showing results for 
Search instead for 
Did you mean: 

On se71 editor can I write like this?

Former Member
0 Kudos

I have &RFKHELP-QSFBT& which is printing on script output...

Some time in driver program it assigns -ve sign to &RFKHELP-QSFBT& value for the calculation.

Can I change &RFKHELP-QSFBT& value, if it contains any -ve value ...

to +ve value like..

is the syntax :

IF &RFKHELP-QSFBT& CA '-'.

&RFKHELP-QSFBT& = &RFKHELP-QSFBT& * -1.

ENDIF.

??

Could you please suggest me ?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

Without writing the subroutine just write the field like this and see

&RFKHELP-QSFBT(<b>S</b>)&

This will not print the sign even if comes sometime with negative sign.

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Singh,

Thanks!

How ever this declaration did not work in driver program.

DATA: l_QSFBT LIKE RFKHELP-QSFBT

Instead i have use DATA: l_QSFBT(16) TYPE c.

Can any body say why ?

Former Member
0 Kudos

Do ou mean

DATA: l_QSFBT LIKE RFKHELP-QSFBT <b>.</b>

is giving error !? Does it gives you syntax error for this declarations ?

Regards,

A.Singh

Message was edited by:

Amarjit Singh

former_member196280
Active Contributor
0 Kudos

problem is QSFBT is a currency field and you subroutine values passed will be in ITCSY-VALUE which is character format, since currency field cannot hold character value, it did not work out for you.

Reward points if useful.

Regards,

Sairam

former_member196280
Active Contributor
0 Kudos

This cannot be used in forms.

<b>IF &RFKHELP-QSFBT& CA '-'.

&RFKHELP-QSFBT& = &RFKHELP-QSFBT& * -1.

ENDIF.</b>

Solution for your query is, call one subroutine.From your FORM and change the sign

IF &RFKHELP-QSFBT& < 0.

/: PERFORM change_negativesign IN PROGRAM 'PROGRAM NAME'

/: USING &RFKHELP-QSFBT&

/: CHANGING &VALUE&

/:ENDPERFORM.

ENDIF.

IF &RFKHELP-QSFBT& < 0.

***PRINT &VALUE&

ELSE.

***PRINT &RFKHELP-QSFBT&

ENDIF.

Reward points if useful.

Regards,

SaiRam

Former Member
0 Kudos

Hello,

RFKHELP-QSFBT is a currency type field yopu can not use this statement

IF &RFKHELP-QSFBT& CA '-'.

You should use

IF &RFKHELP-QSFBT& LT 0.

By the way to solve your problem.

/: PERFORM change_sign IN PROGRAM 'Your Program Name'

/: USING &RFKHELP-QSFBT&

/: CHANGING &NEW_VALUE&

/:ENDPERFORM.

In 'Your Program Name':

FORM change_sign TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

DATA: l_QSFBT LIKE RFKHELP-QSFBT

READ TABLE in_par WITH KEY 'RFKHELP-QSFBT'.

CHECK SY-SUBRC EQ 0.

l_QSFBT = in_par-value.

IF l_QSFBT < 0.

l_QSFBT = l_QSFBT * -1.

ENDIF.

READ TABLE out_par WITH KEY 'NEW_VALUE'.

CHECK sy-subrc = 0.

out_par-value = l_QSFBT.

MODIFY out_par INDEX sy-tabix.

ENDFORM.

Regards,

A.Singh

Former Member
0 Kudos

Hi Sam,

are u using a standard print program, if so try to write a subroutine in the script,

or else if you are using a customized print program you can write a conditional statement and then pass that calue to the script.

J