This website is not affiliated with, sponsored by, or approved by SAP AG.

Number of Line items in an invoice

Logistics : SD and its sub-modules (Inquires, Quotes, Order Entry, SIS, Sales Contacts, Dist. & Billing)

Moderators: Snowy, thx4allthefish, mike_ac, Lost Identity

Number of Line items in an invoice

Postby iamskulled » Sat Sep 23, 2006 1:43 pm

Dear SAP Experts,
I have sent in this request earlier as well, I understand that SAP Standard SD capabilities does not allow us to have more than 9999 line items in an invoice/sales order, I was wondering if it is possible to have around 50000 line items in a single invoice..........wondering wat is the maximum number of line items allowed in a single invoice in the most recent version ECC 6.0

The client's each invoice would have line items running into 5 digits in each invoice, i would appreciate any suggestions on how to tackle this problem. Is it possible to customize this requirement in SD or would it be advisable to use sum other billing engine as a solution

Thanks,

BS
iamskulled
 
Posts: 12
Joined: Wed Jul 19, 2006 1:46 pm

Postby sapaholic » Mon Sep 25, 2006 11:03 am

The number of accounting line items are restricted to 999 therefore your billing document line items should be significantly less than that to prevent a failure to post an accounting document.
There are two options open to you, one is to split the billing document automatically each time a maximum number of line items are reached, take a look at IMG > Billing >Country Specific Features > Maximum number of Billing Items, then in your copy control line item Data VBRK/VBRP include the following code


DATA: BEGIN OF ZUK2,
MODUL(3) VALUE '006',
VTWEG LIKE VBAK-VTWEG,
SPART LIKE VBAK-SPART,
VGBEL LIKE VBRP-VGBEL,
BILLNO LIKE TVKO-MAXBI,
END OF ZUK2.

DATA: BEGIN OF J_1B_SIZE_SPLIT2 OCCURS 0,
KUNRG LIKE VBRK-KUNRG,
KUNAG LIKE VBRK-KUNAG,
ZTERM LIKE VBRK-ZTERM.
INCLUDE STRUCTURE ZUK2.
DATA: ITEMNO LIKE TVKO-MAXBI.
DATA: END OF J_1B_SIZE_SPLIT2.

DATA: J_1B_SIZE_COPY2 LIKE J_1B_SIZE_SPLIT2.


*---------------------------------------------------------------------*
* FORM DATEN_KOPIEREN_633 *
*---------------------------------------------------------------------*
* This is a clone of routine 003. *
* It will ensure that *
* *
* -- one billing document can only have one reference document *
* -- the sum of item volumes will not exceed the amount *
* specified in the number of billing doc. items for the *
* sales organization (TVKO-MAXBI) *
*---------------------------------------------------------------------*

FORM DATEN_KOPIEREN_633.
CLEAR: VBRK-EXPKZ, VBRK-EXNUM.

VBRK-BZIRK = SPACE.
VBRK-KDGRP = SPACE.
VBRK-KONDA = SPACE.
VBRK-REGIO = SPACE.
VBRK-PLTYP = SPACE.

* If maximum number of billing items active
IF NOT TVKO-MAXBI IS INITIAL.

* Get billing doc. item number split data
READ TABLE J_1B_SIZE_SPLIT2
WITH KEY KUNRG = VBRK-KUNRG
KUNAG = VBRK-KUNAG
ZTERM = VBRK-ZTERM
VGBEL = VBRP-VGBEL.
IF SY-SUBRC <> 0.
CLEAR J_1B_SIZE_SPLIT2.
MOVE-CORRESPONDING VBRK TO J_1B_SIZE_SPLIT2.
MOVE-CORRESPONDING VBRP TO J_1B_SIZE_SPLIT2.
ENDIF.

* Check number of billing items against max. defined by tvko-maxbi
IF J_1B_SIZE_SPLIT2-ITEMNO < TVKO-MAXBI.
J_1B_SIZE_SPLIT2-ITEMNO
= J_1B_SIZE_SPLIT2-ITEMNO + 1.
ELSE.
J_1B_SIZE_SPLIT2-BILLNO
= J_1B_SIZE_SPLIT2-BILLNO + 1.
J_1B_SIZE_SPLIT2-ITEMNO = 1.
ENDIF.

* Store actual billing document counter and item counter
READ TABLE J_1B_SIZE_SPLIT2 INTO J_1B_SIZE_COPY2
WITH KEY KUNRG = VBRK-KUNRG
KUNAG = VBRK-KUNAG
ZTERM = VBRK-ZTERM
VGBEL = VBRP-VGBEL.
IF SY-SUBRC = 0.
MODIFY J_1B_SIZE_SPLIT2
TRANSPORTING ITEMNO BILLNO
WHERE KUNRG = VBRK-KUNRG
AND KUNAG = VBRK-KUNAG
AND ZTERM = VBRK-ZTERM
AND VGBEL = VBRP-VGBEL.
ELSE.
APPEND J_1B_SIZE_SPLIT2.
ENDIF.

* Add billing doc. number to split criteria
ZUK2-BILLNO = J_1B_SIZE_SPLIT2-BILLNO.

ENDIF.
* End of billing document split by number of allowed items

The other method is to summarise the billing document see the following post for advice on that

http://www.sapfans.com/forums/viewtopic.php?t=258364&highlight=
sapaholic
 
Posts: 232
Joined: Tue Nov 19, 2002 3:57 am
Location: Dublin, Ireland

Re: Number of Line items in an invoice

Postby ramu_bj » Fri May 23, 2008 5:24 am

Hi Sapaholic,

Can u pleas help me.. In sales order how many lineitems i can create.(MAX).
I have created backgroud program to create a sales order.. If there is any max limitation is there i want to apply that logic also..

can u pls let me knwo.. what is the maximum limit.

Thanks in advance
Ram
ramu_bj
 
Posts: 14
Joined: Tue Jul 25, 2006 5:32 am
Location: India

Re: Number of Line items in an invoice

Postby ib » Fri May 23, 2008 6:34 am

You should not hijack old threads but rqise a new one .........

However, the filed POSNR which is for the item number is 6 numerical long so you could, in theory, have up to 999,999 items in an order - but it would be a bloody unworkable one to process online!
Regards.
ib
___________________________________
SAPFans help those who help themselves !
ib
 
Posts: 3216
Joined: Fri Oct 17, 2003 5:41 am
Location: Oil Patch, Scotland

Re: Number of Line items in an invoice

Postby sapaholic » Fri May 23, 2008 6:55 am

Hi ramu_bj,
Remember it is not just your billing document which will generate FI line items, if your order is delivery related then when you goods issue you will also get an accounting document, on a delivery you will have a minimum of 2 FI line items per delivery line item. You have to evaluate how many line items your order produces in FI for each single line item on the sales order, or delivery in order to determine the appropriate maximum for your company, for example do you apply discounts, tax, accruals.....you may have many FI line items for a single billing document line item.

You have two options here, program your background job to create a sales order after an agreed reasonable number of line items are used, and as ib states in the last post 'make sure the document is manageable', and then use teh MAX number of line items procedure I've outlined when it comes to billing.
Alternatively you could use FI Summarization, where the FI posting is summarised reducing the number of line items. You would configure the system to summarise on BSEG fields of your choice. These fields will then be blank in BSEG, and the FI document will merge any lines that are identical. Check out transaction OBCY for this - your reference procedure will be the area for which the summarisation is to apply, but ALWAYS check this with your FI consultant to ensure it meets the business requirements.

Best of luck
Sapaholic
sapaholic
 
Posts: 232
Joined: Tue Nov 19, 2002 3:57 am
Location: Dublin, Ireland


Return to Logistics SD

Who is online

Users browsing this forum: No registered users and 5 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.