‎2008 Oct 23 6:53 AM
Hi,
I am Doing Module Pool Programming in which I Should add line items and if the user gives the save button the data wil be saved in tables and SAP should generate one unique number.
Please give me inputs how to generate unique number and add n number of line items
correct inputs are rewarded
Thanks
Rasheed.
‎2008 Oct 23 7:12 AM
line item you mean(there is any header for the item) for line items you manually increment the previous existing line item. if there is no header then you can use number range for increasing the item number.
‎2008 Oct 23 7:02 AM
Hi,
You may use Number Generator for generating unique ids in the system.
The keyword DEFAULT SERIAL gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL).
The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value.
If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0.
Each table may not contain more than one column with the DEFAULT specification DEFAULT SERIAL.
Regards,
Renjith
Edited by: Renjith Michael on Oct 23, 2008 11:34 AM
‎2008 Oct 23 7:12 AM
line item you mean(there is any header for the item) for line items you manually increment the previous existing line item. if there is no header then you can use number range for increasing the item number.
‎2008 Oct 23 11:29 AM
Hi Vijay,
I have Header Items also i should get these values from standard table and i should enter my line items and once i save i shd generate a unique number like standard transaction codes .
Any correct inputs are rewarded.
Thanks
Rasheed
‎2008 Oct 23 11:39 AM
>
> Hi Vijay,
> I have Header Items also i should get these values from standard table and i should enter my line items and once i save i shd generate a unique number like standard transaction codes .
>
> Any correct inputs are rewarded.
>
> Thanks
> Rasheed
Standard transactions create a line number for each new line that is unique within the document. Which you should be able to do yourself quite easily by incrementing the max line number for the document by 1 for each new line.
‎2008 Oct 23 11:48 AM
Hi Chris,
Thank you for your inputs,
For example if we create a sales order after giving all the line items and header items SAP will generate one unique sales order number for each and every sales order we create.
So i also need to generate a unique number after saving all my data in module pool programming
Correct inputs are suggested
Thanks
Rasheed.
‎2008 Oct 23 11:52 AM
Hi,
Hope this helps : http://help.sap.com/saphelp_nw04/helpdata/en/7b/6eb2aa7aed44ea92ebb969e03081fb/frameset.htm
Regards,
Renjith Michael.
‎2008 Oct 23 11:53 AM
in your case you don't need the Number range. Little code you require to generate the item numbers for a header document.
For each header you will have items from 1 to n.
how sap handles normal transaction the way you can proceed.
‎2008 Oct 23 12:02 PM
Hi,
I need to have external Number range for my Z t Code which i am developing in module pool.
I need to have one unique number when ever i create new record.
For example like new sales order,new purchase order
Correct inputs are rewarded
Regards
Rasheed
‎2008 Oct 23 1:05 PM
‎2014 Aug 22 4:57 PM
How did you solve this problem. I am having the same issue.
Thanks. can I see your code.