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

F4IF_INT_TABLE_VALUE_REQUEST

Former Member
0 Likes
1,428

Hi Experts,

See the below code.

REPORT YTEST_VALUE_REQUEST.

TABLES: VBAK.

DATA: BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBAK-VBELN,

VKORG LIKE VBAK-VKORG,

ERNAM LIKE VBAK-ERNAM,

KUNNR LIKE VBAK-KUNNR,

END OF ITAB.

DATA: W_REPID LIKE SY-REPID,

W_DYNNR LIKE SY-DYNNR.

W_REPID = SY-REPID.

SELECT-OPTIONS: S_KUNNR FOR VBAK-KUNNR.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_KUNNR-LOW.

SELECT VBELN VKORG ERNAM KUNNR FROM VBAK INTO TABLE ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'KUNNR'

  • PVALKEY = ' '

DYNPPROG = W_REPID

DYNPNR = W_DYNNR

DYNPROFIELD = 'S_KUNNR-LOW'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = ITAB

  • FIELD_TAB =

  • RETURN_TAB =

  • 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.

after exicuting i am able to see the list but when i select a perticular value in the list it is not capturing in the selection screen .

what may be the wrong in the code?..

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,360

Hi,

There is no need to write Function Module for this one.Since VBAK is a Standard Table ,the values for F4 Request will come Automatically.

Regards,

Padmam.

10 REPLIES 10
Read only

Former Member
0 Likes
1,360

Hi,

Try populating the W_DYNNR with the value 1000

Then pass that value to the function module

Thanks

Naren

Read only

gopi_narendra
Active Contributor
0 Likes
1,360

<b>data : IT_RETURN type standard table of DDSHRETVAL initial size 0,</b>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'KUNNR'

  • PVALKEY = ' '

DYNPPROG = W_REPID

DYNPNR = W_DYNNR

DYNPROFIELD = 'S_KUNNR-LOW'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = ITAB

  • FIELD_TAB =

<b> RETURN_TAB = IT_RETURN</b>

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3.

Include the ones in <b>BOLD</b> that will solve ur problem.

Regards

Gopi

Read only

Former Member
0 Likes
1,361

Hi,

There is no need to write Function Module for this one.Since VBAK is a Standard Table ,the values for F4 Request will come Automatically.

Regards,

Padmam.

Read only

sivasatyaprasad_yerra
Product and Topic Expert
Product and Topic Expert
0 Likes
1,360

Hi Ravi,

The problem is with the "<b>W_DYNNR</b>" value. This is not initialized. That to this initialization should be done after "AT SELECTION-SCREEN" statement.

So, include these statements after AT SELECTION-SCREEN statement.

W_REPID = SY-REPID.

W_DYNNR = SY-DYNNR.

This will work for sure. please check & assign the points.

Regards,

Siva.

Read only

Former Member
0 Likes
1,360

Do not use w_repid or w_dynnr in FM. direstly pass sy-repid and sy-dynnr.

your problem will get solve

regards,

Ruchika.

Read only

Former Member
0 Likes
1,360

put w_dynnr = sy-dynnr..before the call

the screen number is not getting a value in the call...thats why the problem

Read only

Former Member
0 Likes
1,360

RAVI,

To getthose fields in youe sel screen you need to add this:

declare retun_tab as :

DATA: return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

write return_tab = return_tab in function module (table)

After function module write this:

IF sy-subrc = 0.

READ TABLE itab INDEX 1.

p_skillg = return_tab-fieldval.

ENDIF.

This will definetly work.

Thanks,

Shweta

Message was edited by:

Shweta Verma

It worked???? Please close the thread in case it worked

Read only

Former Member
0 Likes
1,360

Hi Ravi,

Check this example : -

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_extwg-low.

PERFORM search_help_extwg USING 'S_MATKL-LOW' 'S_MATKL-HIGH'

s_extwg-low '1000'.

&----


*& Form search_help_extwg

&----


  • text

----


FORM search_help_extwg USING p_low p_high p_append p_screen.

DATA: BEGIN OF t_values OCCURS 2,

prodh LIKE t179-prodh ,

vtext LIKE t179t-vtext,

END OF t_values.

DATA : t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

*

DATA : lv_low(30) .

DATA : lv_high(30).

RANGES : r_prodh FOR t179-prodh .

DATA : gt_dynp LIKE dynpread OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = p_screen

request = 'A'

TABLES

dynpfields = gt_dynp

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

CLEAR : gt_dynp.

READ TABLE gt_dynp WITH KEY fieldname = p_low.

lv_low = gt_dynp-fieldvalue.

CLEAR : gt_dynp.

READ TABLE gt_dynp WITH KEY fieldname = p_high.

lv_high = gt_dynp-fieldvalue.

IF lv_low IS INITIAL AND

lv_high IS INITIAL .

MESSAGE text-001 TYPE 'S'.

REJECT.

ENDIF.

  • Value range to be shown

r_prodh-sign = 'I'.

r_prodh-option = 'BT'.

IF NOT lv_low IS INITIAL.

CONCATENATE lv_low+0(5) text-005 INTO r_prodh-low.

ELSE.

CONCATENATE lv_high+0(5) text-005 INTO r_prodh-low.

ENDIF.

IF lv_high IS INITIAL.

CONCATENATE lv_low+0(5) text-009 INTO r_prodh-high.

ELSE.

CONCATENATE lv_high+0(5) text-009 INTO r_prodh-high.

ENDIF.

APPEND r_prodh.

  • Values to be shown

SELECT prodh FROM t179 INTO TABLE t_values

WHERE prodh IN r_prodh

AND stufe = '2'.

LOOP AT t_values.

SELECT SINGLE vtext FROM t179t INTO t_values-vtext

WHERE spras = sy-langu AND

prodh = t_values-prodh.

MODIFY t_values.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'PRODH'

value_org = 'S'

TABLES

value_tab = t_values

return_tab = t_return

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

READ TABLE t_return INDEX 1.

p_append = t_return-fieldval.

ENDIF.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,360

Hi,

Try this code and reward points if it helps.

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

select-options s_begru for kna1-begru.

at selection-screen on value-request for s_begru-low.

refresh t_values.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

<b>return_tab = t_return</b>

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

<b>if sy-subrc = 0.

read table t_return index 1.

s_begru-low = t_return-fieldval.

endif.</b>

Read only

Former Member
0 Likes
1,360

hi ravi,

y do u want f4 help for customer field when it has default searc help for this kunnr field,

that like this(as u coded) u can't get f4 help,

requirement should be like this,

just see the below code,

parameter: p_kunnr like kan1-kunnr.

select-options: s_vbeln for vbak-vbeln.

now u can write AT SELECTION-SCREEN ON VALUE-REQUEST FOR <b>s_vbeln</b>.

SELECT VBELN VKORG ERNAM KUNNR FROM VBAK INTO TABLE ITAB where kunnr = p_kunnr.

"now u can call function module 'F4IF_INT_TABLE_VALUE_REQUEST' and fill the parameters like below.

TABLES: vbak.

DATA: BEGIN OF itab OCCURS 0,

vbeln LIKE vbak-vbeln,

vkorg LIKE vbak-vkorg,

ernam LIKE vbak-ernam,

kunnr LIKE vbak-kunnr,

END OF itab.

DATA: w_repid LIKE sy-repid,

w_dynnr LIKE sy-dynnr,

it_return like ddshretval occurs 0 with header line.

w_repid = sy-repid.

parameter: p_kunnr like knA1-kunnr.

select-options: s_vbeln for vbak-vbeln.

SELECT VBELN VKORG ERNAM KUNNR FROM VBAK INTO TABLE ITAB where kunnr = p_kunnr.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

  • DDIC_STRUCTURE =

retfield = 'VBELN'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'VBAK-VBELN'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = 'F'

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = itab

  • FIELD_TAB = IT_FIELD

return_tab = it_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.

regards,

seshu.