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: 

How to get PO and PO item number from VBFA table by providing KDAUF and KDPOS field values from AFPO table

0 Kudos

I need to get purchase order number and item number in corresponding to a Production order number (AUFK-AUFNR). Doesn't matter if the PO is Customer PO or SAP generated PO. Initially I used EKKN table to fetch PO number. I gave AFPO-KDAUF and AFPO-KDPOS to EKKN-VBELN and EKKN-VBELP respectively and I got desired performance. But during run time selection condition for EKKN dumped. So i'm trying for an alternative solution - without using EKKN table to be precise.

My ultimate goal is to find out the exact PO created for a Production order. I may have to follow bottom to top approach I guess.

Please advice me on this.

1 ACCEPTED SOLUTION

Patrick_vN
Active Contributor
0 Kudos

There is a field AUFNR in table EKKN. With a select statement you will get all the Purchase orders linked to it, not?

14 REPLIES 14

Patrick_vN
Active Contributor
0 Kudos

There is a field AUFNR in table EKKN. With a select statement you will get all the Purchase orders linked to it, not?

0 Kudos

Hi Patrick van Nierop,

Actually I'm able to get values from EKKN. But my issue is selection statement written for EKKN is getting dumped in QAS system itself. So I need to find an alternative for EKKN table.

0 Kudos

So your code works on the development system, but dumps on the quality system? Sounds awkward.

Personally I'd look for a solution for the dump though (and compare the versions of the report in both systems).

0 Kudos

Hi Patrick van Nierop ,


Versions are same. For the dump issue I tried Open Cursor method and INDEX ORACLE statement. But Still it's dumping. Roll Out memory.

0 Kudos

Hmm.. not completely sure, but wouldn't that indicate a problem with the Roll and Page memory? An overflow, or something the like?

0 Kudos

Are your AFPO-KDAUF and AFPO-KDPOS filled? you are doing a single select or a "for all entries"?

Could you share a snippet of your code ?

0 Kudos

TSV_TNEW_BLOCKS_NO_ROLL_MEMORY

No roll storage space of length 3748624 available for internal storage.

0 Kudos

Internal table for AFPO is getting populated fine. I'm using for all entries on EKKN by referring to AFPO.

0 Kudos

There's two notes on the subject in this thread Dump TSV_TNEW_BLOCKS_NO_ROLL_MEMORY | SCN.

But as Simone suggests, if you're using a FOR AL ENTRIES in your select, please make sure your reference table with the production orders is not initial (or you'll be trying to select all records from EKKN)

Note: in short, make sure GT_AFPO isn't empty

0 Kudos

That's the answer imho.

As suggested, check GT_AFPO is not initial and that KDAUF and KDPOS are filled or you'll go in full scan.

Without knowing your full scenario, you can put also in LEFT JOIN table EKKN when you select AFPO so you'll have the EBELN/EBELP in a single shot

0 Kudos

AFPO internal table is not initial. Anyway I'm checking if GT_AFPO is initial or not before fetching from EKKN. Please have a look at the snippet.

0 Kudos

That line wasn't in the first snippet .

All kidding aside though, I suggest you check the notes on the matter. I think there are some system parameters of the Roll & Page memory that may be involved.

0 Kudos

I keep suggesting to add EKKN as LEFT JOIN when reading AFPO

0 Kudos

Thanks a lot for your time