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

program error

Former Member
0 Likes
649

DATA:W_NAME1 TYPE NAME1,

W_ORTO1 TYPE ORT01,

W_ADRNR TYPE ADRNR.

SELECT SINGLE NAME1 ORT01 ADRNR INTO (W_NAME1,W_ORTO1,W_ADRNR)

FROM KNA1 WHERE KUNNR = KUNNR.

WRITE SY-SUBRC.

SY-SUBRC IS RETURNING 4 WHEN KUNNR IS ENTERED AS 1.ANY IDEAS WHY IT IS 4 EVEN IF IT HAS RECORD WITH KUNNR 1

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
629

Use the Following Statement before your Select statement. You shud be fine.

Unpack kunnr to kunnr.

Hope this helps.

Vinodh Balakrishnan

4 REPLIES 4
Read only

Former Member
0 Likes
630

Use the Following Statement before your Select statement. You shud be fine.

Unpack kunnr to kunnr.

Hope this helps.

Vinodh Balakrishnan

Read only

Former Member
0 Likes
629

Hi,

Place zeros in kunnr field in front of the one.

Ex.

1 (wrong)

00001 (right)

you use function module to place zero.

L.Velu

Read only

Former Member
0 Likes
629

Hi Gopi,

When yuo check the value of KUNNR in KNA1 from SE16 you wont see 1 but you will see 0000000001, i.e. the number is prefixed with 0s to complete the 10 digits.

This is achieved by conversion exits. Hence when apply the conversion exit to add 0s to KUNNR before querying the DB.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING INPUT = KUNNR

IMPORTING OUTPUT = KUNNR.

Then place your SELECT query after this.

Regards,

Aditya

Read only

Former Member
0 Likes
629

hi mates,

when using 'conversion_exit_alpha_input' before select queries. whether it wil add 0's to the output, or trips the prefixed 0's in output.

reply asap.

regards

manoharan