Application Development 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: 

SAPSCRIPT PROBLEM Overriding the Variable

Former Member
0 Kudos

Hi

I have this SAP SCRIPT FORM that gets company info from a table and which works fine. But we don't have access to the table anymore. so if we have an update of the address we have to hard code it in the script. And there lies my problem.

This is what the program was doing before:


/: PERFORM Z_GET_COINFO IN PROGRAM ZPAY001
/: USING &T001-ADRNR&
/: CHANGING &CO_NAME1&
/: CHANGING &CO_STRAS&
/: CHANGING &CO_ORT01&
/: CHANGING &CO_REGIO&
/: CHANGING &CO_PSTLZ&
/: ENDPERFORM

ZB <B>&CO_NAME1&</><B>,...

Now since I have to over Ride the info that it gets from the table I changed the code like this


/: PERFORM Z_GET_COINFO IN PROGRAM ZPAY001
/: USING &T001-ADRNR&
/: CHANGING &CO_NAME1&
/: CHANGING &CO_STRAS&
/: CHANGING &CO_ORT01&
/: CHANGING &CO_REGIO&
/: CHANGING &CO_PSTLZ&
/: ENDPERFORM
/: IF &T001-BUKRS& = '9700'
/: &CO_NAME1& = 'Whayne & Sons Enterprises'
/: &CO_STRAS& = '10515 E 40th Ave Ste 103'
...
/: ENDIF

ZB <B>&CO_NAME1&</><B>,...

But when i am printing the check its printing blank. (in this case 9700 doesn't even exist in the table. But if i directly print the company name after the IF condition it prints it correctly but in the wrong format and some cases double (where there r old data in the table)...

Please tell me why its not over riding the data from the table and printing my defined data...

Message was edited by:

Anwarul Kabir

1 REPLY 1

Former Member
0 Kudos

I used DEFINE infront which did the trick



/: DEFINE &CO_NAME1& = 'Whayne & Sons Enterprises'