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

Screen Refresh

Former Member
0 Likes
1,645

Hello Master's,

I heve created screen where there is I/O field kunnr and output(Display) field is Name of kunnr.My question is that whenever i select kunnr name should be display in name field.

In my coading it's shows after preesing the enter button, but i want after selection immediate name is shows in name field.


    WHEN 'ENTE'.
          SELECT SINGLE kunnr name1
          FROM kna1
          INTO (gv_kunnr, gv_name)
          WHERE kunnr = zmc_fi_interest-kunnr.
        IF sy-subrc = 0.
          gs_interest-name = gv_name.

Thanks & regards

Atul Singh

8 REPLIES 8
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,110

You have to use the FM: DYNP_VALUES_UPDATE to update the screen data. Search SDN for details.

Similar requirement is discussed here:

Edited by: Suhas Saha on Jun 16, 2010 5:07 PM

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,110

Use event POV.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,110

You may also not use ABAP: use an existing search help, or create one, with the following requirements:

- screen field names must refer to the same DDIC structure or table

- search help must have kunnr as the only importing parameter, and kunnr and name1 as the exporting parameters

- in the DDIC the structure or table, search help must be attached to the kunnr field, and the 2 search help parameters must be linked to the 2 DDIC fields

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,110

Hi Sandra,

Just a small query since i am not that conversant with DDIC search help.

Will this technique work if the NAME1 field is disabled on the screen, i mean will the screen element be populated ?

BR,

Suhas

Read only

0 Likes
1,110

Hi Suhas,

> Will this technique work if the NAME1 field is disabled on the screen, i mean will the screen element be populated ?

Good remark, I should have mentioned it explicitly! The answer is Yes

One important point is to not make it as an importing parameter of the search help (only an exporting parameter), otherwise it wouldn't work.

Shortest example you can try:


PARAMETERS input TYPE DD04D-DATATYPE.
PARAMETERS display TYPE DD04D-LENG MODIF ID GR1.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'GR1'.
      SCREEN-INPUT = 0. "gray out DISPLAY field
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

If you want to make a test with dynpro, you simply need to define field names DD04D-DATATYPE (don't forget to link the screen field to the ABAP Dictionary, otherwise search help is inactive) and DD04D-LENG (declare it as an input/output field of type output only).

It works because you'll see in SE11 that DD04D structure has its DATATYPE field assigned explicitly to DD_DATATYPE search help, where the linked fields between structure and search help are:

1) DATATYPE is linked to the importing (and exporting of course) parameter VALUE of search help

2) LENG is linked to the exporting only parameter LENG of search help

sandra

Read only

Former Member
0 Likes
1,110

Hi

Check the following

"  Implement your own search Help as below
data : from_f4.
PARAMETERS : carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
             fldate TYPE sflight-fldate.
 
DATA : itab TYPE TABLE OF sflight WITH HEADER LINE. " You can create a Structure having only KUNNR and NAME1 so that 
" Only required fields will be visible in the F4 Help
DATA : fmap TYPE TABLE OF dselc WITH HEADER LINE.
 
 AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-name = 'CONNID' OR
       screen-name = 'FLDATE'.
      screen-input = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid." If it is a selection Screen
else in PROCESS ON VALUE REQUEST
from_f4 = 'X'. " This indicates the Value come from F4 only
  SELECT * FROM sflight INTO TABLE itab.
  SORT itab BY carrid connid fldate.
  DELETE ADJACENT DUPLICATES FROM itab
  COMPARING carrid connid fldate.
  fmap-fldname = 'CARRID'.
  fmap-dyfldname = 'CARRID'.
  APPEND fmap.
  fmap-fldname = 'CONNID'.
  fmap-dyfldname = 'CONNID'.
  APPEND fmap.
  fmap-fldname = 'FLDATE'.
  fmap-dyfldname = 'FLDATE'.
  APPEND fmap.
 
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
     ddic_structure         = 'SFLIGHT'
      retfield               = 'CARIID'
     dynpprog               = sy-repid
     dynpnr                 = sy-dynnr
     DYNPROFIELD            = 'CARRID'
     value_org              = 'S'
     DISPLAY                = 'F' " This forces the F4 help for Display Only Fields
    TABLES
      value_tab              = itab
     dynpfld_mapping        = fmap
   EXCEPTIONS
     PARAMETER_ERROR        = 1
     NO_VALUES_FOUND        = 2
     OTHERS                 = 3
            ." Just Execute this pilot program and verify

Cheerz

Ram

Read only

Former Member
0 Likes
1,110

Hi,

Try like this:

1. Declare two fields like carrid and connid.

2. In connid attributes select program, and select check boxes of outfield and outputonly.

3. In PAI write the following code:

data: i_carrid like sflight-carrid,

i_connid like sflight-connid,

connid like sflight-connid,

ok_code type sy-ucomm.

select connid

from sflight into connid

where carrid eq i_carrid.

endselect.

ok_code = sy-ucomm.

if sy-subrc = 0.

case ok_code.

when ''.

i_connid = connid.

endcase.

endif.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,110

answered