Get Field MARA-FERTH By PO - Z_BAPI_GET_PO_PRODINSP_MEMO
FUNCTION Z_BAPI_GET_PO_PRODINSP_MEMO.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(I_PONUM) LIKE AFKO-AUFNR
*" EXPORTING
*" REFERENCE(E_RETURN) LIKE MARA-FERTH
*"----------------------------------------------------------------------
* Author: Wei_Zhu
* Date: 2007-04-19
* Description: Check by PO --> Field MARA-FERTH then
* Return the field contain
*
*-----------------------------------------------------------------------
Tables: AFKO, MARA.
DATA: L_RETURN LIKE MARA-FERTH.
Select SINGLE MARA~FERTH INTO L_RETURN
FROM AFKO
INNER JOIN MARA
ON AFKO~PLNBEZ = MARA~MATNR
WHERE AFKO~AUFNR = I_PONUM.
IF SY-SUBRC = 0.
E_RETURN = L_RETURN.
ELSE.
E_RETURN = ''.
ENDIF.
ENDFUNCTION.
---Test Result