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

passing value from field symbol / variable type ref to data to variable

Former Member
0 Likes
1,531

hey ,

DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.

DATA: RT_CARRID TYPE REF TO DATA.

FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE

.* Retrieve the data from the select option

RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).

  • Assign it to a field symbol

ASSIGN RT_CARRID->* TO <FS_CARRID>.

how can i pass RT_CARRID or <FS_CARRID> to a varible with type vbap-netgrw ( net weight ) ?

thanks

ASA

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
956

>

> hey ,

>

>

> DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.

> DATA: RT_CARRID TYPE REF TO DATA.

> FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE

>

> .* Retrieve the data from the select option

> RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).

> * Assign it to a field symbol

> ASSIGN RT_CARRID->* TO <FS_CARRID>.

create a work area of type <FS_CARRID>.

field-symbol: <fs_wa> type line of <FS_CARRID>.

loop at <FS_CARRID> into <fs_wa>.
lv_netgr = <fs_wa>-netgr.

7 REPLIES 7
Read only

former_member156446
Active Contributor
0 Likes
957

>

> hey ,

>

>

> DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.

> DATA: RT_CARRID TYPE REF TO DATA.

> FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE

>

> .* Retrieve the data from the select option

> RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).

> * Assign it to a field symbol

> ASSIGN RT_CARRID->* TO <FS_CARRID>.

create a work area of type <FS_CARRID>.

field-symbol: <fs_wa> type line of <FS_CARRID>.

loop at <FS_CARRID> into <fs_wa>.
lv_netgr = <fs_wa>-netgr.

Read only

0 Likes
956

hey j@y and thanks for your reply,

i didn't debug your solution yet but i thing that i will get a syntax error :

<fs_wa> dosn't have a component netgr .

any other solution ?

Regards

ASA .

Read only

prasenjit_sharma
Active Contributor
0 Likes
956

Hi,

You may use READ statement to read the contents.

Depending on your scenario, if SIGN = I and OPTION = EQ, you may shift the content left 3 places to get the contents of the select options table.

Use this,

Data variable type vbap-netgrw.
Read <FS_CARRID>  into variable index 1.
shift variable left by 3 places.

Regards

Prasenjit

P.S. this is just an example, you may derive your own logic from this.

Read only

0 Likes
956

hey Sharma ,

thanks for your reply.

variable type vbap-netgrw.
Read <FS_CARRID>  into variable index 1.
shift variable left by 3 places.

in the srtucture, indeed --> SIGN = I and OPTION = EQ LOW = my value , HIGH = empty

how can i extract and cast "my value" into a variable type vbap-netgrw ?

Regards

ASA

Read only

0 Likes
956

Hi,

Just define a variable of type string and another of type vbap-netgrw.

data var1 type string.

data var2 type vbap-netgrw.

Read <FS_CARRID> into var1 index 1.

shift var1 left by 3 places.

write var1 to var2.

Regards

Prasenjit

Read only

Former Member
0 Likes
956

Hi,

yoi can delare awok area, for the table and assign the field symbol to it.

Eg: gwa_vbak = <wa>.

hear the type of gwa_vbak and <wa> , need to be the same.

after that, you can take your field from, gwa_vabk

as in vbak-netwr = gwa_vbak-netwr.

Read only

Former Member
0 Likes
956

*