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 issue

Former Member
0 Likes
970

In my module pool screen I have Shipment Number(vttk-tknum) field along with Shipment Item(vttp-tpnum).

Now I have created custom search help for Shipment item (TPNUM). Now the search help for Item should function like: what Shipment no I have selected, it should give the corresponding Item number once I click the search button for item field.

To get that thing I am using FM 'F4IF_INT_TABLE_VALUE_REQUEST' and I am getting desire list.

Now the issue is:

1) If I select Shipment No and then hit enter and click on F4 of Item then I get the desire list.

2) But if I select Shipment No and click on F4 of Item immediately after that then no list appears.

Why this is so?

I have to get that list without hitting enter key.

Please help me on that and let me know if any more details is required on that.

Thanks

Nabanita

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
895

Hi, Nandi

For this you will have to create your Search help using SE11 and than assign this to your Structure for steps please have a look at my [Blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13637] [original link is broken] [original link is broken] [original link is broken]; and use it like i did in bellow code of Blog under Selection Screen

Hope will help you in this way.

Please Reply if any Issue.

Best Regards,

Faisal

7 REPLIES 7
Read only

Former Member
0 Likes
895

hi,

You would have written the module pool program such that, after pressing enter only, it retrieves the data from the next item table.

plz provide with the code. so that it will be better to give you a solution.

thanks.

Read only

Former Member
0 Likes
895

Hello,

You can get the F4 help of a field if you call the module under the event PROCESS ON VALUE-REQUEST.

If you have created a standard search help for your field, then declare that search help name in the screen field.

You can add it here.

Screen-> Element list-> References. Give the search help name again the I/0 button.

Hope this helps.

Thanks,

Sowmya

Read only

Former Member
0 Likes
895

hi,

Please post the sample code..u r logic seems to be right.. there may be some problem with the coding part..

Read only

Former Member
0 Likes
895

This is the sample code. Z_F4_SHIPMENT_IT is my custom search help for shipment item. PLease help

&----


*& Module Z_F4_SHIPMENT_IT INPUT

&----


  • text

----


MODULE z_f4_shipment_it INPUT.

DATA: return_tab TYPE TABLE OF ddshretval,

dynpro_values TYPE TABLE OF dynpread.

DATA: ship_item(4) TYPE c.

DATA: BEGIN OF wa_f4_prn OCCURS 0,

tknum TYPE vttk-tknum,

tpnum TYPE vttp-tpnum,

END OF wa_f4_prn.

CLEAR wa_f4_prn.

SELECT tknum tpnum FROM vttp INTO TABLE wa_f4_prn WHERE tknum EQ rqm01-tknum.

DELETE ADJACENT DUPLICATES FROM wa_f4_prn.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = dynpro_values.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'TPNUM' "'CNPNO_RSR'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'SHIP_ITEM' "'ZCNPNORS'

value_org = 'S'

TABLES

value_tab = wa_f4_prn

return_tab = return_tab.

  • txtuser = return_tab-FIELDVAL .

IF sy-subrc <> 0.

ENDIF.

ENDMODULE. " Z_F4_SHIPMENT_IT INPUT

Read only

0 Likes
895

Hello,

in your select query this field "rqm01-tknum" is there which is your screen value. therefore when you enter a screen value and press enter and then when you press f4 it works.

Just change your select query remove the where condition and everything would be fine

hope this solves your problem.

Cheers,

Suvendu

Read only

Former Member
0 Likes
895

Get rid of the entire coding, create a Search help in SE11.

Choose Elemenatry type.

Selection method : VTTP

Search help parameters

TKNUM -> Set Imp -> Set Exp -> Lpos = 1 -> Default value = 'TNR'

TPNUM -> Set Exp -> Lpos = 2

Activate it.

Now go to module pool. Attach this search help in attributes for fields Shipment number and Shipment item. Also check the fields for "Set/get parameter id"

Comment out the entire code in Process on value request.

Your search help will work.

Read only

faisalatsap
Active Contributor
0 Likes
896

Hi, Nandi

For this you will have to create your Search help using SE11 and than assign this to your Structure for steps please have a look at my [Blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13637] [original link is broken] [original link is broken] [original link is broken]; and use it like i did in bellow code of Blog under Selection Screen

Hope will help you in this way.

Please Reply if any Issue.

Best Regards,

Faisal