Skip to Content
avatar image
Former Member

ABAP code. Not returning any value..Please help

Hi All,

I need some help with this code...

DESCRIBE TABLE itab1 LINES lin.

IF lin = 1.

select single * INTO table itab2 from mara

where matnr = itab1-matnr.

IF sy-subrc EQ 0.

W_matnr = itab2-matnr.

ENDIF.

ENDLOOP.

My Itab1 is having 1 record but by select single statement is returning with subrc 4 as I don't have value in header, can you please help in this code.

Thank You.

Sunitha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 20, 2008 at 07:20 PM

    try the changes..

    DESCRIBE TABLE itab1 LINES lin.
    
    IF lin = 1.
    read table itab1 index 1.  "add this , if it is with header line, else use work area
    select single * INTO table itab2 from mara
    where matnr = itab1-matnr. 
    IF sy-subrc EQ 0.
    W_matnr = itab2-matnr.
    ENDIF.
    .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 07:16 PM

    Hi,

    Can you please share the complete LOOP.....ENDLOOP... that you written for itab1.

    Add comment
    10|10000 characters needed characters exceeded