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

DEFINE & INCLUDE in Form?

Former Member
0 Likes
871

Hi,

I use this code to read text from MRP 4 view Material Memo (MM03)


DEFINE &LV_MATNR& := '&LTAP-MATNR&&LTAP-WERKS&'
INCLUDE &LV_MATNR& OBJECT MDTXT ID LTXT LANGUAGE 'E' PARAGRAPH LV

But, LV_MATNR is = 260DE10

I need LV_MATNR to be = 260 space space space space space space space DE10

How can I achieve this?

Adibo..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
787

Hello,

Try concatenating the value in a new variable,

something lilke this:

On the sapcript:

....

PERFORM concat IN PROGRAM ZXXX using &LV_MATNR& changing &string&

INCLUDE &string& OBJECT MDTXT ID LTXT LANGUAGE 'E' PARAGRAPH LV

.....

" Do it calling an external form.

form concat TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

data: string type string, LV_MATNR(7)

READ TABLE in_tab INDEX 1.

LV_MATNR = in_tab-value.

concatenate LV_MATNR(3) LV_MATNR+3(4) into string separated by space.

READ TABLE out_tab INDEX 1.

out_tab-value = string.

MODIFY out_tab INDEX 1.

endform.

Dont forget to reward!!!

Gabriel P.

6 REPLIES 6
Read only

Former Member
0 Likes
787

You could try like this.

data: lv_blank(1).
lv_blank = space.
DEFINE &LV_MATNR& := '&LTAP-MATNR&&lv_blank&&LTAP-WERKS&'
INCLUDE &LV_MATNR& OBJECT MDTXT ID LTXT LANGUAGE 'E' PARAGRAPH LV

REgards,

Vasanth

Read only

0 Likes
787

Problem is that I dont know how many spaces I need..

I you look in MM03 --> MRP 4 --> button Material Memo --> Go to --> Header

You wil see what I mean..:)

Read only

Former Member
0 Likes
788

Hello,

Try concatenating the value in a new variable,

something lilke this:

On the sapcript:

....

PERFORM concat IN PROGRAM ZXXX using &LV_MATNR& changing &string&

INCLUDE &string& OBJECT MDTXT ID LTXT LANGUAGE 'E' PARAGRAPH LV

.....

" Do it calling an external form.

form concat TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

data: string type string, LV_MATNR(7)

READ TABLE in_tab INDEX 1.

LV_MATNR = in_tab-value.

concatenate LV_MATNR(3) LV_MATNR+3(4) into string separated by space.

READ TABLE out_tab INDEX 1.

out_tab-value = string.

MODIFY out_tab INDEX 1.

endform.

Dont forget to reward!!!

Gabriel P.

Read only

0 Likes
787

I know this..But I want to try to slove this problem within sap script..:)

thanx.

Read only

Former Member
0 Likes
787

use READ_TEXT to get the same by using Subroutines in Scripts.

Regards

Peram

Read only

Former Member
0 Likes
787

is realy simpel..::)



/: DEFINE &LV_MATNR& := '&LTAP-MATNR(19)&&LTAP-WERKS(4)&'
/: INCLUDE &LV_MATNR& OBJECT MDTXT ID LTXT LANGUAGE 'E' PARAGRAPH LI