‎2009 Oct 28 3:02 AM
Dear Experts,
I have a problem while using a delete statement. I want to delete the contents of the li_abc based on a where condition and I am using the following code:
TYPES: BEGIN OF ty_abc,
include TYPE bdcdata,
END OF ty_abc.
DATA: li_abc TYPE STANDARD TABLE OF ty_abc,
wa_abc LIKE LINE OF li_abc.
DELETE li_abc WHERE fval NE 'X'.
But it is giving me a compilation error :
" No Component Exist with the name fval".
Since i have included bdcdata structure in the types, it should refer ti the fval field....
Kindly suggest..
Thanks and Best regards,
Sahil
Edited by: Sahil@sap on Oct 28, 2009 4:02 AM
Edited by: Sahil@sap on Oct 28, 2009 4:04 AM
‎2009 Oct 28 3:10 AM
HI
TYPES: BEGIN OF ty_abc.
include STRUCTURE bdcdata. --> Change here
TYPES END OF ty_abc.
DATA: li_abc TYPE STANDARD TABLE OF ty_abc,
wa_abc LIKE LINE OF li_abc.
START-OF-SELECTION. --> if required include this ( If you get Statement not Accessible Error)
DELETE li_abc WHERE fval NE 'X'.
Cheers
Ram
‎2009 Oct 28 3:10 AM
HI
TYPES: BEGIN OF ty_abc.
include STRUCTURE bdcdata. --> Change here
TYPES END OF ty_abc.
DATA: li_abc TYPE STANDARD TABLE OF ty_abc,
wa_abc LIKE LINE OF li_abc.
START-OF-SELECTION. --> if required include this ( If you get Statement not Accessible Error)
DELETE li_abc WHERE fval NE 'X'.
Cheers
Ram
‎2009 Oct 28 3:15 AM
Hi Sahil,
If u want to access particular field in query, u have to explicitly declare it.
Declare types explicity like below,
TYPES: BEGIN OF ty_abc,
program TYPE bdc_prog,
dynpro TYPE bdc_start,
dynbegin TYPE bdc_dynr,
fnam TYPE fnam_____4,
fval TYPE bdc_fval,
END OF ty_abc.
DATA: li_abc TYPE STANDARD TABLE OF ty_abc,
wa_abc LIKE LINE OF li_abc.
DELETE li_abc WHERE fval NE 'X'.
Thanks,
‎2009 Oct 28 3:26 AM
Dear Ram and Fan,
Thank you very much for the help. My problem is solved.
Best regards,
Sahil