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 Issue

Former Member
0 Likes
926

I have used the follwoing select statement.

select posnr kwmeng meins vbeln from VBAP

into corresponding fields of table it_vbap

where vbeln = v_vbeln.

Now, i am able to get the required fields from VBAP table without any issue.

But, it has been observed that for particluar sales document, the value for the field VBAP-MEINS is 'H' (Hours). I am able to get this value as 'H' only.

But few Sales Documents have the VBAP-MEINS value as 'D' (Day).

Then select statement should retrieve this value as 'D' only.

But instead of this, the select statement is getting this value as '1'.

When i look into SE11-->VBAP table, the table shows it as VBAP-MEINS as 'D'.

When i debug the code, the value shows as '1'.

How to resolve this issue?

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
894

Hi ,

The reaseon for it is that MEINS has a conversion routine CUNIT attached to it.

So the value which you get in the internal table will be the internal representation , but you will not have any problem when you print it or display it in ALV.

Regards

Arun

7 REPLIES 7
Read only

valter_oliveira
Active Contributor
0 Likes
894

Hi there.

That behaviour is normal, because the field MEINS has a convertion routine. The measure Day, has output format as D, but internal as 10.

Use FM CONVERSION_EXIT_CUNIT_OUTPUT after select.

To check how it works, try in SE37, with input parameter 10.

Regards.

Valter Oliveira.

Read only

Former Member
0 Likes
894

there is CONVERSION_EXIT for MEINS so ur geting that data in that way

if you want to change 1 to d Use FM 'CONVERSION_EXIT_CUNIT_OUTPUT'.

Read only

Former Member
0 Likes
896

Hi ,

The reaseon for it is that MEINS has a conversion routine CUNIT attached to it.

So the value which you get in the internal table will be the internal representation , but you will not have any problem when you print it or display it in ALV.

Regards

Arun

Read only

GauthamV
Active Contributor
0 Likes
894

hi,

use this function module

CONVERSION_EXIT_CUNIT_OUTPUT

reward if hlpful.

Read only

Former Member
0 Likes
894

HI,

Why dont you use the conversion exit for that field of the internal table.

I guess MEINS has the conversion exit.

If it does not solve ur problem u can use CASE Statement.

Read only

Former Member
0 Likes
894

hi pavan,

as my understanding it should not get like that.

let it be i have one solution try like this.

select posnr kwmeng meins vbeln from VBAP

into corresponding fields of table it_vbap

where vbeln = v_vbeln.

after collecting the data into the internal table write the below code.

loop at it_vbap where meins eq '1'.

it_vbap-meins = 'D'.

modify it_vbap.

endloop.

i think this may solve your problem.

Regards

Sree..

Read only

Former Member
0 Likes
894

Thanks....