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

Adding Street 2 field in a SAPScript

Former Member
0 Likes
1,427

I need to add the street 2 field in a SAPScript. However, I am unsure how to do this. Below is what I have on the SAPScript:

/:	 	IF &RPCOBQBDAT-DSUBT& EQ '0   ' OR &P0106-STRAS(30)& EQ &SPACE(30)&
/:	 	ADDRESS PARAGRAPH L4
/:	 	  TITLE       &FORM_OF_ADDRESS&
/:	 	  NAME        &RPCOBLET01-NAM01&
/:	 	  STREET      &P0006-STRAS&
/:	 	  CITY        &P0006-ORT01&, &P0006-ORT02&
/:	 	  POSTCODE    &P0006-PSTLZ&
/:	 	  COUNTRY     &P0006-LAND1&
/:	 	  REGION      &P0006-STATE&
/:	 	  FROMCOUNTRY &P0006-LAND1&
/:	 	ENDADDRESS
/:	 	ELSE
/:	 	ADDRESS PARAGRAPH L4
/:	 	  TITLE       &FORM_OF_ADDRESS&
/:	 	  NAME        &RPCOBLET01-NAM01&
/:	 	  STREET      &P0006-STRAS&
/:	 	  CITY        &P0106-ORT01&
/:	 	  POSTCODE    &P0106-PSTLZ&
/:	 	  COUNTRY     &P0106-LAND1&
/:	 	  REGION      &P0106-STATE&
/:	 	  FROMCOUNTRY &P0106-LAND1&
/:	 	ENDADDRESS
/:	 	ENDIF

I know that I need to add the field &P0006-LOCAT& to the form (under &P0006-STRAS&) but I am unsure what to use in place of 'STREET'. I tried the following but it doesn't print:


/:	 	  STREET2      &P0006-LOCAT&
/:	 	  BUILDING      &P0006-LOCAT&
/:	 	  STREET      &P0006-LOCAT& -> This one just overwrites the field &P0006-STRAS&

I realize that this is an easy thing but I am not sure what to use.

Regards,

Davis

I need to add the street 2 field in a SAPScript. However, I am unsure how to do this. Below is what I have on the SAPScript:

/:	 	IF &RPCOBQBDAT-DSUBT& EQ '0   ' OR &P0106-STRAS(30)& EQ &SPACE(30)&
/:	 	ADDRESS PARAGRAPH L4
/:	 	  TITLE       &FORM_OF_ADDRESS&
/:	 	  NAME        &RPCOBLET01-NAM01&
/:	 	  STREET      &P0006-STRAS&
/:	 	  CITY        &P0006-ORT01&, &P0006-ORT02&
/:	 	  POSTCODE    &P0006-PSTLZ&
/:	 	  COUNTRY     &P0006-LAND1&
/:	 	  REGION      &P0006-STATE&
/:	 	  FROMCOUNTRY &P0006-LAND1&
/:	 	ENDADDRESS
/:	 	ELSE
/:	 	ADDRESS PARAGRAPH L4
/:	 	  TITLE       &FORM_OF_ADDRESS&
/:	 	  NAME        &RPCOBLET01-NAM01&
/:	 	  STREET      &P0006-STRAS&
/:	 	  CITY        &P0106-ORT01&
/:	 	  POSTCODE    &P0106-PSTLZ&
/:	 	  COUNTRY     &P0106-LAND1&
/:	 	  REGION      &P0106-STATE&
/:	 	  FROMCOUNTRY &P0106-LAND1&
/:	 	ENDADDRESS
/:	 	ENDIF

I know that I need to add the field &P0006-LOCAT& to the form (under &P0006-STRAS&) but I am unsure what to use in place of 'STREET'. I tried the following but it doesn't print:


/:	 	  STREET2      &P0006-LOCAT&
/:	 	  BUILDING      &P0006-LOCAT&
/:	 	  STREET      &P0006-LOCAT& -> This one just overwrites the field &P0006-STRAS&

I realize that this is an easy thing but I am not sure what to use.

Regards,

Davis

7 REPLIES 7
Read only

Former Member
0 Likes
1,128

Hi Davis,

You will directly get all the Address Details from Table PA0006.

Regards,

Vishal

Read only

0 Likes
1,128

Yes, I realize that. My issue is that the line isn't printing on the SAPScript (even though there is a value in P0006-LOCAT.

I just tried /: LOCATION &P0006-LOCAT& and that didn't seem to work either.

Regards,

Davis

Read only

0 Likes
1,128

Hi Davis,

Instead of "/: LOCATION &P0006-LOCAT&", you should use:

  • LOCATION &P0006-LOCAT&.

Means replace /: with *.

Regards,

Vishal

Read only

Former Member
0 Likes
1,128

Does anybody else have an idea?

Davis

Read only

former_member156446
Active Contributor
0 Likes
1,128

hi as you are writing the code in adress .. endaddress tags.... sap automatically pick the address format baed on COUNTRY (&P0006-LAND1&)

Read only

Former Member
0 Likes
1,128

Thanks for the ideas. I got it to work by setting the priority (PRIORITY A). This works even though the priority statement isn't omitting the title field. I'm not sure why it is working but it is.

Regards,

Davis

Read only

Former Member
0 Likes
1,128

According to my notes, the address is formatted by FM ADDRESS_INTO_PRINTFORM and you should see its documentation for further information.

Rob