‎2010 Mar 30 5:14 PM
Hello friends,
I am trying to read material Sales text using the FM Read_TEXT.
it works good for a numberic material but has a problem with the non mumberic material.
CONCATENATE material salesorg channel INTO tdname.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = '0001'
language = 'E'
name = tdname
object = 'MVKE'
TABLES
lines = i_lines
if the material is 999 , saleas org = 1234, channel = 01
then
tdname = 000000000000000999123401. tha functional Module works good here.
but when material is ABC
the tdname = ABC123401, here the functional module fails because it is excepting a value of
ABC 123401 ( 15 spaces).
Please suggest if there is something wrong with the way text name is created in SAP or do I need to do programming changes.
Thanks,
BOB
‎2010 Mar 30 5:21 PM
CONCATENATE material salesorg channel INTO tdname respecting blanks.Try adding 'respecting blanks' to your concatenate statement:
or build your tdname by offset length...
like tdname= material.
tdname+17(4) = salesorg, etc.
‎2010 Mar 30 5:21 PM
CONCATENATE material salesorg channel INTO tdname respecting blanks.Try adding 'respecting blanks' to your concatenate statement:
or build your tdname by offset length...
like tdname= material.
tdname+17(4) = salesorg, etc.
‎2010 Mar 30 6:36 PM
i tried the respecting blangs option but i get the foloowing error,
".", "IN BYTE MODE", "SEPARATED BY ..." or "IN CHARACTER MODE" expected after "TDNAME".
if nothing works i will use the offset option but i want to try other bfr i use the offset option.
Thanks,
Bob
‎2010 Mar 30 5:28 PM
Pass the data directly to STXH and STXL tables and check how its stored there.
‎2010 Mar 30 6:52 PM
Hi,
You can do the same thing using offset.
tdname = material.
CONCATENATE salesorg channel INTO tdname+18.
Then you can use the TDNAME.
Thanks.
Subhankar
‎2010 Mar 30 6:52 PM
Hi,
What you can do is to define a structure for your text name:
TYPES:BEGIN OF typMatText,
matnr type mara-matnr,
vkorg type vbak-vkorg,
vtweg type vbak-vtweg,
END OF typMatText.
then you declare a variable of that type
DATA: lsMatText TYPE typMatText.
then you assign values to it:
lsMatText-matnr = material.
lsMatText-vkorg = salesorg.
lsMatText-vtweg = distChannel.
Finally you copy structure to the TDNAME variable
tdname = lsMatText.
Eric
‎2010 Mar 30 6:53 PM
But the easiest way would be:
CLEAR tdname.
tdname = material.
tdname+18 = salesorg.
tdname+22 = distchannel.
Eric
Edited by: Eric Meunier on Mar 30, 2010 1:54 PM
‎2010 Mar 30 11:50 PM
DATA : f_len TYPE i. " Desides the length of the line.
DESCRIBE FIELD tdname LENGTH f_len IN CHARACTER MODE.
CONCATENATE material salesorg channel INTO tdname respecting blanks.
Hope it will work ..