Skip to Content

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

Ignore Warnings on BAPI_PO_CHANGE

Hi Experts,

The following code produces error "No message generated for output of purchasing document". This prevents the BAPI from saving the document. This error is actually a yellow warning. When completing the changes manually in ME22N the user has the option to ignore warnings & save.

Is there any code which can be added so that yellow warnings are ignored?

Thanks for your time.

Here is my complete code:

 
REPORT  Z_MASS_REMOVE_FDI_DCI_BAPI.

*head
PARAMETERS: p_ebeln LIKE bapimepoheader-po_number OBLIGATORY.

*Item
PARAMETERS :p_ebelp LIKE bapimepoitem-po_item DEFAULT 1.

DATA: s_header TYPE bapimepoheader,
      s_headerx TYPE bapimepoheaderx,
      s_item TYPE bapimepoitem,
      s_itemx TYPE bapimepoitemx,
      i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
      i_extension TYPE bapiparex OCCURS 0 WITH HEADER LINE,
      s_bapimepoheader TYPE bapimepoheader,
      s_bapimepoheaderx TYPE bapimepoheaderx,
      s_bapimepoitem TYPE bapimepoitem occurs 0 with header line,
      s_bapimepoitemX TYPE bapimepoitemX occurs 0 with header line,
      wa_message TYPE c LENGTH 100.

s_bapimepoheaderx-po_number = p_ebeln.
s_bapimepoheader-po_number = p_ebeln.

s_bapimepoitemx-PO_ITEM = p_ebelp.
s_bapimepoitem-PO_ITEM = p_ebelp.

s_bapimepoitemx-DELIV_COMPL = 'X'.
s_bapimepoitem-DELIV_COMPL = 'X'.

append s_bapimepoitem.
clear s_bapimepoitem.

append s_bapimepoitemx.
clear s_bapimepoitemx.

s_header-po_number = p_ebeln.
S_item-PO_ITEM = p_ebelp.

CALL FUNCTION 'BAPI_PO_CHANGE'
  EXPORTING
    purchaseorder = p_ebeln
  TABLES
    return        = i_return
    poitem        = s_bapimepoitem
    poitemx      =  s_bapimepoitemx.

COMMIT WORK AND WAIT.

LOOP AT i_return.
  MESSAGE ID   i_return-id
       TYPE    i_return-type
       NUMBER  i_return-number WITH
               i_return-message_v1
               i_return-message_v2
               i_return-message_v3
               i_return-message_v4.
ENDLOOP. 

Tags:
Former Member
Former Member replied

Hi Nathan ,

u need to config output types of PO, this can done thru Tcode NACE.

if u want to ignore this message from ur code , then u need do one thing.

u need to delete this message from the Internal table RETURN based on the Message ID , Type , No.

sameple code

DELETE GT_MSSG WHERE ( MESSAGE_TYPE EQ 'E' AND

MESSAGE_NO EQ '525' AND

MESSAGE_ID EQ 'CL' ).

regards

Prabhu

0 View this answer in context

Helpful Answer

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