Skip to Content

ODATA SAP NOTE 1797736

HI

I created Program To Test ODATA ,

when using GET the result is true no problem like below

1- implement GET_ENTITY

method TESTSET_GET_ENTITY.
DATA : IS_KEY_TAB TYPE /IWBEP/S_MGW_NAME_VALUE_PAIR,
IV_MAID TYPE ZODATA_TEST-ID.
LOOP AT IT_KEY_TAB INTO IS_KEY_TAB .
IF IS_KEY_TAB-NAME EQ 'ID'.
IV_MAID = IS_KEY_TAB-VALUE .
ENDIF .
ENDLOOP .
SELECT SINGLE * FROM ZODATA_TEST INTO CORRESPONDING FIELDS OF ER_ENTITY WHERE ZODATA_TEST~ID = IV_MAID.
endmethod.

2- implement GET_ENTITYSET

method TESTSET_GET_ENTITYSET.
select * FROM ZODATA_TEST INTO TABLE ET_ENTITYSET .
endmethod.

the result run like pic below

but when Using delete there are error I can not found what is the error like below .

1- implement DELETE_ENTITY

method TESTSET_DELETE_ENTITY.
DATA : IS_KEY_TAB TYPE /IWBEP/S_MGW_NAME_VALUE_PAIR,
IV_MAID TYPE ZODATA_TEST-ID.
LOOP AT IT_KEY_TAB INTO IS_KEY_TAB .
IF IS_KEY_TAB-NAME EQ 'ID'.
IV_MAID = IS_KEY_TAB-VALUE .
ENDIF .
ENDLOOP .
DELETE FROM ZODATA_TEST
WHERE ID = IV_MAID.
endmethod.

the result like pic below

1.png (99.9 kB)
2.png (68.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Mar 30 at 03:34 AM

    Hi,

    Not sure how are passing your Key for Deletion in the above example.

    Please try as below :

    Regards,

    Samson


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30 at 04:29 AM

    Hello ALaa Azazy,

    The URL you have used should have an issue, that's the reason you get this error.

    Recommend you to go through the below Link to get a knowledge on troubleshooting, You should get a better understanding on these different methods through the blog.

    BLOG

    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.