2006 Jun 27 1:38 AM
How to get the individual status per operation in Production Order, CO03.
I'm stuck in j_stmaint structure.
2006 Jun 27 1:57 AM
Here is a sample program. I think this will give you some idea.
report zrich_0001.
data: xline type bsvx-sttxt.
data: xafko type afko .
data: iafvc type table of afvc with header line.
parameters: p_aufnr type aufk-aufnr.
start-of-selection.
select single * from afko into xafko
where aufnr = p_aufnr.
select * into table iafvc from afvc
where aufpl = xafko-aufpl.
loop at iafvc.
call function 'STATUS_TEXT_EDIT'
exporting
flg_user_stat = 'X'
objnr = iafvc-objnr
only_active = 'X'
spras = sy-langu
importing
line = xline
exceptions
object_not_found = 01.
write:/ iafvc-vornr, xline.
endloop.
REgards,
Rich Heilman
How to get the individual status per operation in Production Order, CO03.
I'm stuck in j_stmaint structure.
2006 Jun 27 1:55 AM
Hi Jose,
I hope following code will help you. You have to use the fn/. module STATUS_TEXT_EDIT.
SELECT SINGLE objnr INTO v_objnr FROM aufk
WHERE aufnr = f_afko-aufnr.
IF NOT v_objnr IS INITIAL.
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
client = sy-mandt
objnr = v_objnr
only_active = 'X'
spras = sy-langu
IMPORTING
line = v_status
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE v_status TO ze1afkol_rec-status.
ENDIF.
Cheers
Prasad
2006 Jun 27 1:57 AM
Here is a sample program. I think this will give you some idea.
report zrich_0001.
data: xline type bsvx-sttxt.
data: xafko type afko .
data: iafvc type table of afvc with header line.
parameters: p_aufnr type aufk-aufnr.
start-of-selection.
select single * from afko into xafko
where aufnr = p_aufnr.
select * into table iafvc from afvc
where aufpl = xafko-aufpl.
loop at iafvc.
call function 'STATUS_TEXT_EDIT'
exporting
flg_user_stat = 'X'
objnr = iafvc-objnr
only_active = 'X'
spras = sy-langu
importing
line = xline
exceptions
object_not_found = 01.
write:/ iafvc-vornr, xline.
endloop.
REgards,
Rich Heilman