Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Structure is not getting filled in the subroutine

Hi Gurus,

I'm working on a Z-report ZMB52 for fetching Reserved Stock and showing it in a column.

The following code in a subroutine I've written for the same.

DATA: GS_RESB LIKE LINE OF GT_RESB.

    CLEAR: BESTAND.

    IF BESTAND[] IS NOT INITIAL.

      SELECT MATNR
             BDMNG
        FROM RESB
        INTO TABLE GT_RESB
        FOR ALL ENTRIES IN BESTAND[]
        WHERE MATNR EQ BESTAND-MATNR.

        IF SY-SUBRC EQ 0.
          SORT GT_RESB BY MATNR.

          LOOP AT BESTAND.

           READ TABLE GT_RESB INTO GS_RESB WITH KEY MATNR = BESTAND-MATNR. "BINARY SEARCH.
             IF SY-SUBRC EQ 0.
               MODIFY BESTAND TRANSPORTING BDMNG WHERE MATNR = BESTAND-MATNR.
             ENDIF.

             CLEAR: BESTAND, GS_RESB.

          ENDLOOP.
        ENDIF.
     ENDIF.



When I debug, I can see that the structure GS_RESB is not getting filled through the READ TABLE statement. However, GT_RESB shows the data.

Could you please tell me where am I going wrong and a way to correct it?

Thanks in Advance!


Best Regards,

Ashutosh.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question