09-16-2008 3:46 PM
Hello,
how can I check sy-subrc
on a SAP function which has no exceptions?
e.g. function "PM_PARTNER_DELETE_PARVW".
If I try to check the sy-subrc after calling this function,
I will get following error on the code inspector:
No EXCEPTION to set SY_SUBRC Declared for CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'.
Thanks for your help.
Ibrahim.
09-16-2008 9:18 PM
Hi,
Instead of,
CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'
EXPORTING
objnr = ls_equi-objnr
parvw = ls_ihpa-parvw.
use as
CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'
EXPORTING
objnr = ls_equi-objnr
parvw = ls_ihpa-parvw
EXCEPTIONS
others = 1.
This will avoid the message.
09-16-2008 4:51 PM
Hello Ibrahim
Using this fm I assume you have to use at least two more fm's:
PM_PARTNER_UPDATE
BAPI_TRANSACTION_COMMIT
Eventually you can evaluate the RETURN message of the BAPI to see if the DB update worked.
Regards
Uwe
09-16-2008 6:34 PM
Hello Uwe,
my code looks like following lines:
*The internal table contains all relevant partners
LOOP AT lt_ihpa_comp
INTO ls_ihpa.
CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'
EXPORTING
objnr = ls_equi-objnr
parvw = ls_ihpa-parvw.
*my problem is here
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
ENDLOOP.
*this function calls also the partner update function
CALL FUNCTION 'PM_PARTNER_CALL_VB'
EXPORTING
objnr = ls_equi-objnr.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Do you have any idea?
Thanks and regards,
Ibrahim.
09-16-2008 9:18 PM
Hi,
Instead of,
CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'
EXPORTING
objnr = ls_equi-objnr
parvw = ls_ihpa-parvw.
use as
CALL FUNCTION 'PM_PARTNER_DELETE_PARVW'
EXPORTING
objnr = ls_equi-objnr
parvw = ls_ihpa-parvw
EXCEPTIONS
others = 1.
This will avoid the message.
09-16-2008 10:19 PM
EXCEPTIONS
others = 1.
This will avoid the message.
True, but there's no point in it (at least until some exceptions are added to the function later in time).
If certain function has no exceptions defined, there's no point to code conditions over SY-SUBRC value.