2009 Apr 15 6:06 AM
Hi Friends,
I am very new to Module Pool.Here in my screen header i have vendor number,Vendor name,
bank Name, Branch, LC value and Due date fields.
and for item details i have to take table control.In the item details i have the fields Sl No, PO Number and Po Value.
and Two push buttons i need to put.SAVE and CANCEL.
When i click on SAVE all my screen details should be saved in a ZTABLE and should generate a LCDOCUMENT-Number from the system.
How can i proceed.Plz provide me with ur inputs.
Hi Friends,
I am very new to Module Pool.Here in my screen header i have vendor number,Vendor name,
bank Name, Branch, LC value and Due date fields.
and for item details i have to take table control.In the item details i have the fields Sl No, PO Number and Po Value.
and Two push buttons i need to put.SAVE and CANCEL.
When i click on SAVE all my screen details should be saved in a ZTABLE and should generate a LCDOCUMENT-Number from the system.
How can i proceed.Plz provide me with ur inputs.
2009 Apr 15 7:10 AM
Hi,
In ABAP number generation is generally done using Number range objects. Transaction SNRO.
You can use the function module NUMBER_GET_NEXT to generate a number once you create your number range object and interval.
For saving to the Ztable you should use INSERT or MODIFY statement.
Regards,
Sesh
2009 Apr 15 8:17 AM
Hi Sameera,
Since you mentioned that you are new to module pool. i wanna add a few things to Sesh's answer.
Addition is that you need to write this code in the sy-ucomm of the save button.
The mentioned function module takes number range object as input.
you need to create this number range in SNRO transaction and set a from interval and to interval
Regards
Sajimon
2009 Apr 15 9:17 AM
Hi thanks for ur inputs and Any sample code for my requirement plz?
If u have any sample code for the above plz let me know.
Edited by: Sameera shaik on Apr 15, 2009 10:45 AM
2009 Apr 16 12:38 PM
2009 Apr 16 12:42 PM
Hi Sameera,
see the below example to create and call ...
Tables used for ranges:
NRIV Number range intervals. Note: Field NRLEVEL Contains the last assigned
number.
TNRO Definition of number range objects
Ranges are maintained in transaction SNRO
Q:
Just another chance to show my ignorance. Isn't there a function for returning
a unique key and isn't there also a configuration method for describing the
range of those objects. I know that there is something like that for EDI but I
can't identify it. I need to retrieve a key for a user defined field in IS-U
CCS 1.2 for sap 4.0B.
A:
You can use a range object . You define ranges in transaction SNRO. The number in the ranges automatically increment ebvery time you use a new number.
Use the function NUMBER_GET_NEXT to get the next number in the range:
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = '01'
object = 'ZCOSTA'
quantity = '1'
importing
number = i_zcostafstm-zafstemnr
* quantity = ' '
* RETURNCODE =
exceptions
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
others = 7.
Regards,
Prabhudas