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

Capture selected row's field value

Former Member
0 Likes
1,622

Hai Experts,

How to get the selected row's particular field value in table control. In my scenario i have n number of rows in table control. In that if i select the particular row, then that selected row's particular field value (for example 4th column value) should be capture. so how to capture that 4th column value of the selected row in table control.

Regards,

Harish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,145

Use DYNP_VALUES_READ to read the values after you select the values in the pleadtyp values

Like:

l_dynpfields-fieldname = 'PLEADTYP-LOW'.

APPEND l_dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = <program name>

dynumb = '1000'

TABLES

dynpfields = l_dynpfields

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

OTHERS = 9.

You will get the value in the table internal table l_dynpfields and in field FIELDVALUE.

You have to use that value to filterout your next selection

reward if helpful

regards,

preet

5 REPLIES 5
Read only

Former Member
0 Likes
1,145

Hello,

Use this FM DYNP_VALUES_READ

Read only

0 Likes
1,145

Hai Vishal,

Can you tell me clearly about this FM DYNP_VALUES_READ? It contains input parameters like dyname, dynumb, request,... How can i pass that table control name in that FM and how to get the required value from that FM?

Regards,

Harish

Read only

0 Likes
1,145

Hi,

The sample is as below:

In the below FM the exporting parameter Request must be 'A' in order to read all values of table control.

Declare it_dynpread1 as:

data :it_dynpread1 type standard table of dynpread.

wa_dynpread1 type dynpread.

CLEAR wa_dynpread1.

wa_dynpread1-fieldname = 'WPLANT'.

APPEND wa_dynpread1 TO it_dynpread1.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

  • TRANSLATE_TO_UPPER = ' '

request = 'A'

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

  • START_SEARCH_IN_CURRENT_SCREEN = ' '

  • START_SEARCH_IN_MAIN_SCREEN = ' '

  • START_SEARCH_IN_STACKED_SCREEN = ' '

  • START_SEARCH_ON_SCR_STACKPOS = ' '

  • SEARCH_OWN_SUBSCREENS_FIRST = ' '

  • SEARCHPATH_OF_SUBSCREEN_AREAS = ' '

TABLES

dynpfields = it_dynpread1

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

.

After selecting a particular row,the internal table will have the details about all the fields in table control.

Write the code in PAI.

Read only

Former Member
0 Likes
1,146

Use DYNP_VALUES_READ to read the values after you select the values in the pleadtyp values

Like:

l_dynpfields-fieldname = 'PLEADTYP-LOW'.

APPEND l_dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = <program name>

dynumb = '1000'

TABLES

dynpfields = l_dynpfields

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

OTHERS = 9.

You will get the value in the table internal table l_dynpfields and in field FIELDVALUE.

You have to use that value to filterout your next selection

reward if helpful

regards,

preet

Read only

0 Likes
1,145

Hai Kiran,

Through your answer i can get all the values but i cant get the selected rwo index.... how can i get that selected row index.

Regards,

Harish