Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Remove blank space when the the variable is blank

Former Member
0 Likes
6,209

Dear Experts,

The value of gs_sans1_ort02 may contain nothing. In that case, it is showing blank space. Can that be removed? Is there any solution except for using conditions tab?

Regards

Mani

12 REPLIES 12
Read only

Former Member
0 Likes
4,926

and why not using the conditions tab? I suppose this is a smartform. Imagine you would want the space there if the field is empty. So just use the conditions tab

Read only

0 Likes
4,926

Hi,

Thanks for the reply. There would not be any requirement for putting blank space when district(ort01)  is blank.

There are already 4 conditions maintained. For this, I need to make 4 more which is tedious. Is there any other solution?

Regards

Mani

Read only

0 Likes
4,926

No.

You place a "mergefield" at a place, where a text should be outputted. If you do not want it to be outputted, first check whether there really is nothing passed to the smartforms FM (CONDENSE string NO-GAPS). If this is not satisfactory, use the condition.

Read only

0 Likes
4,926

How can I merge two variable up and down? I think I cannot.

Read only

0 Likes
4,926

Hi,

This option is provided in SAP SCRIPT but it is not provided in SMARTFORMs 😮

Thanks

Read only

0 Likes
4,926

Hi Mani,

you can split your text in three  text element  like 1st text element carrying value till OTRT01 and 2nd text element only use for ORT02 and put condition in this text element.

and after that you can use third text element for Country, postal code and mobile number field.

Please try this solution .

Thanks,

Prasenjit

Read only

0 Likes
4,926

Then maybe you want to implement your output in a table style and send those rows as plain texts in a table.

Read only

Former Member
0 Likes
4,926


Hi Mani,

Please try to use address window in your smartform and pass address number in the layout then this problem will be resolved.

Thanks,

Prasenjit

Read only

Former Member
0 Likes
4,926

Hi,

If this is text element then why dont to try using IF --------- ENDIF statements?

Have you tried it?

Because similar requirement I did in SAP script and I believe the commands IF and ENDIF also works in smartforms.

Regards,

Aswath.

Read only

Private_Member_7726
Active Contributor
0 Likes
4,926

Hi,

&gs_sans1-ort02(I)& will not output initial value.

Forget it, I misunderstood - it will not remove the line

cheers

Janis

Message was edited by: Jānis B

Read only

anubhab
Active Participant
0 Likes
4,926

Hi Mani,

     You can use graphical editor. There is a button to switch to it on the left hand corner of the editor. You can open it in graphical editor and put an IF-ENDIF condition for checking if OTR02 is blank or not. Same as SAP Script, you can display this variable on condition basis.

Thanks,

Anubhab

Read only

jay_dalsaniya
Participant
0 Likes
4,926

I am assuming you would like to omit blank lines when there is no value in the variable while using a text element in SmartForm.
So for each line of address I use a different text-element. I am not sure if this is a best way or worst way, but this is helpful. And for each line of text element, in the condition tab, I would check if the variable contains any value?
Lastly, in General Attributes, setting the start value to "New Line" worked for me.