Skip to Content

F4 help through internal table.

Hi Experts,

I have a small doubt regarding F4 help through internal table.

I am not getting the value of P_MATNR-LOW on the selection screen. Can anyone please let me know what wrong when passing ITAB_SELECTED_MATNR-FIELDVAL to P_MATNR.

When debugging it I get value for ITAB_SELECTED_MATNR-FIELDVAL and also it in P_MATNR-LOW, but wen the screen appears it shows blank value for P_MATNR-LOW.

select-options p_matnr FOR ZZZ_STOCKTYPE-STOCKTYP .

data : BEGIN OF GT_VALUETAB OCCURS 0,

F1 type char30,

END OF GT_VALUETAB.

DATA: ITAB_SELECTED_MATNR TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

initialization.

do 20 times.

move sy-index to GT_VALUETAB.

append GT_VALUETAB.

enddo.

at selection-screen on value-request for p_matnr-LOW.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'F1'

value_org = 'S'

TABLES

VALUE_TAB = GT_VALUETAB

return_tab = ITAB_SELECTED_MATNR

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC eq 0.

READ TABLE ITAB_SELECTED_MATNR INDEX 1.

MOVE ITAB_SELECTED_MATNR-FIELDVAL TO P_MATNR-LOW .

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2008 at 07:36 AM

    HI,

    Try the below code

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
        retfield = 'LGART'
        dynpprog = sy-cprog
        dynpnr = sy-dynnr
        dynprofield = 'I_LGTXT-LGART'
        value_org = 'S'
    TABLES
        value_tab = i_lgtxt[]
    EXCEPTIONS
        parameter_error = 1
        no_values_found = 2
        OTHERS = 3.
    IF sy-subrc EQ 0.
      s_lgart-low  = I_LGTXT-LGART.
    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2008 at 07:42 AM
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'F1'
    DYNPPROG  = sy-cprog
    DYNPNR = sy-dynnr
    DYNPROFIELD = 'P_MATNR'
    value_org = 'S'
    TABLES
    VALUE_TAB = GT_VALUETAB
    return_tab = ITAB_SELECTED_MATNR
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3.
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2008 at 07:55 AM

    Hi,

    I did the following things: Did not work....

    at selection-screen on value-request for p_matnr-LOW.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    RETFIELD = 'F1'

    window_title = 'Material Numbers'

    • value = '*'

    DYNPPROG = sy-cprog

    DYNPNR = sy-dynnr

    DYNPROFIELD = 'P_MATNR' (also tried with P_MATNR-LOW)

    value_org = 'S'

    TABLES

    VALUE_TAB = GT_VALUETAB

    return_tab = ITAB_SELECTED_MATNR

    EXCEPTIONS

    PARAMETER_ERROR = 1

    NO_VALUES_FOUND = 2

    OTHERS = 3.

    IF SY-SUBRC eq 0.

    READ TABLE ITAB_SELECTED_MATNR INDEX 1.

    MOVE ITAB_SELECTED_MATNR-FIELDVAL TO P_MATNR-low .

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2008 at 07:56 AM

    Hi,

    try this....

    select-options p_matnr FOR ZZZ_STOCKTYPE-STOCKTYP

    data : BEGIN OF GT_VALUETAB OCCURS 0,

    F1 type char30,

    END OF GT_VALUETAB.

    DATA: ITAB_SELECTED_MATNR TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

    initialization.

    do 20 times.

    move sy-index to GT_VALUETAB.

    append GT_VALUETAB.

    enddo.

    at selection-screen on value-request for p_matnr-LOW.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    RETFIELD = 'F1'

    DYNPPROG = SY-REPID

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'P_MATNR'

    value_org = 'S'

    TABLES

    VALUE_TAB = GT_VALUETAB

    return_tab = ITAB_SELECTED_MATNR

    EXCEPTIONS

    PARAMETER_ERROR = 1

    NO_VALUES_FOUND = 2

    OTHERS = 3.

    IF SY-SUBRC eq 0.

    READ TABLE ITAB_SELECTED_MATNR INDEX 1.

    MOVE ITAB_SELECTED_MATNR-FIELDVAL TO P_MATNR-LOW .

    ENDIF.

    regrds

    dhaya

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2008 at 08:06 AM

    Not yet , tried all above mentioned suggestions...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2008 at 08:16 AM
    REPORT ztest.
    TABLES:
      mara.
    
    SELECT-OPTIONS p_matnr FOR mara-matnr .
    
    DATA : BEGIN OF gt_valuetab OCCURS 0,
    f1 LIKE mara-matnr,
    END OF gt_valuetab.
    
    
    DATA: itab_selected_matnr TYPE ddshretval OCCURS 0 WITH HEADER LINE.
    
    INITIALIZATION.
    
      DO 20 TIMES.
        MOVE sy-index TO gt_valuetab.
        APPEND gt_valuetab.
      ENDDO.
    
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr-low.
    
    
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'F1'
          value_org       = 'S'
    *      dynpprog        = sy-repid
    *      dynpnr          = sy-dynnr
    *      dynprofield     = 'P_MATNR-LOW'
        TABLES
          value_tab       = gt_valuetab
          return_tab      = itab_selected_matnr
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    
      IF sy-subrc EQ 0.
        READ TABLE itab_selected_matnr INDEX 1.
        MOVE itab_selected_matnr-fieldval TO p_matnr-low .
      ENDIF.
    

    Check the above code

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2008 at 08:18 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 12, 2008 at 10:29 AM

    Hi,

    Problem solved....there was mismatch in data type thanks all...

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.