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

printing address in sapscript

tarangini_katta
Active Contributor
0 Likes
1,822

Hi All,

I want to display the vendor address in the script.I am using the FM ADDRESS_INTO_PRINTFORM.

CUstomer needs it as in XK03 Preview poup address.

When i am using this FM the data is coming importing aparameter

address_printform_table = address_printform_table.

I am looping the data like this and populating ADRS structure

LOOP AT address_printform_table INTO wa_address_printform_table.

IF wa_address_printform_table-line_type = '1'.

adrs-line1 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '5'.

adrs-line2 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '7'.

adrs-line3 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'S'.

adrs-line4 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '0'.

adrs-line5 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'R'.

adrs-line6 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'C'.

adrs-line7 = wa_address_printform_table-address_line.

ENDIF.

ENDLOOP.

IF one value is empty then it is showing empty in the output.

DavidDonaldson

ACCOUNTS

57 xxx

USA.

How can i delete this space-How can i solve this problem.

Can aynbody please give me solution.

Thanks,

1 ACCEPTED SOLUTION
Read only

tarangini_katta
Active Contributor
0 Likes
1,434

Hi all,

Thank u so muxh for u r reply.

ADDRESS TYPE &1& PARAGRAPH AD

ADDRESSNUMBER &REGUH-ADRNR&

FROMCOUNTRY &t001-land1&

ENDADDRESS

but this not displaying the adrees in script.

I want the address to be displayed as in XK03 print priview adress.

This i am able to get through 'address_print_program' in importing parameter 'ADDRESS_PRINTFORM_TABLE-ADDRESS_LINE'

How can i display same output in print form.

Please can anybody give idea it is so quick forme

Thanks,

Hi All,

I want to display the vendor address in the script.I am using the FM ADDRESS_INTO_PRINTFORM.

CUstomer needs it as in XK03 Preview poup address.

When i am using this FM the data is coming importing aparameter

address_printform_table = address_printform_table.

I am looping the data like this and populating ADRS structure

LOOP AT address_printform_table INTO wa_address_printform_table.

IF wa_address_printform_table-line_type = '1'.

adrs-line1 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '5'.

adrs-line2 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '7'.

adrs-line3 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'S'.

adrs-line4 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = '0'.

adrs-line5 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'R'.

adrs-line6 = wa_address_printform_table-address_line.

ENDIF.

IF wa_address_printform_table-line_type = 'C'.

adrs-line7 = wa_address_printform_table-address_line.

ENDIF.

ENDLOOP.

IF one value is empty then it is showing empty in the output.

DavidDonaldson

ACCOUNTS

57 xxx

USA.

How can i delete this space-How can i solve this problem.

Can aynbody please give me solution.

Thanks,

11 REPLIES 11
Read only

shishupalreddy
Active Contributor
0 Likes
1,434

Hello ,

Get the address number or Person Number for the vendor from LFA1 or LFB1 and use

ADDRESS Command with in the script with the address number fetched .It will display the same in the script output.

Regards

Read only

0 Likes
1,434

Hi Sirish,

Can you please give me code how to write it.I have address number.

Thanks

Read only

0 Likes
1,434

hello sishu

I am writing coding like this

/: ADDRESS TYPE VENDOR PARAGRAPH AD

/:ADDRESSNUMBER &REGUH-ADRNR&

/:FROMCOUNTRY &LFA1-LAND1&

/:LANGUAGE &SYST-LANGU&

/:ENDADDRESS

while i am checking the script it is throwing error.

Can you please let me know is this correct and where i am doing maisatek.

Thanks

Read only

0 Likes
1,434
	ADDRESS
 	  TITLE    &SADR-ANRED&
 	  NAME     &SADR-NAME1&, &SADR-NAME2&, &SADR-NAME3&, &SADR-NAME4&
 	  STREET   &SADR-STRAS&
 	  POBOX    &SADR-PFACH& CODE &SADR-PSTL2&
 	  POBOX                 CODE                CITY &XXXX-PFORT&
 	  POSTCODE &SADR-PSTLZ&
 	  CITY     &SADR-ORT01&, &SADR-ORT02&
 	  REGION   &SADR-REGIO&
 	  COUNTRY  &SADR-LAND1&
 	  FROMCOUNTRY &XXXX-SLAND&
 	ENDADDRESS
Read only

0 Likes
1,434

Hello,

I don't believe 'VENDOR' is a valid address type. It should be 1,2,3 or ' ' (default).

For paragraph AD set the 'No Blank Lines' flag and it will stop printing the blank line in the address.

Note that some postal regulations want a space before printing the destination country, which is why the address_into_printform sometimes adds a blank line.

Michael

Read only

tarangini_katta
Active Contributor
0 Likes
1,435

Hi all,

Thank u so muxh for u r reply.

ADDRESS TYPE &1& PARAGRAPH AD

ADDRESSNUMBER &REGUH-ADRNR&

FROMCOUNTRY &t001-land1&

ENDADDRESS

but this not displaying the adrees in script.

I want the address to be displayed as in XK03 print priview adress.

This i am able to get through 'address_print_program' in importing parameter 'ADDRESS_PRINTFORM_TABLE-ADDRESS_LINE'

How can i display same output in print form.

Please can anybody give idea it is so quick forme

Thanks,

Read only

0 Likes
1,434

if at all you are using address .. endaddress tags SAP will automatically pick the country format of address and displays in the same fashion. If you want as per your specifications give all the fields you want to show and remove the tags ( address... endaddress)

Read only

0 Likes
1,434

Hi J@Y,

As u said I have all the fields in the script and removed the adress and end adrees tags.

as i have given in my code for first post i am getting the spaces in sructure and these spaces are coming output also.

Please let me know how to solve this.

Thanks.

Read only

0 Likes
1,434

How about trying like this :

	  TITLE    &SADR-ANRED&
 	  NAME     &SADR-NAME1&, &SADR-NAME2&, &SADR-NAME3&, &SADR-NAME4&
 	  STREET   &SADR-STRAS&
if not SADR-PFACH is initial.  "<<<<<<<<<<<check if we have value..
 	  POBOX    &SADR-PFACH& CODE &SADR-PSTL2&
endif.
 	  POBOX                 CODE                CITY &XXXX-PFORT&
if not SADR-PSTLZ is initial.
 	  POSTCODE &SADR-PSTLZ&
endif.
 	  CITY     &SADR-ORT01&, &SADR-ORT02&
 	  REGION   &SADR-REGIO&
 	  COUNTRY  &SADR-LAND1&
 	  FROMCOUNTRY &XXXX-SLAND&

Read only

0 Likes
1,434

Don't put the 1 in &&


ADDRESS TYPE 1 PARAGRAPH AD

Read only

0 Likes
1,434

Hi MIchael,

U have solved my problem.

I have a small question the address coming in bold letters.

How can i chnage the font style.

In printout is it come properly.

Please let me know .

Thanks u so much for u r help.

Thanks