cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript

Former Member
0 Kudos

Hi gurus,

i have a field in window.

in form i have added that new field.

PERFORM FVALUE IN PROGRAM ZDCILAYOUT

..

CHANGING &DISCOUNTT&

..

this code in sub-routine.

READ TABLE out_par WITH KEY 'DISCOUNTT'. out_par-value = DISCOUNTT.

IF sy-subrc = 0.

MODIFY out_par INDEX sy-tabix.

endif.

but problem is that in out_par that structure for output parameters, DISCOUNTT is not coming in that structure.

i have activated the forms also.

points sure!

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

I think this: read table int_cond with key 'F150D-ZIELD'.

should be this : read table int_cond with key name = 'F150D-ZIELD'.

former_member181995
Active Contributor
0 Kudos

Rahul,

this is the pure example of like your requirement:

form z_get_interest tables int_cond structure itcsy
                           outt_cond structure itcsy.

data: value type SALFW,
*       value1 type p DECIMALS 2,
*       value2 type p DECIMALS 2.
       value1 type salfw,
       value2 type salfw,
       value3 type salfw.

data: SMAHSK type c.
data: days(5) type n.
      "value1 type salfw.
data: valuec type c.


read table int_cond with key 'F150D-SALFW'.
if sy-subrc = 0.
*pack int_cond-value to value." FM added and commented by amit

CONDENSE int_cond-value NO-GAPS.
 CALL FUNCTION 'MOVE_CHAR_TO_NUM'
 EXPORTING
 chr                   = int_cond-value
IMPORTING
  NUM                   = value
EXCEPTIONS
CONVT_NO_NUMBER       = 1
CONVT_OVERFLOW        = 2
OTHERS                = 3
                                             .
                                   IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                                   ENDIF.
            .




*value = int_cond-value.
endif.

read table int_cond with key 'MHND-SMAHSK'.
if sy-subrc = 0.
SMAHSK = int_cond-value.
clear days.
case SMAHSK.

WHEN '3'.  "Reminder 2 9% plus extra 10


value = value / 100.
*

value1 = ( value * '.09').
value2 = '15.00'.
*value1 = value1 + '15.00'.

value3 = ( value1 + value2 + value ).


when '2'.   "Reminder 2 9% plus extra 5
value = value / 100.

value1 = ( value * '.09').
value2 = '10.00'.

value3 = ( value1 + value2 + value ).

when '1'.
value3 = value / 100.
endcase.

endif.




*value = value / 100.

*value1 = ( value * '.09').
*value2 = ( value1 + value ).

Read table outt_cond with key 'INTCH'.
if sy-subrc = 0.

  outt_cond-value = value1.
CONDENSE outt_cond-value NO-GAPS.

modify outt_cond index sy-tabix.
endif.


Read table outt_cond with key 'ADMFEE'.
if sy-subrc = 0.

  outt_cond-value = value2.
CONDENSE outt_cond-value NO-GAPS.

modify outt_cond index sy-tabix.
endif.

Read table outt_cond with key 'NEWTOT'.
if sy-subrc = 0.

  outt_cond-value = value3.
CONDENSE outt_cond-value NO-GAPS.

modify outt_cond index sy-tabix.
endif.


endform.

form z_get_date tables int_cond structure itcsy
                           outt_cond structure itcsy.

data: value type DZIELD_F15,
*       value1 type p DECIMALS 2,
*       value2 type p DECIMALS 2.
       value1 type DZIELD_F15,
       value2 type DZIELD_F15,
       date type  P0001-BEGDA,
       date1(10) type c.
*22.04.2008
read table int_cond with key 'F150D-ZIELD'.
if sy-subrc = 0.
  CONCATENATE int_cond-value+6(4) int_cond-value+3(2) int_cond-value+0(2)  into date.
  date = date + 5.
  int_cond-value = date.
*  date = int_cond-value.
endif.

Read table outt_cond with key 'ZDATE'.
if sy-subrc = 0.
concatenate date+6(2) '.' date+4(2) '.' date+0(4) into date1.

  outt_cond-value = date1.
CONDENSE outt_cond-value NO-GAPS.

modify outt_cond index sy-tabix.
endif.



endform.

Former Member
0 Kudos

Hi,

Is the control going to your program, check the field names in form what your passing, and in the code what you are reading.

Netaji.b

Former Member
0 Kudos

Hi,

try to write code in your subroutine pool program as follows

READ TABLE out_par WITH KEY NAME = 'DISCOUNTT'.

IF sy-subrc = 0.

out_par-value = DISCOUNTT.

MODIFY out_par INDEX sy-tabix.

endif.

Hope this will solve your problem,

Regards,

Aswini.

Former Member
0 Kudos

Hi,

You will not filnd it in out_par structure since that is for output parameters. Check the structure you have defined for input parameters.

Nayan

Former Member
0 Kudos

debug and fine whether you are getting value for discount or not.

i means to say just confirm whether its printing problem or what??

u write like this &discount(c)&