Skip to Content
0
Former Member
Feb 24, 2006 at 07:34 PM

DataType conversion

32 Views

Hello:

I'm facing a problem about parameters into RFC/Selects. I learned here that when developing ABAP I should make sure to fill with zero's incomplete variables such as: '0000000029' instean of just '29'. In order to format it I could call:

call function 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = CLIENT_ID

IMPORTING

OUTPUT = CLIENT_ID.

Now I'm having a similar issue but I don't seem to figure it out the same way. I have:

FUNCTION Z_GET_REGION_DETAILS.

*"----


""Interfase local

*" IMPORTING

*" VALUE(CLIENT_ID) TYPE Z_CLIENT_ID OPTIONAL

*" EXPORTING

*" VALUE(COLONY) TYPE ADRC-LOCATION

*" VALUE(COUNTRY) TYPE T005T-LANDX

*"----


TYPES: BEGIN OF client_eq_type,

LAND1 TYPE KNA1-LAND1,

ADRNR TYPE KNA1-ADRNR,

LANDX TYPE T005T-LANDX,

LOCATION TYPE ADRC-LOCATION,

END OF client_eq_type .

DATA: client_eq TYPE client_eq_type.

CONSTANTS LANGUAGE LIKE T005T-SPRAS value 'S'.

And I get client_eq-ADRNR correctly. for instance it is a 29232. Now I go and use it to get data from another table:

SELECT SINGLE LOCATION

FROM ADRC

INTO client_eq

WHERE ADDRNUMBER = client_eq-ADRNR.

and I assign it as COLONY = client_eq-LOCATION.. However. this shows me nothing. I assume I should zero fill the remainning spaces for client_eq-ADRNR so I tried:

SELECT SINGLE LOCATION

FROM ADRC

INTO client_eq

WHERE ADDRNUMBER = '0000022539'.

But nothing. I also tried:

call function 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = client_eq-ADRNR

IMPORTING

OUTPUT = client_eq-ADRNR.

But none of this are working... any suggestions?

Thanks a lot!

Alejandro