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

Editing field in table control

Former Member
0 Likes
1,527

Hi

I have assigned search help to one of the fields in table control

I am able to display the list of possible values

But the problem is when I press F4 key and then select any other value.. it is not reflecting on the screen

In other words I am not able to change/select the value from F4 help

Any ideas.. why its happening so??

Also we want to modify db table from table control.

For this I kept code between loop at itab--endloop in PAI.

but this is also not happening??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,446

Dear Rashmi Agarwal,

For this you need to write the coding as in below area. For eg if you are defining F4 help for a field Material Number in your table control. Your coding should look something as this:

PROCESS ON VALUE-REQUEST.

FIELD (tablecontrol_name)- fieldname MODULE fieldname.

Inside the Module fieldname.

call the function module 'F4IF_INT_TABLE_VALUE_REQUEST'.

and inside this, <b>tables parameter</b> return_tab you need to get the values which you select from F4. So once you double click the <u><b>return_tab</b></u> value will come and sit in your table control field in the screen.

Hope this solves your purpose.

Lakshminarayanan.

9891778945

Hi

I have assigned search help to one of the fields in table control

I am able to display the list of possible values

But the problem is when I press F4 key and then select any other value.. it is not reflecting on the screen

In other words I am not able to change/select the value from F4 help

Any ideas.. why its happening so??

Also we want to modify db table from table control.

For this I kept code between loop at itab--endloop in PAI.

but this is also not happening??

11 REPLIES 11
Read only

Former Member
0 Likes
1,446

Hi,

You can trigger PROCESS ON VALUE-REQUEST event for getting the F4 help. Trigger this event after PAI.

You can modify the DB table using MODIFY statement, and to be written in the PAI event.

If its useful, award points pls,.

Regards,

Bharadwajv

Read only

0 Likes
1,446

Thanks Raju to reply

I am following the same procedure

I have kept search help in POV and db updates in PAI

but its not reflecting

M not getting whatz the problem??

Read only

Former Member
0 Likes
1,446

Hi Rashmi,

If its a customised screen, try recreating it.

Because this will have to work, or have u left out in activating any object there.

Regards,

Bharadwaj

Read only

Former Member
0 Likes
1,447

Dear Rashmi Agarwal,

For this you need to write the coding as in below area. For eg if you are defining F4 help for a field Material Number in your table control. Your coding should look something as this:

PROCESS ON VALUE-REQUEST.

FIELD (tablecontrol_name)- fieldname MODULE fieldname.

Inside the Module fieldname.

call the function module 'F4IF_INT_TABLE_VALUE_REQUEST'.

and inside this, <b>tables parameter</b> return_tab you need to get the values which you select from F4. So once you double click the <u><b>return_tab</b></u> value will come and sit in your table control field in the screen.

Hope this solves your purpose.

Lakshminarayanan.

9891778945

Read only

0 Likes
1,446

Hi Laxminarayan

this is the cod that i have given in flow logic

PROCESS BEFORE OUTPUT.

MODULE FILL_ITAB.

loop at itab with control tab_control cursor tab_control-current_line.

endloop.

MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

loop at itab.

MODULE DB_UPDATE.

endloop.

MODULE DB_UPDATE1.

MODULE USER_COMMAND_0100.

PROCESS ON VALUE-REQUEST.

*field tab_control-frmty module frmty.

FIELD itab-FRMTY MODULE FRMTY .

and can you please elaborate how to get the values thrugh return_tab

Thanks in advance

Read only

0 Likes
1,446

Hi Rashmi,

Are you able to see the values on the screen? Pls show the code u hv used in MODULE FRMTY, if not. If you r able to see the changes then db should be updated, tell me if your manual entries r getting updated in db.

regards

sangharsh

Read only

0 Likes
1,446

Dear Rashmi,

Inside your MODULE FRMTY.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'FRMTY' -- name of the field for

which u press F4

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'ITAB-FRMTY'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_VALUE.

endmodule.

the Internal table it_value will contain all the fields which is getting displayed in F4.

Hope this solves your issue.

Lakshminarayanan

Read only

0 Likes
1,446

Hi Sangharsh

the code in frmty is

DATA: BEGIN OF ITAB2 OCCURS 0 ,

FRMTY LIKE ZFRMOPER-FRMTY,

END OF ITAB2,

cursorfield like itab-frmty,

cursorline,

cursorvalue like itab-frmty,

sel_lifnr like itab-lifnr,

itab3 like DDSHRETVAL occurs 0.

*Read the line of the table where user has requested F4 help

get cursor field cursorfield line cursorline value cursorvalue.

read table itab index cursorline.

sel_lifnr = itab-lifnr.

SELECT frmty FROM ZFRMOPER INTO table ITAB2 WHERE PARTY = sel_lifnr.

  • ENDSELECT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'FRMTY'

  • PVALKEY = ' '

DYNPPROG = 'sy-repid'

  • DYNPNR = 'sy-dynnr '

DYNPROFIELD = 'itab-frmty'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = ITAB2

  • FIELD_TAB =

RETURN_TAB = itab3

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

and am able to see the list of possible values on the screen but am not able to select the value from the list

If anybody can find the reason..

Thanks in advance

Read only

0 Likes
1,446

Hi Rashmi,

the solution is simple, u hv not assigned the entry u r getting in itab3 to the table control (i think it is itab), after the call to FM u need to check for sy-subrc = 0 and inside that read the table itab3 with index 1 assign its fieldval to ur itab.

also uncomment the exceptions as if the user choose to cancel the search help u will get a dump if u don't do so.

Pls award me my first points on sdn if u get it right

thnx

sangharsh

Read only

0 Likes
1,446

Thanks Sangharsh

Now I am able to see the changes on the table control

Read only

0 Likes
1,446

Hey Rashmi,

Thnk u for my first points.