cancel
Showing results for 
Search instead for 
Did you mean: 

Postal Code not appearing correctly thru ADDRESS statement

Former Member
0 Kudos

Hi,

I am using ADDRESS - ENDADDRESS to write company code address.

Now, Postal Code of one of the co code is maintained as

5605 LS. However, in the form it is appearing without space i.e

5605LS.

I just noticed that in function module ADDRESS_INTO_PRINTFORM, once postal code is entered into the string , there is a CONDENSE statement with NO-GAPS that suppresses the spaces.

Kindly advise how i can print postal code with space correctly in form using ADDRESS - ENDADDRESS .

Thanks

Nidhi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sohit,

We all know that the address will be generated from the FM 'ADDRESS_INTO_PRINTFORM' into a work area. That work area will be of type adrs_print. So that work area contains 10 lines of the address.

Now just observe the line into which the Postal code is populating. Then take that line value i.e for example l_wa_address-line4 into a variable and separate the number(5605) and string (LS).

concatenate v_postalcode0(4) ' ' v_postalcode4(2) INTO v_string.

Then write the below code:

READ TABLE out_tab ASSIGNING <fs_outtab> INDEX l_c_5.

IF sy-subrc = 0.

<fs_outtab>-value = v_string.

ENDIF.

I hope this trick works. Try it out & let me know in case of any issues.

Don't forget to reward if this is useful.

Pavan.

Former Member
0 Kudos

Hi Pavan,

thanks for the solution , but have small confusion.

What u are suggesting is that now, instead of using ADDRESS and ENADDRESS...I call the function module ADDRESS_INTO_PRINTFORM and then format the data returned by this function module and pass it back to form?

Thanks

Former Member
0 Kudos

Hi Sohit,

Your interpretion is correct. U avoid using the ADDRESS command & make use of the specified FM. That will surely works.

Don't forget to reward points, if useful.

Pavan.

Former Member
0 Kudos

Hi,

Refer this:

ADDRESS ... ENDADDRESS

ADDRESS and ENDADDRESS is used to specify the address which will be formatted according to the target country i.e the recipient country.

e.g. /:ADDRESS sales PARAGRAPH C

/:NAME &KNA1-NAME1&

/:STREET &KNA1-STRAS&

/:POSTCODE &KNA1-PSTLZ&

/:CITY &KNA1-ORT01&

/:COUNTRY &KNA1-LAND1&

/:FROMCOUNTRY 'DE'

/:ENDADDRESS.

Regards,

Shiva