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 filtering problem in selection screen

Former Member
0 Likes
911

Hi everyone,

I just want to filtering order numbers by using order type.In my structure I use order number,order material number,batch number and order type.Here is the code below but I get the all records when I press the f4 help in order number field on selection screen.

data :gt_itab type table of zmystruct with header line.

..

...

...

SELECT afko~aufnr into corresponding fields of table gt_itab

FROM aufk inner join afko on aufkaufnr = afkoaufnr

WHERE aufk~auart = 'MI03'.

And I tried this also..Maybe works..:)

SELECT afpoaufnr aufkauart afpomatnr afpocharg

INTO CORRESPONDING FIELDS OF TABLE gt_itab

FROM afpo inner join aufk on afpoaufnr = aufkaufnr

WHERE p_aufnr = gt_itab-aufnr

and aufk~auart = 'MI03'.

but no result.All the records return again...??

Regards.

Edited by: ozcandemirbilek on Feb 10, 2011 9:39 AM

1 ACCEPTED SOLUTION
Read only

pradiptakumar_mishra
Participant
0 Likes
828

Hi,

If you need your own custom F4 then you need to code the logic inside an event. If it is a report then use 'AT SELECTION-SCREEN ON VALUE-REQUEST FOR <screen field name> ' else if it is a module pool, then use 'PROCESS ON VALUE-REQUEST'.

Then you need to use the FM 'F4IF_INT_TABLE_VALUE_REQUEST' to show the relevant result.

Hope it helps you.

Thanks and Regards

Pradipta Kumar Mishra

4 REPLIES 4
Read only

pradiptakumar_mishra
Participant
0 Likes
829

Hi,

If you need your own custom F4 then you need to code the logic inside an event. If it is a report then use 'AT SELECTION-SCREEN ON VALUE-REQUEST FOR <screen field name> ' else if it is a module pool, then use 'PROCESS ON VALUE-REQUEST'.

Then you need to use the FM 'F4IF_INT_TABLE_VALUE_REQUEST' to show the relevant result.

Hope it helps you.

Thanks and Regards

Pradipta Kumar Mishra

Read only

0 Likes
828

Hi Pradipta Kumar Mishra,

Firstly thank you so much for your answer.I used my custom f4 help function but on selection screen I am getting default f4 help.

form f4_help.

DATA: BEGIN OF itab_aufk OCCURS 0,

aufnr like afpo-aufnr,

auart like aufk-auart,

END OF itab_aufk.

DATA it_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

SELECT afpo~aufnr

FROM afpo INNER JOIN aufk on afpoaufnr = aufkaufnr

INTO CORRESPONDING FIELDS OF itab_aufk

WHERE aufk~auart eq 'MI03''.

APPEND itab_aufk.

ENDSELECT.

SORT itab_aufk BY aufnr.

CLEAR itab_aufk.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'AUFNR'

window_title = 'order master data'

value_org = 'S'

"DISPLAY = 'AUFNR'

DYNPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'AUFNR'

TABLES

value_tab = itab_aufk

return_tab = it_return

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

CLEAR itab_aufk.

READ TABLE it_return INDEX 1.

itab_aufk-aufnr = it_return-aufnr.

READ TABLE itab_aufk WITH KEY itab_aufk-aufnr.

if sy-subrc eq 0.

endif.

ENDIF.

REFRESH itab_aufk. CLEAR: itab_aufk.

ENDFORM.

Do you have any ideas how can I use my custom f4 help?.I mean that,

at selection-screen.

"if sscrfields-ucomm eq '?F4..keypress..?'"

Is there any way like this?

Thank you so much and regards.

ZCN

Edited by: ozcandemirbilek on Feb 10, 2011 2:35 PM

Read only

0 Likes
828

I am curious why you need your custom F4 help? As far as I can see there are search helps to get orders by order type... You can use either of the below search helps (collective or individual)...


select-options so_order FOR AUFK-AUFNR MATCHCODE OBJECT CO_SH_PRODORD_AUART .
select-options so_order FOR AUFK-AUFNR MATCHCODE OBJECT CO_SH_PRODORD_ALL .

And there are multiple threads in SDN, if you are still interested in doing it thru custom F4 help.. search with 'F4IF_INT_TABLE_VALUE_REQUEST'

Read only

0 Likes
828

Hi Kris,

Thanks for your answer.When I am using default f4 help,I got so much datas.I need the select criteria which returns MI03 order type for the performance.By the way your opinion very useful.It helped me.

Thanks and regards.