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

Complete fields in dynpro after input help

mariano_gallicchio2
Participant
0 Likes
1,439

Hello expert.

This is my problem

I have 3 input fields

FIELD1

FIELD2

FIELD3

Field1 has martchcode, and i want after select the value from the search help of field1, that field2 and field3 be completed with some data

I put the code to complete the field2 and field3 in the PBO, but, the pbo doesnt execute until the user press enter.

How can i do, that after the user select the value from the help, but without press enter, the field be completed?

Thanks!!!

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
1,381

Hi Mariano,

you can create a custom search help where you define field2 and field3 additionally as export parameters and everything is done, probaly without any programming.

Regards,

Clemens

10 REPLIES 10
Read only

former_member191735
Active Contributor
0 Likes
1,381

Question is not clear

If you are executing Help which process on value request event.... the control should go to PBO automatically when you add the fields.

So write the help functionality under POV event. Read help on it or post clearly

Read only

0 Likes
1,381

Sorry for mi english Sampath.

this is mi code:

porcess before output.

module complete_fields.

process on value-request.

field field1 module module_field1.

and the module execute the function F4IF_INT_TABLE_VALUE_REQUEST

But the PBO is not executed after select a value for field1.

Read only

0 Likes
1,381

Hi Friend ,

Please see this program for Dropdown value's

DEMO_DYNPRO_DROPDOWN_LISTBOX

DEMO_DROPDOWN_LIST_BOX

Also see this link for more infomation[http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm]

Regards,

Read only

0 Likes
1,381

Check out the return tab of the function module. If you get them in the tab then you can map them to your fields.

If it does not go through PBO... use dunpro update fm (some one already posted here)

Read only

danilo_henriques
Explorer
0 Likes
1,381

Hi Mariano,

See the code below:


  t_dynpread-fieldname = p_fieldname.
  t_dynpread-fieldvalue = p_fieldvalue.
  APPEND t_dynpread.

  CALL FUNCTION 'DYNP_UPDATE_FIELDS'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
      request              = sy-ftype
    TABLES
      dynpfields           = t_dynpread
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      undefind_error       = 7

Read only

Clemenss
Active Contributor
0 Likes
1,382

Hi Mariano,

you can create a custom search help where you define field2 and field3 additionally as export parameters and everything is done, probaly without any programming.

Regards,

Clemens

Read only

0 Likes
1,381

Hello Clemens, thanks,

I have create the search help.

My quiestion is:

How map the 2 others parameters to the field2 and field3?

Thanks!

Read only

Former Member
0 Likes
1,381

Hi

U can do it in the POV event:

AT SELECTION-SCREEN ON VALUE-REQUEST for a selection-screen

PROCESS ON VALUE-REQUEST for a dynpro (in this case the abap code has to be placed in a MODULE)

The logic is always the same, after selecting the data of the first field, it needs to select and transfer the data to other input fields.

It needs to use the fm DYNP_VALUES_UPDATE in order to fill the fields not managed in the events:

PARAMETERS: P_BUKRS LIKE T001-BUKRS,
            P_BUKR1 LIKE T001-BUKRS,
            P_BUKR2 LIKE T001-BUKRS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.

  DATA: DYNAME LIKE  D020S-PROG,
        DYNUMB LIKE  D020S-DNUM,
        DYNPFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.

  DATA: RETURN_TAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      TABNAME    = 'T001'
      FIELDNAME  = 'BUKRS'
    TABLES
      RETURN_TAB = RETURN_TAB.

  READ TABLE RETURN_TAB INDEX 1.

  MOVE RETURN_TAB-FIELDVAL TO P_BUKRS.

  CHECK P_BUKRS = 'MAAB'.

  DYNAME = SY-REPID.
  DYNUMB = SY-DYNNR.

  DYNPFIELDS-FIELDNAME = 'P_BUKR1'.
  DYNPFIELDS-FIELDVALUE = 'AAAA'.
  APPEND DYNPFIELDS.

  DYNPFIELDS-FIELDNAME = 'P_BUKR2'.
  DYNPFIELDS-FIELDVALUE = 'BBBB'.
  APPEND DYNPFIELDS.

  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      DYNAME     = DYNAME
      DYNUMB     = DYNUMB
    TABLES
      DYNPFIELDS = DYNPFIELDS.

Max

Read only

Clemenss
Active Contributor
0 Likes
1,381

Hi Mariano,

define the desired values as export in search help interface. Connection is done via data element on screen.

Regards,

Clemens

Read only

0 Likes
1,381

Hello, thank a lot for the answers, i took max`s solution.

thanks again!