Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

it table

Former Member
0 Likes
882

LOOP AT mdeqp.

LOOP AT mdcw.

SELECT equnr

FROM viser02

INTO viser02-equnr

WHERE sdaufnr = mdcw-zs_vbeln

AND posnr = mdcw-zs_posnr

AND equnr = mdeqp-equnr.

IF sy-subrc = 0.

mdcw-zs_equnr = viser02-equnr.

ENDIF.

MODIFY mdcw.

ENDSELECT.

ENDLOOP.

ENDLOOP.

i get error not defined viser02-equnr

i tried select single too and it's working.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

hi,

data : l_equnr like viser02-equnr.

SELECT equnr

FROM viser02

>>INTO viser02-equnr

into l_equnr

WHERE sdaufnr = mdcw-zs_vbeln

AND posnr = mdcw-zs_posnr

AND equnr = mdeqp-equnr.

IF sy-subrc = 0.

mdcw-zs_equnr = l_equnr.

ENDIF.

note: your using nested loop and select endselect inside the nested loop, it will affect the performence very much.

cheers,

sasi

7 REPLIES 7
Read only

Former Member
0 Likes
825

tried select single too and it's not working.

sorry.

Read only

0 Likes
825

Try this declaration:

TABLES: viser02.

It would help to re-visit your code, the select is not optimized and might run into performance issues. Why not try a SELECT..FOR ALL ENTRIES?

Sudha

Read only

Former Member
0 Likes
825

Hi,

Did you declare VISER02 with TABLES statement?

Like,

TABLES: VISER02.

Otherwise do the following,

LOOP AT mdeqp.

LOOP AT mdcw.

SELECT equnr FROM viser02

<b>INTO mdcw-zs_equnr</b>

WHERE sdaufnr = mdcw-zs_vbeln

AND posnr = mdcw-zs_posnr

AND equnr = mdeqp-equnr.

<b>*IF sy-subrc = 0.

*mdcw-zs_equnr = viser02-equnr.

*ENDIF.

IF sy-subrc NE 0.

CLEAR mdcw-zs_equnr.

ENDIF.</b>

MODIFY mdcw.

ENDSELECT.

ENDLOOP.

ENDLOOP.

Sri

Message was edited by: Srikanth Pinnamaneni

Read only

Former Member
0 Likes
825

Yehiel,

Add the following code to u r program:

tables: viser02.

Thanks

Kam

Read only

Former Member
0 Likes
825

Hi Braha,

Try declaring VISER02 in the Tables statement.

Tables : VISER02. at the top of the program.

Thanks,

Vinod.

Don't forget to reward points if u got the solution.

Read only

Former Member
0 Likes
825

DATA:
  lv_equnr type equnr.

LOOP AT mdeqp.
  LOOP AT mdcw.

    SELECT SINGLE equnr
           INTO lv_equnr
           FROM viser02
           WHERE sdaufnr = mdcw-zs_vbeln
             AND posnr = mdcw-zs_posnr
             AND equnr = mdeqp-equnr.
    IF sy-subrc EQ 0.
      mdcw-zs_equnr = lv_equnr.
      MODIFY mdcw.
    ENDIF.
  ENDLOOP.
ENDLOOP.

hth, Tim

Read only

Former Member
0 Likes
826

hi,

data : l_equnr like viser02-equnr.

SELECT equnr

FROM viser02

>>INTO viser02-equnr

into l_equnr

WHERE sdaufnr = mdcw-zs_vbeln

AND posnr = mdcw-zs_posnr

AND equnr = mdeqp-equnr.

IF sy-subrc = 0.

mdcw-zs_equnr = l_equnr.

ENDIF.

note: your using nested loop and select endselect inside the nested loop, it will affect the performence very much.

cheers,

sasi