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

Entry in Table

Former Member
0 Likes
716

Hi ,

I have one requirement for table Entry. Requirement is like i hve 3 fields in table dealer no , dealer name and city.While entering the the fields from SM30, user wants like if he/she enters dealer no then dealer name and city should automatically comes .

How can i do this ????? Plz. do help me as soon as possible. Its very very urgent.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
677
4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
678
Read only

Former Member
0 Likes
677

I think by using module pool we can get a solution for this.I have stimulated it with an example.Please go through it and make the necessary changes.If found useful please do reward points.

Populating Screen fileld using a Search Help

1.Create a table zdealer.

2.Create a Search help zrremphlp(with all the 3 fields dealer no,name and city)

3.Create a module pool program SAPMZRRTEST4 . Create a layout and assign the search help to that particular field.

4.In the flow logic write a module PROCESS ON VALUE-REQUEST.Inside the module write the screen field and the module name.

5.double click on the module name and write.

&----


*& Module value_request INPUT

&----


  • text

----


MODULE value_request INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = ' '

fieldname = ' '

searchhelp = 'ZRREMPHLP'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'ZRREMP-EMPID'

callback_program = 'SAPMZRRTEST4'

TABLES

return_tab = return_tab

EXCEPTIONS

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

OTHERS = 5.

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 return_tab INTO wa_return_tab INDEX 1.

SELECT SINGLE dealerno dealername dealercity FROM zdealer INTO wa WHERE

dealerno = wa_return_tab-fieldval.

wa_dynp-fieldname = 'ZDEALER-DEALERNO'.

wa_dynp-fieldvalue = wa-dealerno.

APPEND wa_dynp TO itab_dynp.

wa_dynp-fieldname = 'ZDEALER-DEALERNAME'.

wa_dynp-fieldvalue = wa-dealername.

APPEND wa_dynp TO itab_dynp.

wa_dynp-fieldname = 'ZDEALER-DEALERCITY'.

wa_dynp-fieldvalue = wa-dealercity.

APPEND wa_dynp TO itab_dynp.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = itab_dynp

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDMODULE. " value_request INPUT

6.In the TOPINCLUDE write.

TABLES: zdealer.

TYPES: BEGIN OF st_zdealer,

dealerno TYPE zdealer-dealerno,

dealername TYPE zdealername-dealername,

dealercity TYPE zdealercity-dealercity,

END OF st_zdealer.

DATA: itab TYPE TABLE OF st_zdealer,

wa TYPE st_zdealer,

return_tab TYPE TABLE OF ddshretval,

wa_return_tab TYPE ddshretval,

itab_dynp TYPE TABLE OF dynpread,

wa_dynp LIKE LINE OF itab_dynp.

Note: For PROCESS ON VALUE REQUEST NO PBO IS TRIGGERED. That is why you need to write this much of code.

7.Go to the transaction and press f4 on the field where you have assigned the Search Help.

8.Select the required dealerno and dealer name and city will be displayed automatically.

Read only

Former Member
0 Likes
677

Hi,

I guess this can be done in the module pool program of the Maintenance view itself. If you see in the se80 the function group that you created during the table maintenance generation, you will see the screens and the PBO, PAI modules.

You can use the POV and create a POV module and code for the F4 help using the FM F4IF_INT_TABLE_VALUE_REQUEST.

Please do let me know if you are having any troubles with the same. If you want i can send you the code for the same.

Regards,

Hari

Read only

Former Member
0 Likes
677

hi

good

create a F4 SEARCH HELP,i think that ll help you to solve your problem

thanks

mrutyun^