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: 

requirment to display sales text

Bhushan_hs
Participant
0 Kudos

Hi Experts,

my material number is stored in the form of Character so i want to add a trailing space to that number

supposr for example my material number is ccf5a so i want add space to make it 18 like 'cf5a ' characters

Please help me on this hoping for the quick replay.

My actual requirment is to print sales text which is maintained in material master so this sales text depents on disribution channel & storage location properties of that text is

Text name is combination of material number storage location & distribution channel

Text Id = 0001

Text object = 'MVKE'

so when i concatinate material storage location & distribution channel in the program because the material starting with text so text name is stored for example

'CF5A 100010' here its taking space between values SO THIS TEXT IN TEXT HEADER IS NOT MATCHING WITH PROGRAM VALE

'CF5A100010'

SO kindly help me on this.

hoping for some valuable input.

Edited by: Bhushan on Aug 13, 2009 9:52 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

U can use the below code

LEN = STRLEN( MATNR ).

VAL = 18 - LEN.

CONCATENATE VKORG VTWEG INTO STEXT1.

SHIFT STEXT1 RIGHT BY VAL PLACES.

CONCATENATE MATNR STEXT1 INTO STEXT.

11 REPLIES 11

former_member209217
Active Contributor
0 Kudos

Try using this.

Take one more variable and conactenate location and channel into a third variable and use condense statement.


CONCATENATE materialstorage   channel   into variable.
condense variable no gaps.

Regards,

Lakshman.

Bhushan_hs
Participant
0 Kudos

Hi Lakshman,

i can condense the gap in the program but i want to match this value in textname value in the teader of the text which is stored automatically so i want to add gap in my program to match with the value in name value of the text header.

0 Kudos

Hello


concatenate var1 var2 into var3 separated by space.

0 Kudos

Hi Bhushan,

Try separate by space as follows:

concatenate m_text1 m_text2 into m_text3 separated by space.

Regds,

Anil

0 Kudos

Then use SEPARATED BY SPACE addition with CONCATENATE

Former Member
0 Kudos

Hi,

Check this one, might work like wat u need

CONCATENATE Sales_org Dist_chan INTO STEXT.

CONCATENATE material STEXT INTO STEXT SEPARATED BY ' '.

Bhushan_hs
Participant
0 Kudos

Dear all,

see material number is 18 digit long .supose my material number is 'cfiof' my material number is 5 digits long so

my text name length is 1842 = 24 i.e material number + sales org + distribution channel

so i am not able to make my variable length of 24 by adding space to the material number to match text name in the material master.

0 Kudos

Hi Bhusan,

Try using this FM 'CONVERSION_EXIT_ALPHA_OUTPUT'


CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    input         =  MATERIALNUMBER
 IMPORTING
   OUTPUT        =   TEXTNAME 

Alternatively, if u need to get spaces WRITE INTO command with addition "RIGHT-JUSTIFIED".

 write var1 into var2 no-zero right justified.

Here var2 shuld be og length 24

Regards,

lakshman

Former Member
0 Kudos

Hi,

U can use the below code

LEN = STRLEN( MATNR ).

VAL = 18 - LEN.

CONCATENATE VKORG VTWEG INTO STEXT1.

SHIFT STEXT1 RIGHT BY VAL PLACES.

CONCATENATE MATNR STEXT1 INTO STEXT.

0 Kudos

Really Thanks for the Solution it was really critical issue.

Former Member
0 Kudos

Hi,

Concatenation will not work in this case. Use Offset in your case.

Ex: Material (Length = 18), Storage Location(Length is i tink 4) and IDstribution Channel(length is 2, please check in table).

Text+0(18) = Material.

Text+18(4) = Storage Location.

Text+22(2) = Distribution Channel.

Finally you will get combination of three field values in to TEXT field in a fixed format.

Regards,

Balaji Peethani.