‎2013 Dec 17 6:27 AM
Hi team,
I have a problem while generating the file.
For nine digit zip code, insert a hyphen after the fifth digit. i.e.; 631464714 it should be like 63146-4714.
and this zip code should be valid if the country is US.
Guys please help me, how to code this.
Thanks & Regards,
Dheeraj.
‎2013 Dec 17 6:39 AM
data : v_zip_us(10).
if wa_tab-country = 'US'.
concatenate wa_zipcode+0(5) '-' wa_zipcode+5(4) into v_zip_us.
else.
v_zip_us = wa_zipcode.
endif.
wa_tab-zipcode = v_zip_us.
‎2013 Dec 17 6:39 AM
data : v_zip_us(10).
if wa_tab-country = 'US'.
concatenate wa_zipcode+0(5) '-' wa_zipcode+5(4) into v_zip_us.
else.
v_zip_us = wa_zipcode.
endif.
wa_tab-zipcode = v_zip_us.
‎2013 Dec 17 6:49 AM
Hi Dheeraj,
You can use STRLEN method & CONCATENATE to achive this.
For example say postal code is in l_postalcode.
Then l_length = STRLEN (l_postalcode).
IF l_length>5.
l_length = l_length-5.
CONCATENATE l_postalcode+0(5) '-' l_postalcode+5(l_length) INTO l_postal_final.
CONDENSE l_postal_final NO-GAPS.
ENDIF.
Regards,
Shiva.