‎2009 Nov 17 1:28 PM
HI Experts,
i have created VOFM requirement routine for the output & thn assigned tht VOFM routine to the output type in the output determination procedure,eventhough the output type is getting generated. below code for ur ref.how can i solve this iisue..
DATA: w_value TYPE ZVXXVALUE,
w_subrc TYPE sy-subrc.
DATA: e_lips TYPE lips.
DATA: i_lips TYPE STANDARD TABLE OF lips.
CONSTANTS: c_xlips(17) TYPE c VALUE '(SAPMV50A)XLIPS[]',
c_main TYPE ZVXXMAIN VALUE 'STXH_VSLOC',
c_value TYPE ZVXXVALUE VALUE '0098'.
FIELD-SYMBOLS: <fs_lips> TYPE ANY TABLE,
<fs_t_lips> TYPE lips.
UNASSIGN <fs_lips>.
ASSIGN (c_xlips) TO <fs_lips>.
IF <fs_lips> IS ASSIGNED.
FREE i_lips.
MOVE <fs_lips> TO i_lips[].
UNASSIGN <fs_t_lips>.
LOOP AT i_lips ASSIGNING <fs_t_lips> WHERE vbeln EQ komkbv2-vbeln.
CLEAR e_lips.
MOVE <fs_t_lips> TO e_lips.
CLEAR w_value.
SELECT SINGLE value
FROM ZVXXPARAM_GLOBAL
INTO w_value
WHERE main EQ c_main
AND Sub1 EQ <fs_t_lips>-werks
AND sub2 EQ c_value.
IF sy-subrc EQ 0.
IF w_value EQ <fs_t_lips>-lgort.
MOVE 4 TO w_subrc.
ELSE.
MOVE 0 TO w_subrc.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
sy-subrc = w_subrc.
Thx & Regards,
Veera.
‎2009 Nov 17 1:40 PM
Hi,
Just place a break point in the routine and go to delivery outputs in change mode and see where it is going wrong. At the end of the routine, sy-subrc should not be zero if you don't want to trigger the output.
Thanks,
Vinod.
‎2009 Nov 17 1:45 PM
thanks for ur reply...
at the end of the routine the sy-subrc value is 4 only,
Regards,
Veera.
‎2009 Nov 17 3:03 PM
Please follow the forum rules and use code tags when you post code. It would also be helpful if you would comment your code, especially if you expect others to read it.
As for the question of the SY-SUBRC value, you only assign '4' in one place, so if anything else happens, then the value assigned is always 0. The output will NOT trigger if the value is 4, so you must be mistaken on the SY-SUBRC value. A more common practice is to set the default value as '4' and then only switch to '0' if a certain condition is met.
‎2009 Nov 17 3:24 PM
Hi Brad Bohn
thanks for your reply,
I need to block output type (Eg: ZPR2) only for particular storage location in VL02 transaction. i have created VOFM
requirement routine for the output & thn assigned tht VOFM routine to the output type in the output determination
procedure,eventhough the output type is getting generated. how can i solve this issue?
Thanks & Regards,
Veera.
‎2009 Nov 17 5:02 PM
Since storage location is a line item value in the delivery, you need to make sure that if at least one item has the 'blockable' value, then the return code is '4'. Your code does not do that if there is a mix of storage locations on the delivery items. You should exit the loop as soon as you assign '4', and then the '4' value will be assigned to SY-SUBRC. Without debugging or looking at your delivery, that's the best guess as to why your code doesn't work.
‎2009 Nov 27 12:14 PM
Hi ,
You have to raise a error message like below if sy-subrc is not initial.
message id 'XYZ
type 'E'
number 'XXX' with 'Output' xnast-kschl
'cannot be processed'
raising error
display like 'I'.