Skip to Content
0
Former Member
Feb 20, 2008 at 05:22 AM

Even if the if condn is not satisfied, I want to move & append internal tab

20 Views

Hi!

Please give me a solution to this problem.

In this, I want to move and append the contents into ist_vbap_ot even if the if condition is not met.

Please give me a simple solution as to how do I do it?

The code is as follows

Loop at ist_vbap into wa_vbap where matnr = wa_vbap-matnr.

Read table ist_vbap into wa_vbap with key matnr = wa_vbap-matnr

matkl = wa_vbap-matkl.

if wa_vbap-matkl eq 'ZCHCLUBFE'.

wa_vbap-otext = '3. Club House Fee'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHELWASA'.

wa_vbap-otext = '4. External electrification, water & sanitary connections'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHPROPAS'.

wa_vbap-otext = '5. Property Assessment & Khatha Transfer charges'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHREGSDT'.

wa_vbap-otext = '6. Stampduty, Registration (on prevailing valuation)'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHLEGFEE'.

wa_vbap-otext = '7. Legal Fee'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHMAINTC'.

write: wa_vbap-fakwr to ch_value1.

write: wa_vbap-kwmeng to ch_value2.

CONCATENATE '8. Maintenance Charges (Rs.)' ch_value1 '/-per sft. x' ch_value2 into wa_vbap-otext.

wa_vbap-otamt = wa_vbap-fakwr * wa_vbap-kwmeng * 12.

endif.

if wa_vbap-matkl eq 'ZCHCORPFU'.

wa_vbap-otext = '9. Corpus Fund equivalent to one years maintenance'.

wa_vbap-otamt = wa_vbap-fakwr.

endif.

if wa_vbap-matkl eq 'ZCHPOPCHA'.

write: wa_vbap-fakwr to ch_value1.

CONCATENATE '10. Towards Park & Open space @ Rs.' ch_value1 '/-per sft.' into wa_vbap-otext.

wa_vbap-otamt = wa_vbap-fakwr * wa_vbap-kwmeng.

endif.

move wa_vbap-matnr to wa_vbap_ot-matnr.

move wa_vbap-matkl to wa_vbap_ot-matkl.

move wa_vbap-otext to wa_vbap_ot-otext.

move wa_vbap-otamt to wa_vbap_ot-otamt.

Append wa_vbap_ot to ist_vbap_ot.

sort ist_vbap_ot by otext.

endloop.