Application Development 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: 

Concatentating values of internal table

Former Member
0 Kudos

Hi,

can anyone help me with this?

How can i concatenate values from internal table?

Example:

Concatenate i_sto-matnr i_sto-sales-org into v_name1.

Would it be possible? Please reply. Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Yes . Use the Work area for that.

loop at i_sto into wa_sto.

concatenate wa_sto-matnr wa_sto-org into v_name1.

endloop.

Regards,

Nilesh

5 REPLIES 5

Former Member
0 Kudos

Yes . Use the Work area for that.

loop at i_sto into wa_sto.

concatenate wa_sto-matnr wa_sto-org into v_name1.

endloop.

Regards,

Nilesh

0 Kudos

Hi Nilesh!

Thanks for that very helpful info.

Can i just use the i_sto instead of wa_sto? since I did not store it in the work area when i loop at i_sto? thanks!

0 Kudos

Hi Mark,

If you dont want ot use the explicit work area then the internal table should be created with header line . This header line is similar to work area . So with this you can continue.

Regards,

Nilesh

Former Member
0 Kudos

due to follow up question

Former Member
0 Kudos

Hi,

Please note that concatenation will work if & only if noe of the variables contain Spaces.If you want to concatenate the variables eventhough they contain spaces then you mau use the following procedure so that it will always work.

Define DATA: w_fix(50) VALUE '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! '.

  • 'Value' be any special character whch you will never grt from the i/p. Then for each & every variable which you are using for concatenation use:

IF NOT variable IS INITIAL.

ELSE.

variable = w_fix.

ENDIF.

Then Concatenate variable variable1 into say w_c.

then use TRANSLATE w_c USING w_c3.

I hope this helps,

Regards

Raju Chitale