cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script form Related Query

Former Member
0 Kudos

Hello Everyone,

I am a newbie to SAP Script.I have to find a way to display an alternative payee addrees on the cheque output, if specified in the vendor record rather than the actual vendor's address, Can any one please help me out here,Thanks.At the moment it is just printing the each line of the address as a separate fields from the REGUH table.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In REGUH table just go through the fields

ZANRE

ZNME1

ZNME2

ZNME3

ZNME4

ZPSTL

ZORT1

ZSTRA

ZPFAC

ZLAND

ZREGI

(and other fields after that). It will automatically take the alternate payee address and name if you maintain that in vendor master. Other wise it will take same vendor name and address. In your script just print above mentioned fields.

Answers (3)

Answers (3)

Former Member
0 Kudos

The suggestions have been help to progress sooner than I expected,Thanks a lot

Former Member
0 Kudos

Hi,

After the perform -- endperform check for the condition.

if <changing parameter value> eq ' '

display vendor address

else.

display alternative address

endif.

regards

padma

former_member585060
Active Contributor
0 Kudos

Hi,

Use subroutine in SAPScript to get the Alternate Payee address from LFA1 table. Use LFA1-LIFNR and USING parameter and get LFA1-LNRZA value.

read this daocuments

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Regards

Bala Krishna

Former Member
0 Kudos

Hello Mr.Bala Krishna

Thanks for replying ,I think I forgot to mention one more thing here ;The alternate payee address should be displayed whenever it is there in the vendor record and when it is not present, it should display the vendor address, In that case will the perform sub routine not throw any error?Also, when you mentioned to create a sub routine,you meant to say that a new report program should be created which should contain the sub routine or use any existing sub rotuines,Please Clarify,Thanks.

former_member585060
Active Contributor
0 Kudos

Hi ,

You need to create a new Subroutine type program, with name which you will be giving in your PERFORM statement.

For that you write the PERFORM statement in IF and ENDIF statement.

Ex:-

/: IF &REGUH-LIFNR& EQ ' '.

/: PERFORM ....

code

/:ENDPERFORM

address fields of Alternate Payee

/: ENDIF

Regards

Bala Krishna

Edited by: Bala Krishna on Sep 5, 2008 1:23 PM