Skip to Content
0
Former Member
Oct 21, 2009 at 07:46 AM

Hashed table read with large data from STPO and STAS to get Valid-To Date

1088 Views

Hi,

Here are some complicated stuff for you tech guys that I really want to have a good and quick solution to.

This is what I do.

I have 2 hashed tables, one for BOM Components from STPO with unique keys STLTY STLNR STLKN STPOZ

and one for BOM Items selection from STAS with unique keys STLTY STLNR STLAL STLKN STASZ.

Now I have selected data into the different tables and STPO have like 200k+ records and STAS have like 400k+ records.

My task is to use the STAS table instead of using the FM: CSAP_MAT_BOM_ITEM_SELECT to get the valid component for

the BOM Headers. I don't want to use the FM since this will probably take forever with 200k records.

This works all fine and it takes about 3 min to get all data into the tables.

Now Sisyfos arrives... I want to match the records and starts with a loop on the STAS table.

To match the records I need to populate the unique key, but I don't have the STPOZ field available.

How can I match these records?

It might look like this:

STAS

MANDT STLTY STLNR STLAL STLKN STASZ DATUV TECHV AENNR LKENZ

100 M 00010262 01 00000001 00000003 08-28-2006

100 M 00010262 01 00000001 00000071 12-13-2006 500000000061 X

STPO

MANDT STLTY STLNR STLKN STPOZ DATUV TECHV AENNR LKENZ

100 M 00010262 00000001 00000002 08-28-2006

(btw, why is not the change number field updated in this table?)

If I do it the other way around by starting with the STPO table the problem still is the same.

I need to match with the correct key.

Is there a way of passing a blank field, so the read picks up the first record anyway?

I tried SPACE but it didn't work.

I wrongly assumed that the STPOZ field always was double the STLKN field, but when I passed this I only got the valid-to date calculation that I have made for some records. This is not an option.

Are there some other tables that links these together?

My date assumption is that line 1 in STAS is for the Valid-From Date and line 2 is for the Valid-To Date.

The loop works all fine with these number of records, but the matching is not correct.

Please help me out on this problem.

Rgds,

/Fredrik.