<?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: Movement type 101 and 102 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508945#M2003856</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you need always to consider SHKZG and do minus. &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 10:28:39 GMT</pubDate>
    <dc:creator>Yasin</dc:creator>
    <dc:date>2022-01-12T10:28:39Z</dc:date>
    <item>
      <title>Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508940#M2003851</link>
      <description>&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2009144-mseg.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Hi Guys,&lt;/P&gt;
  &lt;P&gt;from MSEG table i want to pick up MBLNR having movement type 101...but at the same time these MBLNR's should not be cancelled with 102.&lt;/P&gt;
  &lt;P&gt;In short how can i pick up uncancelled MBLNR from MSEG with movement type 101 . in the screenshot as shown i want only last record.&lt;/P&gt;
  &lt;P&gt;PLzz help it is urgent.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:07:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508940#M2003851</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T09:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508941#M2003852</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;which is the issue? I cannot understand the problem: you have a lot of solutions, from pure SQL to handling internal tables.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508941#M2003852</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2022-01-12T09:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508942#M2003853</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;simone.milesi&lt;/SPAN&gt;, I think you need also a Crystal ball !  &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;rahul_1996&lt;/SPAN&gt; Use the transaction ST05 to make a trace, find in the trace where the line 102 is added in the table. in this transaction you could see the corresponding code. In the editor you could set a break point&lt;/P&gt;&lt;P&gt;And restart the creation, and debug to find, yourself, why it creates 101 &amp;amp; 102&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:54:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508942#M2003853</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-01-12T09:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508943#M2003854</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; I think you are giving him wrong directions: the OP is asking how to retrieve the last valid Good Entry document, for what i understand.&lt;/P&gt;&lt;P&gt;And it's a quite common request.&lt;/P&gt;&lt;P&gt;I'd go for a select into table from MSEG, loop on internal table, then if LFBJA - LFBNR - LFPOS  are initial, check if there is any record with LFBJA - LFBNR - LFPOS  = MJAHR - MBLNR - ZEILE and if i find none, then the record is valid.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:02:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508943#M2003854</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2022-01-12T10:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508944#M2003855</link>
      <description>&lt;P&gt;maybe, I didn't clean my crystal ball for a long time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508944#M2003855</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-01-12T10:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508945#M2003856</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you need always to consider SHKZG and do minus. &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:28:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508945#M2003856</guid>
      <dc:creator>Yasin</dc:creator>
      <dc:date>2022-01-12T10:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508946#M2003857</link>
      <description>&lt;P&gt;Hi guys , &lt;/P&gt;&lt;P&gt;thanks for your precious time i already solved the problem.&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:41:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508946#M2003857</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T10:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508947#M2003858</link>
      <description>&lt;P&gt;Give your answer &amp;amp; close the message&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508947#M2003858</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-01-12T10:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508948#M2003859</link>
      <description>&lt;P&gt;hi yasin ,&lt;/P&gt;&lt;P&gt;my problem is that i want to show the data in alv report which is not reversed.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:49:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508948#M2003859</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T10:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508949#M2003860</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;FORM GET_DATA.

*BREAK-POINT.

SELECT MBLNR
MJAHR
BUDAT
FROM MKPF INTO TABLE IT_MKPF WHERE MBLNR IN PO_NO AND BUDAT IN S_BUDAT.

IF IT_MKPF IS NOT INITIAL .

  SELECT      MBLNR
            MJAHR
            ZEILE
            BWART
            MATNR
            WERKS
            DMBTR
            MENGE
            LFBNR
            LFPOS
            SJAHR
            SMBLN
            SMBLP
            EBELN
            EBELP
FROM MSEG INTO TABLE IT_MSEG FOR ALL ENTRIES IN IT_MKPF
WHERE MBLNR = IT_MKPF-MBLNR
AND BWART IN ('101' , '102' )

ENDIF .

ENDFORM.

FORM F_PROCESS_DATA.

 SORT IT_MSEG BY MBLNR.
  IT_REV[] = IT_MSEG[].
  DELETE IT_MSEG WHERE BWART EQ '102'.
  DELETE IT_REV WHERE BWART EQ '101'.

LOOP AT IT_MSEG INTO WA_MSEG .
*
  READ TABLE IT_REV INTO WA_REV WITH KEY SMBLN = WA_MSEG-MBLNR
                                          SMBLP = WA_MSEG-ZEILE.

    IF SY-SUBRC EQ 0.
      DELETE IT_MSEG.
      CONTINUE.
    ENDIF.

WA_FINAL-MBLNR = WA_MSEG-MBLNR.
WA_FINAL-EBELN = WA_MSEG-EBELN.
WA_FINAL-MATNR = WA_MSEG-MATNR.
WA_FINAL-WERKS = WA_MSEG-WERKS.
WA_FINAL-BWART = WA_MSEG-BWART.
WA_FINAL-MENGE = WA_MSEG-MENGE.
WA_FINAL-DMBTR = WA_MSEG-DMBTR.

READ TABLE IT_MKPF INTO WA_MKPF WITH KEY MBLNR = WA_MSEG-MBLNR.
IF SY-SUBRC EQ 0.
WA_FINAL-BUDAT = WA_MKPF-BUDAT.
ENDIF.

APPEND WA_FINAL TO IT_FINAL.
CLEAR : WA_FINAL,WA_MSEG.

ENDLOOP .
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:52:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508949#M2003860</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T10:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508950#M2003861</link>
      <description>&lt;P&gt;&lt;STRONG&gt;hana Sql Code to get the value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;select "Mat. Doc." from MSEG&lt;/P&gt;&lt;P&gt;minus&lt;/P&gt;&lt;P&gt;select "Mat. Doc." from MSEG as m1 // this gives cancelled material doc&lt;/P&gt;&lt;P&gt;where MBLNR = '102'&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ABap method&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;take MSEG in internal table LT_mseg&lt;/P&gt;&lt;P&gt;loop at internal table  LT_mseg&lt;/P&gt;&lt;P&gt;where MBLNR = '102'&lt;/P&gt;&lt;P&gt;delete the "Mat. Doc." from LT_mseg// delete cancelled material doc&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 10:59:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508950#M2003861</guid>
      <dc:creator>former_member688242</dc:creator>
      <dc:date>2022-01-12T10:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508951#M2003862</link>
      <description>&lt;P&gt;thanks i will try&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:04:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508951#M2003862</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T11:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508952#M2003863</link>
      <description>&lt;P&gt;check my code it is working fine any idea where i can make changes according to you&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508952#M2003863</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T11:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508953#M2003864</link>
      <description>&lt;P&gt;why you marked it as answer ? while you still asking am confused. &lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:13:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508953#M2003864</guid>
      <dc:creator>Yasin</dc:creator>
      <dc:date>2022-01-12T11:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508954#M2003865</link>
      <description>&lt;P&gt;You need to consider SHKZG and do minus. by deleting other Movement types like 102 from the query your report will not be accurate and you will get in troubles.&lt;/P&gt;&lt;P&gt;sometimes there will be return not cancel only.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508954#M2003865</guid>
      <dc:creator>Yasin</dc:creator>
      <dc:date>2022-01-12T11:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508955#M2003866</link>
      <description>&lt;P&gt;hi yasin can you update my code and post it so i can understand. &lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508955#M2003866</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-12T11:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Movement type 101 and 102</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508956#M2003867</link>
      <description>&lt;P&gt;Hi Yasin, Help me with my code.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 05:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/movement-type-101-and-102/m-p/12508956#M2003867</guid>
      <dc:creator>rahul_1996</dc:creator>
      <dc:date>2022-01-13T05:40:10Z</dc:date>
    </item>
  </channel>
</rss>

