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

Query problem : help me

Former Member
0 Likes
1,339

DATA : s_werks TYPE vbrp-werks,

BELN like vbpa-VBELN,

BITM like vbpa-POSNR,

v_adrnr like vbpa-adrnr.

tables : vbpa.

READ TABLE IT_FINAL.

beln = it_final-vbeln.

bitm = it_final-posnr.

s_werks = it_final-werks.

s_bukrs = it_final-bukrs.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = beln1

IMPORTING

OUTPUT = beln1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = bitm1

IMPORTING

OUTPUT = bitm1.

select single *

from vbpa

where vbeln = beln

and posnr = bitm

AND PARVW EQ 'SH'.

Now i have changed the query yar, but its also not woking,

it returns sy-subrc = 4, even the condition satisfied with values.

can anyone help me on this.

Regards

Rajaram

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,298

Go to SE16 and use table VBPA after giving input values check whether you are getting values?

13 REPLIES 13
Read only

former_member194669
Active Contributor
0 Likes
1,299

Go to SE16 and use table VBPA after giving input values check whether you are getting values?

Read only

0 Likes
1,298

I am getting values in se16 yar, but in debugging returns

sy-subrc = 4.

Read only

0 Likes
1,298


select single *
from vbpa
where vbeln = beln
and posnr = bitm
AND PARVW EQ 'WE'.  "<<<<<<<

There will a conv routine behind data element PARVW please check thru SE11 .

Read only

0 Likes
1,298

yes yar PARVW value in se11 is 'WE', but in database when i put N transaction its SH.

whats the reason actually.

Read only

0 Likes
1,298

Check the domain PARVW , in the definition tab you can find conversion routine PARVW double click on that

you can find

CONVERSION_EXIT_PARVW_INPUT

CONVERSION_EXIT_PARVW_OUTPUT

Read only

0 Likes
1,298

i dont understand conversion routine PARVW.

pls explain me, and even if i remove PARVW condition,

the quey is not working yar, what could be the reason.

Read only

0 Likes
1,298

hi,

there are two function modules involved in this pls check

in se 37.

CONVERSION_EXIT_PARVW_INPUT--which converts SH to WE

CONVERSION_EXIT_PARVW_OUTPUT-which converts WE to SH

for some reason SAP has made conversion like this for many fields so we have to check when we hard code some values in query...but in se16 it will atomatically do the process...

pls check the link too...

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee19446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/2b/e9a20d3347b340946c32331c96a64e/content.htm

regards,

karthik.

Edited by: karthikeyan sukumar on Dec 20, 2007 10:47 AM

Read only

0 Likes
1,298

select single *

from vbpa

where vbeln = '0081600002'

and posnr = '000010'.

This query is working perfectly yar,

i thing the forwaded zeroes is the problem.

how can we solve this.

Read only

0 Likes
1,298

For checking & testing


select single *
from vbpa
where vbeln = beln
and posnr = bitm.

check whether you are getting values if not


select single *
from vbpa
where vbeln = beln.

then you can easily filter it out where the problem is

for find the conversion routines pl check function module i have give able

Read only

Former Member
0 Likes
1,298

hi ,

i have just made small change...more than that i could not find any error...

DATA : s_werks TYPE vbrp-werks,

BELN like vbpa-VBELN,

BITM like vbpa-POSNR,

v_adrnr like vbpa-adrnr.

tables : vbpa.

*What u are trying to read every time i think u should use index/key field

READ TABLE IT_FINAL.

if sy-subrc = 0.

beln = it_final-vbeln.

bitm = it_final-posnr.

s_werks = it_final-werks.

s_bukrs = it_final-bukrs.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = beln "not beln1

IMPORTING

OUTPUT = beln.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = bitm "not bitm1

IMPORTING

OUTPUT = bitm.

select single *

from vbpa

where vbeln = beln

and posnr = bitm

AND PARVW EQ 'SH'.

endif.

regards,

karthik

Read only

former_member402443
Contributor
0 Likes
1,298

Hi Raja,

Your code seems to be ok.

Will you can tell me the structure of IT_FINAL.

Regards

Manoj Kumar

Read only

Former Member
0 Likes
1,298

hi ,

there is a conversion routine for PARVW field pls check..

regards,

karthik

Read only

former_member282823
Active Participant
0 Likes
1,298

Hi Raja Ram,

Even i have faced the similar problem, the problem is coming bcoz in the select query in the condition ,we will not get the leading zeros, when we go in se16 and check for that particular condition we will see there will be leading zeros, so just add the fm, convrersion_alpha_exit_input and your problem will be solved.

All the Best

Ramesh.