cancel
Showing results for 
Search instead for 
Did you mean: 

Address Printing

Former Member
0 Kudos

HI all,

I'm printing address field in smartform header.

i'm using lfa1 table n fields like

name1, name2, nmae3, stras, ort01, ort02,pstlz,

land1, regio.

if some field is blank means in output i shouldn't get the blank space.

how to handle this condtion.

i'm coding in Smartform screen only..

Regards

Suprith

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Refer this link

Ranga

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Chek If Condition for every variable in condition tab.U can use separate textelements for every variable.

Then u can't get any space if the variables r not having any value.

Eg:

if &name& NE ' '

&name&

Endif

and soon.

Former Member
0 Kudos

dont use select query fileds in the address format.

you can use ADDRESS command and pass the LFA1-ADRNR in the address command, you wont get the spaces.if you are not having the values..

Former Member
0 Kudos

Hi,

DATA: L_V_ADRNR TYPE ADRNR,

L_V_LEN TYPE I.

CLEAR: L_V_ADRNR,

V_STCEG,

V_VAT,

V_NAME,

V_CITY,

V_CODE,

V_STREET.

CONSTANTS:L_C_NATION TYPE AD_NATION VALUE 'I'.

*Get the details of the receiving company.

SELECT SINGLE ADRNR

STCEG

FROM T001

INTO (L_V_ADRNR,V_STCEG)

WHERE BUKRS = IS_VPHEADER-BUKRS.

IF SY-SUBRC IS INITIAL.

V_VAT = V_STCEG+2(18).

SELECT NAME1

CITY1

POST_CODE1

STREET

UP TO 1 ROWS

FROM ADRC

INTO (V_NAME,V_CITY,V_CODE,V_STREET)

WHERE ADDRNUMBER = L_V_ADRNR

AND NATION = L_C_NATION.

ENDSELECT.

ENDIF.

IF V_CITY IS NOT INITIAL OR

V_CODE IS NOT INITIAL OR

V_STREET IS NOT INITIAL.

CONCATENATE V_CITY V_CODE V_STREET INTO V_ADDRESS SEPARATED BY ','.

CONDENSE V_ADDRESS.

DO 2 TIMES.

IF V_ADDRESS+0(1) = ','.

V_ADDRESS = V_ADDRESS+1.

ENDIF.

ENDDO.

ENDIF.

Please modify your code according to your requirement.

Hope this will help.

Regards,

Rohan.

Former Member
0 Kudos

Hi Suprith,

You can insert an address window instead of passing variables separately.

Hope this wont get you any issues.

Even now if the issue persues, you can reduce the number of line in the General Attributes of the address window to remove the blank space.

Regards,

Anand.

Former Member
0 Kudos

Hi suprith,

say if you are printing the adress in a address window,just create

text elements in the window for each variable that you are printing in the

form(ex:v_name1 and v_name2).Then in the conditions tab of the text element

put a condition v_name1 not equalto initial.similarly for v_name2.

this will print the adress variables only when they have some value.

regards,

srikanth.

Former Member
0 Kudos

hi ,

u can use table it will adjust automatically ...

regards,

prashanti