03-10-2010 11:58 AM
Dear All,
I have a requirement that while Creation of Billing Document through VF01 Transaction, I want to update data into an external Z table which is related to item-wise. So at the the time of Updation, I also need the Billing No. which is going to be generated for one to one relation between VBRP and Z Table (i.e ZVBRP Table).
I tried with some User Exits and also some Customer exits, but the problem is all these exits are getting processed before Determination of New Invoice Number.
However, I Think the same is possible for Accounting Related Documents but now here the Problem is my company is also making Proforma Invoices, and I have to consider those Billing Invoices also. So while doing the Proforma Billing the logic fails.
Please suggest a solution.
Regards,
Vishal
03-10-2010 12:08 PM
hi,
try to use CMOD exit: SDVFX008
and write here some code like this:
PERFORM update_z_table ON COMMIT.
regards,darek
03-10-2010 12:19 PM
Hi Darek,
The SMOD that you given, there is one function module available EXIT_SAPLV60B_008. In this an Include "zxvvfu08" is there. So do you want me to write the code in this INCLUDE?
Please clarify.
Regards,
Vishal
03-10-2010 12:28 PM
HI VIshal,
yes you are right you need to write your code in this include... after this You need to create a project in CMOD and atatch the enhancement.
Regards,
Nagaraj
03-10-2010 12:29 PM
yes, but (if this enhancemet is used for first time) you must:
1. create own project in CMOD
2. assign mentioned enhancement SDVFX008
3. activate project
4. create (if not exist) include program zxvvfu08 (by dblclick in FM: EXIT_SAPLV60B_008)
in this program include you can write own code
to update your z-table - but remeber- it should be executed "on commit" only
for example by:
perform zform on commit
or
cal function z_func in update task....
regards,darek
03-10-2010 1:27 PM
Hi,
I am trying to write the Code in INCLUDE - ZXVVFU08.
Herre is the code which I wrote:
PERFORM Z_UPDATE ON COMMIT.
FORM Z_UPDATE.
BREAK SDDEV.
DATA: WA_VBRP LIKE CVBRP, WA_YXVBRP LIKE YXVBRP.
DATA: IT_YXVBRP TYPE TABLE OF YXVBRP WITH HEADER LINE.
LOOP AT CVBRP INTO WA_VBRP.
WA_YXVBRP-VBELN = WA_VBRP-VBELN.
WA_YXVBRP-POSNR = WA_VBRP-POSNR.
WA_YXVBRP-MATNR = WA_VBRP-MATNR.
APPEND WA_YXVBRP INTO IT_YXVBRP.
CLEAR: WA_YXVBRP, WA_VBRP.
ENDLOOP.
APPEND YXVBRP FROM IT_YXVBRP.
ENDFORM.
But now when I am trying to activate this Include, the system is giving me following error:
"Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded with "ENDFUNCTION". ."
Please suggest a solution.
regards,
Vishal
03-10-2010 1:57 PM
hi
1. create your z_function / z_function_group (se37)
2. in this function put line "PERFORM Z_UPDATE ON COMMIT"
2.1. create above form routine in the same function group
3. call this function from ZXVVFU08
regards,darek
03-10-2010 6:52 PM
Hi Darek,
I have tried all Combinations but still the same error is coming.
Regards,
Vishal
03-10-2010 9:09 PM
hi Vishal
see example code from SE37:
FUNCTION Z_CHECK.
*"----------------------------------------------------------------------
*"*":
*" IMPORTING
*" REFERENCE(PARAM1)
*"----------------------------------------------------------------------
* code inside function module...
PERFORM Z_UPDATE ON COMMIT.
ENDFUNCTION.
* form declaration....
FORM Z_UPDATE.
* code inside form...
* update z-table here
ENDFORM.
regards,darek
03-11-2010 8:19 AM
Hi Darek,
There is no use of this EXIT. As this EXIT is not gettong called for PROFORMA BILLING DOCUMENTS.
So please suggest any other solution.
Regards,
Vishal
03-11-2010 8:41 AM
hi Vistal,
in my opinion, this exit should be called for proforma invoices (TVFK-TRVOG = 😎 also...
check you CMOD project...is it active?
regards,darek
03-11-2010 11:33 AM
Hi,
I tried but this exit is not getting called at all for Proforma Invoices.
Regards,
Vishal
03-11-2010 8:27 AM
Hi Vishal,
Find the USer exits Of billing documents:
User Exits For Billing:
USEREXIT_NUMBER_RANGE (Module pool SAPLV60A, program RV60AFZZ)
The internal number range used in the standard system is specified in the billing type table and can be changed in this user exit. This user exit is only called when the billing documents is created.
USEREXIT_ACCOUNT_PREP_KOMKCV (Module pool SAPLV60A, program RV60AFZZ)
In this user exit additional fields for account determination that are not provided in the standard system are copied into communication structure KOMKCV (header fields).
USEREXIT_ACCOUNT_PREP_KOMPCV (Module pool SAPLV60A)
In this user exit additional fields for account determination that are not provided in the standard system are copied into communication structure KOMPCV (item fields).
USEREXIT_NUMBER_RANGE_INV_DATE (Module pool SAPLV60A, program RV60AFZC)
Depending on the number range, table TVFKD is used to set the billing date (country-specific requirments in Italy). USEREXIT_NUMBER_RANGE is automatically deactivated when this user exit is being applied.
USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)
This user exit is only called when the billing document is created. It is used to provide the header and the item of the new billing document with deviating or additional data.
USEREXIT_PRINT_ITEM (Module pool SAPLV61A, program RV61AFZB)
Printing the item line of a billing document can be supplemented or changed.
USEREXIT_PRINT_HEAD (Modulpool SAPLV61A, Programm RV61AFZB)
Printing the header line of a billing document can be supplemented or changed.
User exits in program RV60AFZD
Short descriptions of the user exits are contained in the program:
USEREXIT_RELI_XVBPAK_AVBPAK
USEREXIT_NEWROLE_XVBPAK_AVBPAK
USEREXIT_NEWROLE_XVBPAP_AVBPAK
The following user exits are available in report SAPLV60B for transfer to accounting (function group V60B):
EXIT_SAPLV60B_001: Change the header data in the structure acchd
You can use this exit to influence the header information of the accounting document. For example, you can change the business transaction, "created on" date and time, the name of the person who created it or the transaction with which the document was created.
EXIT_SAPLV60B_002: Change the customer line ACCIT
You can use this exit to change the customer line in the accounting document. This exit is processed once the ACCIT structure is filled in with data from document header VBRK.
EXIT_SAPLV60B_003: Change the customer line in costing
The customer line is filled in differently for costing. You can use exit 003 to influence the ACCIT structure.
EXIT_SAPLV60B_004: Change a GL account item ACCIT You can add information to a GL account item (such as quantity specifications) with this exit.
EXIT_SAPLV60B_005: User exit for accruals
Once all relevant data for accruals was entered in the GL account item, you can add to this data with this exit.
EXIT_SAPLV60B_006: Change the control line ACCIT
You can use exit 006 to add information to the control line.
EXIT_SAPLV60B_007: Change the installment plan
You can use exit 007 to add information to the installment plan
parameters in the GL account item.
EXIT_SAPLV60B_008: Change the transfer structure ACCCR, ACCIT and ACCHD
After the accounting document is filled in with data, you can use exit 008 to change the document once again.
EXIT_SAPLV60B_010: Item table for customer lines
You can use exit 10 to influence the contents of customer lines before they are created.
EXIT_SAPLV60B_0011: Change the parameter for cash account determination or reconciliation account determination
You can use this exit to change inbound parameters in order to influence account determination.
Regards,
Ravinder.
03-11-2010 11:36 AM
Dear Ravinder,
All the exits are getting called before Determination of Billing No. So these do not solve my purpose. Suggest some other solution.
Regards,
Vishal