‎2010 Feb 20 7:10 AM
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
‎2010 Feb 20 7:12 AM
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
‎2010 Feb 20 7:21 AM
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
‎2010 Feb 20 7:35 AM
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
‎2010 Feb 20 7:44 AM
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.
‎2010 Feb 20 7:49 AM
Hi Murali,
You are going in the right way exactly. Your understanding regarding ASSERT statement is correct in your case go ahead.
Regards,
Pavan.
‎2010 Feb 20 7:52 AM
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
‎2010 Feb 20 7:54 AM