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 Programming!!

Former Member
0 Likes
792

Dear all,

I have an issue, I need to except three values on a screen and process them,

as soon as the user enters the first field (even before OK_CODE ) I need to process the value in that field and control the entry of the next 2 fields.

Can any one tell me how to process the content of the field even before the OK_CODE is execuated.

Thanks,

VJ

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
772

You must fire some event in order for the application to process the screen, meaning user must hit enter or something. You may be able to tie an FCODE to a listbox field, where when the user selects a value from a listbox, the FCODE is automatically fired. Would this work for you?

Regards,

Rich Heilman

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
773

You must fire some event in order for the application to process the screen, meaning user must hit enter or something. You may be able to tie an FCODE to a listbox field, where when the user selects a value from a listbox, the FCODE is automatically fired. Would this work for you?

Regards,

Rich Heilman

Read only

0 Likes
772

It may work, but the next field the user need to enter a value is depandent on the previous field

1) Plant

2) Family

3) Period

Plant will determine the process on value request for the next two fields ( family and period).

I need to process the content of the field "plant" when the process on value request is activated on next two fields.

Read only

0 Likes
772

Oh, in that case, you can simply use the DYNP_VALUES_READ function module to read the plant value when you are doing the F4 help.

Regards,

Rich Heilman

Read only

0 Likes
772

any sample codes for my help~!!!!!

Read only

0 Likes
772

Here is a sample where it is implemented in a selection screen, it is pretty much the same when doing it with a dynpro.

For example, if you enter a sales document number, and do F4 on the item, only the item numbers that exist for that sales document will be shown.



report zrich_0002 .

parameters: p_vbeln type vbak-vbeln,
            p_posnr type vbap-posnr.

at selection-screen on value-request for p_posnr.


  data: begin of help_item occurs 0,
          posnr type vbap-posnr,
          matnr type vbap-matnr,
          arktx type vbap-arktx,
        end of help_item.

  data: dynfields type table of dynpread with header line.


  dynfields-fieldname = 'P_VBELN'.
  append dynfields.

  call function 'DYNP_VALUES_READ'
       exporting
            dyname               = sy-cprog
            dynumb               = sy-dynnr
            translate_to_upper   = 'X'
       tables
            dynpfields           = dynfields
       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.


  read table dynfields with key fieldname = 'P_VBELN'.

  p_vbeln = dynfields-fieldvalue.


  call function 'CONVERSION_EXIT_ALPHA_INPUT'
       exporting
            input  = p_vbeln
       importing
            output = p_vbeln.

  select posnr matnr arktx into table help_item
                 from vbap
                      where vbeln = p_vbeln.



  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'POSNR'
            dynprofield = 'P_POSNR'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = help_item.

REgards,

RIch Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
772

Yep, just tested this in Netweaver 2004s, works good. IN screen painter, double click on the field in question, in the dialog, select "ListBox" for the "DropDown" field, then set an fcode in the FCODE field. Save and activate. Now when the user selects a value the PAI will be fired automatically.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
772

Thanks Rich