Application Development and Automation 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: 
Read only

Read_text problem

Former Member
0 Likes
696

Hi sap gurus,

I have an issue to read text function module.

My text name is shown as matnr 9 spaces then sales org and distribution channel.

Eg 400001542 100070

I am unable to concatenate this as text name .How to try this give me some suggestions.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

u can use the following:

move matnr to variable

move vkorg to variable+18(4)

move vtweg to variable+22(2)

5 REPLIES 5
Read only

Former Member
0 Likes
658

Hi Sriram:

Is not clear for me all your explanation, please paste some code about your program, otherwise help you is hard.

One propousal:


DATA: TEXT(72) C.
CONTATENATE ITAB-MATNR  ITAB-VKORG  ITAB-VTWEG  INTO  TEXT SEPARATE BY '/'.

Don't work for you this piece of code?

Regards

José Luis.

Read only

Former Member
0 Likes
658

Can't be very difficult...:-

lt_header-tdname = lv_matnr.
lt_header-tdname+17(4) = lv_vkorg.
lt_header-tdhane+21(2) = lv_vtweg.

Read only

Former Member
0 Likes
659

u can use the following:

move matnr to variable

move vkorg to variable+18(4)

move vtweg to variable+22(2)

Read only

brad_bohn
Active Contributor
0 Likes
658

When in doubt, always go back and read the help files - the answer you require for CONCATENATE is right there...here's a clue - look at extra option #3.

Read only

Former Member
0 Likes
658

Hi,

Actually, if I read the question correctly, the issue is that the material should be reformatted for output before being used in the concatenation and, therefore, concatenate may not be applicable because of the embedded spaces.

I would suggest something like...


CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'  (Use the pattern button to get this - may need ALPHA not MATN1)
  EXPORTING 
    INPUT     = YOUR_MATNR_FIELD
  IMPORTING
    OUTPUT     = LV_MATNR.
CLEAR L_TDNAME.
L_TDNAME = LV_MATNR.
L_TDNAME+18(4) = YOUR_VKORG.
L_TDNAME+22(2) = YOUR_VTWEG.
* Use resulting L_TDNAME as your text name

Hope I understood correctly.

Regards, Andy