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

How to retrieve the basic data text in material master to SAPSCRIPT?

Former Member
0 Likes
2,800

Besides using the function module READ_TEXT in the calling program, what alternatives are there if I don't want to modify the program but make changes in the sapscript only?

I've tried to use the include statement in the sapscript editor, but I don't know how to call the text object whose ID is GRUN, object is MATERIAL.

Should I use the include statement or any other ways to do it?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,244

Macy,

If you get this error (4) it means that you haven't set up the text for your material.

Use MM02->Additional data/Basic data tab.

If you call the editor and Goto/Header it will display all the necessary information for you in order to extract this text. I found it very useful in many occasions.

Thanks,

Wojtek

5 REPLIES 5
Read only

Former Member
0 Likes
1,244

Macy,

Try this:

INCLUDE &MY_MATNR& OBJECT MATERIAL ID 0001

Tag column must be set to '/:'

Thanks,

Wojtek

Read only

Former Member
0 Likes
1,244

The statement should be

INCLUDE <b>&MARA-MATNR&</b> OBJECT MATERIAL ID GRUN LANGUAGE &SY-LANGU&

<b>MARA-MATNR</b> needs to be replaced with the variable that contains the material number at runtime.

Rishi

Read only

0 Likes
1,244

Thanks for replying this message.

But the problem is that the object is not found,

as I tried to print &SAPSCRIPT-SUBRC& and 4 is resulted.

I've tried:

/:INCLUDE &MARA-MATNR& OBJECT MATERIAL ID GRUN LANGUAGE &SY-LANGU&

and

/:INCLUDE &ISEG-MATNR& OBJECT MATERIAL ID GRUN LANGUAGE &SY-LANGU&

But nothing is displayed. Anything wrong?

Read only

Former Member
0 Likes
1,245

Macy,

If you get this error (4) it means that you haven't set up the text for your material.

Use MM02->Additional data/Basic data tab.

If you call the editor and Goto/Header it will display all the necessary information for you in order to extract this text. I found it very useful in many occasions.

Thanks,

Wojtek

Read only

0 Likes
1,244

Wojtek,

Yes, Thanks!

I just found the solution.

I should have known the method to find the text name by going to the header to view it.

And it works well.

Another method is to create a program containing a subroutine for the sapscript to call.