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

smartforms

Former Member
0 Likes
1,060

Hi,

I have a material number and i want to display its last 8 digit in the smartforms...

but when i used:


l_dummy = 000000000000008633.
l_dummy = l_dummy+10(8).

the value of the l_dummy = 8633. i want to display it 00008633 how can i do that? does anybody knows?

thank you...

regards,

mae

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,034

HI,

Please try this.

<b>DATA : c8(8).

data : P_FIELD(4) TYPE P.

P_FIELD = '8633'.

UNPACK P_FIELD to c8</b>.

c8 would have 00008633.

<b>Reward Points if useful.</b>Regards

Saket Sharma

9 REPLIES 9
Read only

Former Member
0 Likes
1,034

Hi

data: matnr(18), v_mat(8) type N.

matnr = '000000000000008633'.

v_mat = matnr+10(8).

Regards

anji

Read only

Former Member
0 Likes
1,035

HI,

Please try this.

<b>DATA : c8(8).

data : P_FIELD(4) TYPE P.

P_FIELD = '8633'.

UNPACK P_FIELD to c8</b>.

c8 would have 00008633.

<b>Reward Points if useful.</b>Regards

Saket Sharma

Read only

0 Likes
1,034

hi thank you for that..

but how can i declare c8 in smartfor as 8characters?

regards,

mae

Read only

0 Likes
1,034

Hi ,

you can declare the same in GLOBAL SETTINGS ---> GLOBAL DEFINITION.

Regards

Saket Sharma

Read only

0 Likes
1,034

hi,

I tried it c8(8) type c.

but it displays an error...:(

please help...

thank you...

regards,

mae

Read only

0 Likes
1,034

Hello ,

Try c type char08.

Regards

Saket

Read only

Former Member
0 Likes
1,034

Hi..

l_dummy = 000000000000008633.

l_dummy = l_dummy+10(8).

now u r getting l_dummy value = 8633.

<b>Try this logic</b>..

Data var(8) type n.

Now store l_dummy in this variable.

For eg:

l_dummy = 000000000000008633.

var = l_dummy.

Pass this <b>var</b> value to ur smartform.

Regards

Bala.

Read only

Former Member
0 Likes
1,034

Hi Mae,

l_dummy = 000000000000008633.

in smartform use it as below...

<b>&l_dummy+10&</b>

http://www.howforge.com/formatting-options-in-sapscript-offset

Hope ur problem solved now..

<b>Reward points if useful..</b>

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
1,034

Hi Mae,

Have you got the answer?

You can try this way

parameters : P_matnr TYPE mara-matnr.

Data: var(15) type c.

var = P_matnr+10(8).

write var.

Regards,

Satish