cancel
Showing results for 
Search instead for 
Did you mean: 

Reading and internal table

Former Member
0 Kudos
36

I have the following code but it doens't like this line. Hod do i need to code this corectly

LOOP AT WA_DATAPACKAGE INTO WA_DATAPACKAGE_LN.

wa_TABIX = SY-TABIX.

READ table DATA_PACKAGE INTO WA2_DATAPACKAGE_LN

WITH KEY

DOC_NUMBER = WA_DATAPACKAGE_LN-DOC_NUMBER

S_ORD_ITEM = WA_DATAPACKAGE_LN-S_ORD_ITEM

WA_DATAPACKAGE_LN--sched_line NE sched_line

dsdel_date = WA_DATAPACKAGE_LN-REQ_DATE.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks, this worked

Former Member
0 Kudos

Hi,

It is not possible to have NE in Read statement..instead..use..LOOP AT..EXIT..ENDLOOP.


LOOP AT WA_DATAPACKAGE INTO WA_DATAPACKAGE_LN.
wa_TABIX = SY-TABIX.
******" Naren changes
LOOP AT DATA_PACKAGE INTO WA2_DATAPACKAGE_LN
WHERE
******" Naren changes End.
DOC_NUMBER = WA_DATAPACKAGE_LN-DOC_NUMBER
S_ORD_ITEM = WA_DATAPACKAGE_LN-S_ORD_ITEM
WA_DATAPACKAGE_LN--sched_line NE sched_line.
******" Naren changes
EXIT.
ENDLOOP.
******" Naren changes End

dsdel_date = WA_DATAPACKAGE_LN-REQ_DATE. 

Thanks

Naren

former_member194669
Active Contributor
0 Kudos

Hi,


LOOP AT WA_DATAPACKAGE INTO WA_DATAPACKAGE_LN.
wa_TABIX = SY-TABIX.
READ table DATA_PACKAGE INTO WA2_DATAPACKAGE_LN
     WITH KEY DOC_NUMBER = WA_DATAPACKAGE_LN-DOC_NUMBER
                     S_ORD_ITEM = WA_DATAPACKAGE_LN-S_ORD_ITEM.
IF SY-SUBRC EQ 0.
    IF WA_DATAPACKAGE_LN-sched_line NE sched_line.
         dsdel_date = WA_DATAPACKAGE_LN-REQ_DATE.
    ENDIF.
ENDIF.

ENDLOOP.

Former Member
0 Kudos

Okay but how does it then read it again to find one that isn't the same line

former_member194669
Active Contributor
0 Kudos

Hi,

Okay then you have multiples?


LOOP AT WA_DATAPACKAGE INTO WA_DATAPACKAGE_LN.
wa_TABIX = SY-TABIX.
LOOP AT  DATA_PACKAGE INTO WA2_DATAPACKAGE_LN
      WHERE DOC_NUMBER = WA_DATAPACKAGE_LN-DOC_NUMBER
             AND  S_ORD_ITEM = WA_DATAPACKAGE_LN-S_ORD_ITEM.
             AND sched_line NE sched_line.

         dsdel_date = WA_DATAPACKAGE_LN-REQ_DATE.

ENDLOOP..

ENDLOOP.