05-27-2008 11:41 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.
05-27-2008 12:03 PM
>
> 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
05-27-2008 12:03 PM
>
> 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
05-27-2008 12:24 PM
Tks a lot matt for your response ..
Yes, i'm writing the code for BPS .. :).
I've written the code, but i got an error:
the error goes on:
DELETE <ls_data> FROM TABLE xth_data.
the error message:
<ls_data> is not internal table.
Could you help me again matt ??
Really need your help.
Regards,
Niel.
05-27-2008 12:42 PM
Tks math ..
It's already done ..
It should be:
DELETE TABLE xth_data FROM <ls_data>.
A huge appreciation has sent already ..
Regards,
Niel.
05-27-2008 1:05 PM
Would you believe it was a deliberate error, just to help you learn? ( I was coding from memory ).
cheers
matt