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

F4 help

madan_ullasa
Contributor
0 Likes
660

frnds,

below code does not work for parameter, but its working fine for select-options. y????

tables : mara , marc.

data : begin of itab occurs 0,

mat_no like mara-matnr,

end of itab.

data : matnr type matnr.

data t_return like ddshretval occurs 0 with header line.

  • select-options :

  • plant for marc-werks,

  • mat_no for mara-matnr.

parameters : plant like marc-werks,

mat_no like mara-matnr.

select matnr from marc into table itab where werks = plant.

at selection-screen on value-request for mat_no.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

DDIC_STRUCTURE = ''

retfield = ''

tables

value_tab = itab

  • FIELD_TAB =

RETURN_TAB = t_return

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE t_return INDEX 1.

mat_no = t_return-fieldval.

start-of-selection.

write:/ mat_no.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
556

hi madan

i have made a some changes to ur code

hope this works fine just check out...

tables : mara , marc.

data : begin of itab occurs 0,

mat_no like mara-matnr,

end of itab.

data : matnr type matnr.

data t_return like ddshretval occurs 0 with header line.

  • select-options :

  • plant for marc-werks,

  • mat_no for mara-matnr.

parameters : plant like marc-werks,

mat_no like mara-matnr.

select matnr from marc into table itab where werks = plant.

at selection-screen on value-request for mat_no.

DATA: L_RETFIELD TYPE DFIES-FIELDNAME.

DATA: T_FIELD like DFIES occurs 0 with header line,

T_RETURN like DDSHRETVAL occurs 0 with header line.

.

*Populate table t_values with matnr values

Select matnr

Into table itab

From mara.

  • POPULATE THE FIELD TABLE...

MOVE: 'MARA' TO T_FIELD-TABNAME,

'MATNR' TO T_FIELD-FIELDNAME.

APPEND T_FIELD. CLEAR T_FIELD.

L_RETFIELD = 'MATNR'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = L_RETFIELD

TABLES

VALUE_TAB = itab

FIELD_TAB = t_Field

RETURN_TAB = t_return

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

READ TABLE t_return INDEX 1.

mat_no = t_return-fieldval.

start-of-selection.

write:/ mat_no.

Regards

Hari

3 REPLIES 3
Read only

Former Member
0 Likes
556

for parameter give user-command 'ABC'.

parameters: p_matnr like mara-matnr user-command 'ABC'.

and try..

Read only

0 Likes
556

hi

either use user-command 'ABC'

or

declare like this

select-options: p_matnr for mara-matnr no-extension no intervals.

and chnage the select query by changing it in where clause ie. MATNR in p_MATNR.

PLZ REWARD POINTS IF IT HELPS!!

Thanks and Regards

Gunjan

Read only

Former Member
0 Likes
557

hi madan

i have made a some changes to ur code

hope this works fine just check out...

tables : mara , marc.

data : begin of itab occurs 0,

mat_no like mara-matnr,

end of itab.

data : matnr type matnr.

data t_return like ddshretval occurs 0 with header line.

  • select-options :

  • plant for marc-werks,

  • mat_no for mara-matnr.

parameters : plant like marc-werks,

mat_no like mara-matnr.

select matnr from marc into table itab where werks = plant.

at selection-screen on value-request for mat_no.

DATA: L_RETFIELD TYPE DFIES-FIELDNAME.

DATA: T_FIELD like DFIES occurs 0 with header line,

T_RETURN like DDSHRETVAL occurs 0 with header line.

.

*Populate table t_values with matnr values

Select matnr

Into table itab

From mara.

  • POPULATE THE FIELD TABLE...

MOVE: 'MARA' TO T_FIELD-TABNAME,

'MATNR' TO T_FIELD-FIELDNAME.

APPEND T_FIELD. CLEAR T_FIELD.

L_RETFIELD = 'MATNR'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = L_RETFIELD

TABLES

VALUE_TAB = itab

FIELD_TAB = t_Field

RETURN_TAB = t_return

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

READ TABLE t_return INDEX 1.

mat_no = t_return-fieldval.

start-of-selection.

write:/ mat_no.

Regards

Hari