2008 Jun 12 8:30 AM
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.
2008 Jun 12 8: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.
2008 Jun 12 8: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.
2008 Jun 12 8: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.
2008 Jun 12 8: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
2008 Jun 12 9:06 AM
2008 Jun 12 9: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
2008 Jun 12 9:18 AM
2008 Jun 12 11:29 AM
Hi,
Problem solved....there was mismatch in data type thanks all...