on 03-06-2010 5:23 AM
Hi to All,
I have created a new sap-script form
One page, one main window in that main window one text element
/: PERFORM SUB_DATA IN PROGRAM ZDEMO_PROGRAM
/: USING &AMOUNT&
/: CHANGING &AMOUNT&
/: ENDPERFORM
/E DEMO
&AMOUNT&
in driver program
DATA : AMOUNT TYPE PAD_AMT7S.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
DEVICE = 'PRINTER'
FORM = 'ZDEMO_FORM'
LANGUAGE = SY-LANGU.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DEMO'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
CALL FUNCTION 'CLOSE_FORM'
In subroutine pool program
FORM sub_data TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA : VAL TYPE PAD_AMT7S.
READ TABLE in_tab INDEX 1.
CONDENSE in_tab-value.
IF in_tab-value = '0.00'.
VAL = '15.1'.
out_tab-value = VAL.
MODIFY out_tab INDEX 1 TRANSPORTING value.
ENDIF.
ENDFORM. "sub_data
Here my question in the form it should display 15.10, but it displaying 0.00 only
Please help me out, how I am going to do?
Numbers are passed right-aligned by default, so your test IF in_tab-value = '0.00'. is incorrect (it should be something like ' 0.00 '). You would have seen that if you DEBUG. Copy the VALUE component (of type character) to a number field, then do the test IF number = 0...
Maybe it's not the only error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
This is your script code
/: PERFORM SUB_DATA IN PROGRAM ZDEMO_PROGRAM
/: USING &AMOUNT&
/: CHANGING &AMOUNT&
/: ENDPERFORM
/E DEMO
&AMOUNT&
Try this
/E DEMO
/: PERFORM SUB_DATA IN PROGRAM ZDEMO_PROGRAM
/: USING &AMOUNT&
/: CHANGING &AMOUNT&
/: ENDPERFORM
&AMOUNT&
Hope you will resolve your issue
Let me know if any concerns.........
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.