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

DYNP_VALUES_READ For Table Control

Former Member
0 Likes
3,327

Hello,

How to use DYNP_VALUES_READ fm for table control?

it_partner-FIELDNAME = 'IHPA-PARNR(01)'.

append it_partner.

D020S-PROG = 'SAPLIPAR'.

D020S-DNUM = '1000'.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = D020S-PROG

dynumb = D020S-DNUM

tables

dynpfields = it_partner

.

It is giving an exception ..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,431

Max,

I had tried even that but still the same problem.

D020S-PROG = 'SAPLIPAR'.

D020S-DNUM = '0201'.

*D020S-DNUM = '1000'.

*D020S-DNUM = '200'.

Thnx,

14 REPLIES 14
Read only

Former Member
0 Likes
2,431

Hi Sree,

Instead of specifying the index, you have to create a module which is inside the PBO loop of the TC.

In that module, you can pass the fieldname as just IHPA-PARNR.iT WOULD RETURN YOU THE CURRENT PASS' RECORD VALUE.

Regards,

ravi

Read only

Former Member
2,431

Hi

Try this:

<b>*it_partner-FIELDNAME = 'IHPA-PARNR(01)'.</b>

it_partner-FIELDNAME = 'IHPA-PARNR'.

it_partner-STEPL = 1.

append it_partner.

Max

Read only

Former Member
0 Likes
2,431

HI Sree,

DATA: lws_object_name TYPE char100.

DATA: repid LIKE sy-repid.

dynpfields-fieldname = p_field. " Field Name

APPEND dynpfields.

repid = sy-repid.

CALL FUNCTION 'DYNP_VALUES_READ' "#EC *

EXPORTING

dyname = repid

dynumb = sy-dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS.

Reward points if this Helps,

Manish

Read only

Former Member
0 Likes
2,431

HI Max,

No.. It is still giving INVALID_DYNPROFIELD exception.

Thxs

Read only

0 Likes
2,431

See if the field name is IFPO_PARNR indeed or is it something else?

See the element list to get the correct name.

Also check the screen number.

Regards,

ravi

Read only

0 Likes
2,431

Hi

The dynpro is wrong:

it_partner-FIELDNAME = 'IHPA-PARNR'.

it_partner-stepl = 1

append it_partner.

D020S-PROG = 'SAPLIPAR'.

<b>*D020S-DNUM = '1000'.</b>

D020S-DNUM = '0200'.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = D020S-PROG

dynumb = D020S-DNUM

tables

dynpfields = it_partner.

Max

Read only

Former Member
0 Likes
2,431

Use the <b>STEPL</b> in the dynpfields. When u pass this it will return the line in which the F4 as been pressed.

Check the sample code:

DATA: stepl1 TYPE systepl,

stepl_index1 TYPE systepl.

To Determine Steploop Index

lt_dynpfields1-fieldname = 'I_MPRN-POST_CODE'.

lt_dynpfields1-stepl = stepl1.

APPEND lt_dynpfields1. CLEAR lt_dynpfields1.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

translate_to_upper = 'X'

determine_loop_index = 'X'

TABLES

dynpfields = lt_dynpfields1

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 EQ 0.

READ TABLE lt_dynpfields1 INDEX 1.

ENDIF.

stepl_index1 = lt_dynpfields1-stepl.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'IFLOT'

fieldname = 'I_MPRN-MPRN'

searchhelp = 'ZS_MPRN_PC'

dynpprog = sy-repid

dynpnr = sy-dynnr

TABLES

return_tab = lt_f4

EXCEPTIONS

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

OTHERS = 5.

Regards,

Prakash.

Read only

Former Member
0 Likes
2,431

Ravi,

I have checked screen no & Screen name.I am writing this inside an exit.

Is that I need to pass the field to table control some other way?

Thnx

Read only

0 Likes
2,431

Sree,

Have you tried like this

lt_dynpfields1-fieldname = 'I_MPRN-MPRN'.

lt_dynpfields1-stepl = 1.

APPEND lt_dynpfields1. CLEAR lt_dynpfields1.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

translate_to_upper = 'X'

determine_loop_index = 'X'

TABLES

dynpfields = lt_dynpfields1

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 EQ 0.

READ TABLE lt_dynpfields1 INDEX 1.

ENDIF.

Read only

0 Likes
2,431

Hi

I'm using 4.6C and there isn't any table control in that screen, but only in 200.

I don't know if you can do it using DYNP_VALUES_READ and DYNP_VALUES_UPDATE, because the screen you manage by those fm has to be active in that moment.

Anyway you can try to use the field-symbols:

Something like this:

DATA: FIELDNAME(30) VALUE 'ITAB[]'.

field-symbols: <table> type table.

ASSIGN (FIELDNAME) TO <TABLE>.

DATA: WA LIKE .....

LOOP AT <TABLE> INTO WA.

---> Here you can modify your data

ENDLOOP.

Max

Read only

Former Member
0 Likes
2,432

Max,

I had tried even that but still the same problem.

D020S-PROG = 'SAPLIPAR'.

D020S-DNUM = '0201'.

*D020S-DNUM = '1000'.

*D020S-DNUM = '200'.

Thnx,

Read only

0 Likes
2,431

Hi

Just as I said in my last answer, the screen has to be loaded when u use the fm DYNP_VALUES_READ.

So I believe when the user-exit is called, the system has left that screen and so you can't use that function module.

Now you should explain us what you need to update.

Max

Read only

Former Member
0 Likes
2,431

Max,

That explains the reason .

Well I am in lower level(wbs element : tcode cj20n ) and trying to access the table control(partner)which is in higher level(project defn ) and trying to pass these partner details to the new screen exit which is in wbs element.

thanks for the help..

Read only

0 Likes
2,431

Hi

I can't use that trx in my system, you should find which is the internal table where the data of table control are stored and try to change it.

Max