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 to get storage Location Based on Plant

Former Member
0 Likes
4,043

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.

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

Former Member
0 Likes
2,128

Hi,

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

<b>Reward if hlepful.</b>

Read only

Former Member
0 Likes
2,128

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.

Read only

Former Member
0 Likes
2,128

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

Read only

Former Member
0 Likes
2,128

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.

Read only

Former Member
0 Likes
2,128

you can try fn module

LOCATION_READ_T001L

(i am in 4.7 version)...

regards

shiba dutta

Read only

0 Likes
2,128

hi Shiba,

should i take one more import parameter as werks_id.

i want to use existing selected plant.

can u help me out.

Read only

Former Member
0 Likes
2,128

Hi,

Try FM <b>LOCATION_READ_T001L</b>

reward if useful.