Function module which generates number in sequence
Hi All
Is there any FM which generates number in a sequence. I am creating a bank file using DMEE. Now for detail records it should create a number say starting with 001, 002. 003....
now every time the bank file is created it should work in this way.
Any help would be higly appreciated.
C
Hello
1. Create interval: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=50004015
2. Use FM NUMBER_GET_NEXT: Re: how to create a number interval for a zprogram
Similar Messages
-
Function module which convert number to days to date
Hi,
Any one knows any function module which convert total number of days into date.
thnaks,
shilpa kHi,
FIMA_DAYS_AND_MONTHS_AND_YEARS
FI_PSO_DAYS_MONTHS_YEARS_GET
RSSM_CONVERT_DAYSEC2TIMESTAMP
RSSM_CONVERT_TIMESTAMP2DAYSEC
Function Modules related to Date and Time Calculations
DATE_COMPUTE_DAY : Returns weekday for a date
DATE_GET_WEEK : Returns week for a date
DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
MONTH_NAMES_GET : Get the names of the month
WEEK_GET_FIRST_DAY : Get the first day of the week
HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
LAST_DAY_OF_MONTHS : Returns the last day of the month
Regards -
Function module to generate a unique number in report based on descrepency
hi friends,
i have a object that..
Every discrepancy Should Have a unique number in the report, which calls based on the discrepancy (dc_qty)-(recd_qty)=shortage
the shortage value will be always positive,n not <=0..
is there any function module which should generate a unque no
based on passing MBLNR..
or any other way...
Thanks n regards
harishuse following funtion module
call function 'NUMBER_GET_NEXT'
exporting
nr_range_nr = '01'
object = 'ZBDCMSC2N'
importing
number = file_no
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
buffer_overflow = 7
others = 8.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
in This
Creat a number Range object(ZBDCMSC2N') using transction SNRO.
for any problem revert back.
regards
Rajesh -
Function module to generate Batch number
Can anyone please let me know, the function module to generate the batch numbers. if possible the procedure to generate the batch number.
Hi Venkat,
Check function module <b>VB_CREATE_BATCH</b>.
Thanks,
Vinay -
Function module which will capture system generated errors
hi gurus,
What is the name of the function module which will capture system generated errors and will populate a internal table?hi,
there is a backgroung job running, if it fails i need to catch the system error because of which the job has failed
Edited by: arunchandra c p on Aug 27, 2008 2:02 PM -
Function module which sort the entries in Table maintance generator
hi
I want to know the function module which is used to sort the entirs in table maintance genrator.
ThanksHi,
Go to the TMG program .You can change the code there.
Rgds,
Anversha -
Functional Module which can send FAX
Hi All,
Can you please suggest a function module which we can use to send fax. We wanted to fax the output list genrated by the program.
Regards,
Vidya.The following program shows you how to send a fax from within ABAP/4. The report is delivered
in the standard system and is used in Transaction SCOM for the function "Send test fax".
Only the method via the call of SAPscript with DEVICE='TELEFAX', described below, ensures the
generation of a correct transmission request, independent of the R/3 release and of the used
fax server solution and its configuration.
The regular printing (for example, with NEW-PAGE PRINT ON...) on an output device created in
the spool administration of the device class 'Telefax' does generally not work!
REPORT RSKSENDF MESSAGE-ID SK.
Test report to send a test fax
sends a fax to the number <TO_CNTRY>-<TO_NMBER>
containing an automatically generated message text.
TABLES: USR03.
PARAMETERS: TO_CNTRY LIKE T005-LAND1 OBLIGATORY,
TO_NMBER LIKE TSP01-RQTELENUM OBLIGATORY,
FROM_USR(30) TYPE C DEFAULT SY-UNAME,
TO_RECIP(30) TYPE C DEFAULT SY-UNAME.
SAPscript content ITAB
DATA: BEGIN OF TEST_DOC OCCURS 10.
INCLUDE STRUCTURE TLINE.
DATA: END OF TEST_DOC.
SAPscript header struct
DATA BEGIN OF HEADER.
INCLUDE STRUCTURE THEAD.
DATA END OF HEADER.
INITIALIZATION.
get county from user addres in usr03
system->user profile->user address
check if not empty
SELECT SINGLE * FROM USR03 WHERE BNAME = SY-UNAME.
IF SY-SUBRC = 0 AND USR03-LAND1 SPACE.
TO_CNTRY = USR03-LAND1.
ENDIF.
START-OF-SELECTION.
PERFORM FILL_UP_TEST_DOC.
PERFORM SHOW_TEST_DOC.
AT PF08.
PERFORM SEND_FAX TABLES TEST_DOC USING TO_CNTRY
TO_NMBER.
AT SELECTION-SCREEN ON TO_NMBER.
PERFORM CHECK_NUMBER USING TO_CNTRY TO_NMBER.
*& Form CHECK_NUMBER
FORM CHECK_NUMBER USING
COUNTRY
NUMBER.
DATA: SERVICE LIKE TSKPA-SERVICE VALUE 'TELEFAX',
LEN LIKE SY-FDPOS.
FIELD-SYMBOLS
windows GUI push the ? from mandatory input instead
of overwriting it
LEN = STRLEN( TO_NMBER ).
IF LEN > 1.
SUBTRACT 1 FROM LEN.
ASSIGN TO_NMBER+LEN(1) TO
IF
= '?'.
= SPACE.
ENDIF.
ENDIF.
official check FM
CALL FUNCTION 'TELECOMMUNICATION_NUMBER_CHECK'
EXPORTING
COUNTRY = COUNTRY
NUMBER = NUMBER
SERVICE = SERVICE.
on old 21?/22? release you may have to handle the
exception
because the Function uses RAISE instead of
MESSAGE... RAISING....
ENDFORM. " CHECK_NUMBER
*& Form FILL_UP_TEST_DOC
fills test text in itab TEST_DOC *
real life example needs to get real life data *
FORM FILL_UP_TEST_DOC.
DATA: DATUM(12) TYPE C,
UZEIT(10) TYPE C.
SAPscript initialization
of course, you may want to set a few parameter
(FORM,LAYOUT,....)
CALL FUNCTION 'INIT_TEXT'
EXPORTING
ID = 'ST '
LANGUAGE = SY-LANGU
NAME = 'FOO-BAR'
OBJECT = 'TEXT'
IMPORTING
HEADER = HEADER
TABLES
LINES = TEST_DOC
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC 0.
MESSAGE A400 WITH 'INIT_TEXT'.
ENDIF.
PERFORM ADD_EMPTY_LINE.
WRITE: SY-DATUM TO DATUM.
WRITE: SY-UZEIT TO UZEIT.
PERFORM ADD_LINES USING 'This is test Telefax'(001)
DATUM UZEIT.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING 'From: &'(002) FROM_USR SPACE.
PERFORM ADD_LINES USING 'To: &'(003) TO_RECIP SPACE.
PERFORM ADD_LINES USING 'Fax number: & &'(004)
TO_CNTRY TO_NMBER.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING
'This is a test fax send by Report RSKSENDF'(005)
SPACE SPACE.
PERFORM ADD_LINES USING 'on SAP system & '(006)
SY-SYSID SPACE.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING
'the quick brown fox jumps over the lazy dog.'(101)
SPACE SAPCE.
PERFORM ADD_LINES USING
'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.'(102)
SPACE SAPCE.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING 'End of test'(007) SPACE
SPACE.
ENDFORM. " FILL_UP_TEST_DOC
*& Form ADD_LINES
printf a line an appends it in test_doc *
--> cformat format.
--> p1 param1
--> p2 param2
FORM ADD_LINES USING CFORMAT P1 P2.
TEST_DOC-TDFORMAT = '/'.
TEST_DOC-TDLINE = CFORMAT.
IF TEST_DOC-TDLINE CA '&'.
REPLACE '&' WITH P1 INTO TEST_DOC-TDLINE.
IF TEST_DOC-TDLINE CA '&'.
REPLACE '&' WITH P2 INTO TEST_DOC-TDLINE.
ENDIF.
ENDIF.
APPEND TEST_DOC.
ENDFORM. " ADD_LINES
*& Form ADD_EMPTY_LINE
appends an empty line to test_doc *
FORM ADD_EMPTY_LINE.
TEST_DOC-TDFORMAT = '/'.
CLEAR TEST_DOC-TDLINE.
APPEND TEST_DOC.
ENDFORM. " ADD_EMPTY_LINE
*& Form SHOW_TEST_DOC
lists the test doc for aproval *
*>>>> this is for fun only because PRINT_TEXT also
offers a preview *
FORM SHOW_TEST_DOC.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
WRITE: / 'Test fax would look like this:'(020).
ULINE.
SKIP.
LOOP AT TEST_DOC.
IF TEST_DOC-TDLINE SPACE.
WRITE:/ TEST_DOC-TDLINE.
ELSE.
SKIP.
ENDIF.
ENDLOOP.
SKIP.
ULINE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE: 'Press PF8 to send it'(021).
ENDFORM. " SHOW_TEST_DOC
*& Form SEND_FAX
send fax by calling SAPscript *
Note: Instead of using PRINT_TEXT you may also *
call OPEN_FORM / WRITE_FORM_LINES / CLOSE_FORM, *
this allows you to use a similar program structure *
as with NEW-PAGE PRINT ON / WRITE / NEW-PAGE PRINT
OFF *
FORM SEND_FAX
TABLES DOC2FAX STRUCTURE TEST_DOC
USING COUNTRY
NUMBER.
DATA: SID(5) TYPE N.
DATA BEGIN OF POPT.
INCLUDE STRUCTURE ITCPO.
DATA END OF POPT.
DATA BEGIN OF PRES.
INCLUDE STRUCTURE ITCPP.
DATA END OF PRES.
CLEAR POPT.
POPT-TDCOPIES = 1. " one copy
POPT-TDDEST = " done internaly by script,
POPT-TDPRINTER = " do not fill !!!
POPT-TDNEWID = 'X'. " do not reuse old spool request
POPT-TDDATASET = 'TEST'(022). " fill as you want
POPT-TDSUFFIX1 = 'FAX'(023). " fill as you want
POPT-TDSUFFIX2 = SY-UNAME. " fill as you want
POPT-TDIMMED = 'X'. " send now
POPT-TDLIFETIME = 8. " keep 8 days in spool
POPT-TDTELENUM = NUMBER. " number without country code
POPT-TDTELELAND = COUNTRY. " country of recipient
POPT-TDCOVER = 'test fax'(024).
POPT-TDCOVTITLE = 'test fax'(024).
POPT-TDIEXIT = 'X'.
CALL FUNCTION 'PRINT_TEXT'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'TELEFAX' "<<< here we say: fax it !
DIALOG = 'X'
HEADER = HEADER
OPTIONS = POPT
IMPORTING
RESULT = PRES
TABLES
LINES = DOC2FAX
EXCEPTIONS
OTHERS = 01.
do not bother with exception in sample code
CANCELED = 01
DEVICE = 02
FORM = 03
OPTIONS = 04
UNCLOSED = 05
UNKNOWN = 06
FORMAT = 07
TEXTFORMAT = 08
EXTERNAL = 09.
IF SY-SUBRC = 0.
arriving here means we could send:
SID = PRES-TDSPOOLID.
IF SID > '00000'.
MESSAGE S433 WITH SID.
ENDIF.
LEAVE .
ELSE.
do not bother with exception in sample code
MESSAGE A400 WITH 'PRIN_TEXT'.
ENDIF.
ENDFORM. " SEND_FAX
Regards. -
Is there a BAPI function module which reverses the sign of an integer
Hi Friends,
Could u plz tell me a BAPI function module which can reverse the
sign of an integer ?
For example:
if i get the integer value in work area as <number> <sign> , i need to change it to <sign><number>.
i.e if i get the integer value in work area as "248-" ("-" indicates minus sign) to " -248 ".
i.e if i get the sign after the value , my requirement is to get the sign before the value.
The actual ABAP query is:
data: QTY_1 TYPE CHAR10,
QTY_2 TYPE CHAR10,
WA_DISTK_PORTLET-QUANTITY TYPE INT4.
QTY_1 = WA_DISTK_PORTLET-QUANTITY.
SEARCH QTY_1 FOR '-'.
IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
SPLIT QTY_1 AT '-' INTO QTY_1 QTY_2.
CONDENSE QTY_1.
CONCATENATE '-' QTY_1 INTO QTY_1.
CONDENSE QTY_1.
ELSE.
CONDENSE QTY_1.
ENDIF.
CLEAR: WA_DISTK_PORTLET-QUANTITY.
MOVE : QTY_1 TO WA_DISTK_PORTLET-QUANTITY.
when i move this QTY_1 to work area quantity field The sign is coming after the numeric value.
Note: There is no possibility to change the datatype of quantity field.
I have tried my level best with 'CLOI_PUT_SIGN_IN_FRONT' function module.
I will assign full points to the correct function module.Hi Ram,
try this ang look into fields.
data: fields type table of SVAL with header line.
fields-tabname = 'MARA'. fields-fieldname = 'MATNR'. append fields.
fields-tabname = 'BKPF'. fields-fieldname = 'BUDAT'. append fields.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
POPUP_TITLE = 'Value Insert'
TABLES
FIELDS = fields.
Regards, Dieter -
Function Module for getting Number ranges between two number
Hi guys,
Is there any Function module which provide us the number range between two numbers?
For Ex:If i give 1 and 10 to FM it must give me 1
2
3
4.....upto 10.
is there any FM for doing this,but i'm not able to find exact Fm for same.
I can write small piece of code for getting number ranges, but if i get FM it could save little work.Hi
But why do u need a fm, can't you do it by yourself?
DATA: FROM_NUMBER TYPE I VALUE 1,
TO_NUMBER TYPE I VALUE 15.
DATA: NUMBER TYPE I.
DATA: BEGIN OF T_NUMBER OCCURS 0,
NR TYPE I,
END OF T_NUMBER.
NUMBER = FROM_NUMBER.
DO.
IF NUMBER <= TO_NUMBER.
T_NUMBER-NR = NUMBER.
APPEND T_NUMBER.
ELSE.
EXIT.
ENDIF.
NUMBER = NUMBER + 1.
ENDDO.
LOOP AT T_NUMBER.
WRITE: / T_NUMBER-NR.
ENDLOOP.
Max -
Function Module for generating Randon Numbers
Hi,
Is there any Function Module to generate Random Numbers automatically.
Say for example: The Lower Limit is 10 and the Higher imit is 30.
So is should generete the random numbers between 10 and 30. and it should store in he Data Base level.
Please help me in this ascept.
Thanks & Regards:
JSRHi,
You can use Number Range Concept.
Get new number
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = c_01
object = c_key_no
IMPORTING
number = pw_key_no
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
buffer_overflow = 7
OTHERS = 8.
Thanks,
Sree. -
Function module for generating password
Hi All,
Is there any function module which randomly generates case sensitive passwords.
ThanksHi,
Please refer:
FM for Random password in a specific pattern
Best regards,
Prashant -
Is there any function module which gives open invoices &open amount?
Hello All,
I want to use function module which gives open invoices with open amount.
I know 'CUSTOMER_OPEN_ITEMS' 'BAPI_AR_ACC_GETOPENITEMS' function which gives open invoices but does not give open amount.
Can anyone help me to find such function?From this BAPI ,
BAPI_AR_ACC_GETOPENITEMS, You got amount for items in lc_amount field of lineitems table parameter.
I hope, it will helpful to you.
by
Prasad GVK. -
What is the function module which is used to trigger email
Hi ALL,
can u send me the function module which has to trigger email when sales order was saved.
kindly send me the inputs
thanks & regards
naveen
Moderator Message: Basic Question. Thread locked.
Edited by: kishan P on Nov 11, 2010 10:56 AMHi,
This needs to coded in the Save User Exit of the Sales Order Include MV45AFZZ (USEREXIT_SAVE_DOCUMENT) and use the Function Module "SO_DOCUMENT_SEND_API1" to trigger a mail.
Please try this and let me know if any.
Regards,
Srinivas
Moderator Message: Do not answer Basic Question.
Edited by: kishan P on Nov 11, 2010 10:58 AM -
Function module for converting number to exponential???
Hi All
please tell me Function module for converting number to exponential.
Deepaktry:
REPORT Zconvertf.
parameters p1 type p decimals 2 default '4711.99'.
data f1 type f.
move p1 to f1.
write: / p1, f1.
hope that helps
Andreas -
IDoc outbound function module to generate Purchase order PORDCH IDoc
Hi all,
Can anyone help me with the outbound function module to generate PORDCH IDocinstead of that you can use the Below For PO's.
Message Type : ORDCHG
Process Code : ME11
Function : IDOC_OUTPUT_ORDCHG
Maybe you are looking for
-
How do I set up two accounts with two separate mail applications?
My wife and I have two separate email accounts. At home she gets her mail on her computer and mine on my computer. While traveling I would like to be able to allow her to get her email on my laptop. I set up the 2nd account and activated it but her e
-
DEAR ALL, I've shutdown the database from SQLPLUS.How to startup the database from sql plus.I tried to connect using sys and i recieve Listener doesn't know currently of service.... Thanks
-
Sharing photos that others can DOWNLOAD
I'm embarrassed to say that i've been using both iPhoto and IWeb a long time, but I've never understood which "sharing" method to use when I want to let others DOWNLOAD my published photos. The iPhoto help file is confusing because it talks about pub
-
Power saving features do not work
I use the better performance when plugged in and normal when unplugged. Shouldn't the dispaly change from max to a lower setting when i unplug the power cable etc. Also i leave the keyboard brightness to full but at times it drops to a lower setting
-
Picking and delivery problem problem
i need picking document for configuring picking step by step i m getting a strane problem that i can not process any document in Vl02n screen wen i m puting any document no its telling corrected deliveries can not be changed below is the error repor