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

for all entries

Hi all ,

I have two tables mara and ztable . i need to compare ztable-zwevtbky+0(18).

this is my code.

SELECT * FROM mara INTO TABLE t_mara WHERE spart = p_spart.

IF p_spart IS NOT INITIAL.

SELECT * FROM zwplcsctbud INTO TABLE t_zwplcsctbud_i

WHERE zwpldt LT sy-datum

OR ( zwpldt EQ sy-datum

AND zwpltm LE sy-uzeit ).

LOOP AT t_zwplcsctbud_i .

READ TABLE t_mara WITH KEY MATNR = t_zwplcsctbud_i-zwevtbky+0(18).

IF sy-subrc <> 0.

DELETE t_zwplcsctbud_i .

CLEAR t_zwplcsctbud_i.

ENDIF.

ENDLOOP.

*ELSEIF p_spart IS INITIAL..

ELSE.

  • Extracting data from ZWPLCSCTBUD(PLC Scheduled Table Update)

SELECT * FROM zwplcsctbud INTO TABLE t_zwplcsctbud_i

WHERE zwpldt LT sy-datum

OR ( zwpldt EQ sy-datum

AND zwpltm LE sy-uzeit ).

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

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

    Hi,

    SELECT * FROM mara INTO TABLE t_mara WHERE spart = p_spart.

    IF NOT p_spart IS INITIAL.

    SELECT * FROM zwplcsctbud INTO TABLE t_zwplcsctbud_i

    for all entries in t_mara

    WHERE zwevtbky0(18) eq T_mara-zwevtbky0(18).

    zwpldt LT sy-datum

    OR ( zwpldt EQ sy-datum

    AND zwpltm LE sy-uzeit ).

    regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

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

    May i suggest some modifications?

    1. Selecting * from MARA for a division is probably going to fetch you a large amount of data.

    2. Since you're anyway not filtering based on MARA during the SELECT-statement on the z-table, first select from the z-table. Then, build up an internal table with 0(18) of your field as MATNR-list, and THEN hit MARA.

    Then loop at your z-table ITAB, and filter based on MARA-fetch.

    It's quite likely that this will perform better than the current code.

    Plz award points to useful answers

    Add a comment
    10|10000 characters needed characters exceeded

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.