‎2008 Dec 03 3:53 PM
Hi firends,
In vbap-matnr = ' 000123456'.
Iam getiing the follwoing value.
Now i need to pass
vbap-matnr vbap-vtweg vbap-vkorg
to the function module save_text in the follwoing format
000123456 200010
Since the material number is 18 digit.
but i have a 9 digit material number in vbap-matnr so i need 9 spaces in btween vbap-matnr and
vbap-vtweg.
How can i do that using condense statment.
Regards
Priyanka.
‎2008 Dec 03 4:42 PM
>
> vbap-matnr vbap-vtweg vbap-vkorg
> to the function module save_text in the follwoing format
>
> 000123456 200010
>
> Since the material number is 18 digit.
> but i have a 9 digit material number in vbap-matnr so i need 9 spaces in btween vbap-matnr and
> vbap-vtweg.
>
> How can i do that using condense statment.
there is no way to that with the condense statement
if you need everything fix placed, than you have to use offset
target_field = vbap-matnr.
target_field+18 = vbap-vtweg ==> this will ensure that vbap-vtweg will start from 19th position!
and so on...
‎2008 Dec 03 3:56 PM
U can use OUTPUT_FORMAT option in Write statement
OR Else.
Use conversion_exit_alpa_input FM.
Best Regards,
Flavya
‎2008 Dec 03 3:58 PM
Hi Priyanka,
Did you try creating a constant with 9 spaces and concatenating it with matnr and the other field?
Best Regards,
Ram.
‎2008 Dec 03 3:58 PM
Hi Priyanka,
Create a work area (say wa) that contains
vbap-matnr
vbap-vtweg
vbap-vkorg
Now move individual values for material, vtweg & sales org to wa-matnr wa-vtweg & wa-vkorg.
Now simply move wa to THEAD-TDNAME.
Hope this helps.
‎2008 Dec 03 3:59 PM
For Material number use conversion exit CONVERSION_EXIT_MATN1_INPUT.
A
‎2008 Dec 03 4:32 PM
‎2008 Dec 03 4:42 PM
>
> vbap-matnr vbap-vtweg vbap-vkorg
> to the function module save_text in the follwoing format
>
> 000123456 200010
>
> Since the material number is 18 digit.
> but i have a 9 digit material number in vbap-matnr so i need 9 spaces in btween vbap-matnr and
> vbap-vtweg.
>
> How can i do that using condense statment.
there is no way to that with the condense statement
if you need everything fix placed, than you have to use offset
target_field = vbap-matnr.
target_field+18 = vbap-vtweg ==> this will ensure that vbap-vtweg will start from 19th position!
and so on...
‎2008 Dec 03 4:51 PM
Hi,
If you need leading 0's or dont need leading 0's then use.
pack & unpack
you will get the solution...
Thanks & Regards,
Krishna..
‎2008 Dec 03 5:04 PM
Hi Priyanka,
You need to pass the concatenated value of MATNR VTWEG VKORG to the FM SAVE_TEXT.
So better use the following code.
DATA : w_matnr TYPE matnr,
w_vtweg TYPE vtweg,
w_vkorg TYPE vkorg,
w_objkey(24) TYPE c.
***Get the values to the 3 variables from corresponding tables.***
PERFORM conv_exit_alpha_output USING w_matnr.
PERFORM conv_exit_alpha_output USING w_vtweg.
PERFORM conv_exit_alpha_output USING w_vkorg.
&----
*& Form CONV_EXIT_ALPHA_OUTPUT
&----
FORM conv_exit_alpha_output USING p_val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = p_val
IMPORTING
output = p_val.
ENDFORM. " CONV_EXIT_ALPHA_OUTPUT
CONCATENATE w_matnr w_vtweg w_vkorg INTO w_objkey.
***Now you can pass the w_objkey to the FM SAVE_TEXT.****
Hope this will solve your issue.
Regards,
Anand.
‎2008 Dec 03 8:33 PM
hi priyanka,
Construct a string with desired number of blank spaces and concatenate with other two parameters.
DATA: str1 TYPE string,
str2 TYPE string,
len type i.
str1 = ''.
len = strlen( text ).
len = 18 - len.
shift str1 right by len places.
concatenate vbap-matnr str1 vbap-vtweg into str2.
Hope it helps!
Mona
‎2008 Dec 03 9:47 PM
Concatenate VBAK-VTWEG VBAK-VKORG into Tempstring.
TDLINE = VBAP-MATNR.
TDLINE+18(6) = Tempstring.
Here, the first 18 char of TDLINE is always reserved to Matnr .. irrespective of it length ...
I think this is more straight ...
Thanks,
Aditya. V
‎2008 Dec 04 5:43 AM
see the following code
SELECT SINGLE k~telbx INTO mobno
FROM kna1 AS k
WHERE k~kunnr = itab-kunag.
CONDENSE mobno .