cancel
Showing results for 
Search instead for 
Did you mean: 

CONCATENATE

Former Member
0 Kudos

Is there a way to add zeros to the beginning of a variable?

CONCATENATE

doesn't seem to be allowed...

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Either

CONVERSION_EXIT_ALPHA_INPUT or

CONVERSION_EXIT_ALPHA_output will work for u .

You can call a function module in a smartform in the program lines .

Regards

Former Member
0 Kudos

Thanks for the advice, but I'm not using Smartforms. Is it possible somehow to call a function from SE71?

Regards.

former_member196280
Active Contributor
0 Kudos

Yes it is possible to call function module, but you have to call external sub-routines from your form...

Go through this example

Ex.

/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>

/:USING &<field name>&

/:CHANGING &<field name1&

/:ENDPERFORM

Then create subroutine pool program and you have to write the code.

FORM ><subroutine name> tables int_cond structure itcsy

outt_cond structure itcsy.

data : value(20), value1(20). "do your own declarations

Read int_cond table index 1.

value = int_cond-value.

value1 = value1 + value.

Read outt_cond table index 1.

outt_cond-value = value1.

Modify outt_cond index 1.

ENDFORM.

Just rough idea given above.

Gonzalez, my advice is to close the thread and open a new thread I guess your question related to CONCATENATE has been answered.. you will get quick responses.. Also note reward to all useful answers.

Regards,

SaiRam

Former Member
0 Kudos

I haven't still managed to get a variable with two extra zeros that will work in the include.

The suggestion you make is exactly the solution I've got so far, but I don't like it because that way I need to create an extra report and it seems to be a bit messy.

So far, my problem is exactly the one I started with. I can't transform the variable I get into the variable I need inside the sapscript form.

Thanks for all your help.

Answers (3)

Answers (3)

Former Member
0 Kudos

So far, I agree that, being ORIGINAL_VAR = 87654321,

DEFINE &NEW_BAR& = '00&ORIGINAL_VAR&'.

will produce, when printed,

&NEW_VAR&

<b>0087654321</b>.

Curiously enough, &NEW_VAR& won't work in:

INCLUDE &NEW_VAR& OBJECT VBBK ID 0002 NEW-PARAGRAPH A1.

whereas

INCLUDE 0087654321 OBJECT VBBK ID 0002 NEW-PARAGRAPH A1.

does.

Anyway,

DEFINE &NEW_VAR&.

returns an error, and so does

DEFINE &NEW_BAR& = 00&ORIGINAL_VAR&.

Any hint?

former_member196280
Active Contributor
0 Kudos

Try like this I guess it will work or helpful to you...

INCLUDE &NEW_VAR(C)& OBJECT VBBK ID 0002 NEW-PARAGRAPH A1.

Regards,

SaiRam

Former Member
0 Kudos

That doesn't work. Thanks all the same.

former_member196280
Active Contributor
0 Kudos

Try this, for pre-fixing zero's &SYMBOL(Ff)& f=fill character.

Ex: &variable(F0)&

Note: here leading spaces in value can be replaced with fill characters.

Regards,

SaiRam

Former Member
0 Kudos

Hi, Sai Ram,

Doesn't seem to be enough. The incoming variable's size is 8, and I need to add two leading zeros, so the resulting variable's size be 10.

Any solution?

Thanks.

former_member196280
Active Contributor
0 Kudos

OK, Define a new variable of size 10 and pass the incoming variable to it. I guess it will solve your problem.

OR easist way is hardcode like this <b>00</b>&variable(F0)&

Regards,

SaiRam

Former Member
0 Kudos

How can I define that new variable (stating length) inside a form?

Thanks.

former_member196280
Active Contributor
0 Kudos

/:DEFINE &NEWSYMBOL&.

NEWSYMBOL = YOUR CURRENT VALUE

DISPLAY NEWSYMBOL

&NEWSYMBOL(<b>10</b>F0)& <b>"Here you are restricting your output to 10 characters</b>

I always advice to open a new thread for new questions so other can also answers. pls close this thread if your current question is answered.

Regards,

SaiRam

gopi_narendra
Active Contributor
0 Kudos

Use the FM :CONVERSION_EXIT_ALPHA_INPUT

Regards

Gopi

Former Member
0 Kudos

Can you use FMs inside a form? I can't use code outside the form.

amit_khare
Active Contributor
0 Kudos

data: var1 type char5,

var2 type char3.

concatenate ........into var1.

unpack var1 to var2.

Regards,

Amit