Hi Experts,
While creating an invoice through VF04/VF06 - we are doing the following checks in the user exit USEREXIT_NUMBER_RANGE.
(VBRK-VKORG)sale org = IT01, billing type(VBRK-FKART) <> YFC and ZFC , Net Value in Document Currency = 0 (VBRk-NETWR) and at least one line item category(VBRP-PSTYV) <> ZANN item category.
If the above conditions are satisfied we should restrict the system not to create an invoice for a particular document and should continue for the rest of the documents.
When executing the t-code VF04/VF06 with multiple billing documents the above exit is stopping our invoice creation process if any one of the billing document satisfied our condition.
Here is an example:
Delivery documents :say 1,2,3
1-Invoice should generate
2-Invoice should not get generate bcoz the above validation is satisfying(Issuing an error message)
3-Invoice should generate
When we are running as a bulk either in foreground or background,the invoice generation is getting terminated bcoz of delivery document 2.
Kindly provide your suggestions.
Regards,
Manimaran.
PFB details
Program : SAPLV60A
user exit : RV60AFZZ
subroutine : USEREXIT_NUMBER_RANGE and logic as follow
IF lt_ysta_param IS NOT INITIAL.
*This user-exit functionality should only work if sales Organization is 'IT01'
CLEAR : wa_ysta_param.
SORT lt_ysta_param BY pname pvalue.
READ TABLE lt_ysta_param INTO wa_ysta_param WITH KEY pname = con_vkorg
pvalue = p_pu_vbrk-vkorg
BINARY SEARCH.
IF sy-subrc EQ 0.
READ TABLE lt_ysta_param INTO wa_ysta_param WITH KEY pname = con_fkart
pvalue = p_pu_vbrk-fkart
BINARY SEARCH.
IF sy-subrc NE 0.
IF p_pu_vbrk-netwr EQ 0 .
lt_xvbrp_temp[] = p_c_it_xvbrp[].
* looping the billing document item table and read the param table for item catagory.
LOOP AT lt_xvbrp_temp INTO wa_xvbrp WHERE updkz NE con_d1.
READ TABLE lt_ysta_param INTO wa_ysta_param WITH KEY pname = con_pstyv
pvalue = wa_xvbrp-pstyv
BINARY SEARCH.
IF sy-subrc NE 0.
* If the item catagory is not ZANN then set the flag
lv_foc = con_val.
ENDIF.
CLEAR : wa_ysta_param,wa_xvbrp.
ENDLOOP.
REFRESH lt_xvbrp_temp[].
* If the foc flag is set then specified error message will get populated.
IF lv_foc = con_val.
MESSAGE s054(zsls) DISPLAY LIKE 'E' . "to tell the user what's the problem
ENDIF.
CLEAR : lv_foc.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
Thanks.
Hi All,
Can anyone please provide the correct user exit, BADI or Enhancement implementation where I can overcome this issue.
I just want to validate the each delivery document, if any wrong document found I need to raise error for that and process should continue for all other correct documents in background as well as foreground with multiple documents.
Thanks
Manimaran K.
Add a comment