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

Urgent : Query on select statement!!

Former Member
0 Likes
917

Hi All,

i am trying to get the customer number from VBPA table into my work area based on vbeln and parvw values. but it is giving me an sysubrc value is 4.

here is my code :

select single kunnr into wa_i_vbpa

from vbpa

where vbeln = p_i_vbeln

and parvw = 'SP'.

Kindly check and let me know whether this is correct or not? if not, please correct it and send it to me back.

Thanks in advance.

Hi All,

i am trying to get the customer number from VBPA table into my work area based on vbeln and parvw values. but it is giving me an sysubrc value is 4.

here is my code :

select single kunnr into wa_i_vbpa

from vbpa

where vbeln = p_i_vbeln

and parvw = 'SP'.

Kindly check and let me know whether this is correct or not? if not, please correct it and send it to me back.

Thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
891

HI Ramesh,

Use Conversion FM before the select statement in this way ...


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = p_i_vbeln
 IMPORTING
   OUTPUT        = p_i_vbeln

Read only

Former Member
0 Likes
891

Hi,

Please try this instead.


select single kunnr into wa_i_vbpa
from vbpa
where vbeln = p_i_vbeln
and parvw = 'AG'.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
891

Try:


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input  = p_i_vbeln
  IMPORTING
    output = p_i_vbeln.

SELECT SINGLE kunnr INTO wa_i_vbpa
  FROM vbpa
  WHERE vbeln = p_i_vbeln
    AND parvw = 'SP'.

Rob

Read only

0 Likes
891

Hi,

No its not working. still i am getting Sy-sUBRC is 4.

Read only

0 Likes
891

Ramesh,

As Ferry Lianto mentioned,

select single kunnr into wa_i_vbpa

from vbpa

where vbeln = p_i_vbeln

and parvw = 'AG'.

should work...Even after using this code, it doesn't work means there is no record in the database table with this selection.

Regards,

Vivek

Read only

0 Likes
891

Then there's no record there for these values.

Rob