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

Select statement

Former Member
0 Likes
606

Hi All...

I would like to fetch VBPA-KUNNR based on VBPA-PARVW = 'SH'.

Then i need to move VBPA-KUNNR to KOMKCV-ZZKUNNR.

Is it possible for me to write the SELECT statement without using INTO clause..???

If YES, how to write the code,...??????

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
575

Hi,

I if konw vbpa-vbeln and vbpa-posnr then based on vbpa-parvw u can get vbpa-kunnr with out INOT clause...

here your can use select single statement to get the required data.

select single kunnr into gv_kunnr

from vbpa

where vbeln = vbeln

and posnr = posnr

and parvw = parvw.

if sy-subrc = 0.

komkcv-zzkunnr = gv_kunnr.

endif.

Regards,

Satya.

5 REPLIES 5
Read only

Former Member
0 Likes
575

Hello Pavan,

If u want to use select without into clause then u need to create the workarea for the table using tables statament. Try like this.

TABLES: MARA.

Select single * from mara where matnr = 'ABACD'.

If useful reward.

Vasanth

Read only

Former Member
0 Likes
575

i dont find any filed named ZZKUNNR, is it right field

Read only

Former Member
0 Likes
575
SELECT kunnr from
             vbpa
            INTO v_kunnr
           WHERE parvw = 'SH'.

IF sy-subrc = 0.
   KOMKCV-ZZKUNNR = v_kunnr.
 Pass the other values and 
  UPDATE TABLE KOMKCV. (check syntax)
ENDIF.

Any way u have to use INTO either a variable or internal table o workarea.

Hope this helps you.

Read only

Former Member
0 Likes
575

select * from VBPA where PARVW = 'SH'.

<b>so data gets selected into header of VBPA</b>.

komkcv-zzkunnr = vbpa-kunnr.

update table komkcv where zzkunnr = vbpa-kunnr.

endselect.

Award Points....

Read only

Former Member
0 Likes
576

Hi,

I if konw vbpa-vbeln and vbpa-posnr then based on vbpa-parvw u can get vbpa-kunnr with out INOT clause...

here your can use select single statement to get the required data.

select single kunnr into gv_kunnr

from vbpa

where vbeln = vbeln

and posnr = posnr

and parvw = parvw.

if sy-subrc = 0.

komkcv-zzkunnr = gv_kunnr.

endif.

Regards,

Satya.