Skip to Content
0
Former Member
Mar 30, 2010 at 11:37 PM

Code for counter logic

181 Views

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