Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Function Module

Former Member
0 Likes
688

Hi,

I have to generate a no. and the generated number should be diplayed in the status bar and this logic has to be written in a function module (YOM_ABCD). So when i call this function module, if the number gets generated, will this number be shown in the status bar if i try to show this number through a message. Or do i need to get that generated number out of the function module through some importing parameter and then display it in the status bar?

6 REPLIES 6
Read only

Former Member
0 Likes
667

Hi,

Use the function module NUMBER_GET_NEXT to generate number ranges.

Create the number range object in TCODE : SNUM

Once done proceed as follows

Func modules NUMBER_RANGE_ENQUEUE -> NUMBER_GET_NEXT -> NUMBER_RANGE_DEQUEUE

Regards

Edited by: Rajvansh Ravi on Oct 23, 2008 7:24 AM

Read only

Former Member
0 Likes
667

Hi,

the sample program is shown below..

Following is a test program to get the next available number of the object created above:

REPORT zsnro_test.

DATA:

NUMBER TYPE I.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'ZDEMO'

IMPORTING

NUMBER = NUMBER

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.

You can use this number now to show it on the status bar..

Regards

Mudit

Read only

Former Member
0 Likes
667

Hey guys,

I guess you did not get my question. I am using the fn. module NUMBER_GET_NEXT in a custom function module YOM_ABCD. So when i call the function module YOM_ABCD in my program, the number which gets generated, will it be displayed in the status bar or not?

Thanks,

Ibrahim

Read only

0 Likes
667

Using Message Statement you can show your number on the status bar, Use Type 'I' to show it in a popup box.

Regards

Karthik D

Read only

Former Member
0 Likes
667

Hi,

Just output it as


Message number type 'S'.   "inside the FM..

Edited by: Sukriti Saha on Oct 23, 2008 11:10 AM

Read only

Former Member
0 Likes
667

Thanks guys,

My requirement has been changed. I dont need to write my logic in a function module now.