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

Using Assert id

Hi ABAP guru's,

In this scenario,

data: w_c1(3) type c,

w_c2 type i,

zemp1 like table of zemp.

field-symbols <fs> type zemp.

select * from zemp into table zemp1.

read table zemp1 with key empno = '1' assigning <fs>.

assert id AAB_DEMO condition sy-subrc = 0.

w_c1 = <fs>-empno.

write w_c1.

Here AAB_DEMO is check group created in SAAB transaction inactive mode.

if sy-subrc ne 0. is it possible to run this program without getting any runtime error?

Thanks in advance.

Prasad G.V.K

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 29, 2008 at 02:11 PM

    Check the weather the field-symbol is assigned or not before accessing it.

    select * from zemp into table zemp1.
    read table zemp1 with key empno = '1' assigning <fs>.
    assert id AAB_DEMO condition sy-subrc = 0.
    check <fs> is assigned.  " << check assigned status of the <FS>
    w_c1 = <fs>-empno.
    write w_c1.
    

    Regards,

    Naimesh Patel

    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.