Application Development 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: 

Getting Adress numbers.

ronaldo_aparecido
Contributor
0 Kudos

Hi Experts.

I'm working with BAPI for customers and it returns the field street with numbers of house_num1 and house_num2

Example:

Field street = street mark hughies 2000 ,123.

2000 is house_num1 and 123 is house_num2

I need send that fileds in diferent fields of interface data.

I know i could pass to string and use CA '1234567890' but it gets all numbers 2000123 and I want 2000 in one variable and 123 in other variable.

How can I do it?

Thanks

3 REPLIES 3

paul_bakker2
Active Contributor
0 Kudos

Hi,

Do they always have a comma between them? If so, use the split command.

Eg

SPLIT lv_street AT '.' INTO lv_street_1 lv_street_2.

cheers

Paul

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi Ronaldo,

Please split the street as suggested by Former Member.

Add the below code after splitting to replace characters with space.

Check lv_street_1 and lv_street_2 after executing below statements.

REPLACE ALL OCCURRENCES OF REGEX '[^\d]' IN lv_street_1 WITH ''.

REPLACE ALL OCCURRENCES OF REGEX '[^\d]' IN lv_street_2 WITH ''.




Thanks.

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Ronaldo,

Try.

Using the length of the field get  the value.

house_num1(20) =  lv_street_1.

Regards,

Venkat.