?
Solved

SAP (ABAP) need help

Posted on 2003-03-13
5
Medium Priority
?
361 Views
Last Modified: 2008-02-01
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
Comment
Question by:pbb744v
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 80 total points
ID: 8131717

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
 

Expert Comment

by:CleanupPing
ID: 9474545
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
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 9475668

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question