Skip to Content

F4 Help for PO & PO ITEM

Dear Experts,

I had developed one module pool screen. my key fields in it are PO & PO ITEM.


Now I had create F4 help for PO which returns PO number only.


I want to return PO and PO item at time.


I had read many post and try but not satisfied.


Please check following code.


DATA: BEGIN OF IT_PO OCCURS 0,
EBELN TYPE EKKO-EBELN,
EBELP TYPE EKPO-EBELP,
MATNR TYPE EKPO-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF IT_PO.

REFRESH : IT_PO,I_RETURN_TAB.
CLEAR : W_RETURN_TAB.


SELECT DISTINCT A~EBELN B~EBELP B~MATNR C~MAKTX
INTO TABLE IT_PO
FROM EKKO AS A
INNER JOIN EKPO AS B
ON A~EBELN = B~EBELN
INNER JOIN MAKT AS C
ON B~MATNR = C~MATNR
WHERE A~BSART EQ 'NB'
AND A~EKGRP IN ('P03','P12')
AND A~LIFNR EQ V_LIFNR
AND ( ( A~FRGGR = '' AND A~FRGSX = '' AND A~FRGKE = '' ) OR
( A~FRGKE EQ 'R' ) )
AND B~LOEKZ EQ ''
AND B~ELIKZ EQ ''.


CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
POVSTEPL = V_DYNINDEX.

* I_FIELD-FLDNAME = 'EBELN'.
* I_FIELD-DYFLDNAME = 'WA_SCHEDULE-EBELN'.
* APPEND I_FIELD.
* CLEAR I_FIELD.
* I_FIELD-FLDNAME = 'EBELP'.
* I_FIELD-DYFLDNAME = 'WA_SCHEDULE-EBELP'.
* APPEND I_FIELD.
* CLEAR I_FIELD.

IF IT_PO[] IS NOT INITIAL.
SORT IT_PO BY EBELN DESCENDING EBELP ASCENDING.


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'EBELN'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'WA_SCHEDULE-EBELN'
VALUE_ORG = 'S'
STEPL = V_DYNINDEX
MULTIPLE_CHOICE = 'X'
TABLES
VALUE_TAB = IT_PO[]
RETURN_TAB = I_RETURN_TAB
* FIELD_TAB =
DYNPFLD_MAPPING = I_FIELD[].


* BREAK-POINT.
* READ TABLE I_RETURN_TAB INTO W_RETURN_TAB INDEX 1.
* IT_PO-EBELN = W_RETURN_TAB-FIELDVAL.
*
* IF SY-SUBRC = 0.
* W_DYNPFIELDS-FIELDNAME = 'WA_SCHEDULE-EBELN'.
* W_DYNPFIELDS-FIELDVALUE = IT_PO-EBELN.
* W_DYNPFIELDS-STEPL = V_DYNINDEX.
* APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
* CLEAR W_DYNPFIELDS.
* W_DYNPFIELDS-FIELDNAME = 'WA_SCHEDULE-EBELP'.
* W_DYNPFIELDS-FIELDVALUE = IT_PO-EBELP.
* W_DYNPFIELDS-STEPL = V_DYNINDEX.
* APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
* CLEAR W_DYNPFIELDS.
* W_DYNPFIELDS-FIELDNAME = 'WA_SCHEDULE-MATNR'.
* W_DYNPFIELDS-FIELDVALUE = IT_PO-MATNR.
* W_DYNPFIELDS-STEPL = V_DYNINDEX.
* APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
* CLEAR W_DYNPFIELDS.
* W_DYNPFIELDS-FIELDNAME = 'WA_SCHEDULE-MAKTX'.
* W_DYNPFIELDS-FIELDVALUE = IT_PO-MAKTX.
* W_DYNPFIELDS-STEPL = V_DYNINDEX.
* APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
* CLEAR W_DYNPFIELDS.
* CALL FUNCTION 'DYNP_VALUES_UPDATE'
* EXPORTING
* DYNAME = SY-REPID
* DYNUMB = SY-DYNNR
* TABLES
* DYNPFIELDS = I_DYNPFIELDS.
* ENDIF.
ELSE.
MESSAGE 'No Purchase Orders found.' TYPE 'S'.
ENDIF.

Regards,


Nayan Lad

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Sep 13, 2014 at 08:46 AM

    Hi,

    Hope it helpful.

    Try.

    Create the Search help and include in screen painter.

    Regards,

    Venkat.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 14, 2014 at 07:14 PM

    Try

    I_FIELD-FLDNAME = 'F0001'.

    I_FIELD-DYFLDNAME = 'WA_SCHEDULE-EBELN'.

    APPEND I_FIELD.

    CLEAR I_FIELD.

    I_FIELD-FLDNAME = 'F0002'.

    I_FIELD-DYFLDNAME = 'WA_SCHEDULE-EBELP'.

    APPEND I_FIELD.

    CLEAR I_FIELD.

    0001 in F0001 relates to your first field in IT_PO table

    Add comment
    10|10000 characters needed characters exceeded