Skip to Content
0
Oct 07, 2009 at 05:21 AM

call transaction in foregrnd not working

43 Views

Hello Experts,

I am working on a report where I am calling transaction lp10 in foreground. But I am facing a issue where if suppose I have 15PM-Orders than only 1 PM Order comes up and than the rest does not come in lp10 transaction.

My report is

START-OF-SELECTION.
  SELECT
        AUFNR
        AUART
        OBJNR
        WERKS
        AUTYP
       INTO CORRESPONDING FIELDS OF TABLE ITAB
            FROM AUFK WHERE AUFNR IN S_AUFNR
                      AND WERKS IN S_IWERK
                      AND AUART IN S_AUART
                      AND ERDAT IN S_ERDAT
                      AND ERNAM IN S_ERNAM
                      AND AUTYP = '30'.

  IF SY-SUBRC NE 0.

    SELECT
            AUFNR
            AUART
            OBJNR
            WERKS
            AUTYP
           INTO CORRESPONDING FIELDS OF TABLE ITAB
                FROM AUFK WHERE AUFNR IN S_AUFNR
                                AND ERDAT IN S_ERDAT
                                AND ERNAM IN S_ERNAM
                                AND AUTYP = '30'.
  ENDIF.

  LOOP AT ITAB.

* select all status
    SELECT STAT INACT FROM JEST INTO CORRESPONDING FIELDS OF ITAB1
                                          WHERE OBJNR = ITAB-OBJNR.

       MOVE-CORRESPONDING ITAB TO ITAB1.

      APPEND ITAB1.
    ENDSELECT.
  ENDLOOP.

  LOOP AT ITAB1.
*Status 'I0485' = KKMP   Keine Materialkomponenten
    IF ITAB1-STAT = 'I0485' AND ITAB1-INACT = SPACE.
       MOVE-CORRESPONDING ITAB1 TO ITAB2.
      APPEND ITAB2.
    ENDIF.

*Status 'I0045' = TABG   Technically completed
    IF ITAB1-STAT = 'I0045' AND ITAB1-INACT = SPACE.
       MOVE-CORRESPONDING ITAB1 TO ITAB2.
      APPEND ITAB2.
    ENDIF.
  ENDLOOP.

  LOOP AT ITAB2.
    LOOP AT ITAB1.
      DELETE ITAB1 WHERE AUFNR = ITAB2-AUFNR.
      EXIT.
    ENDLOOP.
  ENDLOOP.
  READ TABLE ITAB1 INDEX 1.
  CAUFVD-GLTRP = SY-DATUM.