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

varibale code

Former Member
0 Likes
1,019

Hi,

I have a fields which has differerent characters in length.

EG

Field 1 = 1 values are like this = 1

Field 2 = 3 value = 123

field 4 = 5 Value = 123100

Field 5 = 8 value = 123100900

Field 6 = 11 va;ue 12310090082

Field 7 = 13 value = 1231009008251

field 8 = 18 value = 123100900825110

I have to create the varible which can accept their respoective code

Eg: field 2 = 23

field 3 = 100

field 4 900

where as in the table it is stored as full code that is field 2 = 123 i need to select last 2 character

i can do that but problme is like this we have different selectionfor the field 4 we cna have 123100,123200 etc combination should be picked up correctly

I need to have the abap code for this

help is urgently needed.

~Thanks

Use meaningful Subject

Edited by: Vijay Babu Dudla on Feb 26, 2009 7:53 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
991

Could you be a little more clear here?

Pushpraj

9 REPLIES 9
Read only

Former Member
0 Likes
992

Could you be a little more clear here?

Pushpraj

Read only

0 Likes
991

This message was moderated.

Read only

0 Likes
991

So how many input fields do you have on the selection screen ?

One for each level or one for all levels?

And what do you mean by setting A12 ?

Is it the default value on the selection screen ?

Read only

0 Likes
991

Yes we need to have each input field seperately apart from this correct combination need to be selected..

A12 i can make it default but they would like to enter evem that also.

Thanks

Read only

0 Likes
991

Ok

well what you may do is this

Let the customer inut those later portions of the values only in the selection screen.

You can use CONCATENATE to have the whole values.

eg field 3 he inputs 100.

So you can use

CONCATENATE '123' field3 INTO field3.

Now field3 will have the value '123100'.

Similarly for all the fields.

Do this before you use these values to read from the table.

is it clear?

Pushpraj

Read only

0 Likes
991

Thanks for this..

Could you guide me for the same if the value exists in the data base .. how to select the last three charaters and store in the other variable...

Thanks

Read only

0 Likes
991

If there's a value like 123100 stored in the database and you want only 100,

then you can truncate it after getting its value.

Say field3 = 123100.

field3 = field3+3. (this would put 100 into field3)

and similarly for other hierarchies.

Pushpraj

Read only

0 Likes
991

pushpa raj singh give u the correct reply.follow this one .

it will leave the 1st 3 characters and store the ;last 3 characters .

field1 = 15487963.

field1 = field1+2(2).... answer is : '48'.

field1 = field1+offset(length).

it will leave the 1st two char and store the 3rd and 4th char .

Read only

0 Likes
991

pushpa raj singh give u the correct reply.follow this one .

it will leave the 1st 3 characters and store the ;last 3 characters .

field1 = 15487963.

field1 = field1+2(2).... answer is : '48'.

field1 = field1+offset(length).

it will leave the 1st two char and store the 3rd and 4th char .

Thanks ,

jowar