Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 12, 2010 at 09:03 PM

    >

    > 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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 .

  • Jan 12, 2010 at 09:51 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2010 at 09:17 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 26, 2010 at 09:43 PM

    *

    Add comment
    10|10000 characters needed characters exceeded