Application Development 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: 

Data is not populating in textboxes

Former Member
0 Kudos

Hi Folks,

On my selection screen, when I am taking data from F4 help, first field is populating properly but rest two fields are populating only after pressing enter.

Scenario is like that I have three textboxes on selection screen. Out of them two are in display only mode. When I take F4 help on editable text box it shows me list of all the values of three fields. As soon as I select an entry the editable text box get the value but display only text box get values only after pressing enter.

I have tried to debug the code just after pressing enter and checked whether the variables have value in then or not. I got to know that value exists there. But it is not populating in the text boxes.

Please help me with the same.

Thanks

Siddarth.

15 REPLIES 15

Former Member
0 Kudos

Can you place your code here?

I believe, if it is a custom search help, while assigning the values to the fields for other boxes, you are clearing the header which makes values vanish. But when you hit enter first value gets into header and on selection screen.

0 Kudos

Hi Ashish,

It is custom search help. But I can't place the code over here as it is too long.

Let me check your thing so that I will be able to solve the problem.

Thanks for your quick reply.

Siddarth

former_member223537
Active Contributor
0 Kudos

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

<b>retfield = 'BEGRU'</b>

<b>value_org = 'S'</b>

tables

<b>value_tab = t_values

return_tab = t_return</b>

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

Above values in bold should be passes alwyz. Please check your code for the same.

0 Kudos

Hi Prashant,

The following is the code which I am using in Function Module but I can't see the fields which you have mentioned like retfield and value_org.

  CALL FUNCTION 'F4_FIELD_ON_VALUE_REQUEST'
    EXPORTING
      tabname                   = 'ZFTRPTVERSION'
      fieldname                 = 'RALDB_VARI'
   TABLES
     return_tab                = lt_return
   EXCEPTIONS
     field_not_found           = 1
     no_help_for_field         = 2
     inconsistent_help         = 3
     no_values_found           = 4
     OTHERS                    = 5.

Thanks,

Siddarth

0 Kudos

The selected record will be stored in table RETURN. This also contain field RECORDPOS which gives information about selected record index.

You read your internal table passed to the Search help with this index. And this will contain values for other 2 fields. Assign these 2 values to two text boxes and this should solve your problem.

0 Kudos

Hi Ashish,

I don't think I need to take data in internal table and select the record using index. I have created the search help in Data Dictionary as Z search help.

Thanks

Siddarth

0 Kudos

hi sid,

ok firstly check whether the return table lt_return has got the values of the other fields or not???

if it gets populated then after the CALL statement insert:-

retfield = lt_return-retfield (or whatever represents the specific field name)

value_org = lt-value_org

regards,

sagar

<i>ps: am sorry abt the prev msg... i miss read ur Q</i>

0 Kudos

Hi Sagar,

I have checked the return table also. It is giving value for all the fields properly.

But not populating in the textboxes.

Thanks,

Siddarth

0 Kudos

hi sid,

are these ur textbox names on the screen:-

<i>retfield</i> and <i>value_org</i> ??

if so have u defined them in ur prog ?? (exact same name exact same type)

if so check in the debugger, the values of the variables.

still if everythin matches and the ouput isn't. can u pls paste the code!!

regards,

sagar.

Former Member
0 Kudos

hi sid,

<b>1)</b> make sure that the variable names that are representing the text boxes in the program and in the screen layout are <b>same</b>.

<b>2)</b> at the end of the PAI module in which u r processing the OKCODE... clear the value of OKCODE.

<b>3)</b> then while processing the OKCODE u can insert an additional condition representing whether a blank enter has been pressed:-

CASE OKCODE.

WHEN ''.

populate the values of the textboxes.

at the end of ur query u r writting that the values exists in the variables but rn't populatin.. that condition only happens when the variable name and type donot match (thats they are different in the program and the screen layout).

and in the following thread u mentioned that u r using a custom search help. if im not wrong then u will have to run a database search in the program to retrieve the values for seperate textboxes.. u can do that in the <b>third step</b>.. for that try adaptin the following code:-

SELECT name, dept INTO textbox2 textbox3

FROM table_name

WHERE emp_id = textbox1.

hope this helped solving your problem.

Regards,

sagar.

0 Kudos

Hi Sagar,

Please find my responses after your comments in italics.

<b>1)</b> make sure that the variable names that are representing the text boxes in the program and in the screen layout are <b>same</b>.

<i>Varible names are same. but i am not using any Dynpro screen. In progam it just normal selection screen.</i>

<b>2)</b> at the end of the PAI module in which u r processing the OKCODE... clear the value of OKCODE.

<i>As there is no Dyn Pro screen, there is no OKCODE and PAI.</i>

<b>3)</b> then while processing the OKCODE u can insert an additional condition representing whether a blank enter has been pressed:-

CASE OKCODE.

WHEN ''.

populate the values of the textboxes.

at the end of ur query u r writting that the values exists in the variables but rn't populatin.. that condition only happens when the variable name and type donot match (thats they are different in the program and the screen layout).

<i>All variable name and type are same all over the code.</i>

And in the following thread u mentioned that u r using a custom search help. If i'm not wrong then u will have to run a database search in the program to retrieve the values for seperate textboxes.. u can do that in the <b>third step</b>.. for that try adapting the following code:-

SELECT name, dept INTO textbox2 textbox3

FROM table_name

WHERE emp_id = textbox1.

<i>I can't understand why I need to run the database query when I have already created the search help in Data dictionary.</i>

thanks

Siddarth.

Former Member
0 Kudos

Hi,

1. You get all the F4 data into a internal table

2. call the FM "DYNP_VALUES_READ"

3. Call the FM "HELP_VALUES_GET_WITH_TABLE"

4. For all the fields which the data to be populated

5. Upon User selection from the F4 help, modify the internal table used in DYNP_VALUES_READ, with the values.

6. call the FM "DYNP_VALUES_UPDATE"

If the hint is useful… Say thanks by reward….

Regards,

Prabhu Rajesh

Message was edited by:

PrabhuRajesh Janardanan

0 Kudos

Hi Prabhu Rajesh,

Is it necessary to go in such complex manner?? Because I am using F4_FIELD_ON_VALUE_REQUEST Function module for this purpose.

Thanks

Siddarth

Former Member
0 Kudos

Hi Siddarth,

Try using event

AT SELECTION-SCREEN ON <editable field>.

ur code to poputalte data in non editable fields.

0 Kudos

Hi Mandeep,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varit.
  PERFORM f_display_version_entries USING p_varit
                                          p_date
                                          p_time.

In the form I am using Function Module 'F4_FIELD_ON_VALUE_REQUEST' and further populating the fields but still data is not showing.

Thanks

Siddarth