Skip to Content
author's profile photo Former Member
Former Member

Extractor FM - Reurn Data in Packets

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2007 at 01:54 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2007 at 02:26 PM

    The internal table reads data from where?

    Yes, you can.

    Ravi Thothadri

    RThothadrii@yahoo.com

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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....

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.