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

Selection screen fields

vidyadhar2k2
Explorer
0 Likes
1,946

Hi ,

There are no of selection screen fields, in that two are 1) PO number 2) PO item.

The requirement is by giving the first field value as PO number and with out pressing enter, in the second field the po item values of that particular PO number should appear in the F4 screen when we press F4.

Please provide the code if possible.

it is an very urgent requirement for the client.

Thanks & Regards,

Vidyadhar

4 REPLIES 4
Read only

Former Member
0 Likes
777

Hi,

You should program your own value help for the PO item field:

parameters:

pa_ebeln TYPE ebeln,

pa_ebelp TYPE ebelp.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_ebelp.

DATA:

zls_dynpfield TYPE dynpread,

zlt_dynpfields TYPE TABLE OF dynpread,

zlv_dynpro TYPE syst-repid.

zlv_dynpro = syst-repid.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = zlv_dynpro

dynumb = syst-dynnr

request = 'A'

TABLES

dynpfields = zlt_dynpfields

EXCEPTIONS

OTHERS = 0.

LOOP AT zlt_dynpfields INTO zls_dynpfield.

CASE zls_dynpfield-fieldname.

WHEN 'PA_EBELN'.

......

ENDCASE.

ENDLOOP.

CALL FUNCTION 'DYNP_VALUES_READ'

Read only

harimanjesh_an
Active Participant
0 Likes
777

hi kurmala,

<b>

This is the easiest way............. And definitely works</b>

1) For this you need to create a Search help that EXPORTS these two values EBELN and EBELP.

2) And then Create a structure in SE11 which will have these two fields

3) And you should assign your search help to one of the fields of structure i.e,

MAP your search help EXPORT parameters to your Structure fields( for any one field).

After doing this, use this structure to create your selection-screen fields.

Example:

PARAMETER: fld1 LIKE struct-fld1,

fld2 LIKE struct-fld2.

Here<b> struct </b> is the structure that you create and where you assign your search help to structure.

check this link:

This link contains -- how to create search help, how to attach search help to field in se11.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm

Elementary Search Help

1) Goto SE11

Enter the search help name and click on create.

2)Choose elementary search help radio button option as the search help type.

3)Enter the search help parameters, the selection method and activate the search help.

Reward me if useful..............

Harimanjesh AN

Read only

Former Member
0 Likes
777

Hi,

F4IF_FIELD_VALUE_REQUEST

This FM is used to display value help or input from ABAP dictionary.We have to pass the name of the structure or table(TABNAME) along with the field name(FIELDNAME) . The selection can be returned to the specified screen field if three

parameters DYNPNR,DYNPPROG,DYNPROFIELD are also specified or to a table if RETRN_TAB is specified.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = table/structure

FIELDNAME = 'field name'

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNR

DYNPROFIELD = 'screen field'

IMPORTING

RETURN_TAB = table of type DYNPREAD

.

F4IF_INT_TABLE_VALUE_REQUEST

This FM is used to dsiplay values stored in an internal table as input

help.This FM is used to program our own custom help if no such input help

exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD

is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.

If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = field from int table whose value will be returned

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'screen field'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = internal table whose values will be shown.

RETURN_TAB = internal table of type DDSHRETVAL

EXCEPTIONS

parameter_error = 1

no_values_found = 2

others = 3.

See the following ex:

TYPES: BEGIN OF TY_MBLNR,

MBLNR LIKE MKPF-MBLNR,

END OF TY_MBLNR.

DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.

data: it_ret like ddshretval occurs 0 with header line.

At selection-screen on value-request for s_mat-low.

Select MBLNR from mkpf into table it_mblnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MBLNR

  • FIELD_TAB =

RETURN_TAB = IT_RET

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

IF SY-SUBRC = 0.

read table it_ret index 1.

move it_ret-fieldval to S_mat-low.

ENDIF.

Go through the test program.

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Read only

Former Member
0 Likes
777

Hi Vidyadhar,

Seems Ifound solution for your post....

just cut & paste below code and check...


"PS: You must enter full PO number for ex: '0000051622' not 51622
REPORT TEST.
TABLES : ekpo.

DATA: BEGIN OF itab OCCURS 0,
ebelp LIKE ekpo-ebelp,
END OF itab.

PARAMETERS  s_po LIKE ekpo-ebeln.
SELECT-OPTIONS s_item FOR ekpo-ebelp.

INITIALIZATION.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
  DATA:
  dyn_field TYPE dynpread,
  temp_fields TYPE TABLE OF dynpread,
  zlv_dynpro TYPE syst-repid.
  zlv_dynpro = syst-repid.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = zlv_dynpro
      dynumb     = syst-dynnr
      request    = 'A'
    TABLES
      dynpfields = temp_fields
    EXCEPTIONS
      OTHERS     = 0.

  LOOP AT temp_fields INTO dyn_field.
    IF dyn_field-fieldname EQ 'S_PO'.
        SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
        WHERE ebeln EQ dyn_field-fieldvalue.
        EXIT.
    ENDIF.
  ENDLOOP.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'EBELP'
      dynprofield = 'S_ITEM-LOW'
      dynpprog    = sy-cprog
      dynpnr      = sy-dynnr
      value_org   = 'S'
    TABLES
      value_tab   = itab.

*start-of-selection.