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

Function Module

Former Member
0 Likes
403

<b>Hi friends

I need to create function module to get material text for a given material in given language.</b>

4 REPLIES 4
Read only

former_member404244
Active Contributor
0 Likes
340

hI,

in the import parameters specify material number and in tables parameter define one structure like makt.

in import parameter

P_matnr like mara-matnr

in tables parameter write this

itab like makt

now in source code

write

select matnr maktx spras from makt into table itab where matnr = p_matnr.

Regards,

nagaraj

Read only

Former Member
0 Likes
340

create function module like this :

*"----


""Local Interface:

*" IMPORTING

*" VALUE(MATNR) TYPE MATNR OPTIONAL

*" VALUE(LENG) TYPE SPRAS OPTIONAL

*" EXPORTING

*" VALUE(MAKTX) TYPE MAKTX

*"----


select maktx from makt into maktx

where matnr eq matnr

and spras eq leng.

endselect.

Reward points, if helpful,

Sandeep Kaushik

Read only

Former Member
0 Likes
340

Hi Tiwari,

There is already a standard FM for this.

MD_MATERIAL_GET_TEXT

Regards,

Sachin

Reward if helpful********

Read only

Former Member
0 Likes
340

Hi,

Do a select against MAKT.


parmaters: p_matnr type mara-matnr.
 
data: xmaktx type makt-maktx.
 
Select maktx into xmaktx from makt
          where matnr = p_matnr
            and spras = sy-langu.

Regards,

Omkar.