Skip to Content
author's profile photo Former Member
Former Member

work area may not be converted into number

Hi All

I need to delete internal table having company code NE BBP_CO_CODE(selection screen)

lo_el_node_selection->get_attribute(

Exporting

name = 'BBP_CO_CODE'

IMPORTING

value = lv_BBP_CO_CODE ).

LOOP at gt_alv INTO gs_alv.

DELETE gt_alv FROM gs_alv WHERE gs_alv-BBP_CO_CODE NE lv_BBP_CO_CODE.

ENDLOOP.

ERROR : gs_alv may not be converted into number.

Thanks

Vamsi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 07, 2014 at 06:47 PM

    Not a good idea to delete the records inside the looping table.

    This should be better.

    LOOP at gt_alv INTO gs_alv.

    if gs_alv-BBP_CO_CODE = lv_BBP_CO_CODE.

    append gs_alv to lt_alv.

    endif.

    ENDLOOP.

    gt_alv = lt_alv.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2014 at 03:23 PM

    Hi,

    You can try this code please.

    LOOP at gt_alv INTO gs_alv.

    DELETE gt_alv WHERE BBP_CO_CODE NE lv_BBP_CO_CODE.

    ENDLOOP.

    If you are in a loop, remember that sy-tabix is the indicator of the table index

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2014 at 05:56 PM

    Simply do this

    lo_el_node_selection->get_attribute(

    Exporting

    name = 'BBP_CO_CODE'

    IMPORTING

    value = lv_BBP_CO_CODE ).

    DELETE gt_alv FROM gs_alv WHERE BBP_CO_CODE NE lv_BBP_CO_CODE.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2014 at 07:58 PM

    Error message is regarding field type, which types have gs_alv-BBP_CO_CODE and lv_BBP_CO_CODE ? If it have different types maybe the system can´t compare.


    Maybe you need to cast your variable.


    Besides that, I agree that the best is delete like nabheet said.


    Best regards!

    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.