Skip to Content
author's profile photo
Former Member

Moving Values to fields of different data types- Conversion

I'm having trouble figuring out how to move a value from a field of a <b>char type</b> to a field of <b>structure RSDSSELOPT</b> type in a different itab.

I'll show you what I have so far.

DATA: BEGIN OF ITABAPI OCCURS 0,
      SEARCHFLD LIKE ZDOLTARC03-SEARCHFLD,
      VALUE LIKE ZDOLTARC03-VALUE,
      END OF ITABAPI.
DATA: BEGIN OF ITAB_GO occurs 0,
         FIELDNAME LIKE RSDSTABS-PRIM_FNAME,
         SELOPT_T TYPE RSDS_SELOPT_T,
      END OF ITAB_GO.

  LOOP AT ITABAPI.
     MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME,
           <b>ITABAPI-VALUE TO ITAB_GO-SELOPT_T.</b>
     APPEND ITAB_GO.
  ENDLOOP.

As an alternative I tried feeding the value into ITAB_GO-selopt_t-low, but breaking down the structure that far may be beyond the capabilities of the processor.

If anyone knows a way to feed a char value into the structure field please help. 😊

N L

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on Mar 10, 2005 at 06:02 PM

    Hi Natasha,

    my advice is: don't try to do it in just step. Instead,

    DATA: LT_RANGE TYPE TABLE OF RSDSSELOPT WITH HEADER LINE.
    
    LOOP AT ITABAPI.
       MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME.
    
       CLEAR: LT_RANGE.
       REFRESH: LT_RANGE.
       LT_RANGE-SIGN = 'I'.
       LT_RANGE-OPTION = 'EQ'.
       LT_RANGE-LOW = ITABAPI-VALUE.
       APPEND LT_RANGE.
    
       ITAB_GO-SELOPT_T[] = LT_RANGE[].   
       APPEND ITAB_GO.
    ENDLOOP.
    

    Pls let us know if it helped. BR,

    Alvaro

    Add comment
    10|10000 characters needed characters exceeded