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

Avoid Enter Hit

Former Member
0 Likes
750

Hi Everyone,

I had created a selection screen with two parameters.

1st parameter have search help.

I got F4 help on value request for 2nd parameter.

My requirement is, after entering value in 1st parameter, relavant records from table should be fetched

and only those data should be in f4 help for 2nd parameter.

Everything is working fine as per requirement.

Only problem is , after entering data in parameter1, till a ENTER Hit, F4 help for Parameter 2 is not workking.

I think this is for a event trigger, But how can i over come this issue to avoid ENTER HIT.

Thanks in Advance,

Regards

Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
704

Hay try this,(DYNP_VALUES_READ)

data: begin of i_afpo occurs 0,

aufnr type afpo-aufnr,

end of i_afpo.

data : dyname like d020s-prog value sy-repid,

dynumb like d020s-dnum value '0100'.

data: begin of dynpfields occurs 3.

include structure dynpread.

data: end of dynpfields.

refresh dynpfields.

move 'PARAMETER 1' to dynpfields-fieldname.

append dynpfields.

*--> FETCHING PURCHASE ORDERS RELATED TO PLANT.

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-repid

dynumb = dynumb

translate_to_upper = 'X'

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

tables

dynpfields = dynpfields

  • 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 <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

read table dynpfields

with key fieldname = 'PARAMETER 1' transporting fieldvalue.

move dynpfields-fieldvalue to var1.

select aufnr

from afpo

into table i_afpo

where pwerk eq var1.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

  • DDIC_STRUCTURE = ' '

retfield = 'AUFNR'

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = PARAMETER 2

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = i_afpo

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

6 REPLIES 6
Read only

former_member242255
Active Contributor
0 Likes
704

the ENTER hit has to be done as the input for the 1st parameter is given only after the sel.screen is displayed..

else we can handle it in the inititalization or some at-selc.scre event..

so only if you put the enter,some action is performed and the coreesponding data is fetched for the 2nd parameter..

Read only

Former Member
0 Likes
704

Hi,

write code in At Selection-screen On value request for F4 help.

Regards,

jaya

Read only

Former Member
0 Likes
705

Hay try this,(DYNP_VALUES_READ)

data: begin of i_afpo occurs 0,

aufnr type afpo-aufnr,

end of i_afpo.

data : dyname like d020s-prog value sy-repid,

dynumb like d020s-dnum value '0100'.

data: begin of dynpfields occurs 3.

include structure dynpread.

data: end of dynpfields.

refresh dynpfields.

move 'PARAMETER 1' to dynpfields-fieldname.

append dynpfields.

*--> FETCHING PURCHASE ORDERS RELATED TO PLANT.

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-repid

dynumb = dynumb

translate_to_upper = 'X'

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

tables

dynpfields = dynpfields

  • 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 <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

read table dynpfields

with key fieldname = 'PARAMETER 1' transporting fieldvalue.

move dynpfields-fieldvalue to var1.

select aufnr

from afpo

into table i_afpo

where pwerk eq var1.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

  • DDIC_STRUCTURE = ' '

retfield = 'AUFNR'

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = PARAMETER 2

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = i_afpo

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Read only

SumanPoddar
Active Participant
0 Likes
704

>

> Hi Everyone,

>

> I had created a selection screen with two parameters.

> 1st parameter have search help.

> I got F4 help on value request for 2nd parameter.

>

> My requirement is, after entering value in 1st parameter, relavant records from table should be fetched

> and only those data should be in f4 help for 2nd parameter.

>

> Everything is working fine as per requirement.

> Only problem is , after entering data in parameter1, till a ENTER Hit, F4 help for Parameter 2 is not workking.

> I think this is for a event trigger, But how can i over come this issue to avoid ENTER HIT.

>

> Thanks in Advance,

>

> Regards

> Ravi

Hi Ravi,

Here is a Sample code where for P_EBELN standard search help is working and for P_EBELP, F4 help on value request is done.

Sample code is

REPORT ztest.

PARAMETERS : p_ebeln TYPE ebeln,
             p_ebelp TYPE ebelp.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ebelp.
  DATA : dynp_fields LIKE dynpread OCCURS 0 WITH HEADER LINE.
  DATA : l_ebeln     TYPE ebeln.
  DATA : BEGIN OF it_ekpo OCCURS 0,
          ebeln TYPE ebeln,
          ebelp TYPE ebelp,
         END OF it_ekpo.

  dynp_fields-fieldname = 'P_EBELN'.
  APPEND dynp_fields TO dynp_fields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-repid
      dynumb     = sy-dynnr
    TABLES
      dynpfields = dynp_fields
    EXCEPTIONS
      OTHERS     = 99.

  READ TABLE dynp_fields WITH KEY fieldname = 'P_EBELN'.
  IF sy-subrc EQ 0.
    IF dynp_fields-fieldvalue IS NOT INITIAL.
      l_ebeln = dynp_fields-fieldvalue.

      SELECT ebeln
             ebelp
        FROM ekpo
        INTO TABLE it_ekpo
       WHERE ebeln = l_ebeln.

      CHECK sy-subrc EQ 0.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'EBELP'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_EBELN'
          value_org       = 'S'
        TABLES
          value_tab       = it_ekpo
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
        MESSAGE i398(00) WITH 'Error When Showing Help'(002).
      ENDIF.
    ENDIF.
  ENDIF.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
704

Hi,

Use event AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2 , and then use like:-


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2.

And refer code for f4 help:-


  TYPES : BEGIN OF it,
            area TYPE yapn-area,
          END OF it.

  DATA : itab TYPE STANDARD TABLE OF it WITH HEADER LINE,
         tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
         spey TYPE yapn-spey.

  CLEAR:   tb_dynpfields.
  REFRESH: tb_dynpfields.

  MOVE 'YAPN-SPEY' TO tb_dynpfields-fieldname.
  APPEND tb_dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
  EXPORTING
    dyname                               = 'Z_F1F4'
    dynumb                               = '1000'
  TABLES
    dynpfields                           = tb_dynpfields
  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 <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  READ TABLE tb_dynpfields INDEX 1.
  IF sy-subrc EQ 0.
    spey = tb_dynpfields-fieldvalue.
  ELSE.
    spey = ' '.
  ENDIF.

  IF spey EQ ' '.
    itab-area = 'Fresher'.
    APPEND itab.
  ESLE.
    SELECT area FROM yapn
      INTO TABLE itab
    WHERE
      spey = spey.
  ENDIF.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
   EXPORTING
    retfield               = 'AREA'
    dynpprog               = 'Z_F1F4'
    dynpnr                 = '1010'
    dynprofield            = 'AREA'
    value_org              = 'S'
  TABLES
    value_tab              = itab
  EXCEPTIONS
    PARAMETER_ERROR        = 1
    NO_VALUES_FOUND        = 2
    OTHERS                 = 3
            .
  IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
704

Hi Ravi,

Use the FM giving below:

DYNP_VALUES_UPDATE

Very useful when you want to change a field based on the value entered for another field.

DYNP_VALUES_READ

With luck,

Pritam.