Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

SAP (ABAP) need help

I have created a report which must produce two reports (rep1_tab and rep2_tab)for rep1_tab I get the correct data but the rep2_tab is never executed even if the requirements are met. Everytime the elsif(code in asterix) part is executed it goes to the endselect.
Eg data: zvarr-ded = '27.01.03', zvarr-ead = '23.01.03',  vbrk-fkdat = '03.03.03'  

If p_accr = 'X'.
              IF zvarr-ded < Vbrk-FKDAT.
                if vbrk-fkdat+4(2) = zvarr-ded+4(2).
                  if zvarr-aed+4(2) < zvarr-ded+4(2).
                    if zvarr-aed+6(2) <= 26.
                   move: vbak-vkbur   to  rep1_tab-vkbur ,
                         vbak-vkgrp   to  rep1_tab-vkgrp,
                         vbak-zzarrno to  rep1_tab-zzarrno,
                         zvarr-aed    to  rep1_tab-aed,
                         zvarr-ded    to  rep1_tab-ded,
                         vbrk-netwr   to  rep1_tab-netwr,
                          vbrk-vbtyp  to  rep1_tab-vbtyp.

                      perform get_name.
                      move kna1-name1 to rep1_tab-name1.

                      if vbrk-vbtyp eq 'O'.
                        rep1_tab-netwr = rep1_tab-netwr * -1.
                      endif.
                      collect rep1_tab.
                    endif.
                  endif.
                endif.
              endif.
*********************************************************
            elseif vbrk-fkdat+4(2) > zvarr-ded+4(2).
*********************************************************
              if zvarr-ded+6(2) >= 26.
                wa_oldmnth = zvarr-ded+4(2) + 1.
                if Vbrk-FKDAT+4(2) = wa_oldmnth.
                  move: vbak-vkbur   to  rep2_tab-vkbur ,
                    vbak-vkgrp   to  rep2_tab-vkgrp,
                    vbak-zzarrno to  rep2_tab-zzarrno,
                    zvarr-aed    to  rep2_tab-aed,
                    zvarr-ded    to  rep2_tab-ded,
                    vbrk-netwr   to  rep2_tab-netwr,
                    vbrk-vbtyp  to  rep2_tab-vbtyp.

                  perform get_name.
                  move kna1-name1 to rep2_tab-name1.

                  if vbrk-vbtyp eq 'O'.
                    rep2_tab-netwr = rep2_tab-netwr * -1.
                  endif.
                  collect rep2_tab.
                endif.
              endif.
            else.
              move: vbak-vkbur   to  rep2_tab-vkbur ,
                vbak-vkgrp   to  rep2_tab-vkgrp,
                vbak-zzarrno to  rep2_tab-zzarrno,
                zvarr-aed    to  rep2_tab-aed,
                zvarr-ded    to  rep2_tab-ded,
                vbrk-netwr   to  rep2_tab-netwr,
                vbrk-vbtyp   to  rep2_tab-vbtyp.

              perform get_name.
              move kna1-name1 to rep2_tab-name1.
              if vbrk-vbtyp eq 'O'.
                rep2_tab-netwr = rep2_tab-netwr * -1.
              endif.
              collect rep2_tab.
            endif.
          endif.
       endselect.
    endif.
  endselect.
endselect.
0
pbb744v
Asked:
pbb744v
  • 2
1 Solution
 
Kent OlsenData Warehouse Architect / DBACommented:

The "elseif" statement is actually paired with the "if p_accr = 'X'" statement.

Looking at your code, I suspect that you intend for it to be paired with the "If zvarr-ded < Vbrk-FKDAT" statement.


Also, in this snippet, there are too many "endif" and "endselect" statements, but I suspect that you just cut and pasted part of the function.


Kdo
0
 
CleanupPingCommented:
pbb744v:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
Kent OlsenData Warehouse Architect / DBACommented:

The OP probably found the solution himself and never came back.

I don't really care about the points, but I did answer his question.

Kent
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now