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: 

Function Module to get storage Location Based on Plant

Former Member
0 Kudos

Hi friends,

i wanna to fatch storage location based on plant in the function module.

in the function module import parameter is

field id = 'plant'

table itab.

it select all plant from table T001W.

i want to storage location based on Plant in Function module.

Thanks.

7 REPLIES 7

Former Member
0 Kudos

Hi,

You can fech all the storage location for a plant from table <b>T001L</b>.

<b>Reward if hlepful.</b>

Former Member
0 Kudos

hi,

use this code, it will display only selected data.

In POV (Process on value request)

field 'plant' module get_help.

and write module like below.

select sloc from t001w into corresponding fields of table itab where plant eq <plant>.

SELECT * FROM zgpack INTO CORRESPONDING FIELDS OF TABLE izgpack.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'TEST'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'TEST'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = itab.

Former Member
0 Kudos

Rashmi,

For this there is no need to use a separate FM, just write a simple select query to table T001L. You can observe T001L will have all storage locations maintined against the plants.

Example :

Select werks lgort

from T001L

into table i_t001l

where werks eq <i>Plant</i>.

After this use appropriate Read Table statement to validate or to use data.

ALL THE VERY BEST.

- Vamsi

Former Member
0 Kudos

thanks for ur Response,

but my quary is that.in my function module i am geting plant data from table t100w. but in the function module how the user select plant and get storage location.

do i use Read statement.

code: for Plant

SELECT werks name1 spras FROM t001w INTO it.

it-field_id = 'PLANT'.

APPEND it.

CLEAR it.

ENDSELECT.

ENDIF.

code for storage location

SELECT lgort lgobe

FROM t001l INTO itab .

but it fatching all storage location.

i want to use where condition for storage location.

please help me.

Former Member
0 Kudos

you can try fn module

LOCATION_READ_T001L

(i am in 4.7 version)...

regards

shiba dutta

0 Kudos

hi Shiba,

should i take one more import parameter as werks_id.

i want to use existing selected plant.

can u help me out.

Former Member
0 Kudos

Hi,

Try FM <b>LOCATION_READ_T001L</b>

reward if useful.