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

Fill in DATABASE TABLE RANDOMLY

Former Member
0 Likes
1,618

Does anyone have a program to fill in a db table randomly ?

regards,

6 REPLIES 6
Read only

Former Member
0 Likes
993

Can you elaborate your requirment little more?

what type of data you want to insert randomly? what is the source of the data?

Read only

0 Likes
993

I have created my own db table.

want to fill it in with random entries random fields random values ... just to be able to do some testst

Read only

0 Likes
993

Stephan,

Create the Database Table in SE11.

Insert values into this Databse Table through follwoing ways:

Way : 1: Through ABAP Program.

a. Create an Internal Table of Type DataBase Table.

b. Fill the Internal Table with the Randam Values for the fields.

c. Insert Values into the Databse Table

Eg Command: INSERT DBTABLE FROM TABLE itab.

Way: 2: Through Table Maintenance Generator.

a. SE54.

b. SM30.

Thanks

Kam

Message was edited by: Kam

Read only

Former Member
0 Likes
993

Thse Function Modules are useed to generate random values

RANDOM_AMOUNT

RANDOM_C

RANDOM_C_BY_SET

RANDOM_F8

RANDOM_I2

RANDOM_I4

RANDOM_INITIALIZE

RANDOM_P

RANDOM_TABLE_ENTRY

I Think the FM RANDOM_TABLE_ENTRY is the one which suits your requirement.

see if they are useful

Regards,

ravi

Read only

0 Likes
993

> Thse Function Modules are useed to generate random

> values

> RANDOM_AMOUNT

> RANDOM_C

> RANDOM_C_BY_SET

> RANDOM_F8

> RANDOM_I2

> RANDOM_I4

> RANDOM_INITIALIZE

> RANDOM_P

> RANDOM_TABLE_ENTRY

>

>

> I Think the FM RANDOM_TABLE_ENTRY is the one which

> suits your requirement.

> see if they are useful

> Regards,

> ravi

Hi Ravi,

thanks but none of these fm fits. I was thinking to an home made program

Regards,

Read only

0 Likes
993

Hi Stephan,

try this skeleton code

data: random_value type i.

start-of-selection.

do 100 times. "for inserting 100 records

clear random_value.

  • This FM generates an random integer between rnd_min

  • and rnd_max

  • If you want character random values,use random_c

  • If you want amount random values,use random_amount

call function 'RANDOM_I4'

exporting

RND_MIN = 1

RND_Max = 100

importing

rnd_value = random_value.

it_ztable-field1 = random_value.

append it_ztable.

clear it_ztable.

enddo.

modify ztable from it_ztable.

Regards,

Ravi Kanth