04-21-2015 10:35 AM
Hi friends,
I have a scenario where i need to provide input field with F4 help(Dynamic Values), so once i select the value from f4, it is getting reflected on screen,
now i wanted to create a display a description of selected field on screen so i was able to achieve this using below code.
now the problem is the text is being reflected but the input value is not updated. please check the image for more. did i miss anything?
if it_ZHR_SECTION IS NOT INITIAL.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
* DDIC_STRUCTURE = ' '
retfield = 'ZSECTION'
* PVALKEY = ' '
DYNPPROG = SY-repid
DYNPNR = SY-dynnr
DYNPROFIELD = 'P0001-ZZSECT'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
CALLBACK_PROGRAM = sy-repid
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
tables
value_tab = it_ZHR_SECTION
* FIELD_TAB =
RETURN_TAB = IT_RETURN
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
commit WORK.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
* BREAK-POINT.
if IT_RETURN is NOT INITIAL.
READ TABLE IT_RETURN into wa_return INDEX 1.
READ TABLE it_ZHR_SECTION INTO wa_ZHR_SECTION WITH key zsection = wa_return-fieldval.
REFRESH it_dynpfields.
if sy-subrc = 0.
wa_dynpfields-fieldname = 'T1'.
wa_dynpfields-fieldvalue = wa_ZHR_SECTION-description.
APPEND wa_dynpfields to it_dynpfields.
* BREAK-POINT.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = it_dynpfields
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* UNDEFIND_ERROR = 7
* OTHERS = 8
.
* BREAK-POINT.
endif.
* BREAK-POINT.
ENDIF.
ENDIF
.
as per the above image the id (AMGR) does not change but text beside changes as per selection.
if i remove DYNP_VALUES_UPDATE fm then the value is getting updated, but i have to display text also. help how to acieve this.
04-21-2015 10:49 AM
Hi Siva,
Try to pass the value for the field ZSECTION in internal table IT_DYNPFIELDS and check if it works fine.
Hope this helps,
~Athreya
04-21-2015 10:49 AM
Hi Siva,
Try to pass the value for the field ZSECTION in internal table IT_DYNPFIELDS and check if it works fine.
Hope this helps,
~Athreya
04-21-2015 11:13 AM
This solved my issue, but when i click on save the values becomes blank but the table(pa0001) is updated. when i go to pa30 and click on display or change the values are available.
04-21-2015 11:23 AM
Hi Siva,
It is possible that you are clearing the input fields in the PBO module of the screen. Once save button is clicked, it processes the data in PAI module, calls the PBO module of the screen where fields are getting cleared and displayed.
Hope this helps,
~Athreya