FUNCTION ZFI_GET_WBS_INFO.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(PSPID) TYPE PROJ-PSPID OPTIONAL
*" TABLES
*" OUTPUT STRUCTURE ZFI_WBS_INFO OPTIONAL
*"----------------------------------------------------------------------
TYPES:BEGIN OF TY_ITAB,
PSPNR TYPE PRPS-PSPNR,
POST1 TYPE PRPS-POST1,
END OF TY_ITAB.
DATA:ITAB TYPE TABLE OF TY_ITAB WITH HEADER LINE,
m_PSPNR TYPE PROJ-PSPNR.
*删除前面的0
SHIFT PSPID LEFT DELETING LEADING '0'.
*转换成内码
CALL FUNCTION 'CONVERSION_EXIT_ABPRJ_INPUT'
EXPORTING
INPUT = PSPID
IMPORTING
OUTPUT = m_PSPNR.
*从PRPS中取值
SELECT PSPNR
POST1
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PRPS
WHERE PSPHI = m_PSPNR.
LOOP AT ITAB.
CALL FUNCTION 'CONVERSION_EXIT_KONPR_OUTPUT'
EXPORTING
INPUT = ITAB-PSPNR
IMPORTING
OUTPUT = OUTPUT-POSID.
OUTPUT-POST1 = ITAB-POST1.
APPEND OUTPUT.
CLEAR OUTPUT.
ENDLOOP.
ENDFUNCTION.