Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delete Statement

former_member317731
Participant
0 Likes
514

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
488

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

3 REPLIES 3
Read only

Former Member
0 Likes
489

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

Read only

awin_prabhu
Active Contributor
0 Likes
488

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,

Read only

former_member317731
Participant
0 Likes
488

Dear Ram and Fan,

Thank you very much for the help. My problem is solved.

Best regards,

Sahil