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

how to retrive rate field in taxinvoice

hi Guru ,

i Write following code but rate field not retrive.

select kbetr kwert kschl from konv INTO CORRESPONDING FIELDS OF table it_konv

FOR ALL ENTRIES IN IT_VBRk where KNUMV = IT_VBrK-KNUMV and kschl = 'ZRPR'.

loop at it_konv.

endloop.

select kbetr kwert kschl from konv INTO CORRESPONDING FIELDS OF table it1_konv

for all entries in IT_VBRk where KNUMV = IT_VBRK-KNUMV and kschl eq 'ZFAB'.

loop at it1_konv.

endloop.

select kbetr kwert kschl from konv INTO CORRESPONDING FIELDS OF table it2_konv

for all entries in IT_VBRk where KNUMV = IT_VBRK-KNUMV and kschl eq 'ZRLB'.

loop at it2_konv .

endloop.

loop at it_vbrp.

read table it_konv with key knumv = it_vbrk-knumv .

read table it1_konv with key knumv = it_vbrk-knumv.

read table it2_konv with key knumv = it_vbrk-knumv.

itabfinal-amount1 = it_konv-kbetr + it1_konv-kbetr + it2_konv-kbetr .

itabfinal-value = it_konv-KWERT + it1_konv-KWERT + it2_konv-KWERT .

append itabfinal.

refresh itabfinal.

endloop.

this code get same rate in different material.

please help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2008 at 12:37 PM

    Hi,

    Why you r writing so many times a select query on KONV.

    I think you can write the logic as follows

    select kbetr kwert kschl from konv INTO CORRESPONDING FIELDS OF table it_konv

    for all entries in IT_VBRK

    where KNUMV = IT_VBRK-KNUMV

    and ( kschl eq 'ZRPR'

    or kschl eq 'ZFAB'

    or kschl eq 'ZRLB' ) .

    loop at IT_VBRP.

    read table IT_VBRK with key ebeln = IT_VBRP-VBELN.

    if sy-subrc = 0.

    loop at IT_KONV where knumv = IT_VBRK-KNUMV

    sum the condition values as required.

    endloop.

    endloop.

    With Regards,

    Dwarakanath.S

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      As you are looping on IT_VBRP,

      So put the logic in b/w LOOP AT IT_VBRP and ENDLOOP

      with the loop event AT NEW or AT END OF VBELN so that the below code executes only once.....

      {

      read table IT_VBRK with key ebeln = IT_VBRP-VBELN.

      if sy-subrc = 0.

      loop at IT_KONV where knumv = IT_VBRK-KNUMV

      sum the condition values as required.

      endloop.

      }

      Regards,

      Dwearakanath.S

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.