on 08-01-2011 3:38 PM
Hi,
I am trying to change the way address is printed in a script. The script uses the following statement to print the address -
ADDRESS DELIVERY PARAGRAPH ZZ
ADDRESSNUMBER &PEKKO-ADRN2(K)&
FROMCOUNTRY &LFA1-LAND1&
ENDADDRESS
The address is printed in the following format
Title
Name
Street
Street 3
Street 2
City 1 City 2 State Postal Code
Country
The problem is -- 'Street 4' is not printed and the position of Street 3 and Street 2 are swapped, I researched a bit and found that the address format is decided based on the country and can be edited only using a user exit for the function module ADDRESS_INTO_PRINTFORM. I went through the document and found that it is too much of an effort for this adjustment.
So, I used a form routine to fetch the address details (fields: Title, Name1, Name2, Name3, Name4, Street, Street2, Street3, Street4, City etc) from table ADRC. There are no address details maintained in the table SADR in the current production system. I used the address formatting ADDRESS... ENDADDRESS to format the address based on the data I have
ADDRESS DELIVERY PARAGRAPH ZZ
TITLE &SHIPTOADDR-TITLE&
NAME &SHIPTOADDR-NAME1&, &SHIPTOADDR-NAME2&, &SHIPTOADDR-NAME3&, &SHIPTOADDR-NAME4&
STREET &SHIPTOADDR-STREET&
STREET &SHIPTOADDR-STR_SUPPL1&
STREET &SHIPTOADDR-STR_SUPPL2&
STREET &SHIPTOADDR-STR_SUPPL3&
CITY &SHIPTOADDR-CITY1&, &SHIPTOADDR-CITY2&
POSTCODE &SHIPTOADDR-POST_CODE1&
COUNTRY &SHIPTOADDR-COUNTRY&
REGION &SHIPTOADDR-REGION&
FROMCOUNTRY &LFA1-LAND1&
ENDADDRESS
The problem is that the above code skips Street, Street 2 and Street 3 and prints only Street4, I guess there is some kind of overwriting. I cannot concatenate all the 4 street fields into one field because of the length factor (35 chars each) and every street has to be printed in a different line.
My questions
1. Is there a way I can force the program to print all the streets still using ADDRESS.. ENDADDRESS.
2. In a different context, does a statement like below print all the 4 streets of an address
ADDRESS DELIVERY...
STREET &SADR-STRAS&...
ENDADDRESS
what happens if you do:
ADDRESS DELIVERY PARAGRAPH ZZ
TITLE &SHIPTOADDR-TITLE&
NAME &SHIPTOADDR-NAME1&, &SHIPTOADDR-NAME2&, &SHIPTOADDR-NAME3&, &SHIPTOADDR-NAME4&
STREET &SHIPTOADDR-STREET&
&SHIPTOADDR-STR_SUPPL1&
&SHIPTOADDR-STR_SUPPL2&
&SHIPTOADDR-STR_SUPPL3&
CITY &SHIPTOADDR-CITY1&, &SHIPTOADDR-CITY2&
POSTCODE &SHIPTOADDR-POST_CODE1&
COUNTRY &SHIPTOADDR-COUNTRY&
REGION &SHIPTOADDR-REGION&
FROMCOUNTRY &LFA1-LAND1&
ENDADDRESS
or adding LINES 9 and/or PRIORITY S to you Address command line?
Or, since you have obtained the data into your own structure, just refer to the components and print out like you want....
ZZ &SHIPTADDR-TITLE& ...
&SHIPTOADDR-COUNTRY&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried the first approach already and for some reason I am missing City2 in the final display output.
I also tried your second suggestion on priorities just now and found that the order of the display of the fields is
Street2 (STR_SUPPL1)
Street3 (STR_SUPPL2)
Street
Street4 (STR_SUPPL3)
Is there a way I can fix this order, the priorities sequence I have used is A234SOTCRL and used the function module documentation for the order priority.
I do not want to go with the third approach since I have to handle the commas etc etc myself.
Did not find any easier way to do this adjustment.
ADDRESS DELIVERY PARAGRAPH ZZ
TITLE &SHIPTOADDR-TITLE&
NAME &SHIPTOADDR-NAME1&, &SHIPTOADDR-NAME2&, &SHIPTOADDR-NAME3&, &
STREET &SHIPTOADDR-STREET& HOUSE &SHIPTOADDR-HOUSE&
ENDADDRESS
&SHIPTOADDR-STR_SUPPL1&
&SHIPTOADDR-STR_SUPPL2&
&SHIPTOADDR-STR_SUPPL3&
ADDRESS DELIVERY PARAGRAPH ZZ
CITY &SHIPTOADDR-CITY1&, &SHIPTOADDR-CITY2&
POSTCODE &SHIPTOADDR-POST_CODE1&
REGION &SHIPTOADDR-REGION&
COUNTRY &SHIPTOADDR-COUNTRY&
FROMCOUNTRY &LFA1-LAND1&
ENDADDRESS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.