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

field value not being selected

Former Member
0 Likes
1,524

Hi ,

i'm doing an module pool programming....and i have written the following code in PAI event...

IF OK_CODE = 'DISPLAY'.

LEAVE TO LIST-PROCESSING.

SELECT SINGLE NAME1 ORT01 ADRNR FROM KNA1 INTO

(W_NAME1, W_ORT01, W_ADRNR) WHERE KUNNR = KUNNR.

when i debug, i an see the value of kunnr only say i am taking 10000. and no value is found in name1 ort01 or adrnr...

and also all the other events are working correctly say back, cancel..

plz suggest what could be the probable problem...

thnks n regards,

Mukesh

Hi ,

i'm doing an module pool programming....and i have written the following code in PAI event...

IF OK_CODE = 'DISPLAY'.

LEAVE TO LIST-PROCESSING.

SELECT SINGLE NAME1 ORT01 ADRNR FROM KNA1 INTO

(W_NAME1, W_ORT01, W_ADRNR) WHERE KUNNR = KUNNR.

when i debug, i an see the value of kunnr only say i am taking 10000. and no value is found in name1 ort01 or adrnr...

and also all the other events are working correctly say back, cancel..

plz suggest what could be the probable problem...

thnks n regards,

Mukesh

10 REPLIES 10
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,468

Try passing KUNNR with leading zeros ( Use conversion routine ).

SELECT SINGLE NAME1 ORT01 ADRNR FROM KNA1 INTO

(W_NAME1, W_ORT01, W_ADRNR) WHERE KUNNR = '0000010000'.

Read only

0 Likes
1,468

thnks keshav...

but how should i do that?...plz help...m new in module pool programming...

Read only

0 Likes
1,468

hi

usin gthis fm: Conversion routine,Pass the kunnr value

CONVERSION_EXIT_ALPHA_INPUT

import --->kunnr

export --->kunnr

Read only

0 Likes
1,468

In your screen field there is a option to provide your conversion routine.

Check the domain of KUNNR for the conversion exit used,

give the same in screen attributes->dictionary tab of the screen field KUNNR.

Or do as suggested by Dharmaraj.

Read only

Former Member
0 Likes
1,468

Hi Mukesh,

Give ALPHA in the Conv.exit option of field. This will automatically carry out conversion routine...

Hope this helps...

Nag

Read only

Former Member
0 Likes
1,468

Hi, Mukesh,

Copy paste this code and see if it is working

IF OK_CODE = 'DISPLAY'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = kunnr

IMPORTING

output = kunnr.

SELECT SINGLE NAME1 ORT01 ADRNR FROM KNA1 INTO

(W_NAME1, W_ORT01, W_ADRNR) WHERE KUNNR = KUNNR.

LEAVE TO LIST-PROCESSING.

Hope it helps you,

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
1,468

THNKS TO ALL OF U...

but can anybody tell me why is this conversion required?

Read only

0 Likes
1,468

Hi Mukesh,

Conversion exit ALPHA, external->internal

ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.

Hope it clears your doubt.

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
1,468

thnks...

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,468

Always read SAP help for more details.