cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning a Dynamic Variable

Former Member
0 Kudos

Dear Gurus

I want to ask about next code section. On ECC 6, the next statement is working out fine, but somehow, it's giving a short dump in 4.6c, because the second line(ASSIGN statement) is giving out SY-SUBRC = 4. and l_value is trying to access <fvalu> which is not assigned properly(or so they say in the dump).

wa_Data-ebeln = '1000000000'.

g_String = 'WA_DATA-EBELN'.

ASSIGN (g_string) TO <fvalu>.

l_value = <fvalu>.

Can anybody help to tell me what's wrong with the code? I am trying to get the value of WA_DATA-EBELN based on the field string 'WA_DATA-EBELN'. I am expecting l_value's value to be 1000000000. Is there any other way to do this kind of thing? (4.6c environment)

Accepted Solutions (1)

Accepted Solutions (1)

gopi_narendra
Active Contributor
0 Kudos

Hey...Andre ...

* CONCATENATE 'PS_WAREA-' g_string INTO g_string.
* ASSIGN (g_string) TO <fvalu>. " Andres code
  ASSIGN COMPONENT g_string OF STRUCTURE ps_warea TO <fvalu>.

Hey Andre, problem got solved...

Regards

Gopi

Answers (2)

Answers (2)

imthiaz_ahmed
Active Contributor
0 Kudos

Better you should have tried in the ABAP forum. any how, try this link

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/frameset.htm

Regards, IA

Former Member
0 Kudos

Using the Assign statement in 4.6c

DATA dref TYPE REF TO data.

FIELD-SYMBOLS <l_dobj> TYPE ANY.

CREATE DATA dref LIKE g_dobj.

ASSIGN dref->* TO <l_dobj>.

<l_dobj> = g_dobj.

<l_dobj> = <l_dobj> + 1.

WRITE: / g_dobj, <l_dobj>.

Hope this helps,

Sudhir.