08-08-2007 11:21 AM
hi all,
I created a new requirement routine 901, activated it, attached it to output type.
In code first I set SY-SUBRC = 4. Based on condition, i set it to 4 or clear it. Same code is written in both KOBED_901, KOBEV_901.
Now i go to VL32N (inbound delivery), create an output proposal and then try to issue it.
Control now goes to the routine. Even when SY-SUBRC receives 4, the output is not prevented. I can still continue to issue output.
can you please tell me what went wrong ?
useful answers are rewarded.
08-08-2007 11:25 AM
try writing EXIT statement... The thing might be that after the routinue, the cursor goes into some other code and may be here it is just passing off with some other due to which the output is been coming.
08-08-2007 11:26 AM
Hi!
If it is possible, prevent the system variants from overwriting. They can cause unneccessary, and unwanted problems. Try using your own variants instead.
Regards
Tamá
08-08-2007 12:24 PM
hi ,
the code looks something like this and no system variable is overwriting SY-SUBRC once set.
sy-subrc = 4.
SELECT vbeln
posnr
vgbel
vgpos
FROM lips INTO TABLE lt_lips
WHERE vbeln = komkbe1-vbeln.
Read first delivery item to get PO reference
READ TABLE lt_lips INTO ls_lips INDEX 1.
IF sy-subrc = 0.
Get Item category from PO item
SELECT SINGLE pstyp
FROM ekpo
INTO lf_pstyp
WHERE ebeln = ls_lips-vgbel AND
ebelp = ls_lips-vgpos.
ENDIF.
IF lf_pstyp = '5'.
sy-subrc = 4.
EXIT.
ELSE.
CLEAR sy-subrc.
ENDIF.