Application Development 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: 

Issue related to Dialog Programming

Former Member
0 Kudos

Hi All,

I have a Issue related to Dialog Programming.

I have one screen developed.

in that one in input field.

all other's are display only fields.

When i give some entry in INPUT field.

Based on that data the other display-ble fields should be filled in same screen.

I am not able to the same though all the code i have written.

Can anybody tell me the reason & solution for the same.

I have written follow code when i press ENTER.

It is going inside also fetching data.

I tried to push the data directly into screen fields, as well as using <b>'DYNP_UPDATE_FIELDS'</b>

both are not working though data is coming through.

Can anybody give the solution.

<b> WHEN 'ENTE'.

SELECT *

FROM zexport_header

INTO TABLE i_header

WHERE zzexgen = v_zzexgen.

IF sy-subrc EQ 0.

READ TABLE i_header INDEX 1.

IF sy-subrc EQ 0.

  • 1st Way of pushing data in to screen fields

v_zzexgen = i_header-zzexgen.

v_zzgeart = i_header-zzgeart.

v_modco = i_data-modco.

v_zzgmaxw = i_header-zzgmaxw.

  • v_zzchgamt = i_header-zzchgamt.

v_zzgaufw = i_header-zzgaufw.

  • 2nd Way of pushing data in to screen fields

CLEAR: i_updfld[], i_updfld.

i_updfld-fieldname = 'V_ZZEXGEN'.

i_updfld-fieldvalue = i_header-zzexgen.

APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGEART'.

i_updfld-fieldvalue = i_header-zzgeart.

APPEND i_updfld.

i_updfld-fieldname = 'V_MODCO'.

i_updfld-fieldvalue = i_data-modco.

APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGMAXW'.

i_updfld-fieldvalue = i_header-zzgmaxw.

APPEND i_updfld.

  • i_updfld-fieldname = 'V_ZZCHGAMT'.

  • i_updfld-fieldvalue = i_header-zzchgamt.

  • APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGAUFW'.

i_updfld-fieldvalue = i_header-zzgaufw.

APPEND i_updfld.

CALL FUNCTION 'DYNP_UPDATE_FIELDS'

EXPORTING

dyname = v_subdyname

dynumb = v_subdynumb

TABLES

dynpfields = i_updfld.

ENDIF.

ENDIF.</b>

Can anybody give me the solution for the above.

Thanks in advance.

Thanks & Regards,

Prasad.

1 ACCEPTED SOLUTION

vinod_gunaware2
Active Contributor
0 Kudos

Hi

<b>DYNP_VALUES_READ

DYNP_VALUES_UPDATE</b>

call function 'DYNP_GET_STEPL'

importing

povstepl = step_line

exceptions

stepl_not_found = 1

others = 2.

clear: ltab_fields.

refresh : ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-TABNAME'.

ltab_fields-fieldvalue = t_f4_table-tabname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-FLDNAME'.

ltab_fields-fieldvalue = t_f4_table-fieldname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-VALUE'.

ltab_fields-fieldvalue = t_f4_table-fieldtext.

ltab_fields-stepl = step_line.

append ltab_fields.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = lc_dyname

dynumb = lc_dynumb

tables

dynpfields = ltab_fields

exceptions

others = 8.

commit work and wait.

regards

vinod

8 REPLIES 8

Former Member
0 Kudos

1.Check if your are moving the data correctly into the screen fields

2.Check if you are clearing the variables in PBO..

3.Check whether the READ on I_HEADER is resulting in a SY-SUBRC = 0

4.No need to make use of the 'DYNP_UPDATE_FIELDS'.

vinod_gunaware2
Active Contributor
0 Kudos

Hi

<b>DYNP_VALUES_READ

DYNP_VALUES_UPDATE</b>

call function 'DYNP_GET_STEPL'

importing

povstepl = step_line

exceptions

stepl_not_found = 1

others = 2.

clear: ltab_fields.

refresh : ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-TABNAME'.

ltab_fields-fieldvalue = t_f4_table-tabname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-FLDNAME'.

ltab_fields-fieldvalue = t_f4_table-fieldname.

ltab_fields-stepl = step_line.

append ltab_fields.

ltab_fields-fieldname = 'ZMM_TABLE-VALUE'.

ltab_fields-fieldvalue = t_f4_table-fieldtext.

ltab_fields-stepl = step_line.

append ltab_fields.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = lc_dyname

dynumb = lc_dynumb

tables

dynpfields = ltab_fields

exceptions

others = 8.

commit work and wait.

regards

vinod

0 Kudos

Hi,

Still i am not able to fill those fields into screen.

ALthough data is coming correctly.

IT is filling CHAR Type Fields like <b>zzexgen, zzgeart, MODCO.</b>

But <b>Amount[CURR]</b> fields like <b>zzgmaxw, zzchgamt, zzgaufw</b> are not getting filled up.

Cananybody knows why!

Thanks,

Prasad.

0 Kudos

Hi,

That is the problem with DYNP_UPDATE_FIELDS.

You will have to move the currency fields to character and then update.

Ex.

data : lv_curr_char(14).

MOVE lv_curr to lv_curr_char.

Hope it helps.

Regards,

Shashank

0 Kudos

Hi,

I had put the code in PAI only.

First in SE51 calling will be as below:

<b>PROCESS BEFORE OUTPUT.

MODULE status_9002.

*

PROCESS AFTER INPUT.

MODULE user_command_9002.

PROCESS ON VALUE-REQUEST.

FIELD v_zzexgen MODULE f4_help_for_zzexgen.</b>

There corresponding code part in Forms is as below:

<b>PBO</b>

<b>MODULE status_9002 OUTPUT.

SET PF-STATUS 'GUI_9002'.

SET TITLEBAR '001'.

v_vbeln = i_data-vbeln.

v_posnr = i_data-posnr.

v_netwr = i_data-netwr.

v_gegru = i_data-gegru.

v_alnum = i_data-alnum.

v_embgr = i_data-embgr.

v_secgk = i_data-secgk.

ENDMODULE. " STATUS_9002 OUTPUT</b>

<b>PAI</b>

<b>MODULE user_command_9002 INPUT.

CASE ok_9002.

WHEN 'BACK'.

CLEAR ok_9002.

LEAVE TO SCREEN 0.

WHEN 'ENTE'.

SELECT *

FROM zexport_header

INTO TABLE i_header

WHERE zzexgen = v_zzexgen.

IF sy-subrc EQ 0.

READ TABLE i_header INDEX 1.

IF sy-subrc EQ 0.

  • 1st way

v_zzexgen = i_header-zzexgen.

v_zzgeart = i_header-zzgeart.

v_modco = i_data-modco.

v_zzgmaxw = i_header-zzgmaxw.

  • v_zzchgamt = i_header-zzchgamt.

v_zzgaufw = i_header-zzgaufw.

  • 2nd way

CALL FUNCTION 'DYNP_GET_STEPL'

IMPORTING

povstepl = v_step_line

EXCEPTIONS

stepl_not_found = 1

OTHERS = 2.

CLEAR: i_updfld[], i_updfld.

REFRESH: i_updfld[], i_updfld.

i_updfld-fieldname = 'V_ZZEXGEN'.

i_updfld-fieldvalue = i_header-zzexgen.

APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGEART'.

i_updfld-fieldvalue = i_header-zzgeart.

APPEND i_updfld.

i_updfld-fieldname = 'V_MODCO'.

i_updfld-fieldvalue = i_data-modco.

APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGMAXW'.

i_updfld-fieldvalue = i_header-zzgmaxw.

APPEND i_updfld.

  • i_updfld-fieldname = 'V_ZZCHGAMT'.

  • i_updfld-fieldvalue = i_header-zzchgamt.

  • APPEND i_updfld.

i_updfld-fieldname = 'V_ZZGAUFW'.

i_updfld-fieldvalue = i_header-zzgaufw.

APPEND i_updfld.

CALL FUNCTION 'DYNP_UPDATE_FIELDS'

EXPORTING

dyname = v_subdyname

dynumb = v_subdynumb

TABLES

dynpfields = i_updfld.

COMMIT WORK AND WAIT.

ENDIF.

ENDIF.

WHEN 'SAVE'.

  • Remaining Code

ENDCASE.

ENDMODULE. " USER_COMMAND_9002 INPUT</b>

<b>POV</b>

For POV i will populate mutiple Records & select 1 record from them there every thing is fine.

I am able to fill every fields from there.

Can anybody solve this issue.

Thanks,

Prasad.

0 Kudos

Hi Prasad,

I suppose your requirement is like this:

You have 3 fields of which one is I/O and other 2 are output only.When you press f4 on one field and select a value and press enter , correspondingly other fields should be updated with values.

I also suppose the version is 4.6C.

Then do the following steps

1) In the POV module, write the Function Module

HELP_VALUES_GET.Provide the fieldname and tablename.In the Importing parameter , give a variable for SELECT_VALUE.This gives the value selected by you.

2) In the PAI module, corresponding to the code for ENTER, do the steps:

a) select the corresponding values for other fields depending on the value selected.

b) Assign it to the screen variables.

c) Create a variable like this.

DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER

LINE.

d) DYFIELDS-FIELDNAME = 'MAKTX'.

APPEND DYFIELDS.

DYFIELDS-FIELDNAME = 'MAKTG'.

APPEND DYFIELDS.

e) Call the Function Module DYNP_VALUES_UPDATE like

this

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = SY-REPID

dynumb = SY-DYNNR

tables

dynpfields = DYFIELDS

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.

This will update the values in the other fields.

Hope your query will be solved.

Regards,

SP.

0 Kudos

Hi,

The the issue is now solved.

First i declared as:

DATA: l_orgamt1(15).

Then before <b>DYNP_UPDATE_FIELDS</b> i added following things and passed.

<b> MOVE i_header-zzgmaxw TO l_orgamt1.

i_updfld-fieldname = 'V_ZZGMAXW'.

i_updfld-fieldvalue = l_orgamt1.

APPEND i_updfld.</b>

I had allocated points.

Thanks for your time.

Thanks & Regards,

Prasad.

vinod_gunaware2
Active Contributor
0 Kudos

hi

Put proper code in <b>PAI</b>. Just have look below code

it will give u proper idea how to use

REPORT ZVV.

tables tcurt.

DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.

PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency

P_LTEXT LIKE TCURT-LTEXT, "Long Text

P_KTEXT LIKE TCURT-KTEXT. "Short Text

*----


*--- Example of updating value of another field on the screen -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.

CLEAR: DYFIELDS[], DYFIELDS.

*--- select currency

CALL FUNCTION 'HELP_VALUES_GET'

EXPORTING

fieldname = 'WAERS'

tabname = 'TCURT'

IMPORTING

SELECT_VALUE = P_WAERS.

*--- get long text for the selected currency

SELECT SINGLE LTEXT FROM TCURT

INTO DYFIELDS-FIELDVALUE

WHERE SPRAS = SY-LANGU

AND WAERS = P_WAERS.

IF SY-SUBRC <> 0.

CLEAR DYFIELDS-FIELDVALUE.

ENDIF.

*--- update another field

DYFIELDS-FIELDNAME = 'P_LTEXT'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

tables

dynpfields = DYFIELDS .

*----


*--- Example of reading value of another field -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.

*--- read another field

CLEAR: DYFIELDS[], DYFIELDS.

DYFIELDS-FIELDNAME = 'P_WAERS'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYFIELDS .

READ TABLE DYFIELDS INDEX 1.

*--- get short text and update current field

SELECT SINGLE KTEXT FROM TCURT

INTO P_KTEXT

WHERE SPRAS EQ SY-LANGU

AND WAERS EQ DYFIELDS-FIELDVALUE.

*----


regards

vinod