Application Development 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: 

Requirement routine doesn't work properly

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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.

Former Member
0 Kudos

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á

0 Kudos

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.