Skip to Content
avatar image
Former Member

Function Module to get storage Location Based on Plant

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 10:48 AM

    Hi,

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

    <b>Reward if hlepful.</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 10:49 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 10:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 11:08 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 11:17 AM

    you can try fn module

    LOCATION_READ_T001L

    (i am in 4.7 version)...

    regards

    shiba dutta

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi Shiba,

      should i take one more import parameter as werks_id.

      i want to use existing selected plant.

      can u help me out.

  • avatar image
    Former Member
    Aug 20, 2007 at 11:51 AM

    Hi,

    Try FM <b>LOCATION_READ_T001L</b>

    reward if useful.

    Add comment
    10|10000 characters needed characters exceeded