Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

how to show multiple line item errors while Posting PO in Me21N

$
0
0

Hi Experts,

 

http://scn.sap.com/thread/3370195

 

Based on the above thread, I have coded by following ways, here in second coded lines --> maintained all the error messages. These all error messages should populate while posting PO (with multiple line items). If you need any clarity in this post, always free to respond you soon.

 

DATA: WA_ TYPE ZTABLE,
          ITAB TYPE STANDARD TABLE OF ZTABLE.

SELECT * FROM ZTABLE
                 INTO TABLE ITAB
                 WHERE DOC_TYPE = I_EKKO-BSART.

LOOP AT ITAB INTO WA.

READ TABLE TEKPO WITH KEY MATKL = WA-MAT_GRP.

IF SY-SUBRC = 0.

   MESSAGE E065(ZMSG)
   with 'Material group' TEKPO-MATKL
   'not maintained for PO type' WA-DOC_TYPE.           """ First founded error msg is populating. What about other items??

ENDIF.

ENDLOOP.

 

--------------------------------------------------------------------------------------------------

 

 

DATA: WA TYPE ZTABLE,

          ITAB TYPE STANDARD TABLE OF ZTABLE.

 

DATA: WA_ERROR TYPE STRING,

      IT_ERROR TYPE STANDARD TABLE OF STRING.

 

SELECT * FROM ZTABLE

                INTO TABLE ITBLE

                WHERE DOC_TYPE = I_EKKO-BSART.

 

 

LOOP AT TEKPO.

 

  READ TABLE ITAB INTO WA WITH KEY MAT_GRP = TEKPO-MATKL.

 

  IF SY-SUBRC = 0.

 

    CONCATENATE 'Material group'

                            TEKPO-MATKL

                            'not maintained for PO type'

                            WA-DOC_TYPE

          INTO WA_ERROR

          SEPARATED BY SPACE.

 

    APPEND WA_ERROR TO IT_ERROR.

 

  ENDIF.

 

ENDLOOP.

 

LOOP AT IT_ERROR INTO WA_ERROR.

 

  MESSAGE WA_ERROR TYPE 'E'.  """" Here also same like above, first record of error message is populating. What about remaining??

 

ENDLOOP.

 

 

 

 

Regards,

Kiran


Viewing all articles
Browse latest Browse all 8332

Trending Articles