on 07-18-2007 8:04 PM
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 ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.