09-10-2013 1:28 PM
Hello at all,
i have in my SAP SmartForms a Address-Node, which displays via Address- and Personalnumber the Address on the SmartForm!
The Address is comming out in this following format:
1. Title
2. Company-Name
3. Street3
4. Street4
5. Street1
6. Location
Because i want first Street1 and after that Street2 and Street3!!!!
What should i do??
I know, there is a Function-Module "Address_into_printform" but i dont find anything how i can change the sequence of the Address-Fields???
09-10-2013 1:51 PM
Hi Ersin,
If you use an address node then you cannot control the format in which you want to display data. Another issue with address node is that in case the ADRNR is not maintained then it will not output the Smart form. My suggestion is you control the format manually in driver.
Approach- Declare a SE11 structure with fields as -
Address_line1 type c length 80,
Address_line2 type c length 80,
Address_line3 type c length 80,
etc.
Now in driver program fetch the address details like street number, house number, lockbox etc and pass according in this structure. In Smart form use take these values via its interface.
BR.
09-10-2013 2:05 PM
Hi,
There are two options mentioned in the documentation for function module address_into_printform (which is the same code the Smartform address node uses) which will allow you to influence the sequence of address line.
These are user exit SZAD0001 and parameter LINE_PRIORITY, you'll find them well documented so I'll not repeat the detail here.
You can of course choose to bypass the address node and manually construct the address line by line if you choose. I would caution against this as there's significant functionality and flexibility in the address node that you will lose unless you reproduce it in your own code.
Regards,
Nick
09-10-2013 6:59 PM
Instead of calling address node, you can direclty specify the fields in the sequence you desire right?
P1 g_name1
IF G_STREET1 IS NOT INITIAL.
P1 G_STREET1
endif.
IF G_STREET3 IS NOT INITIAL.
P1 G_STREET3
ENDIF.
IF G_STREET2 IS NOT INITIAL.
P1 G_STREET2
ENDIF.
Your issues will be resolved.
09-10-2013 7:32 PM
The address line sequence is related to country codes (OY01 :T005-ADDRS), first look at Customizing, read the provided documentation and look at default values provided by SAP -> Perform some search in SPRO or http://help.sap.com on "address structure key"
Regards,
Raymond
09-10-2013 8:26 PM
User-exit SZAD0001 is the only alternative, if you do not want to handle it manually.
However user-exit SZAD0001 will only trigger if you change the address layout key in OY01 as shown below instead of 001 to any value in between 900 - 999.
It is because the user-exit exists at the else part of the below code in FM ADDRESS_INTO_PRINTFORM.
Regards
Samal