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

Making Table Control Cells editable

Former Member
0 Likes
919

Hi,

i have designed table control .in that one field is having F4 help. on selecting one value from that,based on value next 3 column cells of that row should be enabled.

if anyone have come accrossed the same requirement pls let me know the way.

Regards,

Sneha Kumari.

6 REPLIES 6
Read only

Former Member
0 Likes
854

Hi sneha.

You should do the loop at screen inside the loop at "table_control" and set the "input" value according to your field.

Best regards.

Andrea

Read only

0 Likes
854

Hi Andrea,

Thanks for your reply.

actually ,as this event should trigger with F4 help only i need to write relevent code in F4 help module.

If I do loop at screen it will modify full column not a cell of that row .

Regards,

Sneha

Read only

0 Likes
854

Hi sneha,

if the loop at screen is inside the loop at table control in PBO section, the modification affects only current line.

Try to write the code as follows

loop with control XXXX

loop at screen.

if variable = 'YYYY'.

.....

screen-input = 1

else.

screen-input = 0.

endif.

modify screen.

endloop.

endloop.

Best regards.

Andrea

Read only

0 Likes
854

Andrea,

we need to write code for f4 help in process on value request not in PBO.

so when i press on f4 for that column i select one value next to that i need to make those fields editable according to value.

so i need to proceed writing code for that login after f4 help function module.there I cant loop table control .

Regards,

Sneha

Read only

Former Member
0 Likes
854

Hi There...try this in your 'ON_VALUE_REQUEST Module:

declare a Table type variable eg:

DATA:wf_screen LIKE dynpread OCCURS 0 WITH HEADER LINE.

wf_screen-fieldname = 'ZCONSCOMP-QMCOD'. "The name of screen field

wf_screen-stepl = 0. "The number of the line busy with

wf_screen-fieldvalue = it_qpk1cd-code. "You can populate a value here

wf_screen-fieldinp = ' '. "X=Input enabled Space = Not enabled

APPEND wf_screen.

---Then call this Function Module

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'SAPMZCMPDL' "Dialogue Program name

dynumb = '0100' "Screen your working with

TABLES

dynpfields = wf_screen

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.

Hope it helps.

Please note that you can read the screen calues by using FM:

*-----Read Screen Values

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'SAPMZCMPDL'

dynumb = '0204'

TABLES

dynpfields = wf_screen

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

IF sy-subrc = 0.

LOOP AT wf_screen WHERE fieldname EQ 'ZCONSCOMP-FECOD'.

zconscomp-fecod = wf_screen-fieldvalue.

ENDLOOP.

ENDIF.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
854

You can not change screen attributes in POV (F4) only in PBO.

So in your POV module, you have to save the information (in some work area of the program) and then to trigger the PAI/PBO (via PAI using a [cl_gui_cfw=>set_new_ok_code|http://www.sdn.sap.com/irj/scn/advancedsearch?query=set_new_ok_code+cl_gui_cfw], just ignore this dummy ok_code in your PAI. You use the saved information in PBO.

Regards,

Raymond