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

ASSERT statement

Former Member
0 Likes
1,440

Hi All,

Iam debugging a BDC program. In this I found a statement called ' ASSERT ' .

Is this related to BAPI function module. Please provide me some help on this.


   ASSERT  ID  zlog SUBKEY subk FIELDS return-message CONDITION  return-type NA 'EA' .

Thanks and regards

Murali Krishna T

7 REPLIES 7
Read only

Former Member
0 Likes
925

Hi,

Go to that statement in the program and press 'F1' on assert statement. Get back in case you are not able to understand.

Regards,

Ganga

Read only

0 Likes
925

Hi,

Thanks for your view. I have seen F1 help on this. But Iam unable to understand the parameters ID SUBKEY FIELDS CONDITION. Please help me know for what purpose we use this statement.

Thanks

Murali Krishna T

Read only

0 Likes
925

Simply speaking, this statement basically creates a log in DB.

ID is nothing but the checkpoint group created in SAAB transaction.

SUBKEY is nothing but the key for the log.

FIELDS are nothing but the contents stored in the log.

CONDITION is nothing but the condition to be checked for executing assert statement.

Remember that ID should be active for creating log in DB.

Hope you understood !!!

Regards,

Ganga

Read only

0 Likes
925

Thanks for your prompt reply.

Please make me clear : Iam uploading some transactional data. If there are errors in data uploading, the error logs are created in the data base by the 'ASSERT' statement. Am I going in the correct way.

Read only

0 Likes
925

Hi Murali,

You are going in the right way exactly. Your understanding regarding ASSERT statement is correct in your case go ahead.

Regards,

Pavan.

Read only

0 Likes
925

Yes, you can see the message in log. In your case you can see the log in SAAB for ZLOG checkpoint. Remember that Assert statement creates a log entry in DB and continues with the program execution.

SAP documentation says,

Creating an entry in a specific protocol and continuation of the program execution with the statement after ASSERT. By default, an existing entry of the same ASSERT statement is overwritten. You can use transaction SAAB to evaluate the log.

Ganga

Read only

0 Likes
925

Thanks alot.

Regards

Murali Krishna T