2015 Jul 13 7:14 AM
Hi Friends
My requirement is printing address on smartforms.
Ex : Address :
Name City Country |
If in Date base, all vaues are there then output should be.
Name City Country |
If Name is not there , Output should be:
City Country |
If city is not there , Output should be:
Name Country |
If country is not there , Output should be:
Name city |
Can any one help me to solve this Issue.
2015 Jul 13 9:36 AM
Hi,
This requirement can be satisfied using the Function Module ADDRESS_INTO_PRINTFORM. You will also find the same functionality in the Smartform Address node.
Regards,
Nick
2015 Jul 13 9:08 AM
Hi,
You can achieve this by creating a small table with columns and append only those which have value.
Now loop this table and display the address.
types : begin of ty_addr,
field1 type char35,
end of ty_addr.
data: gt_addr type standard table of ty_addr,
wa_addr type ty_addr.
fetch address from database for eg adrc.
if adrc-name is not initial.
wa_addr-field1 = adrc-name.
append wa_adrc to gt_adrc.
endif.
Like wise you can do for city and country.
then create a table in the Smartform and loop at GT_ADRC into wa_adrc.
Print &wa_adrc-field1(C)& in the text node in the main area.
Hope this helps.
2015 Jul 13 9:33 AM
hi,
I have created a sample below:
TYPES: BEGIN OF lty_address,
name TYPE string,
city TYPE string,
country TYPE string,
END OF lty_address.
TYPES: BEGIN OF lty_output,
text TYPE string,
END OF lty_output.
DATA: lwa_address TYPE lty_address.
DATA: lwa_output TYPE lty_output,
ltt_output TYPE STANDARD TABLE OF lty_output.
FIELD-SYMBOLS: <lfs_output> TYPE lty_output.
lwa_address-name = 'Name'.
lwa_address-city = ''.
lwa_address-country = 'Country'.
lwa_output-text = lwa_address-name.
APPEND lwa_output TO ltt_output.
CLEAR lwa_output.
lwa_output-text = lwa_address-city.
APPEND lwa_output TO ltt_output.
CLEAR lwa_output.
lwa_output-text = lwa_address-country.
APPEND lwa_output TO ltt_output.
CLEAR lwa_output.
DELETE ltt_output WHERE text IS INITIAL.
Now the output is in the internal table LTT_OUTPUT.
You may now loop the internal table LTT_OUTPUT in your smartform with only create one text field (lwa_output-text).
2015 Jul 13 9:36 AM
Hi,
This requirement can be satisfied using the Function Module ADDRESS_INTO_PRINTFORM. You will also find the same functionality in the Smartform Address node.
Regards,
Nick
2015 Jul 13 9:37 AM
while printing the data on smartform we have an option to put conditions on such fields.
we have an option of condition tab available for such conditions.. where you can put conditions whether variable is empty then only show... like shown below.. you can put conditions..
2015 Jul 13 11:21 AM
Hi,
Use table in smartform having no. of cells as per your requirement,
put condition on text that u write in cell,e.g name NE initial
city NE Initial
country NE initial
they can seen only when they have value
if they dont have value than they can't show
I think it may help you
Harish Yadav
2015 Jul 13 2:12 PM
Please use address node in the smartform to print addresses. If you just want Name, City and Country in output, you can utilize the "Priority of Lines" option in the node to output the lines required.
Inserting Addresses - Smart Forms - SAP Library
Try the priority as N2OL and check you have the required output.
Thanks,
Juwin