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

Issue with SELECT statement

Former Member
0 Likes
1,079

Hi All,

I have written a select statment to get the the Sales order Type from VBAK.

select vbeln auart from VBAK

into corresponding fields of table i_vbeln

for all entries in it_main

where vbeln = it_main-aubel

and auart = 'CR'.

Even though the database table VBAK-AUART is having the value as 'CR', the select statment is unable to fetch this value.

How to resolve this?

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

asik_shameem
Active Contributor
0 Likes
982

Hi

It internally uses CONVERSION ROUTINE. That is the problem in your case.

Use G2 instead CR.

Otherwise use FM CONVERSION_EXIT_AUART_INPUT

7 REPLIES 7
Read only

Former Member
0 Likes
982

Hi,

Before this querry,please check whether the internal table it_main is filled.

Add the statement before select querry.

if it_main is not initial.

select.........

endif.

Also check whether the it_main contains valid 'AUBEL'.It should be matching with VBELN.

Read only

former_member673464
Active Contributor
0 Likes
982

hi,

There is conversion routine for it.Sales order type is stored in different format in database table. you have to use the internal format of the order type in select condition.Try to use 'G2' instead of 'CR' in the select query.you can use the function modules CONVERSION_EXIT_AUART_INPUT

CONVERSION_EXIT_AUART_OUTPUT for getting the corresponding sales types and conversions.

Regards,

Veeresh

Edited by: veereshbabu ponnada on Jun 2, 2008 12:23 PM

Read only

Former Member
0 Likes
982

Hi Pavan!

select vbeln auart from VBAK

into corresponding fields of table i_vbeln

for all entries in it_main

where vbeln = it_main-aubel

and auart = 'CR'.

try using:

select vbeln auart from VBAK

into table i_vbeln

for all entries in it_main

where vbeln = it_main-aubel

and auart = 'CR'.

kindly reward points if helpful.

Read only

Former Member
0 Likes
982

Dear Pawan,

Even Though You wrote

select vbeln auart from VBAK

into corresponding fields of table i_vbeln

for all entries in it_main

where vbeln = it_main-aubel

and auart = 'CR'.

you need to check internal table which having AUBEL corresponding that in VBAK values are there and Doc type is CR.

check this.

Amit.

Read only

asik_shameem
Active Contributor
0 Likes
983

Hi

It internally uses CONVERSION ROUTINE. That is the problem in your case.

Use G2 instead CR.

Otherwise use FM CONVERSION_EXIT_AUART_INPUT

Read only

peter_ruiz2
Active Contributor
0 Likes
982

hi pavan,

check the table TAUUM. here, enter CR in the AUART_SPR field and you will see that it has a conversion. In our case, we have assigned 'CR' to the standard order type 'G2' of SAP.

regards,

Peter

Read only

Former Member
0 Likes
982

Hi Pavan,

I think you should check AUBEL and VBELN is of same type..

I am sure problem with the data type..