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: 

passing value range to function module

Former Member
0 Kudos

Hi

Im going to use bom explosion FM CS_BOM_EXPL_MAT_V2 to fetch data.

In my requirement, there are range of WERKS and MATNR i.e. Select-option, which has to be given from selection screen, where as In CS_BOM_EXPL_MAT_V2 function module I can only give single value for WERKS and MATNR.

Can any one guide me how can I implement this?

Thank you in advance

1 ACCEPTED SOLUTION

Private_Member_1084
Active Contributor
0 Kudos

Hello,

Depending on WERKS & MATNR select data from MARC into an internal table. Loop at the int. table & call the FM.


SELECT MATNR WERKS INTO ITAB
WHERE
MATNR IN S_MATNR
AND WERKS IN S_WERKS.

IF SY-SUBRC = 0.

LOOP AT ITAB INTO WA.
" Call the FM using WA-MATNR & WA-WERKS
ENDLOOP.

ENDIF.

BR,

Suhas

3 REPLIES 3

Private_Member_1084
Active Contributor
0 Kudos

Hello,

Depending on WERKS & MATNR select data from MARC into an internal table. Loop at the int. table & call the FM.


SELECT MATNR WERKS INTO ITAB
WHERE
MATNR IN S_MATNR
AND WERKS IN S_WERKS.

IF SY-SUBRC = 0.

LOOP AT ITAB INTO WA.
" Call the FM using WA-MATNR & WA-WERKS
ENDLOOP.

ENDIF.

BR,

Suhas

Former Member
0 Kudos

HI,

Best way is to get matnr plant data from marc based on all your selection criterion..

LOOP on this tab.

"Call FM CS_BOM_EXPL_MAT_V2....

Append the return tab in an internal table and clear it..

ENDLOOP.

you have data for all your material plant combinations in internal tab.

Former Member
0 Kudos

Solved.

Thank you so much from both of you.