Skip to Content

Could you help me .. ? I'm distracted regarding field-symbols.

Hi all,

If i have the code like this,

 data: data_ref type ref to data.
  field-symbols: <ls_data> type any
                 .

  create data data_ref like line of xth_data.
  assign data_ref->* to <ls_data>.

Over there, i create <ls_data> where it refer to table xth_data (this table has type hashed table).

Do you know what should i write the command ? if i want to delete the record from the xth_data .. ??

e.g. if i want to delete data no. 2 within xth_data ...

Really need your guidance .

Regards,

Niel.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 27, 2008 at 11:03 AM

    >

    > Hi all,

    >

    > If i have the code like this,

    >

    >

    >  data: data_ref type ref to data.
    >   field-symbols: <ls_data> type any
    >                  .
    > 
    >   create data data_ref like line of xth_data.
    >   assign data_ref->* to <ls_data>.
    > 

    >

    > Over there, i create <ls_data> where it refer to table xth_data (this table has type hashed table).

    >

    > Do you know what should i write the command ? if i want to delete the record from the xth_data .. ??

    > e.g. if i want to delete data no. 2 within xth_data ...

    >

    > Really need your guidance .

    >

    > Regards,

    > Niel.

    So, you're writing BPS exit function? xth_data is hashed table, so the concept of 2nd record isn't really valid.

    Let's say you want to delete a record where the field s_chas-currency has the value 'EUR'

    data: data_ref type ref to data.
    field-symbols: <ls_data> type any,
                  <curr>   type /bi0/oicurrency.                .
     
    create data data_ref like line of xth_data.
    assign data_ref->* to <ls_data>.
    
    ASSIGN COMPONENT 'S_CHAS-CURRENCY' OF STRUCTURE <ls_data> TO <curr>.
    
    LOOP AT xth_data INTO <ls_data>.
      IF <curr> EQ 'EUR'.
        DELETE <ls_data> FROM TABLE xth_data.
      ENDIF.
    ENDLOOP.
    

    matt

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.