<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error message not coming up correct. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966782#M1603400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SB&lt;/P&gt;&lt;P&gt;For the parameters of your message in this case you should be use the position of lw_zbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE lt_zbox INTO lw_zbox WITH KEY
sales_order = lw_lips-vgbel sales_item = lw_lips-vgpos matnr = lw_lips-matnr." quant = lw_lips-lfimg.
IF sy-subrc = 0.
clear lf_box_num.
Move lw_box-box_num to lf_box_num.
MESSAGE e003 WITH lw_zbox-sales_order lw_zbox-sales_item lf_box_num.
EXIT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jun 2011 13:27:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-30T13:27:08Z</dc:date>
    <item>
      <title>Error message not coming up correct.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966780#M1603398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to display error message by comparing the LIPS table and a ZBOX table. Currently I am summing up the box table. Looping on LIPS and then reading the box table by sales_order sales_item and matnr.IF no of lines in lips&amp;gt; thank the box, throw the error ...  the the error message is correct, but the sales_item is coming wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIPS&lt;/P&gt;&lt;P&gt;VBELN      | POSNR | MATNR     | LFIMG&lt;/P&gt;&lt;P&gt;002743747 | 000010 | MATNR1    | 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOX&lt;/P&gt;&lt;P&gt;BOXNUM | SALES_ORDER | SALES_ITEM | MATNR | QUANT&lt;/P&gt;&lt;P&gt;00001 	| 002743747          | 000010            | MATNR1| 1&lt;/P&gt;&lt;P&gt;00002 	| 002743747          | 000010            | MATNR1| 1&lt;/P&gt;&lt;P&gt;00003 	| 002743747          | 000020            | MATNR2| 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error message should be Sales Order 002743747  Sale item 000020 are boxed.....&lt;/P&gt;&lt;P&gt;but I am getting...Sales Order 002743747  Sale item 000010 are boxed.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Compare lt_lips &amp;amp; lt_final&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT lt_lips INTO lw_lips.&lt;/P&gt;&lt;P&gt;    READ TABLE lt_final INTO lw_final WITH KEY&lt;/P&gt;&lt;P&gt;               sales_order = lw_lips-vgbel sales_item = lw_lips-vgpos matnr = lw_lips-matnr quant = lw_lips-lfimg.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e002 WITH lw_final-matnr lw_final-sales_order lw_final-sales_item lw_final-quantity.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      READ TABLE lt_final INTO lw_final WITH KEY&lt;/P&gt;&lt;P&gt;              sales_order = lw_lips-vgbel sales_item = lw_lips-vgpos.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        DESCRIBE TABLE lt_lips LINES lf_lips_lines.&lt;/P&gt;&lt;P&gt;        DESCRIBE TABLE lt_final LINES lf_final_lines.&lt;/P&gt;&lt;P&gt;        IF lf_final_lines &amp;gt; lf_lips_lines.&lt;/P&gt;&lt;P&gt;          READ TABLE lt_zbox INTO lw_zbox WITH KEY&lt;/P&gt;&lt;P&gt;                     sales_order = lw_lips-vgbel sales_item = lw_lips-vgpos matnr = lw_lips-matnr." quant = lw_lips-lfimg.&lt;/P&gt;&lt;P&gt;          IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          clear lf_box_num.&lt;/P&gt;&lt;P&gt;           Move lw_box-box_num to lf_box_num.&lt;/P&gt;&lt;P&gt;            MESSAGE e003 WITH lw_final-sales_order lw_final-sales_item lf_box_num.&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;            MESSAGE e005 WITH lw_final-sales_order lw_final-sales_item.&lt;/P&gt;&lt;P&gt;            EXIT.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 12:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966780#M1603398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-30T12:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error message not coming up correct.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966781#M1603399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT lt_lips INTO lw_lips.

	READ TABLE lt_final INTO lw_final 
	  WITH KEY sales_order = lw_lips-vgbel 
		   sales_item  = lw_lips-vgpos 
		   matnr       = lw_lips-matnr 
		   quant       = lw_lips-lfimg.
	
	IF sy-subrc 0.

		MESSAGE e002 WITH lw_final-matnr 
				  lw_final-sales_order 
				  lw_final-sales_item 
				  lw_final-quantity.
		EXIT.

	ELSE.

		READ TABLE lt_final INTO lw_final 
		  WITH KEY sales_order = lw_lips-vgbel 
			   sales_item  = lw_lips-vgpos.

		IF sy-subrc = 0.
		
			DESCRIBE TABLE lt_lips LINES lf_lips_lines.
			DESCRIBE TABLE lt_final LINES lf_final_lines.
			
			IF lf_final_lines gt lf_lips_lines.

				loop at lt_zbox INTO lw_zbox 
				where sales_order = lw_lips-vgbel 
				     and matnr           = lw_lips-matnr.

					if lw_zbox-sales_item ne lw_lips-vgpos. 

						clear lf_box_num.
						Move lw_box-box_num to lf_box_num.
						MESSAGE e003 WITH lw_final-sales_order 
							  	  lw_zbox-vgpos 
							  	  lf_box_num.
						EXIT.

					endif.

				endloop.
	
					MESSAGE e005 WITH lw_final-sales_order 
							  lw_final-sales_item.
					EXIT.
			ENDIF.
		ENDIF.
	ENDIF.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robson Pereira&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Robson Pereira on Jun 30, 2011 3:13 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Robson Pereira on Jun 30, 2011 3:14 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Robson Pereira on Jun 30, 2011 3:14 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Robson Pereira on Jun 30, 2011 3:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 13:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966781#M1603399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-30T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error message not coming up correct.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966782#M1603400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SB&lt;/P&gt;&lt;P&gt;For the parameters of your message in this case you should be use the position of lw_zbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE lt_zbox INTO lw_zbox WITH KEY
sales_order = lw_lips-vgbel sales_item = lw_lips-vgpos matnr = lw_lips-matnr." quant = lw_lips-lfimg.
IF sy-subrc = 0.
clear lf_box_num.
Move lw_box-box_num to lf_box_num.
MESSAGE e003 WITH lw_zbox-sales_order lw_zbox-sales_item lf_box_num.
EXIT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 13:27:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-not-coming-up-correct/m-p/7966782#M1603400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-30T13:27:08Z</dc:date>
    </item>
  </channel>
</rss>

