Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

System status per operation

Former Member
0 Likes
663

How to get the individual status per operation in Production Order, CO03.

I'm stuck in j_stmaint structure.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
612

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.

2 REPLIES 2
Read only

Former Member
0 Likes
612

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
613

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