cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Constant Value to a key field

Former Member
0 Kudos

Hi Friends,

I am trying to assign some constant value to an (key field) infobject based on simple condition in the start routine.

here is sample code.

Loop at DATA_PACKAGE.

if DATA_PACKAGE-<ORDERNUM>= '01'.

move '2' to DATA_PACKAGE-</BIC/ZQUAN>.

ENDIF.

ENDLOOP.

but after the condition it not replacing the constant value '2' in the quantity field.

as i want to place this value in all the records.

i hope i am asking simple question. but kindly help me.

Regards,

Ala.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

You can do the same in the field level routine or in the start routine you can try with putting the value of the internal table in work area and modifying the table.

Regards,

Anupama

Former Member
0 Kudos

Before ENDIF.

use MODIFY DATA_PACKAGE.

Former Member
0 Kudos

what is the mapping for field routine part??? are you assigning constant here or i think you may need to write code to populate into field.

try writing a field routine for this, this can help!

Former Member
0 Kudos

Loop at DATA_PACKAGE.

if DATA_PACKAGE-<ORDERNUM>= '01'.

DATA_PACKAGE-</BIC/ZQUAN> = 2.

ENDIF.

ENDLOOP.

try this.

Former Member
0 Kudos

Hi ravi

even i tried this method...but i did not get the result.

is there any other way to get that.

Thanks for the reply.

Former Member
0 Kudos

Loop at DATA_PACKAGE.

if DATA_PACKAGE-<ORDERNUM>= '01'.

DATA_PACKAGE-</BIC/ZQUAN> = '2'.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

yep...same problem with this also....

Former Member
0 Kudos

try assigning this constant according to the length of the infoobject zquan.

Former Member
0 Kudos

Hi

i tried even assigning the constant according to the length of the Infoobject ZQUAN.

but it did not work....

Former Member
0 Kudos

Try using simple Formula at field level insted of field routine.

there is IF( <condition>, <result when true>, <result when false> ) option avaialble in formula

Regards

Sudeep