Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Operation numberS (VORNR) from order number (AUFNR)

Former Member
0 Kudos

Hi,

I am trying to find all the operation number(VORNR) associated with a particular order number(AUFNR).

One oder number can have more than one operation number.

Does anyone know the table from where I can get this data ?

I know one table AFVC (Operation within an order table).

But I am not able to get what I wanted.

Relevant Points will be awarded.

Tushar.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate

VORNR does exist in AFVC, this value is not what you want? VORNR is not in AFVV, but there is other data. What exactly are you looking for.

Regards,

Rich Heilman

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate

VORNR does exist in AFVC, this value is not what you want? VORNR is not in AFVV, but there is other data. What exactly are you looking for.

Regards,

Rich Heilman

0 Kudos

I want all the VORNRs associated with AUFNR when I query using AUFNR.

0 Kudos

So then AFVC does have the data that you want right?

Just do a fetch into an internal table.



report zrich_0003.

data: xafko type afko.
data: iafvc type table of afvc with header line.

parameters: p_aufnr type afko-aufnr.

select single * into xafko
       from afko
             where aufnr = p_aufnr.

clear iafvc. refresh iafvc.
select * into corresponding fields of table iafvc
               from afvc
                        where aufpl = xafko-aufpl.


loop at iafvc.
  write:/ iafvc-vornr.
endloop.

Regards,

Rich Heilman

It may be a little cleaner using an inner join.



report zrich_0003.

data: begin of iaf occurs 0,
      aufnr type afko-aufnr,
      vornr type afvc-vornr,
      end of iaf.

parameters: p_aufnr type afko-aufnr.

select aufnr vornr into corresponding fields of table iaf
         from afko
             inner join afvc
                on afko~aufpl = afvc~aufpl
                        where afko~aufnr = p_aufnr.


loop at iaf.
  write:/ iaf-aufnr, iaf-vornr.
endloop.

Regards,

Rich Heilman

Former Member
0 Kudos

Rich,

Thanks a lot for such a detailed description. I am tryin g to award point but I am getting some error like community award point error. I will try again after sometime.

0 Kudos

So then you problem is solved?

Regards,

Rich Heilman