Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2008 at 05:30 AM

    If the condition not met means u add the neccassary details in a work area..

    and then use thefollowing code

    Append <internal table> from <work area>

    Reward if useful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2008 at 05:35 AM

    Hi Bindu,

    Could u explain u r exact requirement clearly.

    And mention the structure wht tht internal table

    contains ok

    Regards

    Ashok

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      See I want to append into internal table ist_vbap_ot the contents of wa_vbap_ot especially the otext field along with the amount which will be zero even if the condition is not met.

      For eg:

      My ist_vbap_ot should contain

      3. Club House Fee 0000.00

      4. Extern elect..... 450065.00

      5. Prop .................... 00.00

      6. Stamd..................... 68752.00

      .

      10. ............................ 12563.00

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2008 at 05:37 AM

    hi bindu,

    if you want to append the values to internal table even when the condition is not met, remove the final if and endif you have given before endloop, that will solve your issue.

    Reward if useful.

    Karthi.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2008 at 05:40 AM

    Hi Friend,

    You need to Append,even if the condition is not met.

    Then no need of checking the condition at all.(No need for the if check).

    Regards,

    Lakshmanan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.