2010 Mar 31 12:37 AM
Hi,
I am planning to write a code in start routine for an ODS update rules where I need to populate document number.
I already have some code but having some difficulty in finishing it. Below is the code I was talking about.
data: lv_random(5) type c.
CALL FUNCTION 'QF05_RANDOM_INTEGER'
EXPORTING
RAN_INT_MAX = 99999
RAN_INT_MIN = 1
IMPORTING
RAN_INT = lv_random
EXCEPTIONS
INVALID_INPUT = 1
OTHERS = 2.
.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Loop at data_package.
concatenate 'B' sy-uzeit+2(4) lv_random into data_package-ac_doc_no.
modify data_package.
lv_random = lv_random + 1.
endloop.
clear lv_random.
There is no doc number in data package from source ODS. How can I write then.
Can anyone give me some input to finish this? How can you write this for an ODS.
Thanks,
AB
2010 Mar 31 6:10 AM
Maybe your question would be better in a different forum, like (just guessing)?
Anyhow, not quite sure I understand what you're trying to accomplish. Are you possibly looking already at aggregated data and that's why there's no document number? If for some strange reason you need to generate numbers, you're better off with using function module GUID_CREATE, which is designed to create a unique identifier.
Cheers, harald
2010 Mar 31 7:12 PM
2010 Mar 31 7:12 PM