1.通过生产订单从AUFK中取得OBJNR字段
2.根据OBJNR字段使用函数取得订单状态
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
* CLIENT = SY-MANDT
* FLG_USER_STAT = ' '
objnr = it_afko_r-objnr
only_active = 'X'
spras = sy-langu
bypass_buffer = ' '
IMPORTING
line = it_afko_r-state.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = v_objnr
only_active = 'X'
IMPORTING
obtyp = v_obtyp
stsma = v_stsma
stonr = v_stonr
TABLES
status = it_jstat.
3.JEST、JSTO查询订单状态
TJ02T查询状态文本,如‘I0045’
TJ30T查询状态文本,如‘E0001’