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

search help in dialog program

Former Member
0 Likes
2,279

Hi all,

Fora search help in dialog program.

I HAVE TO GET SEARCH FOR A FIELD ZID ON APARTICULAR SCREEN BASED ON DATA, MODIFIED BY AND A PLANT..

I HAVE A RECORD IN ONE MY ZTABLE.

I HAVE TO GET THAT BY SEVERAL SEARCH PARAMETERS SAY BY DATE , MODIFIED BY,PLANT ETC.

each user has been assigned a plant , so in search he has to get records belonging to that plant.

so i cannot include plant in my search help, because user may type in other plant.

so i tried two ways

1) i created a search help in se11 including the plant field again the problem arises if the user types a different plant.

so i want to know whether we can apassa value to plant field in search help(i.e the plant assigned to the user),

i have this kind of thing in some standard t -code i.e especially for searching material , the plant field in search help was filled by one plant.

this should be one of the solution

2)I tried to write a code in pov of program code.

this is how my code looks.

DATA : BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE ZXXX.

DATA : END OF ITAB.

ITAB HAS FIELDS ID, DATE , MODIFIEDBY , PLANT.

USER_PLANT = 'ABC'.

SELECT * FROM ZXXX INTO TABLE ITAB WHERE PLANT = USER_PLANT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'ZID'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

WINDOW_TITLE = 'TEST'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = ITAB

  • FIELD_TAB =

RETURN_TAB = IT_RETURN4

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

if sy-subrc = 0.

clear itab.

read table it_return4 index 1.

ZXXX-ZID = it_return4-fieldval.

endif.

THIS WORKS FINE , BUT HE CANNOT SEARCH BASED ON DATE AND MODIFIEDBY

ALL i want is is get a pop up window and should be able to search based on data and modifiedby for a predifined plant.

I hope iam clear.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,636

Hi,

Try to filter the data by the plant for the user using the search help exit..

Check the following for a search help exit..

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_exit.htm

Link for creating a search help..

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm

Thanks,

Naren

Hi all,

Fora search help in dialog program.

I HAVE TO GET SEARCH FOR A FIELD ZID ON APARTICULAR SCREEN BASED ON DATA, MODIFIED BY AND A PLANT..

I HAVE A RECORD IN ONE MY ZTABLE.

I HAVE TO GET THAT BY SEVERAL SEARCH PARAMETERS SAY BY DATE , MODIFIED BY,PLANT ETC.

each user has been assigned a plant , so in search he has to get records belonging to that plant.

so i cannot include plant in my search help, because user may type in other plant.

so i tried two ways

1) i created a search help in se11 including the plant field again the problem arises if the user types a different plant.

so i want to know whether we can apassa value to plant field in search help(i.e the plant assigned to the user),

i have this kind of thing in some standard t -code i.e especially for searching material , the plant field in search help was filled by one plant.

this should be one of the solution

2)I tried to write a code in pov of program code.

this is how my code looks.

DATA : BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE ZXXX.

DATA : END OF ITAB.

ITAB HAS FIELDS ID, DATE , MODIFIEDBY , PLANT.

USER_PLANT = 'ABC'.

SELECT * FROM ZXXX INTO TABLE ITAB WHERE PLANT = USER_PLANT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'ZID'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

WINDOW_TITLE = 'TEST'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = ITAB

  • FIELD_TAB =

RETURN_TAB = IT_RETURN4

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

if sy-subrc = 0.

clear itab.

read table it_return4 index 1.

ZXXX-ZID = it_return4-fieldval.

endif.

THIS WORKS FINE , BUT HE CANNOT SEARCH BASED ON DATE AND MODIFIEDBY

ALL i want is is get a pop up window and should be able to search based on data and modifiedby for a predifined plant.

I hope iam clear.

Thanks

10 REPLIES 10
Read only

Former Member
0 Likes
1,636

Hi,

any suggestions on this.

Thanks

Read only

Former Member
0 Likes
1,636

Hi Guys,

IF ANYONE HAS ANY SUGGESTION .ITS BIT URGENT.

thanks

Read only

Former Member
0 Likes
1,637

Hi,

Try to filter the data by the plant for the user using the search help exit..

Check the following for a search help exit..

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_exit.htm

Link for creating a search help..

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm

Thanks,

Naren

Read only

0 Likes
1,636

Hi NARENDRAN,

THIS IS NOT STANDARD SEARCH HELP.

THIS IS A Z SEARCH HELP AND I WENT BACK I COULD NOT SEE ANY SEARCH HELP EXIT.

CAN YOU PLEASE ELABORATE ON THIS.

EVEN THE LINK DOESN'T SAY MUCH

WAITING FOR YOUR REPLY

THANKS

PREETI

Read only

Former Member
0 Likes
1,636

Hi,

Goto SE11..Give the search help name ..Press change button..

In the definition tab..

There will be field called Search help exit..There you can give a Function module name..

Have the logic inside the FM..

Hope this helps..

Thanks,

Naren

Read only

0 Likes
1,636

Hi ,

You mean to say i need to write code for that fm ,is there any fm i need to copy and can modify the select query or do ineed to write from scratch.

if i need to write one from scratch , please send me the code if you have one and i can take a look at it and develop my own.

Thanks

Read only

Former Member
0 Likes
1,636

Hi,

Create a FM with the following code..The interface is defined in the code..

In the Function module top include add the following code.

<b>TYPE-POOLS: shlp, vrm.</b>

IN this code I am deleting the records that are not of the currency USD...

Do the same thing for your requirement...

FUNCTION Y_SEARCH_HELP_EXIT.

*"----


""Local interface:

*" TABLES

*" SHLP_TAB TYPE SHLP_DESCR_TAB_T

*" RECORD_TAB STRUCTURE SEAHLPRES

*" CHANGING

*" REFERENCE(SHLP) TYPE SHLP_DESCR_T

*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL

*"----


  • where z_test is my z table..

DATA: ITAB LIKE Z_TEST OCCURS 0 WITH HEADER LINE.

ITAB[] = RECORD_TAB[].

IF NOT RECORD_TAB[] IS INITIAL.

DELETE ITAB WHERE WAERS <> 'USD'.

RECORD_TAB[] = ITAB[].

ENDIF.

ENDFUNCTION.

Thanks,

Naren

Read only

0 Likes
1,636

Hi

one final question . do i need to create a new funtion group.

i tries to give some z abc , it says function doesnot exist.

it does not create the function group like the table maintenance generator dooes

thanks

Read only

0 Likes
1,636

as you are saying its a dailog program, you should write any code under PROCESS ON VALUE-REQUEST event.

Read only

Former Member
0 Likes
1,636

Hi,

Yes. You have to create the Function group manually..

In SE37 ..in the menu ..Go to -> Function groups -> Create Function group.

Thanks,

Naren