2006 Oct 18 1:42 PM
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 ..
2006 Oct 18 2:33 PM
Max,
I had tried even that but still the same problem.
D020S-PROG = 'SAPLIPAR'.
D020S-DNUM = '0201'.
*D020S-DNUM = '1000'.
*D020S-DNUM = '200'.
Thnx,
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.
2006 Oct 18 1:44 PM
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
2006 Oct 18 1:46 PM
Hi
Try this:
<b>*it_partner-FIELDNAME = 'IHPA-PARNR(01)'.</b>
it_partner-FIELDNAME = 'IHPA-PARNR'.
it_partner-STEPL = 1.
append it_partner.
Max
2006 Oct 18 1:47 PM
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
2006 Oct 18 1:58 PM
HI Max,
No.. It is still giving INVALID_DYNPROFIELD exception.
Thxs
2006 Oct 18 2:06 PM
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
2006 Oct 18 2:11 PM
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
2006 Oct 18 2:04 PM
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.
2006 Oct 18 2:18 PM
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
2006 Oct 18 2:22 PM
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.
2006 Oct 18 2:29 PM
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
2006 Oct 18 2:33 PM
Max,
I had tried even that but still the same problem.
D020S-PROG = 'SAPLIPAR'.
D020S-DNUM = '0201'.
*D020S-DNUM = '1000'.
*D020S-DNUM = '200'.
Thnx,
2006 Oct 18 2:52 PM
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
2006 Oct 18 3:18 PM
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..
2006 Oct 18 3:31 PM
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
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |