cancel
Showing results for 
Search instead for 
Did you mean: 

Extractor FM - Reurn Data in Packets

Former Member
0 Kudos

Hi,

I have the following records in an internal table:

<b>Sales Org Customer Material</b>

AU10 C1 M1

AU10 C2 M1

AU10 C3 M1

I have to get the Default Hire Rate (KBETR) from A835 & KONP.

A835 has data for Sales Org + Material combinations.

If I open a CURSOR on A835 for all entries in internal table above, it will return only one record (for Material M1). However, my requirement is to return the Default Rate for all records as below.

<b>Sales Org Customer Material Rate</b>

AU10 C1 M1 $1.00

AU10 C2 M1 $1.00

AU10 C3 M1 $1.00

Is there any way, internal table records can be used to return data in packets?

Thanks,

Kapil

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The internal table reads data from where?

Yes, you can.

Ravi Thothadri

RThothadrii@yahoo.com

Former Member
0 Kudos

Hi Ravi,

The internal table reads data RLPSHP and has the following entries:

Sales Org Customer Material

AU10 C1 M1

AU10 C2 M1

AU10 C3 M1

I want to return both these records. Packet Size is say 2.

it should return

Packet 1 - First 2 Records

Packet 2 - Next 2 Records....

Issue is that on subsequent call for next packet, the itab is refreshed

Only in case i was using a Cursor it would have retained the data to return in packets on each call....

Former Member
0 Kudos

You have to compare all key fields, not only material.

Like:

select * from A835 into wa

where salesorg = data_package-salesorg

and material = data_package-material.

Former Member
0 Kudos

Hi Maik,

A835 has rate at Sales Org & Material Level only (no Customer). I am comparing all the key fields except Customer.

So if a Rate exists for say,

Sale Org: AU10

Material: M1

I have to copy this rate to all the following entries in internal table.

Sales Org Customer Material Rate

AU10 C1 M1

AU10 C2 M1

and pass this data back from the Extractor FM in packets.

Can i do that using internal table entries, issue i faced was that for every call of the FM, the internal table entries get refreshed.

Please find the pseudo code below:

IF initialization?

ELSE Data_extraction_call

IF datapacket_id = 0

Create the internal table with all the Customer, Material combinations.

OPEN CURSOR WITH HOLD..FOR SELECT...FROM A835

for all entries in ITAB

WHERE KAPPL eq, KSCHL eq , VKORG eq itab-vkorg, MATNR eq itab-matnr

datab le sy-datum, datbi ge sy-datum

ENDIF.

FETCH CURSOR...datapacket_size MAX_SIZE.

Increment datapacket_id

ENDIF.

In the example given,if the entries in internal table are

AU10 C1 M1

AU10 C2 M1

The Cursor will hold only one record for M1 and hence will return only one record. I want to return both records.