Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

reg the logic required

Former Member
0 Kudos

Hi,

LOOP AT it_output INTO wa_output.

  • if wa_output-bldat <= p_date.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

EXPORTING

i_datum_bis = p_date

i_datum_von = wa_output-bldat

  • I_KZ_EXCL_VON = '0'

  • I_KZ_INCL_BIS = '0'

  • I_KZ_ULT_BIS = ' '

  • I_KZ_ULT_VON = ' '

  • I_STGMETH = '0'

  • I_SZBMETH = '1'

IMPORTING

e_tage = wa_date

EXCEPTIONS

days_method_not_defined = 1

OTHERS = 2.

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF wa_date <= 30.

MOVE wa_output-wrbtr TO amount.

amount = amount + wa_output-wrbtr1.

move amount to wa_output-wrbtr1.

ELSEIF wa_date > 30 AND wa_date =< 60.

MOVE wa_output-wrbtr TO wa_output-wrbtr2.

amount1 = amount1 + wa_output-wrbtr2.

move amount1 to wa_output-wrbtr2.

ELSEIF wa_date > 60 AND wa_date <= 90.

MOVE wa_output-wrbtr TO wa_output-wrbtr3.

. amount2 = amount2 + wa_output-wrbtr3.

move amount2 to wa_output-wrbtr3.

ELSEIF wa_date > 90.

MOVE wa_output-wrbtr TO wa_output-wrbtr4.

amount3 = amount3 + wa_output-wrbtr4.

move amount3 to wa_output-wrbtr4.

append wa_output to it_output.

ENDIF.

  • append wa_output to it_output.

MODIFY it_output FROM wa_output.

ENDLOOP.

in this code the the wa_output is not filling all the data,

it is picking all the data ,,when it come out of the loop wrbtr3 is

becoming 0, but wrbtr4 is getting the value..........it is getting value becoming the wa_date is more the 90....

wrtbr3 also i need to get...

pls on this issue

some body can help to fill the all the fields when it come out of the loop,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Why are you modifying the output table after appeninding it? Is there any reason for that?

when you are reading a record where date is more than 90, are sure there is value in wrbtr3? if there is no value this field wa_output-wrbrt3 will be empty because the loop is reading a different record.

If you still have doubts get in touch with me.

Thanks,

Anil

4 REPLIES 4

Former Member
0 Kudos

Hi,

Why are you modifying the output table after appeninding it? Is there any reason for that?

when you are reading a record where date is more than 90, are sure there is value in wrbtr3? if there is no value this field wa_output-wrbrt3 will be empty because the loop is reading a different record.

If you still have doubts get in touch with me.

Thanks,

Anil

0 Kudos

hi anil,

i removed that appending,,,,

at the last loop wrbtr4 is getting value , so it wrbtr3 is not getting the valueee..it is becoming empty

in this case what would be the solution

pls help on this issues

Former Member
0 Kudos

Hi,

Use append wa_output to it_output after endif or

append it in every if-else loops. No need to modify.

This will solve ur problem.

Reward if helpful.

Regards,

Ramya

0 Kudos

hi ramya,,

it i use append it is taking lot of time,, after dump is coming showing time is exceeded...what to do in that