2006 Oct 03 7:04 PM
Hello,
I am doing a replica of an SAP R3 std report in portal. I've converted the report pgm to a BAPI. My question is how to populate the BAPIRETURN table with the error messages raised from a std report? I mean how to capture these error messages? I am doing a SUBMIT to call this report from within the BAPI.
Thanks in advance.
Rgds,
Nathan.
Hello,
I am doing a replica of an SAP R3 std report in portal. I've converted the report pgm to a BAPI. My question is how to populate the BAPIRETURN table with the error messages raised from a std report? I mean how to capture these error messages? I am doing a SUBMIT to call this report from within the BAPI.
Thanks in advance.
Rgds,
Nathan.
2006 Oct 03 7:05 PM
I believe you cannot capture errors from a submit statement..
Instead use CALL TRANSACTION and capture the messages in the MESSAGES addition..
CALL TRANSACTION 'ZZZ' MESSAGES INTO itab.
Thanks,
Naren
2006 Oct 03 7:06 PM
If you are calling a BAPI from portal, what you are trying to do is to get the data for the given selection criteria. So, you should not do a SUBMIT of the report inside the BAPI, as SUBMIT just executes the report and doesn't give back the results to the BAPI
You should design the BAPI in such a way that you collect all the data you want and return them via parameters and if there is not data, then pass back the error parameters.
You could use the logic which is already there in the report to collect the data.
Regards,
Ravi
2006 Oct 03 7:50 PM
Hi,
Thanks for your immediate replies. I have taken a Z Version of the std report program. I am exporting the result table to memory in the Z program and importing it in the BAPI after the SUBMIT. This works fine. So for this approach is there any solution?
Rgds,
Nathan.
2006 Oct 03 7:57 PM
You can change your copy so that instead of raising error messages, it exports the errors to memory and then the BAPI imports them and passes them back to the caller.
Rob
2006 Oct 03 7:56 PM
Hi,
Collect all the errors in an internal table..Lets say ITAB.
At the end of the program export it to the memory.
EXPORT T_ERRORS TO MEMORY ID 'BAPI_CALL'.
In the Bapi after the program is completed..use the import statement to get it from the memory...
SUBMIT 'ZREPORT' AND RETURN.
IMPORT T_ERRORS FROM MEMORY ID 'BAPI_CALL'.
Then pass the errors to the return parameter of the BAPI..
Thanks,
Naren
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |