2006 Feb 02 9:32 AM
Hi,
DATA v_tmp(18) TYPE c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = wa_sales-matnr
IMPORTING
output = v_tmp.
CONCATENATE v_tmp 'XXX' INTO PO_OBJ.
The answer that I get is this - "X7000114BLCKXXX" the spaces beteeen the MATNR and XXX is not there. How could I get like this - "X7000114BLCK XXX". The MATNR is made out of 18 characters. This 18 characters should be maintained in MATNR.
Please help me.
Thanks,
Kishan
2006 Feb 02 9:40 AM
hi ,
When you do the concatenation operation always the extra space after or before strings are automatically deleted.
Instead you can do
CONCATENATE v_tmp+16(3) 'XXX' INTO PO_OBJ.
this will solve your problem
Hi,
DATA v_tmp(18) TYPE c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = wa_sales-matnr
IMPORTING
output = v_tmp.
CONCATENATE v_tmp 'XXX' INTO PO_OBJ.
The answer that I get is this - "X7000114BLCKXXX" the spaces beteeen the MATNR and XXX is not there. How could I get like this - "X7000114BLCK XXX". The MATNR is made out of 18 characters. This 18 characters should be maintained in MATNR.
Please help me.
Thanks,
Kishan
2006 Feb 02 9:36 AM
Hi,
Use CONCATENATE v_tmp 'XXX' INTO PO_OBJ separated by SPACE.
Best regards,
Prashant
2006 Feb 02 9:38 AM
Hi Patil,
It didnt work. This creates a single space. I need to make v_tmp 18 characters long.
Thanks,
Kishan
2006 Feb 02 9:37 AM
Use this to get space in between.
CONCATENATE v_tmp 'XXX' INTO PO_OBJ SEPARATED BY SPACE.
Ps: Reward points if helpful.
2006 Feb 02 9:37 AM
2006 Feb 02 9:39 AM
You can also try,
unpack wa_sales-matnr into v_temp.
concatenate v_temp 'xxx' into po_obj separated by space.
Hope this helps.
The above logic will work fine if the matnr has all numeric values.
You can try this generic logic in all cases
1.Use shift statement and delete trailing spaces.
shift tmp right deleting trailing space.
2.fill the spaces with '0' using overlay statement
overlay tmp with '00000000000000000000000' only space.
3. Now you can use concatenate statement using space option.
This is working fine in my syatem.
Message was edited by: Imtiaz Ahmed
2006 Feb 02 9:39 AM
To seperate two values by space, correct syntex for the command is:
CONCATENATE v_tmp 'XXX' INTO PO_OBJ SEPERATED BY SPACE.
and the other way to do the desired task is you can use the existing code in this way:
CONCATENATE v_tmp ' XXX' INTO PO_OBJ.
Hopefully this would serve the cause.
2006 Feb 02 9:40 AM
hi ,
When you do the concatenation operation always the extra space after or before strings are automatically deleted.
Instead you can do
CONCATENATE v_tmp+16(3) 'XXX' INTO PO_OBJ.
this will solve your problem
2006 Feb 02 10:21 AM
hi
try inserting some dummy characters append and then append XXX and replace the dummy characters. Any space in a report will be truncated.
P.S Reward ponits if useful
2006 Feb 02 10:22 AM
hi,
Check out the following code.
You can get space before matnr as well you can maintain a length of 18 to it.
REPORT z_13317_sdn.
PARAMETERS : p_matnr(18) TYPE c.
DATA: f_matnr(18) TYPE c.
START-OF-SELECTION.
WRITE p_matnr TO f_matnr+0(13) RIGHT-JUSTIFIED .
CONCATENATE f_matnr 'XYZ' INTO f_matnr SEPARATED BY space.
WRITE 😕 f_matnr.
Regards,
Sailaja.
2006 Feb 02 10:27 AM
This will solve your problem. Try this.
DATA len TYPE i.
DESCRIBE FIELD v_tmp LENGTH len IN CHARACTER MODE.
po_obj+0(len) = v_tmp+0(len).
po_obj+len(3) = 'XXX'.
WRITE po_obj.Ps: Reward points if helpful.
2006 Feb 02 10:44 AM
Hi Kishan,
A simple solution is declaring a char array of size 18 and using it as
data: v_tmp_c(18) type c.
...
v_tmp_c = v_tmp.
CONCATENATE v_tmp_c 'XXX' INTO PO_OBJ.
This will solve your problem.
Regards,
Uma
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |