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: 

CONCATENATION not working properly. Kindly help!

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

I am concatenating some string literals and workarea field values as shown below

Data: v_subj(250) TYPE c.

CONCATENATE text-033

'Customer DUNS:'

wa_cust-duns

'. PIP NO:'

wa_cust-pipno

INTO v_subj.

text-033 contains "ACTION REQUIRED - Inventory Reconciliation has not been processed due to backend system issues."

wa_cust-duns contains '030414416'

wa_cust-pipno conatins '0000000006825611'

When I run the code and check the v_subj it has the value

"ACTION REQUIRED - Inventory Reconciliation has not been processed due to backend system issues. Customer DUNS:030414416. PIP ID:00000."

The pipno value is not getting populated fully in v_subj. But wa_cust-pipno has correct value '0000000006825611'.

v_subj variable has also size 250. Total no of characters in the concatenated string is just 144.

What is the problem? Where am I going wrong? Please help me.

Thanks

Gopal

Message was edited by:

gopalkrishna baliga

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Can u post the code of declaration part of wa_cust.

Satya

Message was edited by:

satyanarayana tanguturu

20 REPLIES 20

Former Member
0 Kudos

Hi,

write the statement as:

CONCATENATE text-033 'Customer DUNS:' wa_cust-duns '. PIP NO:' wa-cust-pipno into v_subj.

write: v_subj.

Hope this helps.

Reward if helpful.

regards,

Sipra

0 Kudos

Hi Sipra,,

I have actually included INTO clause. It was a TYPO error in writing in this forum text area. I have actually defined it as:

CONCATENATE text-033 'Customer DUNS:' wa_cust-duns '. PIP NO:' wa-cust-pipno into v_subj.

I am still getting the same problem.

Former Member
0 Kudos

declare v_subj as type string.

Did u tried giving v_subj type string.

are u facing this problem while debugging or while displayig data. if it is debugging, it will show that much only if it is while displaying data then there is a problem.

Reward points if useful

Message was edited by:

phanindra a

Message was edited by:

phanindra a

0 Kudos

But what is the problem with declaring v_subj as char type of size 250?

Is there any problem?

0 Kudos

nothing wrong with your syntax.. just for the heck of it try to concatenate some junk chars after the pipno & see if works ie

CONCATENATE text-033 'Customer DUNS:' wa_cust-duns '. PIP NO:' wa-cust-pipno 'TEST' into v_subj.

~Suresh

0 Kudos

Hi,

Just try to increase the line-size in the Report heading.

Regards,

Kumar.

0 Kudos

Hi Kumar,

Actually this is not a report. I have written this code in a function module

which returns the v_subj as output.

So how can I increase the line size? Correct me if I am wrong.

Former Member
0 Kudos

Hi,

Can u post the code of declaration part of wa_cust.

Satya

Message was edited by:

satyanarayana tanguturu

0 Kudos

Hi

wa declaration is like this:

wa_cust TYPE ystnd_format_inv.

Where ystnd_format_inv is a structure defined in SE11.

In this structure the duns field is of char type and size 10.

pipno is also char type and size 20.

Former Member
0 Kudos

check SY-SUBRC after concatenate statement , If it 4 then the result gets truncated..

0 Kudos

just split the statment and try out

CONCATENATE text-033 'Customer DUNS:'  into v_subj.

concatenate v_subj wa_cust-duns '. PIP NO:' wa-cust-pipno into v_subj.

0 Kudos

Hi Chandra

I have tried splitting. But still getting the same problem

Former Member
0 Kudos

Did u tried giving v_subj type string.

are u facing this problem while debugging or while displayig data. if it is debugging, it will show that much only if it is while displaying data then there is a problem.

0 Kudos

Hi

I am facing this problem both while debugging as well as displaying it.

Actually this is not a report. I have written this code in a function module

which returns the v_subj as output.

0 Kudos

a last try use , offsets

v_subj+0(85) = text-033.
v_subj+85(15) = 'Customer DUNS:'
v_subj+100(y) = wa_cust-duns.
v_subj+x(y) = '. PIP NO:',
v_subj+x(y) =  wa-cust-pipno.

"Adjust the length accordingly

0 Kudos

Hi Chandra,

Your offset soln is working.

Thanks.

That means is there any limitation of CONCATENATE statement?

0 Kudos

I am not sure abt that , may be the maximum length is 144 only , will have to chk OSS for that

Pls reward for helpful answers and cloe thread if problem solved

0 Kudos

Hi gopal,

pls try to appreciate others by giving points!!!!!!!!!!!!!!!

raymond_giuseppi
Active Contributor
0 Kudos

What is the value of SY-SUBRC after the CONCATENATE?

If SY-SUBRC = 4, the result was too long for v_subj and could only be transferred in the defined length of v_subj.

Also don't forget that in debug, data-fields are displayed truncated at 132 (which is the length of the result string you wrote in your message)

So in debug mode try to display v_subj+132.

Regards

0 Kudos

Hi

SY-SUBRC after concatenate statement is 0.

-Gopal