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: 

Handle multiple material numbers as import parameter in a function module

Former Member
0 Kudos

Hello Folks,

I want to handle multiple material numbers as import parameters.. I have tried using table types but having problem while reading the data....

My requirement is user will input say 10 materials , now i need to get all the information for that particular material ..

I am unable to use for all entries as it is saying that it is not internal table... I have found table types which is having sigon , option, low and high fields but user doesn't want it... He wants to enter only materials... Currently am using this MD_T_MATNR(table type)

I am stuck up here..

Appreciate any kind of help.

Regards,

Raj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

it looks like you are on a good way, just something little is missing. Type MD_T_MATNR is suitable for your issue. I have tried it and probably your problem is that You have to use

SELECT ... FOR ALL ENTRIES IN it_matnr WHERE mara~matnr EQ it_matnr~table_line.

instead of

SELECT ... FOR ALL ENTRIES IN it_matnr WHERE mara~matnr EQ it_matnr~matnr.

In this example I suppose that a name of your variable of type MD_T_MATNR is it_matnr. Problem is that table line is not structure, but data element, therefore You have to use ~table_line instead of ~matnr.

Hope it helps.

Adrian

6 REPLIES 6

Pawan_Kesari
Active Contributor
0 Kudos

Define Range Table type using SE11 for material and use that range table type as importing parameter in FM.

Edited by: Pawan Kesari on Jan 28, 2010 5:14 PM

Just an update, there are already table types defined in dictionary which you can use

BVNE_MATERIAL_T

ISM_MATNR_TAB

MD_T_MATNR

MMPURUI_MATNR_TTY

RJPMEDIAISSUE

TABLE_MATNR

WSAO_TAB_MATERIAL

Edited by: Pawan Kesari on Jan 28, 2010 5:17 PM

Former Member
0 Kudos

hi

you can define in table parameter.

lt_table like zmat_str_material in table parameter.

just suggestion.

Former Member
0 Kudos

Hi,

it looks like you are on a good way, just something little is missing. Type MD_T_MATNR is suitable for your issue. I have tried it and probably your problem is that You have to use

SELECT ... FOR ALL ENTRIES IN it_matnr WHERE mara~matnr EQ it_matnr~table_line.

instead of

SELECT ... FOR ALL ENTRIES IN it_matnr WHERE mara~matnr EQ it_matnr~matnr.

In this example I suppose that a name of your variable of type MD_T_MATNR is it_matnr. Problem is that table line is not structure, but data element, therefore You have to use ~table_line instead of ~matnr.

Hope it helps.

Adrian

0 Kudos

Thanks adrian. thanks others as well for looking into this

Regards,

Raj

former_member217544
Active Contributor
0 Kudos

Hi Kumar,

Can you post your code so that it is easy to suggest on what went wrong.

Regards,

Swarna Munukoti.

kesavadas_thekkillath
Active Contributor
0 Kudos

Get the materials in a table type.

Move it into a range and use 'in' statement in your query.