Application Development and Automation 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: 
Read only

User Exit for saving Invoice

Former Member
0 Likes
14,441

Hi Experts,

My req, is I have to check billing date with order date/ delivery date while creating the invoice in VF01.

For that I have done codig in user exit RV60AFZZ, so it gives error ,but the billing date field get disable.

& this invoice no. alsp get created.

So can anybody plz tell me in which user exit i have to put my code ???

I have tried with RV60AFZC.But it is not working.

My code is

FORM userexit_pricing_prepare_tkomp.

*  TKOMP-zzfield = xxxx-zzfield2.



* structure for vbak
TYPES:BEGIN OF ty_vbak,
      vbeln TYPE vbak-vbeln,
      audat TYPE vbak-audat,
      END OF ty_vbak.

*likp structure
TYPES:BEGIN OF ty_likp,
      vbeln TYPE likp-vbeln,
      lfdat TYPE likp-lfdat,
      END OF ty_likp.

*vbrp structure
TYPES:BEGIN OF ty_vbrp,
      vgbel TYPE vbrp-vgbel,
      vgpos TYPE vbrp-vgpos,
      aubel TYPE vbrp-aubel,
      aupos TYPE vbrp-aupos,
      END OF ty_vbrp.

DATA:it_vbak TYPE STANDARD TABLE OF ty_vbak,
     it_likp TYPE STANDARD TABLE OF ty_likp,
     it_vbrp TYPE STANDARD TABLE OF ty_vbrp.

DATA:wa_vbak TYPE ty_vbak,
     wa_likp TYPE ty_likp,
     wa_vbrp TYPE ty_vbrp.


***** take reference document no & delivery no. *****
LOOP AT xvbrp.
  wa_vbrp-vgbel = xvbrp-vgbel.
  wa_vbrp-vgpos = xvbrp-vgpos.
  wa_vbrp-aubel = xvbrp-aubel.
  wa_vbrp-aupos = xvbrp-aupos.

  APPEND wa_vbrp TO it_vbrp.

ENDLOOP.

IF it_vbrp IS NOT INITIAL.
SELECT vbeln audat FROM vbak
      INTO TABLE it_vbak
      FOR ALL ENTRIES IN it_vbrp
      WHERE vbeln = it_vbrp-aubel.

SELECT vbeln lfdat from likp
       INTO TABLE it_likp
       FOR ALL ENTRIES IN it_vbrp
       WHERE vbeln = it_vbrp-vgbel.

ENDIF.
**** check for invoice date with order date *****
LOOP AT it_vbak INTO wa_vbak.

  IF xvbrk-fkdat IS NOT INITIAL AND xvbrk-fkdat < wa_vbak-audat.
    MESSAGE 'Invoice Date is less than Order Date' TYPE 'E'.
  ENDIF.
ENDLOOP.

**** check for invoice date with delievery date *****
LOOP AT it_likp INTO wa_likp.

  IF xvbrk-fkdat IS NOT INITIAL AND xvbrk-fkdat < wa_likp-lfdat.
    MESSAGE 'Invoice Date is less than Delivery Date' TYPE 'E'.
  ENDIF.
ENDLOOP.


ENDFORM.                    "USEREXIT_PRICING_PREPARE_TKOMP

Thanks & Regards,

Anagha Deshmukh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,121

Hello,

These are the user exits for the tcode.

J_3RSINV Export sales

SDVFX007 User exit: Billing plan during transfer to Accounting

SDVFX008 User exit: Processing of transfer structures SD-FI

SDVFX009 Billing doc. processing KIDONO (payment reference number)

SDVFX010 User exit item table for the customer lines

SDVFX011 Userexit for the komkcv- and kompcv-structures

V05I0001 User exits for billing index

V05N0001 User Exits for Printing Billing Docs. using POR Procedure

V60A0001 Customer functions in the billing document

V60P0001 Data provision for additional fields for display in lists

V61A0001 Customer enhancement: Pricing

Keep the break point and try in the debugging in each and every exit and see which user exit is triggred.

3 REPLIES 3
Read only

Former Member
0 Likes
3,122

Hello,

These are the user exits for the tcode.

J_3RSINV Export sales

SDVFX007 User exit: Billing plan during transfer to Accounting

SDVFX008 User exit: Processing of transfer structures SD-FI

SDVFX009 Billing doc. processing KIDONO (payment reference number)

SDVFX010 User exit item table for the customer lines

SDVFX011 Userexit for the komkcv- and kompcv-structures

V05I0001 User exits for billing index

V05N0001 User Exits for Printing Billing Docs. using POR Procedure

V60A0001 Customer functions in the billing document

V60P0001 Data provision for additional fields for display in lists

V61A0001 Customer enhancement: Pricing

Keep the break point and try in the debugging in each and every exit and see which user exit is triggred.

Read only

Former Member
0 Likes
3,121

Try using Rollback statement before giving the error message.

Read only

Former Member
0 Likes
3,121

Hi,

Try this

RV60AFZZ

FORM USEREXIT_PRICING_PREPARE_TKOMK.