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

assign a global field using program name to a field symbol

Former Member
0 Likes
2,060

Hi Gurus,

I would like to know how to assign a global field using program name (where field is present) to a field symbol?

1 ACCEPTED SOLUTION
Read only

rahulkavuri
Active Contributor
0 Likes
1,239

You mean to say you want to change the value of Global variable of another program using first program.

That cannot be done I suppose, if you want to do anything like that then use EXPORT & IMPORT memory statements in both the programs.. so as to export the value

4 REPLIES 4
Read only

rahulkavuri
Active Contributor
0 Likes
1,240

You mean to say you want to change the value of Global variable of another program using first program.

That cannot be done I suppose, if you want to do anything like that then use EXPORT & IMPORT memory statements in both the programs.. so as to export the value

Read only

0 Likes
1,239

Hi Rahul,

Actually i want to use a variable which is actually defined in a different program (include). I cant export that value since its a sap standard code. I have a user exit where i need those values. There is some method where i can assign the value using assign statement (eg assign "program name--" to<fs>). Could u let me know the exact syntax?

Read only

0 Likes
1,239

After some search I found this for you...

CONSTANTS: BSL(20) VALUE '(SAPMF05A)BSEG-BSCHL'.
 
FIELD-SYMBOLS: <BSL>.
 
ASSIGN (BSL) TO <BSL>.
IF SY-SUBRC = 0.
* do what you want to do
ENDIF.

This is similar kind of code..

field-symbols:
  <menge> type ekpo-menge.
ASSIGN '(MEPO1211)EKPO-MENGE' to <menge>.
IF SY-SUBRC = 0.
* do what you want to do
ENDIF.

Read only

0 Likes
1,239

Thanks Rahul