Skip to Content

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

rfq number for respective PR number

Hi all,

I am trying to fetch pr number and rfq number in my internal table , and my requirement is that all the rfq numbers should be displayed for the given pr number. The code is given below please help me to solve this issue.

CODE:


SELECT:
         EBAN~WERKS
         EBAN~BANFN
         EBAN~BADAT
         EBAN~FRGDT
         EBAN~EBELN
         EBAN~BEDAT
         EBAN~MATNR


INTO CORRESPONDING FIELDS OF WA_FINAL
   FROM EBAN
   WHERE EBAN~WERKS IN WERKS AND EBAN~BEDAT IN BEDAT

   .



   APPEND WA_FINAL TO IT_FINAL.

*  SORT IT_FINAL BY BANFN.
* DELETE ADJACENT DUPLICATES FROM IT_FINAL COMPARING EBELN.

ENDSELECT.

LOOP AT IT_FINAL INTO WA_FINAL.

   SELECT SINGLE EBELN INTO WA_FINAL-EBELN1 FROM EKET WHERE BANFN = WA_FINAL-BANFN AND EBELN LIKE '6%'.

   IF SY-SUBRC = 0.
     MODIFY IT_FINAL INDEX SY-TABIX FROM WA_FINAL.
*    DELETE ADJACENT DUPLICATES FROM IT_FINAL COMPARING EBELN1.
   ENDIF.
ENDLOOP.

LOOP AT IT_FINAL INTO WA_FINAL.
   SELECT  AEDAT LIFNR SUBMI INTO (WA_FINAL-AEDAT1, WA_FINAL-LIFNR, WA_FINAL-SUBMI) FROM EKKO WHERE EBELN = WA_FINAL-EBELN1 AND BSTYP = 'A'.

   IF SY-SUBRC = 0.
     MODIFY IT_FINAL INDEX SY-TABIX FROM WA_FINAL TRANSPORTING AEDAT1 LIFNR SUBMI.
   ENDIF.
   ENDSELECT.
ENDLOOP.

LOOP AT IT_FINAL INTO WA_FINAL.
SELECT  * FROM MSEG WHERE EBELN = WA_FINAL-EBELN AND MATNR = WA_FINAL-MATNR AND BWART = '103'.
  MOVE-CORRESPONDING MSEG TO WA_FINAL.

  IF SY-SUBRC = 0.
   MODIFY IT_FINAL INDEX SY-TABIX FROM WA_FINAL.
  ENDIF.
ENDSELECT.
ENDLOOP.


LOOP AT IT_FINAL INTO WA_FINAL.
SELECT  NAME1 INTO WA_FINAL-NAME1 FROM LFA1 WHERE LIFNR = WA_FINAL-LIFNR.

  IF SY-SUBRC = 0.
   MODIFY IT_FINAL INDEX SY-TABIX FROM WA_FINAL TRANSPORTING NAME1.
  ENDIF.
  ENDSELECT.

Thanks,

Saurabh Gadkari.

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