Read line and delete line

Hi Experts ,
I am doing a report on material history where I need to find out open orders....if suppose a matnr does'nt have Po then also I need to display as it will have open PR.
Now I want to delete the line where ebeln eq space but I can't put the condition as:
delete it_first where ebeln = space as single lines will also get deleted.
My condition should be if a matnr is displayed in more than 1 line and if ebeln eq space
delete it_first.
loop at it_first.                              " I facing problem with this code
  if it_first-wemng GE it_first-menge.
    move '   '  to it_first-ebeln.
    move '   '  to it_first-menge
    move '   '  to it_first-wenge
modify it_first.
endif.
endloop.
after the above statement my O/P is as below
werks   ,   matnr   ,     ebeln        ,  menge  , wemng
UNIT1   ,    ABCD   ,   450025612       ,    256       ,   125
UNIT1   ,    ABCD   ,   450012345       ,    756       ,   456
UNIT1   ,    ABCD   ,  --SPACE--         ,   0.00       ,  0.00     "Need to delete this line
UNIT1   ,    ABCD   ,  --SPACE--         ,   0.00       ,  0.00     "Need to delete this line
UNIT2   ,  BEDF     ,   --SPACE--        ,   0.00       ,  0.00    " this needs to be displayed (just 4 matnr)
Please advice
Karthik

Hi Karthik,
Hi Dileep,
Its working, but only for the first matnr ....but the matnr diplayed after the first matnr is not working..
Thanks
Karthik
Just to Memorise and confirm, in your post I seen you need to delete only EBELN's when space(null or blank)
Only if there is an order or duplicate... {as commented beside in the code}.
The code works fine... Here is the code What i tested in my system and working fine.
If problem still exists, please update with more records, lets say 7 -15 records,,,,
REPORT  ZSAMPLE.
DATA P_MATNR TYPE MATNR.
DATA: BEGIN OF IT_FIRST OCCURS 0,
WERKS TYPE WERKS,
MATNR TYPE MATNR,
EBELN TYPE EBELN,
MENGE TYPE MENGE,
WEMNG TYPE WEMNG,
END OF IT_FIRST.
IT_FIRST-WERKS = 'UNIT1'.IT_FIRST-MATNR = 'ABCD'.IT_FIRST-EBELN = '450025612'.IT_FIRST-MENGE = '256'.IT_FIRST-WEMNG = '125'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT1'.IT_FIRST-MATNR = 'ABCD'.IT_FIRST-EBELN = '450012345'.IT_FIRST-MENGE = '756'.IT_FIRST-WEMNG = '456'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT1'.IT_FIRST-MATNR = 'ABCD'.IT_FIRST-EBELN = ' '.IT_FIRST-MENGE = '0'.IT_FIRST-WEMNG = '0'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT1'.IT_FIRST-MATNR = 'ABCD'.IT_FIRST-EBELN = ' '.IT_FIRST-MENGE = '0'.IT_FIRST-WEMNG = '0'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT2'.IT_FIRST-MATNR = 'BEDF'.IT_FIRST-EBELN = ' '.IT_FIRST-MENGE = '0'.IT_FIRST-WEMNG = '0'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT2'.IT_FIRST-MATNR = 'BEDF'.IT_FIRST-EBELN = ' '.IT_FIRST-MENGE = '0'.IT_FIRST-WEMNG = '0'.
APPEND IT_FIRST.
IT_FIRST-WERKS = 'UNIT1'.IT_FIRST-MATNR = 'BEDF'.IT_FIRST-EBELN = '450012345'.IT_FIRST-MENGE = '756'.IT_FIRST-WEMNG = '456'.
APPEND IT_FIRST.
SORT IT_FIRST BY MATNR ASCENDING EBELN DESCENDING.
LOOP AT IT_FIRST.
  IF P_MATNR EQ IT_FIRST-MATNR AND IT_FIRST-EBELN EQ SPACE.
    DELETE IT_FIRST.
  ENDIF.
  P_MATNR = IT_FIRST-MATNR .
ENDLOOP.
Thanks & regards,
Dileep .C

Similar Messages

  • HT5361 MacMail has stopped noting when I have read an email.  For example, I had 17 unread messages, so I read them.  Despite me having read them AND deleted them, the inbox still has 17 new messages displayed.  Can anyone help resolve the incorrect displ

    MacMail has stopped noting when I have read an email.  For example, I had 17 unread messages, so I read them.  Despite me having read them AND deleted them, the inbox still has 17 new messages displayed.  Can anyone help resolve the incorrect display?

    Lord K.  Thank you. Yes I am within the 90 time period, however I travel Intertionally and I can not receive not make a call to Apple. I was just at the Genius Bar in Chicago and they said, don't worry about it.  It just floats out there, however, I can not recover my messages on a flash drive. I need to go back to my old computer which I don't have with me.  My messages were in folders for a lawsuit.  It is going to take an incredible amount of work for me to, you have no Idea.  We are talking thousands of pages!  I the defendent will have them during discovery so I am not so worried.  However, I can not bring them to him on a Flashdrive when I meet with him without an extraordinary amount of presssure on my part.  THis is not just some little email issue. This is suing EXPEDIA and Tripadviosr.com

  • Relation column for Tax Line and Item Line in AP Invoice Ditributions 11i

    Hi,
    We have requirement of populating Line_Group_Number in AP_invoice_lines_interface for a related item line and a Tax Lines. We are getting the data for AP invoices from 11i.
    Could you please let us know column which can show the relation between a Tax Line and a corresponding Item Line in AP_invoice_distributions Table in 11i.
    Thanks,
    Bhanu Kiran

    hi,
    If you are using business area method then you want to create all sales tax GL with business area optional. And You create one GL like Tax clearing account(business area optional)and assign the same in OBXM against all the sales tax GLs.
    Then you want to run F.5d and F.5e on everymonth.
    govind.

  • Max line and Max line length restriction in FTP

    Hi all,
    We are using a FTP adapter in our BPEL service to read the input files from a FTP server location.
    Our service fails when the input file has more than 99 lines or if the length of the line exceeds 9 characters.
    i.e:
    Max allowed characters in a line (Max line length) is 9
    Max allowed lines in the file is 99
    If the above limit is exceeded we get the error saying that the FTP authentication failed or permission denied error.
    Do we need to set the Max line length and Max line parameters anywhere in weblogic console or in JCA properties.
    Kindly help us resolve the issue. Thanks in advance.
    Regards,
    Balaji R

    We do not have any schema for the file data since we are reading the file content as attachment.

  • Is there a DIRECT link between SD schedule lines and delivery lines?

    Is there a direct link (db table) between schedule lines on a sales order (VBEP) and the delivery lines (LIPS)? 
    Is there a function module to retrieve the data?
    Example-
    One order line with 3 schedule lines.
    Each schedule line is for 2 units (total of 6 units).
    Three deliveries made.  1st is for 2 units, 2nd is for 1 unit (backorder), 3rd is for 3 units.
    You can use document flow (table VBFA) or examine the SD document in the delivery line (LIPS) and link the delivery line to the order line.  The schedule line already references the order line.
    I am using math to decrement the schedule lines used and make the link between VBEP and LIPS.  It works fine.  I need four records back....
    1st schedule line for 2 units uses delivery 123
    2nd schedule line for 1 unit (partial) uses delivery 124
    2nd schedule line for 1 unit (partial) uses delivery 125
    3rd schedule line for 2 units uses delivery 125
    Like I said, it works. Just wondering if I missed a more direct link.

    As far as Db link is concern , I don’t remember exactly , but 3 years before I had written a report which see Sales order schedule lines and devilry note lines against sales order.  If you see process wise…. when ever you create PO ( production order you assign some qty using 101 movement type .. and against production order you also give sales order . When you do delivery ( run seclude run ) it delivers against that material number , its movement is 601 ...
    but I remember there’s a link between these tables, VBAP,VBFA AND VBEP , LIPS ...  against every sales order you can see sales invoice ( VBRP,VBRK) and you can also see your delivery note number in document flow .
    I hope this’ll give you some guide line, as right now I can not tell you the exact business process but I remember I written a report in SD 4 years before , in which they required Delivery against production order and sales order ... One more thing you also have production order reference on delivery item number. ( field :Empst ) . I think in my project they were maintaining this field .
    Thanks

  • Mapping for item line and condition line

    I saw  mapping specification.Can someone tell what is mappig toitem line and what is mapping to condition line?Tell me with an example.

    Hi Subash,
    In mapping specification mapping to line item means direct mapping the source to target. Condition Mapping means its based on some condition you map source to target.
    Find Examaple.
    IDOC                                        EDI
    Source----
       --Target
    E2EDK01005-BELNR----
    Set BIG.02=BELNR
    E2EDK02-BELNR,QUALF='001'----
    if QUALF='001' SET BIG.04=BELNR.
    In this case if there is only one condition in the segment better to check conditon in the segment level then it wont create the segment itself if condition fails.
    Thanks,
    RamuV

  • MR11 Report with document lines and not line items

    Dear All,
    We are currently using the transaction code MR11 to display the open GRs where the system displays them per line item (shows 10 lines for example for 1 PO document).
    We want the report to only show the PO or GR document number (unique) and not the material lines (just one line with the document number so each line would be a different document number). Is there a similar report that can do this or even can the MR11 Trx be altered to achieve this?
    We have tried the filter but it does not seem to work.
    Any help would be much appreciated.
    Regards,
    George

    Hi raghavendra,
    Thanks for your quick response.I know that MR11 is used for account maintenance but it is also a report since it shows the open GRs that have not yet been turned to Invoice Verification.
    The transaction you are suggesting is for open purchase orders and not open Goods Receipt (even though we 101 says Open Goods Receipt).
    Maybe another Selection criteria would be helpful or other report all together.
    Waiting for your feedback.
    Regards,
    George

  • What are the F keys for and what are the insert and delete line shortcuts?

    I have always had a full keyboard and I'm really missing a few shortcuts I previously had that I used mostly in Quickbooks...mainly using the Control insert combination for inserting a line in General Journal and also the Control delete for deleting a line. Is this just an issue with Quickbooks on a Mac? I hate to say it, but during a period of insanity and persuasion by my accountant, I...GASP, went to a PC from a Mac and now I'm finally back in the family. I've forgotten a lot of what I'd learned in the last several years. Do the F keys have these capabilities or is there some other way? Thank you for any assistance.

    Look carefully at the F keys you will see that F1 and F2 will darken and Brighten yur screen F 10 11 and 12 will Mute turn down and turn up your sound.F3 will minimise the screen F4 goes to all your Applications installed.
    You need to fool around and see what they all do to help minimize work
    Cheers
    Don
    http://support.apple.com/kb/HT1343
    http://macmost.com/mfm/mastering-keyboard-shortcuts.html

  • Function to run conditional on CSV and delete line if true

    It's Friday and my brain is focusing more on the weekend than work, so I ask your help, oh PowerShell community:
    I've been tasked with converting our old VB new user script to Powershell, the input of which is a CSV that HR sends us on a daily basis. On rare occasion they include someone who already exists as a user, and I'd like to write a function to check the CSV
    for that and remove that line in the CSV before continuing processing. So far I have the following:
    Function Clear-Existing
    param
    [string]$path
    $csv_input = import-csv -Delimiter ',' $path -Header @("EmpID","LastName","FirstName","Title","Dept","Status") | % ( $_.EmpID
    foreach ($entry in $csv_input)
    if (Check-ADUser $entry.EmpID -eq $true)
    write-host "user $entry already exists!"
    But being said Friday, I can't figure out how to remove the "offending" line from the CSV and save it.
    [email protected]

    Try something like this, you may want to change the path on the Export-Csv file to verify first, so that way you don't overwrite your file
    Function Clear-Existing
    param
    [string]$path
    $results = @()
    import-csv -Delimiter ',' $path -Header @("EmpID","LastName","FirstName","Title","Dept","Status") | ForEach {
    if (Check-ADUser $_.EmpID -eq $true)
    write-host "user $entry already exists!"
    else
    $results += $_
    $results | Export-Csv $path
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Why are e-mails (subject line) and ("to" line) still staying in bold print after they have been read?

    After I read an e-mail, and after I hit the back space arrow, to look at my list of e-mails, the previously read e-mail still shows up in bold type. Usually when an e-mail is read, and you then look at your list of e-mails, the e-mails that have been read show up in light grey type so you can distinguish these e-mails from the ones that have not been read. Why is this happening? It is very difficult to remember which ones I have read when I am looking at over 100 unread e-mails.
    == This happened ==
    Every time Firefox opened
    == yesterday

    Firefox is not an email program, so your problem depends on what site you are using for email. What site are you using?

  • I only print the top line and bottom line, content in middle doesn't print

    When I print an email only the very top line at the top of the page prints and the very bottom line at the very bottom of the page print. For example the bottom line says page 1 of 1 and then on the other side the date and time. Top line has the web address. When I open internet explorer and print and email I have no problems. This just started out of the blue a few updates ago.

    If there isn't a Page Setup in the Print Dialog, open Text Edit>Edit>Page Setup, check borders there or use Custom Page setup & save.

  • How do I format a second line (and subsequent lines) of text in a form field?

    For example, I don't want this:
    1. Blanskgljdslgjsldjglksjdgljsdklgjskldjgklsjdgkljsldkgjklsdjglkjsdgkljskldgjlskdjglksjdogk jskldgjlskdgjlskdjgkls
    lkjsdlktjlkjglsjldgj
    I would like the second line indented with the first.
    Thanks!

    This is possible for a user to configure if the field is set up to allow rich text formatting. Press Ctrl+E to bring up the Properties bar:

  • I have bookmarks displayed, but when visit some web pages, they disappear and are replaced by horizontal lines, and sometimes lines that look like barcodes appear around the edges of Firefox 4. Any suggestions how to remove them?

    This happens when I have the Menu Bar hidden. It happened with the betas and now with the RC

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    * [[Troubleshooting extensions and themes]]
    In Firefox 4 [http://kb.mozillazine.org/Safe_mode Safe mode] disables extensions and disables hardware acceleration.
    * Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"

  • Grid lines and guide lines are too thin and not visible (Retina display)

    How do I increase the "thickness" of them? I have no other idea how to make them more visible. They are just not visible enough.
    I have tried every color. They are so thin with the settings I'm using for the display (I can't change the settings to smaller resolution)
    On the solid color they are ok, but besides that... almost useless (and the grid, and the guides).

    I asked about your Photoshop version to make sure it would have Retina display support.  I use Windows with a 30inch 1920x1200 main display, but just tried the Photoshop 200% UI feature, and while it made the Photoshop UI nice and chunky, Guides were still just one pixel wide.  So AFAICT the only workaround is to change the guide colour.
    If it is a big problem, start a thread on Photoshop feedback site, or search the existing threads to see what has already been said about guides.

  • How to change category on open and closed PO and Requisition lines

    We realized a little late that our category definition needs change. But when we change the category definitions (including structure) how do we change the existing PO lines and Requisition lines to have the new categories? We checked for any APIs, but there are none. What other option do we have?

    changing the name of the home directory and the login name is not advisable. it can be done
    http://www.macworld.com/article/132693/2008/03/changeshortusername.html
    but a better way would be to make a new user account using system preferences->accounts. call it whatever you want. log into that and delete the old account. since you just got this computer you don't have any data on it yet, right?

Maybe you are looking for

  • How do I get my compressed files assigned to a specific folder?

    OK.. I have a finshed and chaptered FCP video in a chosen sequence.  So I open up compressor to encode the video to make a DVD for IDVDSP. I chose my setting A OK. Here is where I get lost at times. I already have a named folder on a chosen hard driv

  • Error while raising the shopping cart.

    Hi experts, Can any one tell me, I get an error message at the time of raising a SC, The error is Partner 22452 not found with with partner function type goods recipent. Account 54102022 requires an assignment to an CO object No address found for par

  • My iMac is veeeery slow

    please help Problem description: slow responding iMac EtreCheck version: 2.1.6 (109) Report generated 25 de enero de 2015 13:35:15 GMT-6 Download EtreCheck from http://etresoft.com/etrecheck Click the [Support] links for help with non-Apple products.

  • VMWare Server 1.01 ZEN Imaging 6.5

    VMWare Server 1.01 ZEN Imaging 6.5 Hello, I am trying to build up a small VM test environment on my laptop. It would save me a lot of time if I could use our existing zen images. Can any one tell me what I need to do in order to use ZEN imaging in VM

  • JDev ADF Demo Site Not Working

    I am keep trying to access adf demo page http://jdevadf.oracle.com/adffacesdemo/faces/components/index.jspx No Response from Application Web Server There was no response from the application web server for the page you requested. Please notify the si