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

SAPScript - Fields Question

cywings
Explorer
0 Likes
775

Hi all expert,

I'm relatively new to sapscript. This is what i wish to do..

Let's say i want to print the vendor address with the addrnumber,

then take the address from ADRC using the same addrnumber.

From the spec, these are the fields which are required:

Name1, Name2, Name3, Name4, str_suppl1, str_suppl2, street, str_suppl3 and tel_number

Expected:

Kraft Foods Limited

Rm 1606 16/F

Str_suppl2

street

str_suppl3

tel_number

my question is...how to ignore those empty fields.. what if one of the fields required is not filled..will sapscript leave a gap to something like this if str_suppl2 is not field

Kraft Foods limit

Rm 1606 16/F

street

str_suppl3

tel_number

is there anyway to ignore the gap so that it will be printed to the next line instead of leaving a line..

thanks all comments are appreciated.

5 REPLIES 5
Read only

messier31
Active Contributor
0 Likes
725

Hi Yew,

In your driver program you use condition to check whether name1 is initial or not and call the respective text-element only if the address element is not initial..

This will solve your porb...

Enjoy SAP.

Pankaj Singh

Read only

Former Member
0 Likes
725

Hi Yew Wing,

The best option is to use the

/: ADDRESS
          /:    ADDRESSNUMBER &ADRC-ADRNR&
          /: ENDADDRESS

This way the system will automatically format the address for you. You need not worry about the blank space and other formatiing options. You need not select all the other fields as well. Just pass the Address number and rest the command ADDRES and ENDADDRESS will do automatically.

Cheers

VJ

Read only

0 Likes
725

Hi Yew \ Vijayendra,

Th usage of /: ADDRESS - /: ENDADDRESS prints address in sap standard. if this format does suffice the req...then well and good....

But what Yew is asking is

<i> Kraft Foods Limited

Rm 1606 16/F

Str_suppl2

street

str_suppl3

tel_number</i>

I am not sure whether the std addres format also prints tel no too..

Yew try using ADDRESS key and check if it is ok ..if yes then definitely some pain will be reduce in ur driver prog. else littlre extra coding..

Enjoy SAP.

Pankaj Singh

Read only

cywings
Explorer
0 Likes
725

thanks to both of u for the suggestions i will try it out later today and shall reward accordingly if it works...

thank you...

Read only

Former Member
0 Likes
725

Hi

Best way is to avoid the Blank line field is empty .

I observerd that Addess is of 6 lines , You declare the 6 varible for 6 lines of address . Concatenate the address fields in respective lines checking they are blank or not .

Then dispaly these lines again if they are not blan in our sctript .

OR .

USE ADDRESS / END ADDRESS in script this should handle this

*Please mark useful answers