Skip to Content

Production order status

Dear All,

We have insert one field in zva05n report

1 : If production order created mode then status showing "Created"

2 : If production order Released mode then status showing " Released"

3 : If production order clsoed mode then status showing " Ready"

Our report is working fine but If production order created mode then report status showing "Released" please check our code and give me idea how to get proper status.

READ TABLE IT_AUFK INTO WA_AUFK WITH KEY KDAUF = ITAB-VBELN KDPOS = ITAB-POSNR.
IF SY-SUBRC = 0.
READ TABLE IT_JEST INTO WA_JEST WITH KEY OBJNR = WA_AUFK-OBJNR.

IF SY-SUBRC = 0.
ITAB-AUFNR = WA_AUFK-AUFNR.
ITAB-STATS = 'Ready To Dispatch'.

ELSEIF SY-SUBRC NE 0.
ITAB-AUFNR = WA_AUFK-AUFNR.
ITAB-STATS = 'RELEASED'.

ELSEIF SY-SUBRC NE 0.
ELSEIF SY-SUBRC NE 0.
READ TABLE IT_JEST INTO WA_JEST WITH KEY STAT = 'I0001'.
ITAB-AUFNR = WA_AUFK-AUFNR.
ITAB-STATS = 'CREATED'.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 16 at 09:19 AM

    Hello there!
    As first thing, please, use the "CODE" option so your code is formatted and we can understand what your are doing.

    In second step, you are reading JEST table, but an object can have multiple states active and you should skim the one with INACT = X


    Secondly, by customizing, you can say to the system to release an order during the creation.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17 at 11:18 AM

    You code wont never get past first lines of code

    IF SY-SUBRC = 0. " sy-subrc value = 0
    ITAB-AUFNR = WA_AUFK-AUFNR.
    ITAB-STATS = 'Ready To Dispatch'.
    ELSEIF SY-SUBRC NE 0. " " sy-subrc value <> 0 so always if not first case
    ITAB-AUFNR = WA_AUFK-AUFNR.
    ITAB-STATS = 'RELEASED'.
    ELSEIF SY-SUBRC NE 0. " " from there til ENDIF ureachable/deac code
    ELSEIF SY-SUBRC NE 0.
    READ TABLE IT_JEST INTO WA_JEST WITH KEY STAT = 'I0001'.
    ITAB-AUFNR = WA_AUFK-AUFNR.
    ITAB-STATS = 'CREATED'.
    
    Add comment
    10|10000 characters needed characters exceeded