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

Handle multiple material numbers as import parameter in a function module

Former Member
0 Likes
1,519

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
Read only

Former Member
0 Likes
1,211

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
Read only

Pawan_Kesari
Active Contributor
0 Likes
1,211

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

Read only

Former Member
0 Likes
1,211

hi

you can define in table parameter.

lt_table like zmat_str_material in table parameter.

just suggestion.

Read only

Former Member
0 Likes
1,212

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

Read only

0 Likes
1,211

Thanks adrian. thanks others as well for looking into this

Regards,

Raj

Read only

former_member217544
Active Contributor
0 Likes
1,211

Hi Kumar,

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

Regards,

Swarna Munukoti.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,211

Get the materials in a table type.

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