• RELEVANCY SCORE 3.45

    DB:3.45:Event Type Descriptions - Mod Wheel / Quick Access Auto Help zs




    I really just need some description for the possible event types you can assign to controllers in logic, like the mod wheel. For example, expression, portamento time... I don't know what i should be listening for when it comes to utilizing these controls. But I know some of these options would greatly enhance my samples (EWQLSO) in terms of reality (strings swelling instead of remaining stagnant). The manual mentions around 15 event types, and I was wondering if I could get some solid definitions. Some are obvious, but feel free to fill in the gaps, it would be much appreciated.

    Also, I've had some trouble getting mod-wheel movement to show up in multiple windows in logic. Even if I do automation quick access assigned to the mod wheel, I get split information. For instance, the Arrange Window will record pitch bend data, but it will not be reflected in the Event List, or Editor, let alone these options in the Matrix window.

    Any help would be great.

    DB:3.45:Event Type Descriptions - Mod Wheel / Quick Access Auto Help zs

    I really just need some description for the possible event types you can assign to controllers in logic, like the mod wheel. For example, expression, portamento time... I don't know what i should be listening for when it comes to utilizing these controls. But I know some of these options would greatly enhance my samples (EWQLSO) in terms of reality (strings swelling instead of remaining stagnant). The manual mentions around 15 event types, and I was wondering if I could get some solid definitions. Some are obvious, but feel free to fill in the gaps, it would be much appreciated.

    Also, I've had some trouble getting mod-wheel movement to show up in multiple windows in logic. Even if I do automation quick access assigned to the mod wheel, I get split information. For instance, the Arrange Window will record pitch bend data, but it will not be reflected in the Event List, or Editor, let alone these options in the Matrix window.

    Any help would be great.

  • RELEVANCY SCORE 2.68

    DB:2.68:Pitchbend ks




    i cant seem to get orchestral sounds to respond to the pitchbend wheel or to the manually inputed pitchbend data. mod wheel, fine. it also works fine with any of the 'synth string' type of sounds (any other sounds actually) but not with the xtra orchestral instruments or orchestral jam packs. anyone any thoughts?

    thanks.

    DB:2.68:Pitchbend ks

    i cant seem to get orchestral sounds to respond to the pitchbend wheel or to the manually inputed pitchbend data. mod wheel, fine. it also works fine with any of the 'synth string' type of sounds (any other sounds actually) but not with the xtra orchestral instruments or orchestral jam packs. anyone any thoughts?

    thanks.

  • RELEVANCY SCORE 2.68

    DB:2.68:Create Mutiple Records W/Dynamic Checkboxes? 7p




    Greetings

    This is no doubt an easy one, but can't seem to get multiple
    checkboxes displayed dynamically to create corresponding multiple
    records?

    The form page has:

    form action="add_action.cfm" method="post"
    cfoutput query="get_all"
    tr bgcolor="###iif(currentrow MOD
    2,DE('ffffff'),DE('d9ecff'))#"
    td class="tddynamic"#num#/td
    td class="tddynamic"#descriptions#/td
    td class="tddynamic"INPUT Type="Checkbox"
    Name="ID"
    Value="#thequery.ID#"/td

    Action Page?

    Access, CF8

    Thanks for your time in teaching an old dog new
    tricks...

    DB:2.68:Create Mutiple Records W/Dynamic Checkboxes? 7p

    as has been already suggested, give all your checkboxes the
    same name,
    i.e. 'subscription', and give them unique values of
    #GetBlogs.blog_id#.
    this way your form will submit all selected blog ids as a
    comma-delimited list availableon your action page as
    #form.subscription#

    on your form's action page:
    1) check that at least one checkbox has been selected using
    cfif
    len(trim(form.subscription))
    2) if the above is true, loop over the #form.subscription#
    list and
    insert individual blog id into db.

    Azadi Saryev
    Sabai-dee.com

    http://www.sabai-dee.com/

  • RELEVANCY SCORE 2.65

    DB:2.65:Mod Wheel Emulator In Logic Express fa


    I've just installed the Garage Band Voices Jam Pack, and the documentation says that for many of the voice instruments, the mod wheel changes the vowel being sung. Since I have no midi keyboard, is there a control within Logic Express that would give me this same functionality?

    DB:2.65:Mod Wheel Emulator In Logic Express fa

    I've just installed the Garage Band Voices Jam Pack, and the documentation says that for many of the voice instruments, the mod wheel changes the vowel being sung. Since I have no midi keyboard, is there a control within Logic Express that would give me this same functionality?

  • RELEVANCY SCORE 2.59

    DB:2.59:Wheel Event Not Inplemented In Linux - Still Need To Use Non-Standard Dommousescroll d8



    Using Ubuntu (any recent version), which is Debian-based, Firefox (any recent version) doesn't appear to recognise the Standardized wheel event, "wheel" as described here:
    https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel.

    The only one that appears to with is the old, and non-standard "DOMMouseScroll" :
    https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/DOMMouseScroll

    Is this the same in Windows/Mac versions of Firefox?

    In addition, in the example code:
    // detect available wheel event

    support = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel"
    document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel"
    "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox

    doesn't seem to choose DOMMouseScroll, so perhaps the support is there, but somhow not fired?

    DB:2.59:Wheel Event Not Inplemented In Linux - Still Need To Use Non-Standard Dommousescroll d8



    See also:

    https://developer.mozilla.org/en-US/docs/Web/API/Element.onwheel

    bug 18542 - onmousewheel attribute should be replaced with onwheel

  • RELEVANCY SCORE 2.57

    DB:2.57:Come Sblocare Carrozzerie In Mod Nation Racers Ps3 ? z8



    come sblocco le carozzerie per le auto in mod nation racers ?

    in modalita carriera ?




    script type="text/javascript"var lbp_lang = 'it';var lbp_scriptHost = 'lbp.me';var lbp_widget_settings = {theme:'default'};/scriptscript type="text/javascript" src="http://lbp.me/widgets/link_magician/js/loader.js"/script

    DB:2.57:Come Sblocare Carrozzerie In Mod Nation Racers Ps3 ? z8


    uffa ok aposto




    script type="text/javascript"var lbp_lang = 'it';var lbp_scriptHost = 'lbp.me';var lbp_widget_settings = {theme:'default'};/scriptscript type="text/javascript" src="http://lbp.me/widgets/link_magician/js/loader.js"/script

  • RELEVANCY SCORE 2.54

    DB:2.54:"An Item Name Can Only Be 126 Characters Long." In Extension Manager zx



    In the Extension Manager kicked off the ERSAdmin console, after adding an extension DLL for a core event handler, when I press the Configure button, I get the message: "An item name can only be 126 characters long".

    What does this refer too? The DLL name certainly is not 126 characters long.

    FYI, the XML file associated with the extension is (taken verbatim from the eRoom ToolKit samples):

    ?xml version="1.0" encoding="UTF-8" standalone="yes"?

    extension id="eRoomEventLogger.CeRoomEventLogger" type="CoreEvent"

    displaynames

    displayname language=""eRoomEventLogger.CeRoomEventLogger/displayname

    /displaynames

    descriptions/

    mainfileeRoomEventLogger.dll/mainfile

    progideRoomEventLogger.CeRoomEventLogger/progid

    /extension

    DB:2.54:"An Item Name Can Only Be 126 Characters Long." In Extension Manager zx


    After much mucking around, it appears that making the name of the extension shorter solve the problem. Since his name was much slower than 126 characters, one can only imagine that eRoom Server Admin was generating an item name using the extension name and that this generated name had moe than 126 characters.

  • RELEVANCY SCORE 2.54

    DB:2.54:Cc#1 Resetting At The Start Of Every Loop - Bug ??? f9


    Make a 1 bars bas pattern, (internal or external synth with mod-wheel/CC#1 assigned to filter cut off) and loop it. On another track, same midi channel, i record a mod-wheel movement (filter sweep) more than 1 bar, say 4 bars, starting from 0 and moving to max. This is now a filter sweep with a length of 4 bars. Everytime the bas pattern repeat it self, (every 1 bar - because of the loop)the mod-wheel/CC#1 jumps back to zero, until it recieves the next mod-wheel info from the 4 bars sweep.

    I have to use "make loop into real copies or alias" to make it work.

    Is this a bug ?

    nice regards

    Henning Flintholm

    G5 dual 2.0 Mac OS X (10.4.8)

    DB:2.54:Cc#1 Resetting At The Start Of Every Loop - Bug ??? f9

    Hi Fred

    Thanks a lot for a fast answer

    nice regards

    Henning Flintholm

    www.flintholm.com

    G5 dual 2.0 Mac OS X (10.4.8)

  • RELEVANCY SCORE 2.53

    DB:2.53:Synaptics Not Working On Sony Vaio aj



    And another problem to solve...

    My system doesnt detect my touchpad. Well, it works, but I cant use Synaptics driver, because its detected as generic mouse. Ive installed xf-86-input-synaptics and xf86-input-evdev.

    Heres what my Xorg log says:
    [ 15396.302] (II) config/udev: Adding input device ImPS/2 Generic Wheel Mouse (/dev/input/event8)
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: Applying InputClass evdev pointer catchall
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: always reports core events
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: Device: /dev/input/event8
    [ 15396.328] (--) ImPS/2 Generic Wheel Mouse: Found 3 mouse buttons
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found scroll wheel(s)
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found relative axes
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found x and y relative axes
    [ 15396.329] (II) ImPS/2 Generic Wheel Mouse: Configuring as mouse
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: YAxisMapping: buttons 4 and 5
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    [ 15396.329] (II) XINPUT: Adding extended input device ImPS/2 Generic Wheel Mouse (type: MOUSE)
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) keeping acceleration scheme 1
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration profile 0
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration factor: 2.000
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration threshold: 4
    [ 15396.329] (II) ImPS/2 Generic Wheel Mouse: initialized for relative axes.
    [ 15396.329] (II) config/udev: Adding input device ImPS/2 Generic Wheel Mouse (/dev/input/mouse1)

    DB:2.53:Synaptics Not Working On Sony Vaio aj


    And another problem to solve...

    My system doesnt detect my touchpad. Well, it works, but I cant use Synaptics driver, because its detected as generic mouse. Ive installed xf-86-input-synaptics and xf86-input-evdev.

    Heres what my Xorg log says:
    [ 15396.302] (II) config/udev: Adding input device ImPS/2 Generic Wheel Mouse (/dev/input/event8)
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: Applying InputClass evdev pointer catchall
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: always reports core events
    [ 15396.302] (**) ImPS/2 Generic Wheel Mouse: Device: /dev/input/event8
    [ 15396.328] (--) ImPS/2 Generic Wheel Mouse: Found 3 mouse buttons
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found scroll wheel(s)
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found relative axes
    [ 15396.329] (--) ImPS/2 Generic Wheel Mouse: Found x and y relative axes
    [ 15396.329] (II) ImPS/2 Generic Wheel Mouse: Configuring as mouse
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: YAxisMapping: buttons 4 and 5
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    [ 15396.329] (II) XINPUT: Adding extended input device ImPS/2 Generic Wheel Mouse (type: MOUSE)
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) keeping acceleration scheme 1
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration profile 0
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration factor: 2.000
    [ 15396.329] (**) ImPS/2 Generic Wheel Mouse: (accel) acceleration threshold: 4
    [ 15396.329] (II) ImPS/2 Generic Wheel Mouse: initialized for relative axes.
    [ 15396.329] (II) config/udev: Adding input device ImPS/2 Generic Wheel Mouse (/dev/input/mouse1)

  • RELEVANCY SCORE 2.50

    DB:2.50:Mouse Events jc


    Is there any way to capture using a mouse wheel as a mouse event?

  • RELEVANCY SCORE 2.49

    DB:2.49:Populating 0-Many Complex Type Within Another Complex Type 3a


    I have a process that is returning 'Person' types. These contain much info, from which, for each person I need to add only 3 node values to a 'member' type within an 'event' type.

    The person types are all processed individually by separate user tasks.

    Is addChildNode() the thing to be using here? Possibly with addElement()? I've looked in JDev at the descriptions of these functions, but to be honest they just confuse me more... it's been a long day... :D

    Any help much appreciated,

    Dan

    DB:2.49:Populating 0-Many Complex Type Within Another Complex Type 3a

    I have a process that is returning 'Person' types. These contain much info, from which, for each person I need to add only 3 node values to a 'member' type within an 'event' type.

    The person types are all processed individually by separate user tasks.

    Is addChildNode() the thing to be using here? Possibly with addElement()? I've looked in JDev at the descriptions of these functions, but to be honest they just confuse me more... it's been a long day... :D

    Any help much appreciated,

    Dan

  • RELEVANCY SCORE 2.48

    DB:2.48:Mouse Wheel On Safari k7


    Is there any way to get the kEventMouseWheelMoved mouse wheel event in Safari?
    I'm guessing not cause Safari is a cocoa-based app.
    Will there be support for this soon?

    DB:2.48:Mouse Wheel On Safari k7

    Is there any way to get the kEventMouseWheelMoved mouse wheel event in Safari?
    I'm guessing not cause Safari is a cocoa-based app.
    Will there be support for this soon?

  • RELEVANCY SCORE 2.48

    DB:2.48:Automating Mod Wheel Data After Midi Input d1


    Hi all,

    So what ive done is create a Bodyrox style patch on the ES2 and linked the mod wheel using the routing to cutt off 1+2 and Env3 release. I have inputed my midi via piano roll but not want to add the automation for the mod wheel so that I can open and close the feed to the cut offs and release through out the piece.

    I have a feeling I am over looking something really obvious, but isn't it always the way!

    Regards Craig

    DB:2.48:Automating Mod Wheel Data After Midi Input d1

    It's even easier to record Hyper Draw:

    Record over the existing MIDI region and move the Mod wheel... you'll record the CC data in Hyper Draw mode, which you can view in the Piano Roll by clicking on the Hyper Draw button (bottom left of Piano Roll).

    Here you can fine edit the Hyper Draw info if needed.

    Hope that helps
    Rounik

  • RELEVANCY SCORE 2.48

    DB:2.48:Mod Wheel Changes Patches s7


    When I move the mod wheel the patches change in Mainstage. I have tried 3 different keyboard controllers and they all do this. I read that MS automatically passes modulation data without a controller assigned in layout mode so I deleted the mod wheel from my layout. Using MS 1 this was not an issue.
    I'm using a MOTU Micro Express MIDI interface. I can't find info on this in the manual, anybody know how to fix this?

    DB:2.48:Mod Wheel Changes Patches s7

    Changing the Channel to "Unassigned" does the trick.

  • RELEVANCY SCORE 2.46

    DB:2.46:Decision Views In Uwl 9f



    I am trying to create decision views for mass approval of work items. I'm using the 'How to Configure and Customize the Universal Worklist' document, but I keep getting the same error when I click 'Submit decisions'.

    The iView shows the following message:

    Unable to perform the request. Try again. If the problem persists, inform your system administrator.

    Error Detail: String index out of range: -1

    The uwl log shows the following line:

    #1.5#001185B84481027C0000000B00009100000403912E3970EB#1129821987486#/uwl/ui#sap.com/irj#com.sap.netweaver.bc.uwl.ui.UWLMain#mgr03#3897####e1bd7be0417d11dacf45001185b84481#Thread[PRT-Async 7,5,PRT-Async]##0#0#Warning#1#com.sap.netweaver.bc.uwl.ui.UWLMain#Plain####

    I think the error message is blank, and that is why the string index error appears.

    When I access accept or reject for a single work item (through the menu) it works fine.

    Has anyone had this problem before?

    View xml:

    View name="ZExpensesView" selectionMode="NONE" width="100%" supportedItemTypes="uwl.task.webflow.decision.TS92000013.SAP_R3_HumanResources" columnOrder="subject, BEGINDATE, ENDDATE, REASON, LOCATION, ZTOTALCOSTS, approveCol, rejectCol" sortby="createdDate:descend" tableDesign="STANDARD" visibleRowCount="5" headerVisible="yes" queryRange="undefined" tableNavigationFooterVisible="yes" tableNavigationType="CUSTOMNAV" actionRef="" refresh="999" dueDateSevere="0" dueDateWarning="0" emphasizedItems="new" displayOnlyDefinedAttributes="yes" dynamicCreationAllowed="yes" actionPosition="top"

    Descriptions default="Expense Claims To Approve"

    ShortDescriptions

    Description Language="en" Description="Expense Claims To Approve"/

    /ShortDescriptions

    /Descriptions

    DisplayAttributes

    DisplayAttribute name="REASON" type="string" width="" sortable="no" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Reason"

    ShortDescriptions

    Description Language="en" Description="Reason"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="rejectCol" type="checkbox" width="" sortable="no" format="default" actionRef="reject" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Reject"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="CURRENCY" type="string" width="" sortable="yes" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Currency"

    ShortDescriptions

    Description Language="en" Description="Currency"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="ZTOTALCOSTS" type="double" width="" sortable="yes" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Total Costs"

    ShortDescriptions

    Description Language="en" Description="Total Costs"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="LOCATION" type="string" width="" sortable="no" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Location"

    ShortDescriptions

    Description Language="en" Description="Location"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="subject" type="user" width="" sortable="no" format="default" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Name"

    ShortDescriptions

    Description Language="en" Description="Name"/

    /ShortDescriptions

    /Descriptions

    Menu

    MenuItem name="approve" actionRef="approve" referenceBundle="zapprove" /

    MenuItem name="reject" actionRef="reject" referenceBundle="zreject" /

    /Menu

    /DisplayAttribute

    DisplayAttribute name="BEGINDATE" type="date" width="" sortable="yes" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="Begin Date"

    ShortDescriptions

    Description Language="en" Description="Begin Date"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="ENDDATE" type="date" width="" sortable="yes" format="medium" hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"

    Descriptions default="End Date"

    ShortDescriptions

    Description Language="en" Description="End Date"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="approveCol" type="checkbox" width="" sortable="no" format="default" actionRef="approve" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Approve"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    /DisplayAttributes

    Actions

    Action name="refresh" reference="refresh"/

    Action name="removeFromNavigation" reference="removeFromNavigation"/

    Action name="addToNavigation" reference="addToNavigation"/

    Action name="submitUserDecisions" reference="submitUserDecisions"/

    Action name="approve" groupAction="yes" handler="UserDecisionHandler"

    Properties

    Property name="decisionKey" value="1"/

    Property name="UserDecisionTitle" value="Approve the request"/

    /Properties

    Descriptions default="Approve"/

    /Action

    Action name="reject" groupAction="yes" handler="UserDecisionHandler"

    Properties

    Property name="decisionKey" value="2"/

    Property name="UserDecisionTitle" value="Reject the request"/

    /Properties

    Descriptions default="Reject"/

    /Action

    /Actions

    /View

    DB:2.46:Decision Views In Uwl 9f


    Hi,

    I am also getting the same error -Unable to perform the request. Try again and if the problem persists, inform your system administrator.

    I am using 04s, SP07. Can you advice me how did you resolved this issue.

    Many thanks.

    Regs/Venkat

  • RELEVANCY SCORE 2.45

    DB:2.45:Problem Recording Mod Wheel 7d


    Dear All. i'm trying to record the mod wheel using my Oxygen8 controler. I'm recording it over a solo violin track (from Garritan PO). I can record it ok but when i play back I can't hear the violin! In Sonar or Cubase, which I am more used to, this is easy enough but I can't seem to do it properly in GB3. Help!

    Cheers, Maestro-C

    DB:2.45:Problem Recording Mod Wheel 7d

    Dear All. i'm trying to record the mod wheel using my Oxygen8 controler. I'm recording it over a solo violin track (from Garritan PO). I can record it ok but when i play back I can't hear the violin! In Sonar or Cubase, which I am more used to, this is easy enough but I can't seem to do it properly in GB3. Help!

    Cheers, Maestro-C

  • RELEVANCY SCORE 2.45

    DB:2.45:Assigning Organ To Work With Modulator xc


    I have a Oxygen 49 midi controller that has a mod wheel. When I use the Yamaha, I can use the mod wheel to cause the rotary wheel to speed up on the organ sound. Now that I swtiched to mainstage, I can't seem to get the same affect. I use the peachy Hammond sound on the midi. But when I use the mod wheel, nothing happens. I think I have to assign it to something. But I don't know what. I don't know if I should use the vibrato or the tremelo. When I use Mainstage's classic rock 3 sound with the main keyboard, I can press the pedal to get a similar affect of a rotary sound. But I would really like to use the wheel instead and it seems that only certain organ sounds will work with the wheel. Anyone successfullly do what I am asking?

    DB:2.45:Assigning Organ To Work With Modulator xc

    Okay, I think I have figured out a soultion.This assumes you are using MS3.1. Create a patch (without any channel strips).2. Go to the Channel Strip Inspector and select "Add Instrument Channel Strip".3. On the channel strip, where it says "Instrument", click once. This will bring up a drop-down of all of the plugins.4. Select "Vintage B3 Organ---Stereo", this will bring up the B3 window on the setting "Default".5. Press the "Rotor Cabinet" button and change the "Speed MIDI Control" parameter to "ModWheel".6. Click on the drop down menu where it says "Default" up at the top. Select "Save As Default".7. From this point on, any organ you add following steps 1-4 SHOULD keep your rotor setting.The key seems to be saving a user default, and then adding the strip in that way.Hope this helps.

  • RELEVANCY SCORE 2.43

    DB:2.43:Tcode Pvd0 "No Intranet" Flag Check mj



    Hi all,

    In PVD0 transaction there is one tab called "Business Event Info Type". In this subscreen there are 2 flags.

    1. Include in brochure (By default its checked)

    2. No Intranet.

    The "No Intranet" flag is not checked in the transaction. The program which is used in the screen is "SAPLRHV6" and the include which is used to check the INCLUDE LRHV6O75.

    Instead of going for core mod is there anyother thing do without any core mod. Is any BADI or USEREXITs to do the check automatically.

    Reward points if useful..

    Regards,

    Ganesh R K

    DB:2.43:Tcode Pvd0 "No Intranet" Flag Check mj


    Hi,

    In that BADI we have 2 implementation. Can you specify with method should be specific for the Business event type info. It should be more useful for me. This are the methods,

    AFTER_UPDATE

    BEFORE_UPDATE

    REGISTER_HEADER

    REGISTER_OTYPES

    REGISTER_OTYPE_PROPERTIES

    REGISTER_SUBSCREENS

    REPLACE_CREATE_ANY_OBJECT

    REPLACE_EDIT_ANY_OBJECT

    REPLACE_EVENT_2

    REPLACE_EVENT

    REPLACE_GUI_STATUS

    REPLACE_POPUP_RELATION

    REPLACE_RELAT_TIMCO

    Thanks.

    Ganesh R K

  • RELEVANCY SCORE 2.43

    DB:2.43:How To Use Mouse Wheel Events 3p


    Hello Everyone

    I am using Datagrid in my Canvas.

    I use mouse wheel to scroll the datagrid. But in one scroll
    through that wheel make the more than 4 rows to be scroll.
    So Now my requirement is to control the delta value of mouse
    wheel event and how to use that with my datagrid so that i will
    able to scroll one row through mouse wheel scroller.

    Thanks

    DB:2.43:How To Use Mouse Wheel Events 3p

    Currently I am using the code I attached with this reply for
    mouse scrolling......
    this is working fine when I scroll down the datagrid. But in
    scrolling up datagrid got scroll with default value...

    please suggest me some way to control the delta value of
    mouse scrolling.....

  • RELEVANCY SCORE 2.43

    DB:2.43:Unable To Fetch Peformance Report In Scom zf


    Hi,
    I am unable to fetch the Performance reports for certain servers from 5th of this month. Tried troubleshooting the agent issue by clearing cache,bouncing health state folder and reinstalling the agents. But still the reports cant be fetched.
    The event viewer logs in lot of Health service module 10103 and 11903.
    Event Type: Warning
    Event Source: Health Service Modules
    Event Category: None
    Event ID: 10103
    Date: 5/29/2014
    Time: 4:22:17 AM
    User: N/A
    Computer: XXXXXXX
    Description:
    In PerfDataSource, could not find counter Process, % Processor Time, sqlservr* in Snapshot. Unable to submit Performance value. Module will not be unloaded.

    One or more workflows were affected by this.

    Workflow name: XXXXX.ProcessSQLServerprocessortime70
    Instance name: Servername
    Instance ID: {38F12648-F8B0-32E3-684F-38C8A0AF457E}
    Management group: XXXXXXXX

    Event Type: Information
    Event Source: Health Service Script
    Event Category: None
    Event ID: 10212
    Date: 5/29/2014
    Time: 4:22:22 AM
    User: N/A
    Computer: XXXXXXXX
    Description:
    xxxx.Windows2003.PerfRules.DSC1.vbs :
    The script has been launched under following credentials : SYSTEM.

    3 arguments have been passed in parameter :
    - {1F0CE61C-D50D-9BF6-37AF-B0D80D774AF8}
    - {38F12648-F8B0-32E3-684F-38C8A0AF457E}
    - xxxxxxxxxxxxxxxxxxxxx

    The debug mode value for the Management Pack is set to : FALSE

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Event Type: Error
    Event Source: Health Service Modules
    Event Category: None
    Event ID: 11903
    Date: 5/29/2014
    Time: 4:22:54 AM
    User: N/A
    Computer: xxxxxxxxxxxxxxxx
    Description:
    The Microsoft Operations Manager Expression Filter Module could not convert the received value to the requested type.

    Property Expression: ^(1069)$

    Property Value: ^(1069)$

    Conversion Type: DataItemElementTypeUnsignedInteger(6)

    Original Error: 0x80FF005A

    One or more workflows were affected by this.

    Workflow name: MomUIGeneratedRule3973b32e15a14a8585bed8f442676d93
    Instance name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Instance ID: {38F12648-F8B0-32E3-684F-38C8A0AF457E}
    Management group: xxxxxxxxxxxx

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Event Type: Warning
    Event Source: HealthService
    Event Category: Health Service
    Event ID: 1103
    Date: 5/29/2014
    Time: 4:22:54 AM
    User: N/A
    Computer: zxxxxxxxxxxx
    Description:
    Summary: 5 rule(s)/monitor(s) failed and got unloaded, 1 of them reached the failure limit that prevents automatic reload. Management group xxxxxxxx. This is summary only event, please see other events with descriptions of unloaded rule(s)/monitor(s).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Please advise how to take this forward.

    Jesty

    DB:2.43:Unable To Fetch Peformance Report In Scom zf

    Thanks a lot Scott.The servers have started fetching the data.
    You have been of great help.Jesty

  • RELEVANCY SCORE 2.42

    DB:2.42:Adding Method/Property/Event Descriptions To Interop Control And Have Them Appear In Vb6 ks


    Hi, just wondering how I can add method/property/event descriptions to my interop controls and have them appear in the VB6 object browser, property window etc.

    DB:2.42:Adding Method/Property/Event Descriptions To Interop Control And Have Them Appear In Vb6 ks

    Hi Bert, This information should be saved into TLB(the type library) file. As far as I know, VB.NET Interop Form ToolKit doesn't supply the option to customize the description for new members in this scenario.

    Best regards, Riquel Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

  • RELEVANCY SCORE 2.42

    DB:2.42:Table Fields Required For The Following Descriptions sf



    What is the table and the fields with following descriptions?

    1.Partner type Description

    2.Partner type name

    3.Partner name

    I am talking about SD module

  • RELEVANCY SCORE 2.40

    DB:2.40:Mouse Scroll Wheel Input 1k


    How can I tell which direction the scroll wheel was moved in?  I'm currently using a UserControl's MouseWheel event and comparing the given delta value.  This worked at first as delta would be positive if the wheel was scrolled up and negative if the wheel was scrolled down.  However now I'm getting positive numbers for both directions.

    DB:2.40:Mouse Scroll Wheel Input 1k

    Stuby
    In the message that comes in through WndProc a positive Delta is forward, negative reverse.  You should get one event for each click of the wheel.  If you're not getting this behaviour then here are the possibilites:
    The control you're trying to read it in doesn't have capture on the mouse, so mouse messages aren't getting sent to it.
    There's a WndProc override somewhere that's filtering this message out.
    Somewhere you've got an Application.DoEvents() call that's affecting the message queue in an unexpected way.
    I have had the best luck with the mouse wheel overriding WndProc, but that's just one way to solve the problem.
     
    HTH

  • RELEVANCY SCORE 2.40

    DB:2.40:Repost (Amazon Gift Certificate For Answer This Time) Nt Event Ids 1p


    Where can I find information about the different types of event ids (with numbers and descriptions, source tag, type) for what Oracle writes to the NT event log ?
    I offer a $25 gift certificate for the first answer.
    Thanks

  • RELEVANCY SCORE 2.40

    DB:2.40:Ht2513 How Can I Add Descriptions To My Events In Ical? dx


    I can create an event but cannot add descriptions. Please help

    DB:2.40:Ht2513 How Can I Add Descriptions To My Events In Ical? dx

    Thank you for your reply. I was just hoping about customization-i do currently put the phone numbers and web address in the notes area but was wishing i could add more lines.i looked under the description for the upcoming Mountain Lion but did not see this feature listed under the upgrades for ICal.

  • RELEVANCY SCORE 2.40

    DB:2.40:Access Duplicate Rows mf


    Hello all, I am trying to combine two rows in access that has duplicate data. Here is an example.

    My current SQL
    SELECT [PM List].[Preferred Engineer], [PM List].[PM Due Date], [PM List].Customer, [PM List].[IB Model/Test], [PM List].[Instance #], [PM List].[PM Task Number], [PM List].[PM Type], [Type 1 Mod].[MOD Number], [Type 2 Mod].[MOD Number]
    FROM ([PM List] LEFT JOIN [Type 1 Mod] ON [PM List].[Instance #] = [Type 1 Mod].[IB Instance Number]) LEFT JOIN [Type 2 Mod] ON [PM List].[Instance #] = [Type 2 Mod].[IB Instance Number];

    My problem is that the PM, Mod type 1, and Mod type 2 can have multiples that causes duplicate rows. I would like to combine the like information and display the unique data in another column or seperated by a comma.
    Thamk you

    DB:2.40:Access Duplicate Rows mf

    You do know of the 'Hide Duplicates' in a report that would present the data like this --
    dddd eeee fffff xyz
    pqr
    stu
    dddd eeee gggg abc
    def
    ghi
    This method might accomplish what you want.

  • RELEVANCY SCORE 2.40

    DB:2.40:.Mod Files With Idvd 8j


    I'm trying to make DVDs of movies I've created on my camcorder with the .mod file type. I'm not able to select the files. Any suggestions?

    DB:2.40:.Mod Files With Idvd 8j

    I'm trying to make DVDs of movies I've created on my camcorder with the .mod file type. I'm not able to select the files. Any suggestions?

  • RELEVANCY SCORE 2.40

    DB:2.40:How To Capture The Mouse Wheel Press Event d7



    Hi Friends,,

    Today I encounterd some strange problem with captureing the mouse wheel press Event .When user press on mouse wheel on a button .

    i am faceing problem with this please let me know.Any help is greatly appreciated!

    Thanks

    SREE

    DB:2.40:How To Capture The Mouse Wheel Press Event d7


    Are you looking for MouseEvent.MIDDLE_MOUSE_DOWN?

    s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    initialize="btn.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, handle)"
    fx:Script
    ![CDATA[
    public function handle(e:Event):void {
    trace(e.type);
    }
    ]]
    /fx:Script

    s:Button label="test" id="btn" /

    /s:Application

  • RELEVANCY SCORE 2.39

    DB:2.39:Oracle (On Nt) Event Ids xa


    Where can I find a list of Event Ids with descriptions for what is written to the NT Event log by Oracle databases ?
    Thanks

    DB:2.39:Oracle (On Nt) Event Ids xa

    Where can I find a list of Event Ids with descriptions for what is written to the NT Event log by Oracle databases ?
    Thanks

  • RELEVANCY SCORE 2.39

    DB:2.39:Event Id: 1207, 10102,1103 Error In Datawarehouse dx


    Hi I am seeing the below error/warnings in Datawarehouse server's Operationmanager event viwer. Event Type: Warning Event Source: HealthService Event Category: Health Service Event ID: 1103 Date: 3/18/2010 Time: 11:27:19 AM User: N/A Computer: Datawarehouse Server Name Description: Summary: 1 rule(s)/monitor(s) failed and got unloaded, 1 of them reached the failure limit that prevents automatic reload. Management group MG. This is summary only event, please see other events with descriptions of unloaded rule(s)/monitor(s). For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Event Type: Error Event Source: Health Service Modules Event Category: None Event ID: 10102 Date: 3/18/2010 Time: 11:27:19 AM User: N/A Computer: Datawarehouse Server Name Description: In PerfDataSource, could not resolve counter SQLServer:SSIS Pipeline, Rows written, . Module will be unloaded. One or more workflows were affected by this. Workflow name: Microsoft.SQLServer.2005.SQLServer_SSIS_Pipeline_Rows_Written_15.0_minutes_2_Rule Instance name: MsDtsServer Instance ID: {D1088A27-52F8-EE19-87B3-C5622DEB8CA7} Management group: MG For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Event Type: Warning Event Source: HealthService Event Category: Health Service Event ID: 1207 Date: 3/18/2010 Time: 11:27:13 AM User: N/A Computer: Datawarehouse Server Name Description: Rule/Monitor Dell.Connections.DellStorage.Discovery running for remote instance Datawarehouse Server Name with id:{E518D113-FC1B-CFDA-9378-DE380B8229BD} will be disabled as it is not remotable. Management group MG. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Please assist me to resolve this issue. Regards Donald D'souza

    DB:2.39:Event Id: 1207, 10102,1103 Error In Datawarehouse dx

    Donald,
    I think the first 2 events have a relation. When rules cannot run they will be eventually unloaded. The 2nd event shows that specific performance counter cannot be found. You could check if these performance counters have to be enabled.
    You can use a Resource Kit tool for this: exctrlst.exe (Kevin Holman has a blog about using this tool)
    In the 3rd event there's a rule from a Dell Management Pack. Check the documentation to see if you have to enable Agent Proxying for Agents using components which are monitored through this management pack.
    I thought that remotable means that arule or monitor is runable on agentless machines.MCSE | MCITP | MCTS SCCM SCOM 2007 | System Center tech blog: http://michielw.blogspot.com

  • RELEVANCY SCORE 2.39

    DB:2.39:[Solved] Disassociating Steering Wheel Form Mouse c9



    Hi! Im not sure how to exactly describe the issue. So, step by step The issue takes place on my sons computer (running Arch as well as other three computers in the family). In games he uses steering wheel, and, say, stuntrally and supertuxkart run excellent. In one of the Steams game (ES2) X axis is associated with steering wheel, and a wheel in the game does work. But in this game mouse moving is associated with view direction outside from cab. When steering takes place, at the same time view change also takes place in the same direction. And this is the issue.

    When you turn wheel with just desktop on the screen, you see mouse cursor is moving. That is a reason I named the topic the way you see.

    Ideas?

    Some wheel info:
    $ cat /proc/bus/input/devices
    ...
    I: Bus=0003 Vendor=0e8f Product=0003 Version=0110
    N: Name=HORI CO.,LTD. PC/PS2/PS3 Steering Wheel
    P: Phys=usb-0000:00:1d.0-2/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/0003:0E8F:0003.0005/input/input15
    U: Uniq=
    H: Handlers=event12 js0
    B: PROP=0
    B: EV=20001b
    B: KEY=fff00000000 0 0 0 0
    B: ABS=30027
    B: MSC=10
    B: FF=107030000 0
    ...
    $ evtest /dev/input/event12
    Input driver version is 1.0.1
    Input device ID: bus 0x3 vendor 0xe8f product 0x3 version 0x110
    Input device name: HORI CO.,LTD. PC/PS2/PS3 Steering Wheel
    Supported events:
    Event type 0 (EV_SYN)
    Event type 1 (EV_KEY)
    Event code 288 (BTN_TRIGGER)
    Event code 289 (BTN_THUMB)
    Event code 290 (BTN_THUMB2)
    Event code 291 (BTN_TOP)
    Event code 292 (BTN_TOP2)
    Event code 293 (BTN_PINKIE)
    Event code 294 (BTN_BASE)
    Event code 295 (BTN_BASE2)
    Event code 296 (BTN_BASE3)
    Event code 297 (BTN_BASE4)
    Event code 298 (BTN_BASE5)
    Event code 299 (BTN_BASE6)
    Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
    Value 127
    Min 0
    Max 255
    Flat 15
    Event code 1 (ABS_Y)
    Value 0
    Min 0
    Max 255
    Flat 15
    Event code 2 (ABS_Z)
    Value 127
    Min 0
    Max 255
    Flat 15
    Event code 5 (ABS_RZ)
    Value 127
    Min 0
    Max 255
    Flat 15
    Event code 16 (ABS_HAT0X)
    Value 0
    Min -1
    Max 1
    Event code 17 (ABS_HAT0Y)
    Value 0
    Min -1
    Max 1
    Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
    Event type 21 (EV_FF)
    Event code 80 (FF_RUMBLE)
    Event code 81 (FF_PERIODIC)
    Event code 88 (FF_SQUARE)
    Event code 89 (FF_TRIANGLE)
    Event code 90 (FF_SINE)
    Event code 96 (FF_GAIN)
    ...

    DB:2.39:[Solved] Disassociating Steering Wheel Form Mouse c9


    progandy, you made my son happy - xinput disable has helped. Thanks!

  • RELEVANCY SCORE 2.39

    DB:2.39:Mouse Wheel Problem With Scroll Bar And Value Change Event km



    I have an event that triggers when the value of a scroll bar changes. This works fine with everything but with the mouse wheel. At first, the mouse wheel will change the value of the scrollbar, but this won't trigger the event. If I then trigger the event with a mouse click, the mouse wheel will then start to trigger events as well. Then switching to another object makes it revert to not recognizing mouse wheel value changes.

    Is there a way to make it recognize the mouse wheel without having to change the value of the scroll bar with a click first? I've attached a sample vi.










    Attachments:







    ScrollBarTest.vi ‏29 KB

  • RELEVANCY SCORE 2.39

    DB:2.39:Chart Descriptions aj



    Dear All

    In BI web or excel based chart type reports i want th descriptions on the axes to appear in Arabic.

    Please let me know how this can be achieved.

    Regards

    Suresh

    DB:2.39:Chart Descriptions aj


    Hi,

    have a look at notes 1028690 and 531668. Both are about font configuration for the IGS.

    Regards, Kai

  • RELEVANCY SCORE 2.38

    DB:2.38:Mouse Wheel Click Event 89


    Hi everybody!
    I want to implement the tabitem close functionality using the mouse wheel click behavior (like in IE if you want to close a tabitem). I know i can access the mousewheel event, but this seems to fire only if you turn the wheel, not by clicking on it!
    Is there a way to subscribe to this event?

    DB:2.38:Mouse Wheel Click Event 89

    I don't think so there is the click event present in SL for mouse wheel. We need to use some alternative options.

  • RELEVANCY SCORE 2.38

    DB:2.38:Mod Wheel Instrument Articulation In Logic Express ss


    Hello all;
    I'm new to all things Apple. In Garageband I can play different articulations using the mod wheel and Symphony Orchestra Jam Pack without making any additional settings. It just works. However, in Logic Express, the mod wheel does not appear to work the same way. The MIDI activity window shows the wheel is inputing data but the sound remains the same, no articulations.

    Any suggestions would be helpful.

    Thanks
    Bill

  • RELEVANCY SCORE 2.38

    DB:2.38:Using Mod Wheel 7d


    In Garageband when I use mod wheel some instruments (like those in Symphonic Jam Pack) have different modes of playing. How to get this effect in Logic Express? It surely doesn't work the same way... :/

    DB:2.38:Using Mod Wheel 7d

    Since I got the same MIDI controller it should be easy from now on. Thanks and kudos for reply!

  • RELEVANCY SCORE 2.38

    DB:2.38:Rag Doll Kung Fu Mat Event 7j


    i found a mod when this event was on and did it correctly the mod replied (gotcha centegrade) the problem is still never got the email



    DB:2.38:Rag Doll Kung Fu Mat Event 7j


    i got mine. it sits nicely in my summer house in front of the fire.

  • RELEVANCY SCORE 2.38

    DB:2.38:Mod Tool Hanging On Me.... mf


    The Mod Tool has been hanging on me lately. After coming from hibernation and during modeling. These are the messages in the Event Viewer: Fault bucket 1119181548, type 1Event Name: APPCRASHResponse: Not availableCab Id: 569452025Problem signature:P1: XSI.exeP2: 6.0.2007.814P3: 46c23ba5P4: StackHash_4a6cP5: 0.0.0.0P6: 00000000P7: c0000005P8: 0a1f05dcP9: P10: Attached files:C:\Users\Developer\AppData\Local\Temp\WERD21B.tmp.WERInternalMetadata.xmlC:\Users\Developer\AppData\Local\Temp\WER209A.tmp.appcompat.txtC:\Users\Developer\AppData\Local\Temp\WER233A.tmp.mdmpThese files may be available here:C:\Users\Developer\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_XSI.exe_1259dc51d6fd1ac229f7a43898b27f414c84367_cab_0bcd647eAnalysis symbol: BAD_INSTRUCTION_PTR_c0000005_sitaskcore.dll!UnknownRechecking for solution: 0Report Id: 80a4a907-ecf5-11dd-8f54-0019dbcc6600Report Status: 24 Faulting application name: XSI.exe, version: 6.0.2007.814, time stamp: 0x46c23ba5Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000Exception code: 0xc0000005Fault offset: 0x0a1f05dcFaulting process id: 0x1114Faulting application start time: 0x01c980cfe950629bFaulting application path: C:\Softimage\XSI_6_Mod_Tool\Application\bin\XSI.exeFaulting module path: unknownReport Id: 80a4a907-ecf5-11dd-8f54-0019dbcc6600

    DB:2.38:Mod Tool Hanging On Me.... mf

    Thanks for clearing the last post! And, now as I think about the other posts, your correct again, because those happen before the hang. But, now concerning the hanging. I notice in my advance settings of Windows Firewall there's four entries under "Inbound Rules" I accept when I first ran XSI. Two public (Allow), two private (block). XSI was constaintly hanging since I've installed it. Since I've blocked the two private entries there has not been any hanging so far. So, I'm assuming it has to do with XSI communication with your server. If XSI hangs again then I will post again letting you know the changes I made with the firewall didn't solve the problem. Also, to note, I mention it was hanging after coming from "hibernation" and so far it's not hanging since I made the block.

  • RELEVANCY SCORE 2.38

    DB:2.38:G25 Mod mf



    I was wondering if anyone knows if the RA functions off the GT Force Steering Wheel can be made so i can use them with my G25 Setup ?

    DB:2.38:G25 Mod mf


    I was wondering if anyone knows if the RA functions off the GT Force Steering Wheel can be made so i can use them with my G25 Setup ?

  • RELEVANCY SCORE 2.37

    DB:2.37:Killzone Event 9c



    Fancy shooting a mod? Join me in my event right now Check here for details

    Alize's Rank-Up Thursdays

    DB:2.37:Killzone Event 9c

    James91 wrote: It's just a complete noob tubing fest Just rockets and grenades They ruin KZ2 online tbh.You're just scare because you don't want me to edit your sig to "I got PWND BY ALIZE"

  • RELEVANCY SCORE 2.37

    DB:2.37:How Do I Make It So I Can Use My Mod Wheel To Control The Volume For Jampak m8


    how do I make it so I can use my mod wheel to control the volume for the Orchestra Jam Pack?

    Let's say I want to use the Violins 1 legato EXS instrument and use the mod wheel for volume, or say, expression (CC#11)? What's the best way to redirect that information? I think I tried it once using a transformer in the environment, but I seem to recall that ended up recording MIDI data on all my MIDI tracks at once.

    Also, is there a way I can set it up so it cross fades between the three different samples there are for this instrument (I checked it out and apparently there's a legato f, mf, and p)

    How do you folks handle this kind of thing? (Volume and expression)

    thanks!
    Keith

    DB:2.37:How Do I Make It So I Can Use My Mod Wheel To Control The Volume For Jampak m8

    Thanks! I'll try that when I get home. I think I started to do that but I'll keep working with it.

    Also, to clarify my question, I'm referring specifically to the volume controls that emulate what a real musician would do when they'd be playing a wind or string instrument-- like something I'd implement when I'd actually record the part. (I'm not asking so much about the mixing process for a good overall orchestra sound.)

    Anyone else have any thoughts specifically on volume controls and setting up cross fading in EXS? I apologize if this topic's been covered in previous sessions.

    Keith

  • RELEVANCY SCORE 2.37

    DB:2.37:Scan Timed Out Events 19


    Hello, we've recently started using vse85i sp5 with EPO 4 and I am seeing a lot of the following events reported from my clients, can someone tell me why? I just think it throws off the reporting.Thanks in advance!CraigFile Path C:\Program Files\Common Files\McAfee\Engine\avvclean.dat Event Category Malware Event ID 1059 Threat Severity Alert Threat Name Threat Type virus Action Taken None Threat Handled false Analyzer Detection Method OAS Event Descriptions Event Description Scan Timed Out

    DB:2.37:Scan Timed Out Events 19

    Thanks for that info. I will give that a try.

  • RELEVANCY SCORE 2.37

    DB:2.37:Deleting Masterdata In Sap Apo: For Reference Purposes 3a



    **********************************************************************

    ************************************************************************

    PROGRAM--Modification*MOD-1771404

    Program name : ZAXXPR_DELETE_MASTER_DATA

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 15.02.2008

    Initial Change request number : PMI_SIGN_0002

    Author : Aveek Ghose.

    Description :

    *

    ************************************************************************

    ************************************************************************

    MOD-1887120

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 10.03.2008

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA.

    ************************************************************************

    REPORT zaxxpr_delete_master_data MESSAGE-ID zaxxp_sign_fpv.

    Include for global data and constants declaration

    INCLUDE zaxxpr_delete_master_data_top.

    ----

    * Include ZAXXPR_DEL_MASTER_DATA_TOP

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_TOP

    ----

    ************************************************************************

    PROGRAM--INITIAL CREATION

    Description XXXXXXXXXX :

    *

    This is the Top include that contains the global data declarations

    and the selection screen of the main program

    ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    PROGRAM--Modification: MOD-1771404

    Program name : ZAXXPR_DELETE_MASTER_DATA_TOP

    Reference program (copied from) : na.

    Development specification ID :

    Process team contact person/team name: Nandakumar

    Date created : 15.02.2006

    Initial Change request number : PMI_SIGN_0002

    Author : Aveek Ghose..

    Description :

    *

    This is the Top include that contains the global data declarations

    and the selection screen of the main program

    ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    ************************TYPES DECLARATION*****************************

    ************************************************************************

    TYPE-POOLS: slis...

    Types dclaration for view table data.

    TYPES: BEGIN OF s_view_data,

    pcode TYPE matnr, " Product

    maktx TYPE zdmaktx, " Prod Desc

    markt TYPE zdmarkt, " Market

    martx TYPE zdmarkst, " Market Desc

    pdctr TYPE zdpdctr, " Product Center

    pctxt TYPE zdpdcst, " Description

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    vartx TYPE zdvartx, " Variant Description

    status TYPE zdstat1, " Status

    END OF s_view_data,

    t_view_data TYPE STANDARD TABLE OF s_view_data.

    MOD-1771404****

    TYPES: BEGIN OF l_view_data,

    pcode TYPE matnr, " Product

    markt TYPE zdmarkt, " Market

    pdctr TYPE zdpdctr, " Product Center

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    status TYPE zdstat1, " Status

    END OF l_view_data,

    lv_view_data TYPE STANDARD TABLE OF s_view_data.

    MOD-1771404***

    Types declaration for F4 help Product data

    TYPES: BEGIN OF s_f4_data_matnr,

    pcode TYPE matnr, " Product

    maktx TYPE maktx, " Description

    END OF s_f4_data_matnr,

    t_f4_data_matnr TYPE STANDARD TABLE OF s_f4_data_matnr.

    Types declaration for F4 help Location data

    TYPES: BEGIN OF s_f4_data_loc,

    locno TYPE /sapapo/locno, " Location

    desc TYPE /sapapo/loc_descr40, " Description

    pcode TYPE /sapapo/matnr, " Product

    prvar TYPE /sapapo/matnr, " Product Variant

    *MOD-012

    pdctr TYPE ZDPDCTR, "Production Center

    *MOD-012

    vartx TYPE zdvartx, " Variant Description

    maktx TYPE zdmaktx, " Prod Desc

    status TYPE zdstat1, " Status

    loctyp TYPE /sapapo/c_loctype, " Location Type

    whse1 TYPE ZAWHSE1,

    whse2 TYPE ZAWHSE2,

    lv_exist TYPE I, " Variable

    END OF s_f4_data_loc,

    t_f4_data_loc TYPE STANDARD TABLE OF s_f4_data_loc.

    Types declaration for Warehouse description

    TYPES: BEGIN OF s_whse,

    whse TYPE zawhse, " Location

    whdesc TYPE zadesc, " Description

    END OF s_whse,

    t_whse TYPE STANDARD TABLE OF s_whse.

    Types declaration for F4 help Location data

    TYPES: BEGIN OF s_f4_loc,

    locno TYPE /sapapo/locno, " Location

    desc TYPE /sapapo/loc_descr40, " Description

    END OF s_f4_loc,

    t_f4_loc TYPE STANDARD TABLE OF s_f4_loc.

    Types declaration for SCREEN TABLE used in submit statement

    TYPES: t_rsparams TYPE STANDARD TABLE OF rsparams.

    Types declaration for Transportation Lane data

    TYPES: BEGIN OF s_tlane_data,

    trpid TYPE /sapapo/tr_trpid, " Trip Id

    locto TYPE /sapapo/locno, " Location to

    matid TYPE matnr, " Material Id

    locfr TYPE /sapapo/locno, " Location from

    END OF s_tlane_data,

    t_tlane_data TYPE STANDARD TABLE OF s_tlane_data.

    Types Declaration for Range Table

    TYPES: BEGIN OF s_range_matid,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/matid, " Matid low

    high TYPE /sapapo/matid, " Matid high

    END OF s_range_matid,

    t_matid_range TYPE STANDARD TABLE OF s_range_matid.

    Types Declaration for Range Table

    TYPES: BEGIN OF s_range_locid,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/locid, " Locid low

    high TYPE /sapapo/locid, " locid high

    END OF s_range_locid,

    t_locid_range TYPE STANDARD TABLE OF s_range_locid.

    Types Declaration for ALV Display

    TYPES: BEGIN OF s_display,

    prod TYPE /sapapo/matnr, " Product

    p_des TYPE zdmaktx, " Product Desc

    loc TYPE /sapapo/locno, " Location

    l_des TYPE /sapapo/loc_descr40, " Location Desc

    status TYPE char15, " Deletion status

    light TYPE iconname, " Light Indicator

    END OF s_display,

    t_display TYPE STANDARD TABLE OF s_display.

    TYPES: BEGIN OF s_displayprd,

    prod TYPE /sapapo/matnr, " Product

    p_des TYPE zdmaktx, " Product Desc

    status TYPE char15, " Deletion status

    light TYPE iconname, " Light Indicator

    END OF s_displayprd,

    t_displayprd TYPE STANDARD TABLE OF s_displayprd.

    Types Declaration for Product select options

    TYPES: BEGIN OF s_range_product,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE matnr, " Product low

    high TYPE matnr, " Product high

    END OF s_range_product.

    Types Declaration for Location select option

    TYPES: BEGIN OF s_range_location,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/locno, " Location low

    high TYPE /sapapo/locno, " Location high

    END OF s_range_location.

    Types Declaration for Matids for the Products

    TYPES: BEGIN OF s_matid,

    matid TYPE /sapapo/matid, " Matid

    matnr TYPE matnr, " Product

    END OF s_matid,

    t_matid TYPE STANDARD TABLE OF s_matid.

    Types Declaration for Locid and Locations

    TYPES: BEGIN OF s_locid,

    locid TYPE /sapapo/locid, " Matid

    locno TYPE /sapapo/locno, " Product

    END OF s_locid,

    t_locid TYPE STANDARD TABLE OF s_locid.

    TYPES: BEGIN OF s_tlaneupd,

    locfr TYPE /sapapo/locno,

    locto TYPE /sapapo/locno,

    matnr TYPE matnr,

    matid type /SAPAPO/MATID,

    msg TYPE /fre/bif_messagetext,

    END OF s_tlaneupd,

    t_tlaneupd TYPE STANDARD TABLE OF s_tlaneupd.

    TYPES: BEGIN OF s_matloc,

    matnr TYPE matnr,

    locno TYPE /sapapo/locno,

    END OF s_matloc,

    t_matloc TYPE STANDARD TABLE OF s_matloc.

    *MOD-1771404

    TYPES: t_masterdata TYPE STANDARD TABLE OF ZAP_SCMPF,

    s_tship type ZAP_TSHPT,

    t_tship type standard table of s_tship,

    t_log_table TYPE STANDARD TABLE OF bal_s_msg,

    t_log_location TYPE STANDARD TABLE OF bal_s_msg,

    t_log_product TYPE STANDARD TABLE OF bal_s_msg,

    t_log_locprd TYPE STANDARD TABLE OF bal_s_msg,

    t_log_tlane TYPE STANDARD TABLE OF bal_s_msg.

    TYPES: BEGIN OF s_location,

    locno TYPE /sapapo/locno,

    loctp TYPE /sapapo/c_loctype,

    locct TYPE char1,

    END OF s_location,

    t_location TYPE STANDARD TABLE OF s_location,

    BEGIN OF s_product,

    matnr TYPE /sapapo/matnr,

    matct TYPE char1,

    END OF s_product,

    t_product TYPE STANDARD TABLE OF s_product,

    BEGIN OF s_tlane,

    locfr TYPE /sapapo/locno,

    locto TYPE /sapapo/locno,

    matnr TYPE /sapapo/matnr,

    ltpfr TYPE /sapapo/c_loctype,

    ltpto TYPE /sapapo/c_loctype,

    lidfr TYPE /sapapo/locid,

    lidto TYPE /sapapo/locid,

    matid TYPE /sapapo/matid,

    datfr TYPE timestamp,

    datto TYPE timestamp,

    crtyp TYPE flag,

    lv_exist type i,

    END OF s_tlane,

    t_tlane TYPE STANDARD TABLE OF s_tlane,

    BEGIN OF s_loc_extloc,

    locno TYPE /sapapo/locno,

    extloc TYPE /sapapo/loc_extlocno,

    END OF s_loc_extloc,

    t_loc_extloc TYPE STANDARD TABLE OF s_loc_extloc,

    BEGIN OF s_prd_extprd,

    matnr TYPE /sapapo/matnr,

    extmat TYPE /sapapo/ext_matnr,

    END OF s_prd_extprd,

    t_prd_extprd TYPE STANDARD TABLE OF s_prd_extprd,

    BEGIN OF s_locprd,

    locno TYPE /sapapo/locno,

    matnr TYPE /sapapo/matnr,

    loctp TYPE /sapapo/c_loctype,

    prctp TYPE /sapapo/beskz,

    END OF s_locprd,

    t_locprd TYPE STANDARD TABLE OF s_locprd.

    DATA: t_sign type standard table of zap_sign.

    DATA: t_sign1 type standard table of zap_sign.

    DATA: IT_ZDU1002 type standard table of zdu1002.

    DATA: it_zdm0705 type standard table of zdm0705.

    *MOD-1771404

    ************************************************************************

    ********************CONSTANTS DECLARATION*****************************

    ************************************************************************

    CONSTANTS:

    Selection Screen field names

    gc_prd_low TYPE dynfnam VALUE 'S_PRD-LOW',

    gc_prd_high TYPE dynfnam VALUE 'S_PRD-HIGH',

    gc_mkt_low TYPE dynfnam VALUE 'S_MKT-LOW',

    gc_mkt_high TYPE dynfnam VALUE 'S_MKT-HIGH',

    Transaction Name and Program Names

    gc_bp2 TYPE baltcode VALUE '/SAPAPO/BP2',

    gc_slg1 TYPE baltcode VALUE 'SLG1',

    gc_mode_e TYPE ctu_mode VALUE 'E',

    gc_mode_n TYPE ctu_mode VALUE 'N',

    gc_foreground TYPE char1 VALUE 'A',

    gc_rscsel TYPE dynfnam VALUE 'RSCSEL-SLOW_I',

    gc_l_brac TYPE char1 VALUE '(',

    gc_r_brac TYPE char1 VALUE ')',

    Selection Screen Elements for /SAPAPO/RLCDELETE

    gc_radio_btn TYPE rsscr_kind VALUE 'R',

    gc_parameter TYPE rsscr_kind VALUE 'P',

    gc_sel_optn TYPE rsscr_kind VALUE 'S',

    gc_sign_i TYPE tvarv_sign VALUE 'I',

    gc_option_eq TYPE tvarv_opti VALUE 'EQ',

    gc_manual_sel TYPE rsscr_name VALUE 'SHUF_PA1',

    gc_product TYPE rsscr_name VALUE 'SEL_PROD',

    gc_location TYPE rsscr_name VALUE 'SEL_LOC',

    gc_plan_vrsn TYPE rsscr_name VALUE 'P_VERSIO',

    gc_fixed_ord TYPE rsscr_name VALUE 'P_FIXED',

    gc_category TYPE rsscr_name VALUE 'RB_CAT',

    gc_key_fig TYPE rsscr_name VALUE 'RB_KEYF',

    gc_only_apo TYPE rsscr_name VALUE 'P_APO',

    gc_test_run TYPE rsscr_name VALUE 'P_TEST',

    gc_pvrsn_000 TYPE tvarv_val VALUE '000',

    Selection screen fields for /SAPAPO/DELETE_PP_ORDER

    gc_pl_vrsn TYPE rsscr_name VALUE 'LV_SIMID',

    gc_prod TYPE rsscr_name VALUE 'LT_MATAB',

    gc_loc TYPE rsscr_name VALUE 'LT_LOTAB',

    gc_plan_prod TYPE rsscr_name VALUE 'LV_EXT',

    gc_contract TYPE rsscr_name VALUE 'LV_SUBCO',

    gc_display_ord TYPE rsscr_name VALUE 'LV_LIST',

    gc_delete_ord TYPE rsscr_name VALUE 'LV_DEL',

    gc_send_delete TYPE rsscr_name VALUE 'LV_EVENT',

    ALV grid display fields

    gc_pos_1 TYPE lvc_colpos VALUE '0001',

    gc_pos_2 TYPE lvc_colpos VALUE '0002',

    gc_pos_3 TYPE lvc_colpos VALUE '0003',

    gc_pos_4 TYPE lvc_colpos VALUE '0004',

    gc_pos_5 TYPE lvc_colpos VALUE '0005',

    gc_pos_6 TYPE lvc_colpos VALUE '0006',

    gc_prodct TYPE lvc_fname VALUE 'PROD',

    gc_status TYPE lvc_fname VALUE 'STATUS',

    gc_light TYPE lvc_fname VALUE 'LIGHT',

    gc_prod_des TYPE lvc_fname VALUE 'P_DES',

    gc_loctn TYPE lvc_fname VALUE 'LOC',

    gc_loc_des TYPE lvc_fname VALUE 'L_DES',

    gc_tabname TYPE lvc_tname VALUE 'LT_DISPLAY',

    gc_left TYPE lvc_just VALUE 'L',

    gc_center TYPE lvc_just VALUE 'C',

    gc_len_prod TYPE lvc_outlen VALUE '18',

    gc_len_p_des TYPE lvc_outlen VALUE '40',

    gc_len_loc TYPE lvc_outlen VALUE '20',

    gc_len_l_des TYPE lvc_outlen VALUE '30',

    gc_len_stat TYPE lvc_outlen VALUE '20',

    gc_len_lt TYPE lvc_outlen VALUE '5',

    gc_set_pf TYPE slis_formname VALUE 'F_SET_PF',

    gc_show_log TYPE slis_formname VALUE 'F_SHOW_LOG',

    gc_lt_top TYPE slis_formname VALUE 'F_TOP_TL',

    gc_tlupd_top TYPE slis_formname VALUE 'F_TOP_TLUPD',

    gc_prd_top TYPE slis_formname VALUE 'F_TOP_PRD',

    gc_td_log TYPE gui_code VALUE 'TD_LOG',

    gc_tlane TYPE gui_code VALUE 'TLANE',

    gs_type_s TYPE char1 VALUE 'S',

    gs_type_h TYPE char1 VALUE 'H',

    gs_type_a TYPE char1 VALUE 'A',

    gc_save TYPE char1 VALUE 'A',

    gc_red TYPE iconname VALUE '@5C@',

    gc_green TYPE iconname VALUE '@5B@',

    ALV display for Tlane

    gc_prod_tl TYPE lvc_fname VALUE 'MATID',

    gc_locto TYPE lvc_fname VALUE 'LOCTO',

    gc_locfr TYPE lvc_fname VALUE 'LOCFR',

    gc_matnr TYPE lvc_fname VALUE 'MATNR',

    gc_msg TYPE lvc_fname VALUE 'MSG',

    gc_tl_tab TYPE lvc_tname VALUE 'GT_TLANE',

    gc_tl_tabu TYPE lvc_tname VALUE 'IT_TLANEUPD',

    Others

    gc_s TYPE ddbool_d VALUE 'S',

    gc_inactive TYPE zdstat1 VALUE 'I',

    gc_set TYPE char1 VALUE 'X',

    gc_set_val TYPE tvarv_val VALUE 'X',

    gc_int_commit TYPE bapi10001commctrl VALUE 'E',

    gc_bs_group TYPE /sapapo/logqs VALUE 'BSGAPO',

    gc_error TYPE bapi_mtype VALUE 'E',

    gc_abend TYPE bapi_mtype VALUE 'A',

    gc_dot TYPE char1 VALUE '.',

    gc_colon TYPE char1 VALUE ':',

    gc_space TYPE char4 VALUE ' ',

    gc_star TYPE char1 VALUE '*',

    *MOD-1771404

    gc_core TYPE char1 VALUE 'C',

    gc_var TYPE char1 VALUE 'V',

    Message class name

    gc_msgid TYPE symsgid VALUE 'ZAXXP_SIGN_FPV',

    Message types

    gc_warn TYPE symsgty VALUE 'W',

    gc_err TYPE symsgty VALUE 'E',

    gc_succ TYPE symsgty VALUE 'S',

    Message nos

    gc_msgno_021 TYPE symsgno VALUE '021',

    gc_msgno_023 TYPE symsgno VALUE '023',

    gc_msgno_024 TYPE symsgno VALUE '024',

    gc_msgno_025 TYPE symsgno VALUE '025',

    gc_msgno_026 TYPE symsgno VALUE '026',

    gc_msgno_027 TYPE symsgno VALUE '027',

    gc_msgno_028 TYPE symsgno VALUE '028',

    gc_msgno_029 TYPE symsgno VALUE '029',

    gc_msgno_030 TYPE symsgno VALUE '030',

    gc_msgno_031 TYPE symsgno VALUE '031',

    gc_msgno_032 TYPE symsgno VALUE '032',

    gc_msgno_033 TYPE symsgno VALUE '033',

    gc_msgno_034 TYPE symsgno VALUE '034',

    gc_msgno_035 TYPE symsgno VALUE '035',

    gc_msgno_037 TYPE symsgno VALUE '037',

    gc_msgno_038 TYPE symsgno VALUE '038',

    gc_msgno_039 TYPE symsgno VALUE '039',

    gc_msgno_040 TYPE symsgno VALUE '040',

    gc_msgno_041 TYPE symsgno VALUE '041',

    gc_msgno_042 TYPE symsgno VALUE '042',

    gc_msgno_043 TYPE symsgno VALUE '043',

    gc_msgno_044 TYPE symsgno VALUE '044',

    gc_msgno_050 TYPE symsgno VALUE '050',

    gc_msgno_051 TYPE symsgno VALUE '051',

    gc_msgno_052 TYPE symsgno VALUE '052',

    gc_msgno_053 TYPE symsgno VALUE '053',

    gc_msgno_054 TYPE symsgno VALUE '054',

    gc_msgno_055 TYPE symsgno VALUE '055',

    gc_msgno_061 TYPE symsgno VALUE '061',

    gc_msgno_075 TYPE symsgno VALUE '075',

    gc_msgno_076 TYPE symsgno VALUE '076',

    gc_msgno_078 TYPE symsgno VALUE '078',

    gc_msgno_087 TYPE symsgno VALUE '087',

    gc_msgno_096 TYPE symsgno VALUE '096',

    gc_msgno_98 TYPE symsgno VALUE '098',

    gc_msgno_100 TYPE symsgno VALUE '100',

    Location types

    gc_ltp_1001 TYPE /sapapo/c_loctype VALUE '1001', "For Prd centre

    gc_ltp_1002 TYPE /sapapo/c_loctype VALUE '1002', "For Mkt/whouse

    Procurement types

    gc_ptp_x TYPE /sapapo/beskz VALUE 'X', "For Prd centre

    gc_ptp_f TYPE /sapapo/beskz VALUE 'F', "For Mkt/whouse

    Variant status

    gc_stat_p TYPE zdstat1 VALUE 'P',

    gc_stat_a TYPE zdstat1 VALUE 'A',

    Timestamps

    gc_startti TYPE syuzeit VALUE '000000',

    gc_endti TYPE syuzeit VALUE '235959',

    Default means of transport

    gc_ttype_0001 TYPE /sapapo/tr_traty VALUE '0001',

    Business system grp

    gc_bsgapo TYPE /sapapo/loc_logqs VALUE 'BSGAPO',

    gc_utc TYPE timezone VALUE 'UTC'. "UTC time zome

    *MOD-1771404

    ************************************************************************

    ************************DATA DECLARATION******************************

    ************************************************************************

    DATA: gv_flgstart type flag,

    gv_prd TYPE matnr,

    gv_mkt TYPE /sapapo/locno,

    gv_date_before TYPE sy-datum,

    gv_time_before TYPE sy-uzeit,

    gv_flg_error TYPE char1,

    gv_msg_error TYPE char1. " Flag for Call Tr fail

    Internal table declarations

    DATA: gt_f4_data_matnr TYPE STANDARD TABLE OF s_f4_data_matnr,

    gt_f4_data_loc TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_matloc TYPE t_matloc,

    gt_prod_data TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_product TYPE STANDARD TABLE OF bapi10001key,

    *MOD-1771404

    gt_new_product TYPE STANDARD TABLE of s_product,

    gt_location TYPE STANDARD TABLE OF s_location,

    gt_new_tlane TYPE STANDARD TABLE OF s_tlane,

    *MOD-1771404

    gt_core_prod TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_prod_var TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_loc_data TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_tlane TYPE STANDARD TABLE OF s_tlane_data,

    gt_matid_all TYPE STANDARD TABLE OF s_matid,

    gt_view_data TYPE STANDARD TABLE OF s_view_data,

    gt_bdc_tab TYPE STANDARD TABLE OF bdcdata,

    gt_variant_table TYPE STANDARD TABLE OF rsparams,

    gt_fcat TYPE STANDARD TABLE OF slis_fieldcat_alv,

    gt_top_page TYPE slis_t_listheader,

    gt_masterdata TYPE t_masterdata,

    gt_tship type t_tship,

    gt_whse type t_whse,

    *MOD-1771404

    gt_log_location TYPE t_log_location,

    gt_log_product TYPE t_log_product,

    gt_log_locprd TYPE t_log_locprd,

    gt_log_tlane TYPE t_log_tlane.

    DATA:

    lt_tlane TYPE t_tlane,

    lt_tlane_new TYPE t_tlane,

    lt_tlane_dat TYPE t_tlane,

    lt_location TYPE t_location,

    lt_product TYPE t_product,

    lt_prd_extprd TYPE t_prd_extprd,

    lt_loc_extloc TYPE t_loc_extloc,

    lt_locprd TYPE t_locprd.

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    *MOD-1771404

    ************************************************************************

    *******************SELECTION SCREEN DEFINITION************************

    ************************************************************************

    Block to enter the product and location data

    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    Option to delete master data

    *************************************************************

    *MOD-001

    *************************************************************

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-033 FOR FIELD p_mdel.

    PARAMETERS: p_mdel RADIOBUTTON GROUP grp1 USER-COMMAND ucom

    DEFAULT 'X'.

    *

    PARAMETERS: p_mdel RADIOBUTTON GROUP grp1.

    *

    PARAMETERS p_mdel AS CHECKBOX DEFAULT 'X'.

    *

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN SKIP.

    selection-screen: begin of line,

    comment (79) text-043.

    selection-screen end of line.

    selection-screen: begin of line,

    comment (79) text-044.

    selection-screen end of line.

    SELECTION-SCREEN SKIP.

    **************************************************************

    *MOD-001

    *************************************************************

    PARAMETERS: p_log TYPE logsys OBLIGATORY MEMORY ID mid.

    SELECT-OPTIONS:

    s_prd FOR gv_prd OBLIGATORY, " Product variant

    s_mkt FOR gv_mkt OBLIGATORY. " Market

    SELECTION-SCREEN: SKIP.

    SELECTION-SCREEN: BEGIN OF LINE.

    SELECTION-SCREEN POSITION 33.

    PARAMETERS: p_test AS CHECKBOX DEFAULT 'X'. "#EC *

    No Selection Text Maintained as we are displaying comment for it

    SELECTION-SCREEN COMMENT 1(16) text-002 FOR FIELD p_test.

    SELECTION-SCREEN: END OF LINE.

    SELECTION-SCREEN PUSHBUTTON 5(10) text-042 USER-COMMAND wuf.

    *MOD-1771404

    Option to update transportation lanes

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-032 FOR FIELD p_tlan.

    PARAMETERS: p_tlan RADIOBUTTON GROUP grp1.

    SELECTION-SCREEN END OF LINE.

    Sourcing for tlane

    SELECTION-SCREEN SKIP.

    PARAMETERS: p_src TYPE /sapapo/locno OBLIGATORY,

    p_des TYPE /sapapo/locno OBLIGATORY,

    p_prd TYPE matnr OBLIGATORY.

    Radio button for validity date change

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-028 FOR FIELD p_tdat.

    PARAMETERS: p_tdat RADIOBUTTON GROUP grp USER-COMMAND ucom

    MODIF ID mod DEFAULT 'X'.

    SELECTION-SCREEN END OF LINE.

    Fields for dates

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 10(15) text-030 FOR FIELD p_frd.

    PARAMETERS p_frd TYPE sydatum.

    SELECTION-SCREEN: COMMENT 40(10) text-031 FOR FIELD p_tod.

    PARAMETERS p_tod TYPE sydatum.

    SELECTION-SCREEN: END OF LINE.

    Radio button for product removal

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-029 FOR FIELD p_tprd.

    PARAMETERS: p_tprd RADIOBUTTON GROUP grp.

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN: END OF BLOCK b1.

    *MOD-1771404

    include ZAXXPR_DEL_MASTER_DATA_TOP.

    ************************************************************************

    ************************INITIALIZATION********************************

    ************************************************************************

    INITIALIZATION.

    CLEAR gv_flgstart.

    Gets Product and location data for populatiing the search helps

    PERFORM f_get_f4_data CHANGING gt_f4_data_matnr

    gt_f4_data_loc

    gt_view_data.

    Adjusts screen fields

    PERFORM f_adj_screen_flds.

    ***********************************************************************

    ******************SELECTION SCREEN EVENTS****************************

    ***********************************************************************

    AT SELECTION-SCREEN ON s_prd.

    Validates product against the SIGN view

    PERFORM f_validate_product.

    AT SELECTION-SCREEN ON s_mkt.

    Validate market against the SIGN view

    PERFORM f_validate_market.

    Custom search help for Product-Low

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prd-low.

    PERFORM f_f4_for_prodcentre USING gc_prd_low

    gt_f4_data_matnr.

    Custom search help for Product-High

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prd-high.

    PERFORM f_f4_for_prodcentre USING gc_prd_high

    gt_f4_data_matnr.

    Custom search help for Location-Low

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mkt-low.

    PERFORM f_f4_for_market USING gc_mkt_low

    gt_f4_data_loc.

    Custom search help for Location-High

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mkt-high.

    PERFORM f_f4_for_market USING gc_mkt_high

    gt_f4_data_loc.

    Adjusting the screen fields

    AT SELECTION-SCREEN OUTPUT.

    CLEAR gv_flgstart.

    *mod-099

    PERFORM f_clear_tables.

    *mod-099

    PERFORM f_adj_screen_flds.

    AT SELECTION-SCREEN.

    IF sy-ucomm = 'WUF'.

    REFRESH gt_matloc.

    PERFORM f_check_product_status USING gt_f4_data_loc

    CHANGING gt_prod_data

    gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    MOD-1887120 *

    SORT gt_core_prod BY locno pcode.

    DELETE ADJACENT DUPLICATES FROM gt_core_prod

    COMPARING locno

    pcode.

    SORT gt_prod_var BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM gt_prod_var

    COMPARING locno

    pcode

    prvar.

    MOD-1887120 *

    Call the WUF transaction

    PERFORM launch_wuf USING gt_core_prod

    gt_prod_var.

    ENDIF.

    ************************************************************************

    ************************START OF SELECTION****************************

    ************************************************************************

    START-OF-SELECTION.

    gv_flgstart = 'X'.

    IF p_mdel IS NOT INITIAL.

    Filter all the Products selected for deletion with status inactive

    REFRESH gt_matloc.

    wait up to 5 seconds.

    PERFORM f_check_product_status USING gt_f4_data_loc

    CHANGING gt_prod_data

    gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    Set the Date and Time before deleting the Data.

    gv_date_before = sy-datum.

    gv_time_before = sy-uzeit.

    IF gt_core_prod IS INITIAL.

    MESSAGE i085.

    ENDIF.

    IF gt_prod_var IS INITIAL.

    MESSAGE i086.

    LEAVE LIST-PROCESSING.

    ENDIF.

    IF p_test IS INITIAL.

    Delete the Transactional data for the Product and Location Combination

    Using the call transaction /SAPAPO/BP2

    *MOD-1887120

    SORT gt_core_prod BY locno pcode.

    DELETE ADJACENT DUPLICATES FROM gt_core_prod

    COMPARING locno

    pcode.

    SORT gt_prod_var BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM gt_prod_var

    COMPARING locno

    pcode

    prvar.

    SORT gt_loc_data BY locno.

    DELETE ADJACENT DUPLICATES FROM gt_loc_data

    COMPARING locno.

    *MOD-1887120

    PERFORM f_delete_transactional_data USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_prod_data

    gt_bdc_tab.

    Delete the Transactional data created manually by submitting to the

    SAP standard program /SAPAPO/RLCDEL via selection screen variant.

    PERFORM f_delete_manual_created_data USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_variant_table.

    Delete the PPDS orders for selection screen Product and Location

    Done by submitting to SAP Standard program /SAPAPO/DELETE_PP_ORDER

    Via screen table.

    PERFORM f_delete_ppds_orders USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_variant_table.

    ENDIF.

    Delete Products from the Transportation Lanes for the Products and

    locations entered at the selection screen.

    PERFORM f_delete_product_from_tlane USING gt_core_prod

    gt_prod_var

    CHANGING gt_loc_data

    gt_matid_all

    gt_tlane.

    Run the Transportation Lane consistency check program

    PERFORM f_run_consistency_check.

    Set the Deletion flag for the Products selected for deletion.

    IF p_test IS INITIAL.

    PERFORM f_set_deletion_flag USING gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    ENDIF.

    Display the ALV Report.

    PERFORM f_display_alv USING gt_prod_data

    gt_matloc

    CHANGING gt_fcat

    gt_matid_all.

    ENDIF.

    If the user chooses to update the transportation lane

    **MOD-1771404

    IF p_tlan IS NOT INITIAL.

    *MOD-1771404

    Retrieve the master data from teh SIGN portfolio meeting the user

    selection

    PERFORM f_retrieve_masterdata CHANGING gt_masterdata

    gt_tship

    gt_whse.

    Collect all possible transportation lanes

    PERFORM f_collect_tlanes USING gt_masterdata

    gt_tship

    gt_location

    gt_new_product

    CHANGING gt_new_tlane.

    IF gt_new_tlane IS INITIAL.

    EXIT.

    ENDIF.

    The Tlanes can be categorised into 3 categories:

    1 To be created fresh

    2 Exists, but new product need to be assigned

    3 Only validity dates need to be changed

    PERFORM f_categorise_tlanes USING gt_new_tlane

    CHANGING lt_tlane_new

    lt_tlane_dat.

    *MOD-1771404 changed by Aveek

    PERFORM f_update_tlane.

    *MOD-1771404 changed by Aveek

    PERFORM f_update_tlane using gt_new_tlane.

    *MOD-1771404

    ENDIF.

    Include for subroutine declaration

    include ZAXXPR_DELETE_MASTER_DATA_F02.

    *Text elements

    *----

    002 Test Delete

    028 Validity Date Change

    029 Product Removal

    030 From date

    031 To date

    032 Transportation Lane

    042 WUF

    *Selection texts

    *----

    P_DES Destination

    P_FRD From Date

    P_LOG Logical system

    P_MDEL Model

    P_PRD Production

    P_SRC Source

    P_TDAT To Date

    P_TEST Test

    P_TLAN Transportation Lane

    P_TOD To Date

    P_TPRD Product Removal

    S_MKT Market

    S_PRD Product

    ----

    *Messages

    ----

    *Message class: ZAXXP_SIGN_FPV

    *005 no sourcing info is maintained in the sign portfolio

    *016 Product does not exist in APO

    *017 Location does not exist in APO

    *056 Both Product and Location can not be multiple

    *059 Product value as * not allowed at the selection screen

    *060 Product value as * not allowed at the selection screen

    *085 Core Product is Initial.

    *086 Product Variant is Initial

    **************************************************************

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F02

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F02

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F01

    ----

    ************************************************************************

    PROGRAM--INITIAL CREATION

    *

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA...

    ************************************************************************

    ************************************************************************

    PROGRAM--Modification MOD-1771404

    ************************************************************************

    *

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 15.02.2006

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose..

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    MOD-1887120

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 10.03.2006

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ----

    * Form f_validate_product

    ----

    Validates the product

    ----

    FORM f_validate_product.

    Local Date Declaration

    DATA: lv_prd TYPE matnr,

    lv_matnr TYPE /sapapo/matnr.

    Field symbols:

    FIELD-SYMBOLS:

    lfs_prd TYPE s_range_product.

    IF p_mdel IS INITIAL.

    EXIT.

    ENDIF.

    Both Product and Location can not be a range at the selection screen

    IF s_prd-low IS NOT INITIAL AND

    s_prd-high IS NOT INITIAL AND

    s_mkt-low IS NOT INITIAL AND

    s_mkt-high IS NOT INITIAL.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    Check if both Product and location dont have multiple entries

    READ TABLE s_prd INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    READ TABLE s_mkt INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    ENDIF.

    Check if user has entered * in the select option for location.

    READ TABLE s_prd ASSIGNING lfs_prd WITH KEY low = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e059.

    ELSE.

    READ TABLE s_prd ASSIGNING lfs_prd WITH KEY high = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e059.

    ENDIF.

    ENDIF.

    SELECT pcode UP TO 1 ROWS

    INTO lv_prd

    FROM zap_sign

    WHERE pcode IN s_prd.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_prd IS INITIAL.

    Product does not exist in APO

    MESSAGE e016.

    ENDIF.

    ENDFORM. " f_validate_product

    ----

    * Form f_validate_market

    ----

    Validates the market

    ----

    FORM f_validate_market .

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    Field Symbols:

    FIELD-SYMBOLS:

    lfs_mkt TYPE s_range_location.

    IF p_mdel IS INITIAL.

    EXIT.

    ENDIF.

    Both Product and Location can not be multiple at the selection screen

    IF s_prd-low IS NOT INITIAL AND

    s_prd-high IS NOT INITIAL AND

    s_mkt-low IS NOT INITIAL AND

    s_mkt-high IS NOT INITIAL.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    Check if both Product and location dont have multiple entries

    READ TABLE s_prd INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    READ TABLE s_mkt INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    ENDIF.

    Check if user has entered * in the select option for location.

    READ TABLE s_mkt ASSIGNING lfs_mkt WITH KEY low = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e060.

    ELSE.

    READ TABLE s_mkt ASSIGNING lfs_mkt WITH KEY high = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e060.

    ENDIF.

    ENDIF.

    Check if the Location is a market

    SELECT markt UP TO 1 ROWS

    INTO lv_mkt

    FROM zap_sign

    WHERE markt IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Production center

    SELECT pdctr UP TO 1 ROWS

    INTO lv_pdctr

    FROM zap_sign

    WHERE pdctr IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_pdctr IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 1

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse2 IN s_mkt.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS NOT INITIAL.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    ENDFORM. " f_validate_market

    ----

    * Form F_GET_F4_DATA

    ----

    Get all the data required for custom F4 helps

    ----

    --ct_f4_data_matnr Itab with products

    --ct_f4_data_loc Itab with F4 data for location

    --ct_view_data Itab wiht data selected from view table

    ----

    FORM f_get_f4_data CHANGING ct_f4_data_matnr TYPE t_f4_data_matnr

    ct_f4_data_loc TYPE t_f4_data_loc

    ct_view_data TYPE t_view_data.

    Local Data Declaration

    DATA: ls_f4_data_matnr TYPE s_f4_data_matnr,

    ls_f4_data_loc TYPE s_f4_data_loc,

    lts_warehouse TYPE SORTED TABLE OF s_whse

    WITH NON-UNIQUE KEY whse,

    lt_whse TYPE STANDARD TABLE OF s_whse,

    ls_whse TYPE s_whse.

    Local Field-symbols

    FIELD-SYMBOLS: lfs_view TYPE s_view_data,

    lfs_whse TYPE s_whse.

    IF ( ct_f4_data_matnr IS INITIAL AND

    ct_f4_data_loc IS INITIAL ).

    SELECT pcode "Material Number

    maktx "Product Desc

    markt "Market

    pdctr "Production center

    pctxt "Prod center desc

    whse1 "Warehouse 1

    whse2 "Warehouse 2

    prvar "Prod Variant

    vartx "Variant Description

    INTO TABLE ct_view_data

    FROM ZAP_SIGN.

    IF sy-subrc 0.

    no sourcing info is maintained in the sign portfolio

    MESSAGE i005.

    LEAVE LIST-PROCESSING.

    ENDIF.

    LOOP AT ct_view_data ASSIGNING lfs_view.

    ls_whse-whse = lfs_view-whse1.

    APPEND ls_whse TO lt_whse.

    ls_whse-whse = lfs_view-whse2.

    APPEND ls_whse TO lt_whse.

    ENDLOOP.

    SORT lt_whse BY whse.

    DELETE ADJACENT DUPLICATES FROM lt_whse COMPARING whse.

    IF NOT lt_whse IS INITIAL.

    Get the Warehouse Descriptions

    SELECT whse "Warehouse Name

    whdesc "Warehouse Description

    FROM zap_whse

    INTO TABLE lts_warehouse

    FOR ALL ENTRIES IN lt_whse

    WHERE whse = lt_whse-whse.

    ENDIF.

    Populate the Internal Table with Product,Product Variant

    and Location. The location can be the Market,Production center,

    Warehouse 1,Warehouse 2. All the four locations will be clubbed

    under the field Location in the internal table

    LOOP AT ct_view_data ASSIGNING lfs_view.

    ls_f4_data_matnr-pcode = lfs_view-pcode.

    ls_f4_data_matnr-maktx = lfs_view-maktx.

    APPEND ls_f4_data_matnr TO ct_f4_data_matnr.

    CLEAR ls_f4_data_matnr.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_view-martx.

    ls_f4_data_loc-locno = lfs_view-markt.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_view-pctxt.

    ls_f4_data_loc-locno = lfs_view-pdctr.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    Read the description for Warehouse 1

    READ TABLE lts_warehouse ASSIGNING lfs_whse WITH KEY

    whse = lfs_view-whse1.

    IF sy-subrc = 0.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_whse-whdesc.

    ls_f4_data_loc-locno = lfs_view-whse1.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ENDIF.

    Read the description for Warehouse 2

    READ TABLE lts_warehouse ASSIGNING lfs_whse WITH KEY

    whse = lfs_view-whse2.

    IF sy-subrc = 0.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_whse-whdesc.

    ls_f4_data_loc-locno = lfs_view-whse2.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ENDIF.

    ENDLOOP.

    SORT ct_f4_data_matnr BY pcode.

    DELETE ADJACENT DUPLICATES FROM ct_f4_data_matnr COMPARING pcode.

    ENDIF.

    ENDFORM. " F_GET_F4_DATA

    ----

    * Form f_f4_for_prodcentre

    ----

    Display F4 Help for Product

    ----

    --IV_PRD Field Name for Product

    --IT_F4_DATA Itab with F4 data

    ----

    FORM f_f4_for_prodcentre USING iv_prd TYPE dynfnam

    it_f4_data_matnr TYPE t_f4_data_matnr.

    Local Constants Declaration

    CONSTANTS: lc_pcode TYPE fieldname VALUE 'PCODE'.

    PERFORM f_launch_f4_window USING lc_pcode

    iv_prd

    text-016

    it_f4_data_matnr.

    ENDFORM. " f4_for_prodcentre

    ----

    * Form f_f4_for_market

    ----

    Display F4 Help for locations

    ----

    --IV_LOC Field Name for Location

    --IT_F4_DATA Itab with the F4 Data

    ----

    FORM f_f4_for_market USING iv_loc TYPE dynfnam

    it_f4_data_loc TYPE t_f4_data_loc.

    Local Data Declaratino

    DATA: lt_loc_for_f4 TYPE STANDARD TABLE OF s_f4_loc.

    Local Constants Declaration

    CONSTANTS:

    lc_pdctr TYPE fieldname VALUE 'LOCNO'.

    lt_loc_for_f4 = it_f4_data_loc .

    SORT lt_loc_for_f4 BY locno.

    DELETE ADJACENT DUPLICATES FROM lt_loc_for_f4 COMPARING locno.

    DELETE lt_loc_for_f4 WHERE locno IS INITIAL.

    PERFORM f_launch_f4_window USING lc_pdctr

    iv_loc

    text-017

    lt_loc_for_f4.

    ENDFORM. " f_f4_for_market

    ----

    * Form f_launch_f4_window

    ----

    Displays the Custom F4 Help for the field name passed

    ----

    --IV_RETFLD Return field

    --IV_DYNFLD Screen field

    --IV_WINTITLE Window title

    --IT_VALUETAB Value table

    ----

    FORM f_launch_f4_window USING iv_retfld TYPE fieldname

    iv_dynfld TYPE dynfnam

    iv_wintitle TYPE c

    it_valuetab TYPE STANDARD TABLE.

    DATA:

    lv_dynprog TYPE syrepid,

    lv_dynpnr TYPE sydynnr.

    lv_dynprog = sy-repid.

    lv_dynpnr = sy-dynnr.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = iv_retfld

    dynpprog = lv_dynprog

    dynpnr = lv_dynpnr

    dynprofield = iv_dynfld

    window_title = iv_wintitle

    value_org = gc_s

    TABLES

    value_tab = it_valuetab

    EXCEPTIONS

    parameter_error = 1

    no_values_found = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error while displaying search help

    MESSAGE i058.

    EXIT.

    ENDIF.

    ENDFORM. " f_launch_f4_window

    ----

    * Form f_check_product_status

    ----

    Get all the Products with status Inactive selected for deletion

    ----

    --IT_F4_LOC_DATA Itab wiht the products to be deleted

    --CT_PROD_DATA Itab with the Product and Locs to be deleted

    --CT_CORE_PROD Itab with the core products to be deleted

    --CT_PROD_VAR Itab with the product varients to be deleted

    --CT_LOC_DATA Itab with the locations to be deleted

    ----

    FORM f_check_product_status USING it_f4_data_loc TYPE t_f4_data_loc

    CHANGING ct_prod_data TYPE t_f4_data_loc

    ct_core_prod TYPE t_f4_data_loc

    ct_prod_var TYPE t_f4_data_loc

    ct_loc_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc.

    *MOD-1771404

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    DATA: ls_sign type zap_sign.

    DATA: LV_PDCTR1 TYPE ZDPDCTR,

    LV_LTEXT1 TYPE ZDPDCLT.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid,

    lv_ware_desc type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    DATA:

    lv_matnr TYPE /sapapo/matnr,

    lt_matloc TYPE STANDARD TABLE OF /sapapo/v_matloc,

    lv_prod_data TYPE s_f4_data_loc,

    LV_TABIX TYPE SY-TABIX,

    lv_line type i,

    lv_count type i,

    lv_count1 type i.

    *MOD-011

    RANGES: LV_MKT1 FOR S_MKT.

    DATA: int TYPE i,

    rspar TYPE TABLE OF rsparams,

    wa_rspar LIKE LINE OF rspar,

    lv_indicator type i.

    DATA: lv_indicator1 type i value 0.

    DATA: L_WA_PROD TYPE s_f4_data_loc.

    DATA: IT_ITAB_PROD TYPE standard table of s_f4_data_loc.

    *MOD-011

    FIELD-SYMBOLS:

    lfs_core_prod TYPE s_f4_data_loc,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_tsign TYPE zap_sign.

    lfs_zdm0705 TYPE ZDM0705.

    FIELD-SYMBOLS:

    lfs_view TYPE s_view_data,

    *MOD-1771404

    lfs_loc_data TYPE s_f4_data_loc.

    *MOD-1771404

    ct_prod_data = it_f4_data_loc.

    ***MOD-1771404

    Check if the Location is a market

    SELECT *

    into table t_sign

    FROM zap_sign

    WHERE pcode in s_prd AND

    ( markt in s_mkt or

    pdctr in s_mkt OR

    whse1 in s_mkt or

    whse2 in s_mkt ).

    IF sy-subrc 0.

    MESSAGE I004 with s_prd.

    LEAVE LIST-PROCESSING.

    ENDIF.

    DELETE t_sign WHERE status gc_inactive.

    *MOD-1771404

    DELETE: ct_prod_data WHERE status gc_inactive,

    ct_prod_data WHERE NOT ( pcode IN s_prd ).

    **MOD-1771404: This was commneted out for WHH.

    ct_prod_data WHERE NOT ( locno IN s_mkt ).

    **MOD-1771404: This was commneted out for WHH.

    ***MOD-1771404: This was commneted out for WHH.

    IF not ct_prod_data[] IS INITIAL.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = lfs_prod_data-locno BINARY SEARCH.*

    whse2 = s_mkt-low BINARY SEARCH.

    whse1 = lfs_prod_data-locno BINARY SEARCH.

    IF sy-subrc 0.

    *MOD-1771404

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse1 = lfs_prod_data-locno BINARY SEARCH.

    whse1 = s_mkt-low BINARY SEARCH.

    IF sy-subrc 0.

    *MOD-1771404

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = s_mkt-low binary search.

    *MOD-1887120

    markt = lfs_prod_data-locno binary search.

    *

    *MOD-1887120

    IF sy-subrc 0.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    pdctr = s_mkt-low BINARY SEARCH.

    pdctr IN s_mkt BINARY SEARCH.

    pdctr = lfs_prod_data-locno BINARY SEARCH.

    IF sy-subrc = 0.

    IF s_mkt-low = lfs_prod_data-locno and

    s_mkt-low = lfs_tsign-pdctr.

    lfs_prod_data-lv_exist = 0.

    Continue.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    IF s_mkt-low = lfs_prod_data-locno.

    lfs_prod_data-lv_exist = 0.

    Continue.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    continue.

    ENDIF.

    ELSE.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = lfs_prod_data-locno BINARY SEARCH.

    markt = s_mkt-low BINARY SEARCH.

    pdctr = lfs_prod_data-locno BINARY SEARCH.

    IF SY-SUBRC = 0.

    lfs_prod_data-lv_exist = 0.

    CONTINUE.

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    ENDIF.

    ENDIF.

    ELSE.

    lfs_prod_data-lv_exist = 0.

    lfs_prod_data-whse1 = lfs_tsign-whse1.

    EXIT.

    ENDIF.

    ELSE.

    lfs_prod_data-lv_exist = 0.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_tsign-whse1.

    lfs_prod_data-whse2 = lfs_tsign-whse2.

    *MOD-1771404

    EXIT.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    ENDIF.

    *MOD-1887120

    DELETE: ct_prod_data WHERE lv_exist eq 1.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    WHSE1

    WHSE2.

    *

    *MOD-1887120

    *MOD-1887120

    To Handle Multiple production centres

    IF not ct_prod_data[] IS INITIAL.

    SELECT *

    into table t_sign

    FROM zap_sign

    WHERE pcode in s_prd AND

    pdctr in s_mkt.

    IF sy-subrc 0.

    MESSAGE I004 with s_prd.

    ELSE.

    DELETE t_sign WHERE status gc_inactive.

    LV_TABIX = 0.

    IF not T_SIGN IS INITIAL.

    LOOP AT t_sign assigning lfs_tsign.

    LV_TABIX = LV_TABIX + 1.

    LOOP AT S_MKT.

    Get the Warehouse Descriptions

    SELECT pdctr ltext up to 1 rows

    INTO (LV_PDCTR1, LV_LTEXT1)

    FROM ZDU1000

    WHERE PDCTR = S_MKT-LOW.

    ENDSELECT.

    *MOD-1887120

    if sy-subrc = 0.

    *MOD-1887120

    l_wa_prod-locno = lfs_tsign-pdctr.

    l_wa_prod-desc = lv_ltext1.

    l_wa_prod-pcode = lfs_tsign-pcode.

    l_wa_prod-prvar = lfs_tsign-prvar.

    l_wa_prod-vartx = lfs_tsign-vartx.

    l_wa_prod-pdctr = s_mkt-low.

    l_wa_prod-maktx = lfs_tsign-maktx.

    l_wa_prod-whse1 = lfs_tsign-whse1.

    l_wa_prod-whse2 = lfs_tsign-whse2.

    l_wa_prod-status = lfs_tsign-status.

    l_wa_prod-loctyp = lfs_tsign-loctyp.

    APPEND l_wa_prod TO it_itab_prod.

    APPEND LINES OF it_itab_prod TO ct_prod_data.

    *MOD-1887120

    endif.

    *MOD-1887120

    ENDLOOP.

    ENDLOOP.

    ENDIF.

    ENDIF.

    ENDIF.

    *MOD-099

    DELETE: ct_prod_data WHERE lv_exist eq 1.

    *MOD-099

    SORT CT_PROD_DATA BY LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    *MOD-1887120

    IF ct_prod_data IS INITIAL.

    No Inactive products are present in the view table.

    MESSAGE i063.

    LEAVE LIST-PROCESSING.

    ENDIF.

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    locno = ct_prod_data-locno.

    *MOD-1887120

    LOCNO IN S_MKT.

    *MOD-1887120

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    Delete the entries that are not in data base.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    IF sy-subrc 0.

    CLEAR lfs_prod_data-prvar.

    ENDIF.

    ENDLOOP.

    DELETE ct_prod_data WHERE prvar IS INITIAL.

    ct_core_prod = ct_prod_data.

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    SORT ct_core_prod BY pcode.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM ct_core_prod COMPARING pcode.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM CT_CORE_PROD COMPARING

    locno

    pcode

    prvar

    whse1

    whse2.

    SORT CT_PROD_DATA BY LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    *MOD-1887120

    *MOD-1887120

    DELETE ct_core_prod WHERE pcode IS INITIAL.

    LOOP AT ct_core_prod ASSIGNING lfs_core_prod.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_core_prod-pcode AND

    status 'I'.

    CLEAR lfs_core_prod-pcode.

    EXIT.

    ENDLOOP.

    ENDLOOP.

    DELETE ct_core_prod WHERE pcode IS INITIAL.

    **MOD-1887120

    LV_TABIX = 0.

    IF not S_MKT IS INITIAL.

    LOOP AT S_MKT.

    LV_TABIX = LV_TABIX + 1.

    IF LV_TABIX 1.

    delete: ct_core_prod WHERE NOT ( locno IN s_mkt ).

    ENDIF.

    ENDLOOP.

    ENDIF.

    **MOD-1887120

    *MOD-1771404

    SORT ct_prod_var BY prvar.

    DELETE ADJACENT DUPLICATES FROM ct_prod_var COMPARING prvar.

    *MOD-1771404

    LOOP AT ct_prod_var ASSIGNING lfs_core_prod.

    SELECT SINGLE matnr INTO lv_matnr

    FROM /sapapo/matkey

    WHERE matnr = lfs_core_prod-prvar.

    IF sy-subrc 0.

    CLEAR lfs_core_prod-prvar.

    ENDIF.

    ENDLOOP.

    DELETE ct_prod_var WHERE prvar IS INITIAL.

    *MOD-1771404

    SORT ct_loc_data BY locno.

    DELETE ADJACENT DUPLICATES FROM ct_loc_data COMPARING locno.

    *MOD-1771404

    SORT ct_loc_data BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM ct_loc_data COMPARING locno

    pcode

    prvar.

    *MOD-1771404

    DELETE ct_loc_data WHERE locno IS INITIAL.

    *MOD-1771404

    *MOD-1887120 for multiple locations

    LV_INDICATOR = 0.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE CT_MATLOC TRANSPORTING NO FIELDS

    WITH KEY MATNR = lfs_core_prod-PCODE

    locno = lfs_core_prod-locno binary search.

    if sy-subrc 0.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 = lfs_prod_data-locno or

    whse2 = lfs_prod_data-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    PERFORM GET_DESC_LOC USING lfs_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    lv_indicator = 1.

    endif.

    else.

    lfs_prod_data-LV_EXIST = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    *MOD-1887120

    **MOD-1887120 for multiple locations

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE pdctr = lfs_prod_data-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    lv_indicator = 1.

    else.

    lfs_prod_data-LV_EXIST = 1.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    **MOD-1887120 for multiple locations

    LOOP AT ct_core_prod ASSIGNING lfs_core_prod.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE pdctr = lfs_core_prod-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    lv_indicator = 1.

    else.

    lfs_core_prod-LV_EXIST = 1.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    *MOD-1771404: 1 warehouse case

    IF LV_INDICATOR NE 1.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    LOOP AT S_MKT.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse1 = s_mkt-low BINARY SEARCH.

    **MOD-1887120

    whse1 = lv_whse1.

    **MOD-1887120

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1887120

    lfs_prod_data-whse1 = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    *MOD-1887120

    PERFORM GET_DESC_LOC USING lv_prod_data

    PERFORM GET_DESC_LOC USING lfs_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    ENDLOOP.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    **MOD-1887120 Multiple Location Case.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    LOOP AT S_MKT.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = s_mkt-low BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    PERFORM GET_DESC_LOC USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    ENDLOOP.

    ENDLOOP.

    **MOD-1887120

    REFRESH: ct_loc_data, ct_prod_var.

    CLEAR: ct_loc_data, ct_prod_var.

    ct_loc_data = ct_prod_data.

    ct_prod_var = ct_prod_data.

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    *MOD-1887120

    locno IN S_MKT.

    locno = ct_prod_data-locno.

    *MOD-1887120

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    *MOD-1771404

    *MOD-1771404: 2 warehouse case.

    *MOD-1771404

    Check if the Location is a Warehouse 1

    *MOD-1887120

    IF LV_INDICATOR NE 1.

    *MOD-1887120

    CLEAR: LV_WHSE1, LV_WHSE2.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS INITIAL.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    **MOD-011

    LOOP AT S_MKT.

    **MOD-011

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = lv_whse2 BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    ENDIF.

    **MOD-011

    ENDLOOP.

    **MOD-011

    ENDLOOP.

    **MOD-1771404

    *MOD-1887120

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    WHSE2 = lv_whse2 binary search.

    whse2 = S_MKT-LOW BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    ENDIF.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = s_mkt-low BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_prod_data-whse1.

    lfs_prod_data-whse2 = s_mkt-low.

    *MOD-1771404

    PERFORM GET_DESC_WHSE2 USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = s_mkt-low BINARY SEARCH.

    whse2 = lv_whse2 BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_prod_data-whse1.

    lfs_prod_data-whse2 = s_mkt-low.

    lfs_prod_data-whse2 = lv_whse2.

    *MOD-1887120

    *MOD-1771404

    PERFORM GET_DESC_WHSE2 USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ELSE.

    DELETE: ct_prod_data WHERE NOT ( locno IN s_mkt ).

    ENDIF.

    *MOD-1887120

    REFRESH: ct_loc_data, ct_prod_var.

    CLEAR: ct_loc_data, ct_prod_var.

    ct_loc_data = ct_prod_data.

    ct_prod_var = ct_prod_data.

    *MOD-1887120

    **MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    lfs_prod_data-lv_exist = 0.

    ENDLOOP.

    FIELD-SYMBOLs:lfs_matloc TYPE s_matloc.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    ENDLOOP.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    REFRESH: ct_loc_data, ct_prod_var, ct_core_prod.

    CLEAR: ct_loc_data, ct_prod_var, ct_core_prod.

    ct_core_prod = ct_prod_data.

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    *MOD-1887120

    **MOD-1887120 Changes made after release of transport on 28.03

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    REFRESH: it_zdm0705.

    REFRESH: it_zdu1002.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    SELECT * APPENDING TABLE it_zdm0705

    FROM zdm0705

    WHERE parpr = lfs_prod_data-pcode.

    ENDLOOP.

    SELECT * into table it_zdu1002

    FROM zdu1002

    FOR ALL ENTRIES IN it_zdm0705

    WHERE prvar = it_zdm0705-prvar.

    SORT it_zdu1002 BY MARKT prvar.

    DATA: lv_product type ZDPRVAR.

    clear: l_wa_zdu1002.

    clear: l_wa_zdm0705.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT IT_ZDM0705 INTO L_WA_ZDM0705.

    READ TABLE IT_ZDU1002 INTO L_WA_ZDU1002

    WITH KEY PRVAR = L_WA_ZDM0705-PRVAR BINARY SEARCH.

    IF SY-SUBRC = 0.

    lv_count = lv_count + 1.

    IF L_WA_ZDU1002-STATUS NE 'I'.

    lv_indicator1 = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    **MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = l_wa_zdu1002-prvar binary search.

    where dmoap NE 'Z'.

    IF L_WA_ZDU1002-PRVAR NE L_WA_ZDM0705-PRVAR.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    *

    else.

    l_wa_zdm0705-dmoap = 'Z'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    exit.

    ENDLOOP.

    endif.

    **MOD-1887120 Changes made after release of transport on 28.03

    **MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    READ TABLE IT_ZDM0705 ASSIGNING LFS_ZDM0705

    WITH KEY PRVAR = L_WA_ZDU1002-PRVAR BINARY SEARCH.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    IF SY-SUBRC = 0.

    lfs_zdm0705-dmoap = 'X'.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    endif.

    *MOD-1887120 Changes made after release of transport on 28.03

    LOOP AT it_zdu1002 into l_wa_zdu1002.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = l_wa_zdu1002-prvar binary search.

    if sy-subrc ne 0.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    endif.

    ENDLOOP.

    *mod-099

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode binary

    *search.

    if sy-subrc ne 0.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = lfs_prod_data-prvar binary search.

    if sy-subrc ne 0.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    endif.

    endif.

    ENDLOOP.

    **mod-099

    *MOD-1887120 Changes made after release of transport on 28.03

    if lv_indicator1 = 1.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode

    dmoap = 'X'.

    IF SY-SUBRC = 0.

    delete ct_core_prod where pcode = lfs_prod_data-pcode.

    Indicates that the core product should not be included in

    transportation lane and /sapapo/bp2 transaction.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    endif.

    ENDLOOP.

    endif.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    *mod-099 changed on 04042006

    *MOD-099 changed on 04042006

    REFRESH: ct_loc_data, ct_prod_var. " ct_core_prod.

    CLEAR: ct_loc_data, ct_prod_var. " ct_core_prod.

    *MOD-1887120

    ct_core_prod = ct_prod_data.

    *MOD-1887120

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    lv_indicator1 = 0.

    *MOD-1887120 Changes made after release of transport on 28.03

    *MOD-1771404

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    **

    locno = ct_prod_data-locno.

    **

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    *MOD-1771404

    ENDFORM. " f_check_product_status

    ----

    * Form f_delete_transactional_data

    ----

    Delete the transactional data for the Product and Location

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_PROD_DATA Itab wiht Product and Locations selected

    --CT_BDC_DATA BDC TABLE

    ----

    FORM f_delete_transactional_data USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_prod_data TYPE t_f4_data_loc

    ct_bdc_data TYPE STANDARD TABLE.

    "#EC *

    CT_BDC_DATA is populated in the Perform populate_bdc_tab

    Local Data Declaration

    DATA: lv_ctu_params TYPE ctu_params,

    lv_fname TYPE dynfnam,

    lv_count(2) TYPE n,

    lt_msg_tab TYPE STANDARD TABLE OF bdcmsgcoll.

    DATA: lv_prev_pcode type matnr.

    DATA: percentage_text TYPE c LENGTH 5.

    DATA: LV_TABIX(20).

    DATA: lv_line type i.

    DATA: lv_line1 type i.

    DATA: LV_LINE2 TYPE I.

    DATA: lv_pcode type /SAPAPO/MATNR.

    DATA: s_product TYPE RANGE OF BAPI10001APXPRODLOCKEY-product,

    s_product_wa LIKE LINE OF s_product.

    Field-symbols

    FIELD-SYMBOLS: lfs_msg_ret TYPE bdcmsgcoll,

    lfs_data TYPE s_f4_data_loc,

    lfs_data1 TYPE s_f4_data_loc.

    REFRESH ct_bdc_data.

    *MOD-1887120

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    describe table it_prod_var lines lv_line1.

    lv_line2 = lv_line + lv_line1.

    if lv_line2 = 7.

    *Version 0002

    *MOD-1887120: Code that is fixed till TESTAVEEK27.

    *Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *Populate the select options for Product

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%011'.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    ENDLOOP.

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=ONLI',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    *MOD-1887120: Code that is fixed till TESTAVEEK27.

    *Version 0002

    else.

    **Version 0005

    *CTS D7AK900899 New Version code fixed for testaveek28 case.

    *MOD-1887120: Code that is changed after the release of transport.

    Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000'.

    *MOD-1887120:

    IF NOT IT_CORE_PROD[] IS INITIAL.

    *MOD-1887120:

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_pcode = lfs_data-pcode.

    *lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    describe table it_prod_var lines lv_line.

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1 where pcode = lv_pcode.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    *MOD-1887120: Changed after 04.04.2006

    LOOP AT it_prod_var ASSIGNING lfs_data1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count

    gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    ENDLOOP.

    *MOD-1887120:

    *MOD-1887120:

    ELSE.

    *MOD-1887120:

    describe table it_prod_var lines lv_line.

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1. "where pcode=lv_pcode.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname

    .

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    *MOD-1887120:

    ENDIF.

    *MOD-1887120:

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PRD-LOW',

    ' ' 'BDC_OKCODE' '=%012',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    ***MOD-1887120: Code that is changed after the release of transport.

    *CTS D7AK900899 New Version

    *Code fixed for testaveek28 case.

    **Version 0005

    endif.

    *MOD-1887120

    **Version 0002

    **MOD-1887120: Code that is fixed till TESTAVEEK27.

    **Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    **Populate the select options for Product

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%011'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    *

    ENDLOOP.

    *

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    *

    LOOP AT it_loc_data ASSIGNING lfs_data.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    *

    CLEAR lv_fname.

    *

    ENDLOOP.

    *

    **Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=ONLI',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    *

    **MOD-1887120: Code that is fixed till TESTAVEEK27.

    **Version 0002

    ***Version 0005

    **CTS D7AK900899 New Version code fixed for testaveek28 case.

    **MOD-1887120: Code that is changed after the release of transport.

    Populate the general selection criteria on first screen

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    *

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000'.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_pcode = lfs_data-pcode.

    **lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    *

    describe table it_prod_var lines lv_line.

    *

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1 where pcode = lv_pcode.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    ENDLOOP.

    *

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    *

    Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PRD-LOW',

    ' ' 'BDC_OKCODE' '=%012',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    *

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    *

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    *

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    ****MOD-1887120: Code that is changed after the release of transport.

    **CTS D7AK900899 New Version

    **Code fixed for testaveek28 case.

    ***Version 0005

    **Version 0006 latest version.

    **Code for looping at it_prod_var and doing the call transaction for

    **each record

    **CTS D7AK900899 New Version

    *

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    *

    clear: lv_prev_pcode.

    *

    LOOP AT it_prod_var ASSIGNING lfs_data.

    *

    Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_prev_pcode ne lfs_data-pcode.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    clear: lv_count.

    *

    *

    **Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    CLEAR lv_fname.

    clear: lv_count.

    *

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    *

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS

    FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    *

    clear: ct_bdc_data.

    *

    ENDLOOP.

    ***

    ******MOD-1887120: Code that is changed after the release of transport.

    ****CTS D7AK900899 New Version

    ****Version 0006

    **MOD-1887120:

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    *

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    **MOD-1887120:

    commit work and wait.

    *MOD-1771404

    DO 10 TIMES.

    WAIT UP TO '0.1' SECONDS.

    percentage_text(3) = sy-index.

    percentage_text+3 = '%'.

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    EXPORTING

    percentage = sy-index

    text = percentage_text.

    ENDDO.

    *MOD-1771404

    LOOP AT lt_msg_tab ASSIGNING lfs_msg_ret

    WHERE msgtyp = gc_error OR

    msgtyp = gc_abend.

    gv_msg_error = gc_set.

    EXIT.

    ENDLOOP.

    ENDFORM. " f_delete_transactional_data

    ----

    * Form F_POPULATE_BDC_TAB

    ----

    Pupulates BDC Table with the parameters passed to the perform

    ----

    --IV_FLG Flag for New Screem

    --IV_VAR1 Program Name / Field Name

    --IV_VAR2 Screen Number / Field Value

    ----

    FORM f_populate_bdc_tab USING iv_flg TYPE any

    iv_var1 TYPE any

    iv_var2 TYPE any.

    Local Data Declaration

    DATA: ls_bdc_data TYPE bdcdata.

    Populate the BDC Table with the variables passed in it.

    CLEAR ls_bdc_data.

    IF iv_flg = gc_set. " = 'X'

    ls_bdc_data-program = iv_var1.

    ls_bdc_data-dynpro = iv_var2.

    ls_bdc_data-dynbegin = gc_set.

    ELSE.

    ls_bdc_data-fnam = iv_var1.

    ls_bdc_data-fval = iv_var2.

    ENDIF.

    APPEND ls_bdc_data TO gt_bdc_tab.

    ENDFORM. " F_POPULATE_BDC_TAB

    ----

    * Form f_delete_manual_created_data

    ----

    Delete the Manually entered transactional data for prod and loc

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_VARIANT_TABLE Screen Varient Table.

    ----

    FORM f_delete_manual_created_data USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_variant_table TYPE t_rsparams.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc.

    Populate the selection screen table

    PERFORM f_populate_screen_table USING:

    Field Name Type Sign Option Low Value

    Populate the Additional selection options

    Select the Manual selection button

    gc_manual_sel gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Populate the Planning Version

    gc_plan_vrsn gc_parameter gc_sign_i gc_option_eq gc_pvrsn_000 space.

    Populate the Core Products to be deleted

    LOOP AT it_core_prod ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_product gc_sel_optn gc_sign_i gc_option_eq lfs_data-pcode space.

    ENDLOOP.

    Populate the Product Variants to be deleted

    LOOP AT it_prod_var ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_product gc_sel_optn gc_sign_i gc_option_eq lfs_data-prvar space.

    ENDLOOP.

    Populate the Locations to be deleted.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_location gc_sel_optn gc_sign_i gc_option_eq lfs_data-locno space.

    ENDLOOP.

    Populate the Fixed Orders Checkbox

    PERFORM f_populate_screen_table USING:

    gc_fixed_ord gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Populate the Selection Objects

    Unselect the Key Figure Radio Button

    gc_key_fig gc_radio_btn gc_sign_i gc_option_eq space space,

    By Category Radio Button

    gc_category gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Populate the Settings

    Select Delete Transactional data only in APO Radio Button

    gc_only_apo gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Test Run check box.

    gc_test_run gc_parameter gc_sign_i gc_option_eq space space.

    Submit to SAP Standard report /SAPAPO/RLCDELETE

    For deleting manually entered data for the product and location

    SUBMIT /sapapo/rlcdelete WITH SELECTION-TABLE ct_variant_table

    AND RETURN.

    ENDFORM. " f_delete_manual_created_data

    ----

    * Form F_POPULATE_SCREEN_TABLE

    ----

    Populate the screen table with the parameters passed

    ----

    --IV_NAME Screen field Name

    --IV_TYPE Screen field type

    --IV_SIGN Sign I / E

    --IV_OPTION Option BT/EQ

    --IV_LOW Lower value

    --IV_HIGH Higher value

    ----

    FORM f_populate_screen_table USING iv_name TYPE rsscr_name

    iv_type TYPE rsscr_kind

    iv_sign TYPE tvarv_sign

    iv_option TYPE tvarv_opti

    iv_low TYPE any

    iv_high TYPE tvarv_val.

    Local Data Declaration

    DATA: ls_variant TYPE rsparams.

    Populate the Screen Table

    ls_variant-selname = iv_name.

    ls_variant-kind = iv_type.

    ls_variant-sign = iv_sign.

    ls_variant-option = iv_option.

    ls_variant-low = iv_low.

    ls_variant-high = iv_high.

    APPEND ls_variant TO gt_variant_table.

    CLEAR ls_variant.

    ENDFORM. " F_POPULATE_SCREEN_TABLE

    ----

    * Form f_delete_ppds_orders

    ----

    Delete the PPDS orders

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_VARIANT_TABLE Screen Varient Table.

    ----

    FORM f_delete_ppds_orders USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_variant_table TYPE t_rsparams.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc.

    REFRESH ct_variant_table.

    Populate the selection screen variant

    PERFORM f_populate_screen_table USING:

    Field Name Type Sign Option Low Value

    Populate the Location Product details

    gc_pl_vrsn gc_parameter gc_sign_i gc_option_eq gc_pvrsn_000 space.

    Populate the Core Products to be deleted

    LOOP AT it_core_prod ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_prod gc_sel_optn gc_sign_i gc_option_eq lfs_data-pcode space.

    ENDLOOP.

    Populate the Product Variants to be deleted

    LOOP AT it_prod_var ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_prod gc_sel_optn gc_sign_i gc_option_eq lfs_data-prvar space.

    ENDLOOP.

    Populate the Locations to be deleted.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_loc gc_sel_optn gc_sign_i gc_option_eq lfs_data-locno space.

    ENDLOOP.

    Populate Product planned externally checkbox

    PERFORM f_populate_screen_table USING:

    gc_plan_prod gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Populate Subcontracting Planned Orders

    gc_contract gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Display order check box

    gc_display_ord gc_parameter gc_sign_i gc_option_eq space space,

    Check the Delete Order check box

    gc_delete_ord gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Send Deleted orders checkbox

    gc_send_delete gc_parameter gc_sign_i gc_option_eq space space.

    Submit standard program /SAPAPO/DELETE_PP_ORDER

    For deleting PPDS orders created for the product and location

    SUBMIT /sapapo/delete_pp_order WITH SELECTION-TABLE ct_variant_table

    AND RETURN.

    ENDFORM. " f_delete_ppds_orders

    ----

    * Form f_delete_product_from_tlane

    ----

    Delete Products from the Transportation Lane

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --CT_LOC_DATA Itab with the locations to be deleted

    --CT_MATID_ALL Itab with Matid for all the Products

    --CT_TLANE Itab with transportation lane data

    ----

    FORM f_delete_product_from_tlane USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    CHANGING ct_loc_data TYPE t_f4_data_loc

    ct_matid_all TYPE t_matid

    ct_tlane TYPE t_tlane_data.

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    Local Data Declaration

    DATA: lv_matid_low TYPE /sapapo/matid,

    lv_locid_low TYPE /sapapo/locid,

    lv_loctyp TYPE /sapapo/c_loctype,

    lr_matid TYPE RANGE OF /sapapo/matid,

    ls_trprod TYPE s_tlane_data,

    lr_locid TYPE RANGE OF /sapapo/locid,

    ls_locid TYPE s_locid,

    ls_loc_new TYPE /sapapo/loc,

    lt_locid_all TYPE STANDARD TABLE OF s_locid,

    lv_locid TYPE /SAPAPO/LOCID,

    lv_locno TYPE /SAPAPO/LOCNO.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc,

    lfs_locid TYPE s_locid,

    lfs_matid TYPE s_matid.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_zdm0705 TYPE zdm0705,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_matloc TYPE s_matloc.

    *MOD-1771404

    TYPES: BEGIN OF s_view_data,

    pcode TYPE matnr, " Product

    maktx TYPE zdmaktx, " Prod Desc

    markt TYPE zdmarkt, " Market

    martx TYPE zdmarkst, " Market Desc

    pdctr TYPE zdpdctr, " Product Center

    pctxt TYPE zdpdcst, " Description

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    vartx TYPE zdvartx, " Variant Description

    status TYPE zdstat1, " Status

    END OF s_view_data,

    lv_view_data TYPE STANDARD TABLE OF s_view_data.

    For Core Products

    LOOP AT it_core_prod ASSIGNING lfs_data.

    Get the MATID for the Core Products

    PERFORM f_get_matid_for_prod USING lfs_data-pcode

    CHANGING lv_matid_low.

    ls_matid-matid = lv_matid_low.

    ls_matid-matnr = lfs_data-pcode.

    APPEND ls_matid TO ct_matid_all.

    CLEAR ls_matid.

    Populate the Range Table with the Core Products

    PERFORM f_populate_range_table_matid USING lv_matid_low

    CHANGING lr_matid.

    CLEAR lv_matid_low.

    ENDLOOP.

    For Product Variants

    LOOP AT it_prod_var ASSIGNING lfs_data.

    Get the MATID for the Core Products

    PERFORM f_get_matid_for_prod USING lfs_data-prvar

    CHANGING lv_matid_low.

    ls_matid-matnr = lfs_data-prvar.

    ls_matid-matid = lv_matid_low.

    APPEND ls_matid TO ct_matid_all.

    CLEAR ls_matid.

    Populate the Range Table with the Core Products

    PERFORM f_populate_range_table_matid USING lv_matid_low

    CHANGING lr_matid.

    CLEAR lv_matid_low.

    ENDLOOP.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM LR_matid COMPARING SIGN OPTION

    LOW HIGH.

    *MOD-1771404

    For Locations

    LOOP AT ct_loc_data ASSIGNING lfs_data.

    Get the Locid for the Location

    PERFORM f_get_locid_for_loc USING lfs_data-locno

    CHANGING lv_locid_low

    lv_loctyp.

    lfs_data-loctyp = lv_loctyp.

    ls_locid-locno = lfs_data-locno.

    ls_locid-locid = lv_locid_low.

    APPEND ls_locid TO lt_locid_all.

    CLEAR ls_locid.

    Populate the Range Table with the Location

    PERFORM f_populate_range_table_locid USING lv_locid_low

    CHANGING lr_locid.

    CLEAR: lv_locid_low, lv_loctyp.

    ENDLOOP.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM LR_LOCID COMPARING SIGN OPTION

    LOW HIGH.

    *MOD-1771404

    *MOD-1771404

    Get all the transportation lanes for the above Product and Locations

    SELECT *

    FROM /sapapo/trprod

    INTO TABLE lt_trprod

    WHERE matid IN lr_matid AND

    ( locfr IN lr_locid OR

    locto IN lr_locid ).

    IF sy-subrc 0.

    No Transportation lane selected for deletion

    MESSAGE i047.

    EXIT.

    ENDIF.

    *MOD-1771404

    Get all the transportation lanes for the above Product and Locations

    SELECT *

    FROM /sapapo/trprod

    INTO TABLE lt_trprod

    WHERE matid IN lr_matid AND

    ( locfr IN lr_locid OR

    locto IN lr_locid ).

    IF sy-subrc 0.

    No Transportation lane selected for deletion

    MESSAGE i047.

    EXIT.

    ENDIF.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM lt_locid_all COMPARING locid locno.

    *MOD-1771404

    LOOP AT lt_trprod ASSIGNING lfs_trprod.

    READ TABLE lt_locid_all ASSIGNING lfs_locid WITH KEY

    locid = lfs_trprod-locto.

    IF sy-subrc = 0.

    ls_trprod-locto = lfs_locid-locno.

    ENDIF.

    CLEAR ls_loc_new.

    CALL FUNCTION '/SAPAPO/CMDS_LOC_SINGLE'

    EXPORTING

    iv_locid = lfs_trprod-locfr

    IMPORTING

    es_loc = ls_loc_new

    EXCEPTIONS

    empty_locid = 1

    no_location_found = 2

    OTHERS = 3.

    IF sy-subrc = 0.

    ls_trprod-locfr = ls_loc_new-locno.

    ENDIF.

    *MOD-1771404

    clear: lv_locid, lv_locno.

    SELECT single locid locno

    FROM /sapapo/loc

    INTO (lv_locid, lv_locno)

    WHERE locid = lfs_trprod-locto.

    IF SY-SUBRC = 0.

    IF ls_trprod-locto is initial.

    ls_trprod-locto = lv_locno.

    ENDIF.

    ENDIF.

    *MOD-1771404

    READ TABLE ct_matid_all ASSIGNING lfs_matid WITH KEY

    matid = lfs_trprod-matid.

    IF sy-subrc = 0.

    ls_trprod-matid = lfs_matid-matnr.

    ENDIF.

    APPEND ls_trprod TO ct_tlane.

    CLEAR ls_trprod.

    ENDLOOP.

    **MOD-1887120 Changes made after release of transport on 28.03

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    DATA: lv_indicator1 type i.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    **MOD-1887120

    DATA: lv_product type ZDPRVAR.

    clear: l_wa_zdu1002.

    clear: l_wa_zdm0705.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT IT_ZDM0705 INTO L_WA_ZDM0705.

    READ TABLE IT_ZDU1002 INTO L_WA_ZDU1002

    WITH KEY PRVAR = L_WA_ZDM0705-PRVAR BINARY SEARCH.

    IF SY-SUBRC = 0.

    IF L_WA_ZDU1002-STATUS NE 'I'.

    lv_indicator1 = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    ***MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    READ TABLE IT_ZDM0705 ASSIGNING LFS_ZDM0705

    WITH KEY PRVAR = L_WA_ZDU1002-PRVAR BINARY SEARCH.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    IF SY-SUBRC = 0.

    lfs_zdm0705-dmoap = 'X'.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    endif.

    *

    **MOD-1887120 Changes made after release of transport on 28.03

    if lv_indicator1 = 1.

    LOOP AT it_prod_var ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode

    dmoap = 'X'.

    IF SY-SUBRC = 0.

    delete it_core_prod where pcode = lfs_prod_data-pcode.

    Indicates that the core product should not be included in

    transportation lane and /sapapo/bp2 transaction.

    READ TABLE GT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE GT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    endif.

    ENDLOOP.

    endif.

    DELETE it_prod_var WHERE LV_EXIST = 1.

    *MOD-1887120 Changes made after release of transport on 28.03

    LOOP AT CT_TLANE INTO LS_TRPROD.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = ls_trprod-matid

    dmoap = 'X'.

    if sy-subrc = 0.

    LS_TRPROD-MATID = 'X'.

    MODIFY CT_TLANE FROM LS_TRPROD TRANSPORTING MATID.

    COMMIT WORK AND WAIT.

    else.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = ls_trprod-matid

    dmoap = 'X'.

    if sy-subrc = 0.

    LS_TRPROD-MATID = 'X'.

    MODIFY CT_TLANE FROM LS_TRPROD TRANSPORTING MATID.

    COMMIT WORK AND WAIT.

    endif.

    endif.

    ENDLOOP.

    DELETE CT_TLANE WHERE MATID = 'X'.

    **MOD-1887120 Changes made after release of transport on 28.03

    IF p_test IS NOT INITIAL.

    EXIT.

    ENDIF.

    *MOD-1771404

    Delete SAP Table /SAPAPO/TRPROD

    DELETE /sapapo/trprod FROM TABLE lt_trprod.

    IF sy-subrc = 0.

    COMMIT WORK.

    ELSE.

    ROLLBACK WORK.

    ENDIF.

    *MOD-1771404

    ENDFORM. " f_delete_product_from_tlane

    ----

    * Form f_get_matid_for_prod

    ----

    Get the MATID for the material passed

    ----

    --IV_PRD Product (Material Number)

    --CV_MATID MATID for the above material no

    ----

    FORM f_get_matid_for_prod USING iv_prd TYPE any

    CHANGING cv_matid TYPE /sapapo/matid.

    Local Data Declaration

    DATA: lv_matnr TYPE /sapapo/matnr.

    CHECK NOT iv_prd IS INITIAL.

    CLEAR lv_matnr.

    lv_matnr = iv_prd.

    CALL FUNCTION '/SAPAPO/DM_MATERIAL_GET_MATID'

    EXPORTING

    iv_matnr = lv_matnr

    IMPORTING

    ev_matid = cv_matid

    EXCEPTIONS

    matid_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    CLEAR cv_matid.

    ENDIF.

    ENDFORM. " f_get_matid_for_prod

    ----

    * Form f_get_locid_for_loc

    ----

    Get the LOCID for the Location passed

    ----

    --IV_MKT Location Number

    --CV_LOCID LOCID for the above Location

    --CV_LOCTYP Location Type

    ----

    FORM f_get_locid_for_loc USING iv_mkt TYPE /sapapo/locno

    CHANGING cv_locid_low TYPE /sapapo/locid

    cv_loctyp TYPE /sapapo/c_loctype.

    Local Data Declaration

    DATA: ls_loc TYPE /sapapo/loc.

    CHECK NOT iv_mkt IS INITIAL.

    CLEAR ls_loc.

    CALL FUNCTION '/SAPAPO/LOC_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_mkt

    IMPORTING

    ev_locid = cv_locid_low

    es_location = ls_loc

    EXCEPTIONS

    location_not_found = 1

    not_qualified = 2

    OTHERS = 3.

    IF sy-subrc 0.

    CLEAR cv_locid_low.

    ELSE.

    cv_loctyp = ls_loc-loctype.

    cv_locid_low = ls_loc-locid.

    ENDIF.

    ENDFORM. " f_get_locid_for_loc

    ----

    * Form f_populate_range_table_matid

    ----

    Populate the Range thable wiht the values passed

    ----

    --IV_VALUE_LOW Lower Value of the Range

    --ES_RANGE Structure of type Range

    --CT_RANGE_TAB Table of type Range

    ----

    FORM f_populate_range_table_matid USING iv_value_low TYPE any

    CHANGING ct_range_tab TYPE t_matid_range.

    Local Data Declaration

    DATA: ls_locid TYPE s_range_locid.

    ls_locid-sign = gc_sign_i.

    ls_locid-option = gc_option_eq.

    ls_locid-low = iv_value_low.

    APPEND ls_locid TO ct_range_tab.

    CLEAR ls_locid.

    ENDFORM. " f_populate_range_table_matid

    ----

    * Form f_set_deletion_flag

    ----

    Set the deletion flag for the Products to be deleted

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the location details

    ----

    FORM f_set_deletion_flag USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc.

    Local Data Declaration

    DATA: lv_own_sys TYPE bapiapologsys,

    lv_matnr TYPE /sapapo/matnr,

    lt_product TYPE STANDARD TABLE OF bapi10001key,

    ls_product TYPE bapi10001key,

    ls_prod_key TYPE bapi_prodloc_key,

    lt_prod_key TYPE STANDARD TABLE OF bapi_prodloc_key,

    lt_matloc TYPE t_matloc,

    lt_return TYPE STANDARD TABLE OF bapiret2.

    Field Symbols

    FIELD-SYMBOLS: lfs_mat TYPE s_f4_data_loc,

    lfs_product TYPE bapi10001key,

    lfs_loc TYPE s_f4_data_loc,

    lfs_return TYPE bapiret2.

    *MOD-1771404

    *MOD-1887120

    SORT IT_PROD_VAR BY locno

    pcode

    prvar.

    delete adjacent duplicates from it_prod_var comparing locno

    pcode

    prvar.

    SORT it_loc_data by locno

    pcode

    prvar

    loctyp

    whse1.

    delete adjacent duplicates from it_loc_data comparing locno

    pcode

    prvar

    loctyp

    whse1.

    *MOD-1771404

    Populate the Core Product

    LOOP AT it_core_prod ASSIGNING lfs_mat.

    LOOP AT it_loc_data ASSIGNING lfs_loc.

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-pcode

    locno = lfs_loc-locno.

    IF sy-subrc = 0.

    ls_prod_key-loctype = lfs_loc-loctyp.

    ls_prod_key-product = lfs_mat-pcode.

    ls_prod_key-location = lfs_loc-locno.

    APPEND ls_prod_key TO lt_prod_key.

    CLEAR ls_prod_key.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    *MOD-1887120

    sort lt_prod_key by product location loctype.

    delete adjacent duplicates from lt_prod_key

    comparing product

    location

    loctype.

    *MOD-1887120

    Populate the Product Variant

    LOOP AT it_prod_var ASSIGNING lfs_mat.

    LOOP AT it_loc_data ASSIGNING lfs_loc.

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-prvar

    locno = lfs_loc-locno.

    IF sy-subrc = 0.

    ls_prod_key-loctype = lfs_loc-loctyp.

    ls_prod_key-product = lfs_mat-prvar.

    ls_prod_key-location = lfs_loc-locno.

    APPEND ls_prod_key TO lt_prod_key.

    CLEAR ls_prod_key.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    *MOD-1771404

    *MOD-1887120

    sort lt_prod_key by product location loctype.

    *MOD-1887120

    delete adjacent duplicates from lt_prod_key comparing product

    location

    loctype.

    *MOD-1771404

    Get the Own Logical system name

    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

    IMPORTING

    own_logical_system = lv_own_sys

    EXCEPTIONS

    own_logical_system_not_defined = 1

    OTHERS = 2.

    IF sy-subrc 0.

    CLEAR lv_own_sys.

    ENDIF.

    This BAPI will set the deletion flag for the materials selected

    for deletion in the SAP table /SAPAPO/MATLOC

    CALL FUNCTION 'BAPI_PRDSRVAPS_REMOVEITEMS'

    EXPORTING

    logical_system = lv_own_sys

    business_system_group = gc_bs_group

    commit_control = space

    TABLES

    product_location_keys = lt_prod_key

    return = lt_return.

    CLEAR gv_flg_error.

    LOOP AT lt_return ASSIGNING lfs_return

    WHERE type = gc_error OR

    type = gc_abend .

    gv_flg_error = gc_set.

    EXIT.

    ENDLOOP.

    IF gv_flg_error = gc_set.

    Product deletion failed for all the selected products

    MESSAGE i048.

    ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

    Delete the Products using the SAP report /SAPAPO/DELETE_PRODUCTS

    SUBMIT /sapapo/delete_products AND RETURN.

    SORT lt_prod_key BY product.

    DELETE ADJACENT DUPLICATES FROM lt_prod_key

    COMPARING product.

    Look for products which dont have a location

    SELECT matnr locno

    INTO TABLE lt_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN gt_prod_data

    WHERE matnr = gt_prod_data-pcode OR

    matnr = gt_prod_data-prvar.

    SORT lt_matloc BY matnr.

    DELETE ADJACENT DUPLICATES FROM lt_matloc

    COMPARING matnr.

    LOOP AT gt_prod_data ASSIGNING lfs_mat.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-pcode

    BINARY SEARCH.

    IF sy-subrc 0.

    ls_product-product = lfs_mat-pcode.

    APPEND ls_product TO lt_product.

    ENDIF.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-prvar

    BINARY SEARCH.

    IF sy-subrc 0.

    ls_product-product = lfs_mat-prvar.

    APPEND ls_product TO lt_product.

    ENDIF.

    ENDLOOP.

    SORT lt_product.

    DELETE ADJACENT DUPLICATES FROM lt_product COMPARING ALL FIELDS.

    In case of copre products check if they have any active variants

    before deleting them

    LOOP AT lt_product ASSIGNING lfs_product.

    SELECT SINGLE matnr INTO lv_matnr

    FROM /sapapo/matkey

    WHERE matnr = lfs_product-product.

    IF sy-subrc 0.

    CLEAR lfs_product-product.

    CONTINUE.

    ENDIF.

    FIND gc_dot IN lfs_product-product.

    IF sy-subrc 0.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_product-product AND

    status 'I'.

    CLEAR lfs_product-product.

    EXIT.

    ENDLOOP.

    ENDIF.

    ENDLOOP.

    DELETE lt_product WHERE product IS INITIAL.

    REFRESH gt_product.

    gt_product = lt_product.

    IF lt_product IS NOT INITIAL.

    Delete the products which dont have any locations

    CALL FUNCTION 'BAPI_PRDSRVAPS_DELMULTI'

    EXPORTING

    logical_system = lv_own_sys

    business_system_group = gc_bs_group

    commit_control = space

    TABLES

    product_keys = lt_product

    return = lt_return.

    CLEAR gv_flg_error.

    LOOP AT lt_return ASSIGNING lfs_return

    WHERE type = gc_error OR

    type = gc_abend .

    gv_flg_error = gc_set.

    EXIT.

    ENDLOOP.

    IF gv_flg_error = gc_set.

    Product deletion failed for all the selected products

    MESSAGE i048.

    ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

    Delete the Products using the SAP report /SAPAPO/DELETE_PRODUCTS

    SUBMIT /sapapo/delete_products AND RETURN.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDFORM. " f_set_deletion_flag

    ----

    * Form f_display_alv

    ----

    Display ALV report with selected Product and Locations

    ----

    --IT_PROD_DATA Itab with the Product and Location combs

    --CT_FCAT Itab for Field Catelogue

    --CT_MATID_ALL Itab with Matid for all the Products

    ----

    FORM f_display_alv USING it_prod_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc

    CHANGING ct_fcat TYPE slis_t_fieldcat_alv

    ct_matid_all TYPE t_matid.

    *Local constants:

    CONSTANTS:

    lc_tabprd TYPE tabname VALUE 'LT_DISPLAYPRD'.

    Local Data Declaration

    DATA: ls_display TYPE s_display,

    ls_product TYPE bapi10001key,

    ls_layout TYPE slis_layout_alv,

    ls_displayprd TYPE s_displayprd,

    lt_displayprd TYPE t_displayprd,

    lv_flg_del TYPE char1,

    lv_flg_prd TYPE flag,

    lv_repid TYPE syrepid,

    lt_events TYPE STANDARD TABLE OF slis_alv_event,

    lt_eventsprd TYPE STANDARD TABLE OF slis_alv_event,

    lt_display TYPE STANDARD TABLE OF s_display,

    lt_prod_1 TYPE STANDARD TABLE OF s_f4_data_loc,

    lt_prod_2 TYPE STANDARD TABLE OF s_f4_data_loc,

    lt_matloc TYPE STANDARD TABLE OF /sapapo/v_matloc,

    lt_matlocdel TYPE STANDARD TABLE OF /sapapo/matloc,

    ls_matloc TYPE /sapapo/matloc,

    ls_matid TYPE s_matid.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid,

    lv_ware_desc type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2, " Warehouse2

    l_wa_matloc type s_matloc.

    DATA: l_wa_display type s_display.

    lv_repid = sy-repid.

    Field-Symbols

    FIELD-SYMBOLS: lfs_prod TYPE s_f4_data_loc,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_display TYPE s_display,

    lfs_displayprd TYPE s_displayprd,

    lfs_matloc TYPE /sapapo/v_matloc,

    lfs_matid TYPE s_matid.

    **MOD-1887120

    LOOP AT IT_PROD_DATA ASSIGNING lfs_prod_data.

    READ TABLE ct_matloc into l_wa_matloc

    WITH KEY matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    IF sy-subrc = 0.

    CLEAR: ls_display, ls_displayprd.

    ls_display-prod = lfs_prod_data-prvar.

    ls_display-p_des = lfs_prod_data-vartx.

    **MOD-1771404

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    **MOD-1771404

    ls_display-loc = l_wa_matloc-LOCNO.

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    lfs_prod_data-locno = l_wa_matloc-LOCNO.

    ENDIF.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod_data-prvar.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod_data-prvar.

    ls_displayprd-p_des = lfs_prod_data-vartx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    lt_prod_1 = it_prod_data.

    lt_prod_2 = it_prod_data.

    CLEAR lv_flg_del.

    *MOD-1887120

    SORT lt_prod_1 BY prvar locno.

    SORT lt_prod_1 BY locno pcode prvar pdctr status whse1 whse2.

    DELETE ADJACENT DUPLICATES FROM lt_prod_1 COMPARING prvar locno.

    DELETE ADJACENT DUPLICATES FROM lt_prod_1 COMPARING locno

    pcode

    prvar

    pdctr

    status

    whse1

    whse2.

    *MOD-1887120

    *MOD-1887120

    SORT lt_prod_2 BY pcode locno.

    SORT lt_prod_2 BY locno pcode prvar pdctr status whse1 whse2.

    DELETE ADJACENT DUPLICATES FROM lt_prod_2 COMPARING pcode locno.

    DELETE ADJACENT DUPLICATES FROM lt_prod_2 COMPARING locno

    pcode

    prvar

    pdctr

    status

    whse1

    whse2.

    *MOD-1887120

    **MOD-1771404

    PERFORM F_GET_LOC_DESC USING IT_PROD_DATA

    CHANGING lv_ware_desc.

    **MOD-1771404

    LOOP AT lt_prod_1 ASSIGNING lfs_prod.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod-prvar

    locno = s_mkt-low.

    *MOD-1887120

    locno = lfs_prod-locno.

    *MOD-1887120

    IF sy-subrc = 0.

    CLEAR: ls_display, ls_displayprd.

    ls_display-prod = lfs_prod-prvar.

    ls_display-p_des = lfs_prod-vartx.

    *MOD-1771404

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    *MOD-1771404

    *MOD-1887120

    ls_display-loc = S_MKT-LOW.

    *MOD-1887120

    *MOD-1887120

    ls_display-loc = lfs_prod-locno.

    *MOD-1887120

    **MOD-1887120

    PERFORM F_GET_LOC_DESC CHANGING lv_ware_desc.

    **MOD-1887120

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    ENDIF.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod-prvar.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod-prvar.

    ls_displayprd-p_des = lfs_prod-vartx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    LOOP AT lt_prod_2 ASSIGNING lfs_prod.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod-pcode

    locno = s_mkt-low.

    *MOD-1887120

    locno = lfs_prod-locno.

    *MOD-1887120

    IF sy-subrc = 0.

    CLEAR: ls_display, lv_flg_prd.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_prod-pcode AND

    status 'I'.

    lv_flg_prd = 'X'.

    ENDLOOP.

    IF lv_flg_prd IS INITIAL.

    ls_display-prod = lfs_prod-pcode.

    ls_display-p_des = lfs_prod-maktx.

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    *MOD-1887120

    ls_display-loc = S_MKT-LOW.

    *MOD-1887120

    ls_display-loc = lfs_prod-locno.

    *MOD-1887120

    **MOD-1887120

    PERFORM F_GET_LOC_DESC USING lt_prod_2

    PERFORM F_GET_LOC_DESC CHANGING lv_ware_desc.

    **MOD-1887120

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod-pcode.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod-pcode.

    ls_displayprd-p_des = lfs_prod-maktx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    LOOP AT gt_product INTO ls_product.

    ls_displayprd-prod = ls_product.

    FIND gc_dot IN ls_product.

    IF sy-subrc = 0.

    READ TABLE gt_prod_data ASSIGNING lfs_prod

    WITH KEY prvar = ls_product-product.

    IF sy-subrc = 0.

    ls_displayprd-p_des = lfs_prod-vartx.

    ENDIF.

    ELSE.

    READ TABLE it_prod_data ASSIGNING lfs_prod

    WITH KEY pcode = ls_product-product.

    IF sy-subrc = 0.

    ls_displayprd-p_des = lfs_prod-maktx.

    ENDIF.

    ENDIF.

    ENDLOOP.

    SORT lt_display BY prod loc.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM lt_display

    COMPARING prod loc.

    *MOD-1887120

    **MOD-1887120

    *LOOP AT lt_display into l_wa_display.

    READ TABLE CT_MATLOC INTO L_WA_MATLOC

    WITH KEY matnr = l_wa_display-prod

    locno = l_wa_display-loc.

    IF sy-subrc ne 0.

    l_wa_display-status = 'X'.

    modify lt_display from l_wa_display transporting status.

    ENDIF.

    *ENDLOOP.

    *DELETE lt_display WHERE status = 'X'.

    **MOD-1887120

    SORT lt_displayprd BY prod.

    DELETE ADJACENT DUPLICATES FROM lt_displayprd

    COMPARING prod.

    IF lt_display IS INITIAL.

    EXIT.

    ENDIF.

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    i_callback_program = lv_repid

    i_callback_user_command = gc_show_log

    i_callback_pf_status_set = gc_set_pf.

    Populate the top of page event.

    PERFORM f_get_events CHANGING lt_events.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_3 gc_prodct gc_tabname text-003 gc_len_prod gc_left,

    gc_pos_4 gc_prod_des gc_tabname text-004 gc_len_p_des gc_left,

    gc_pos_5 gc_loctn gc_tabname text-005 gc_len_loc gc_left,

    gc_pos_6 gc_loc_des gc_tabname text-006 gc_len_l_des gc_left.

    If not test mode then display status of deletion

    IF p_test gc_set.

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_2 gc_status gc_tabname text-019 gc_len_stat gc_left,

    gc_pos_1 gc_light gc_tabname space gc_len_lt gc_center.

    SELECT *

    FROM /sapapo/v_matloc

    INTO TABLE lt_matloc

    FOR ALL ENTRIES IN lt_display

    WHERE matnr = lt_display-prod AND

    locno = lt_display-loc.

    *Check if the product is deleted.

    LOOP AT lt_display ASSIGNING lfs_display.

    READ TABLE lt_matloc ASSIGNING lfs_matloc

    WITH KEY matnr = lfs_display-prod

    locno = lfs_display-loc.

    IF sy-subrc = 0.

    lfs_display-status = text-020.

    lfs_display-light = gc_red.

    CLEAR lfs_matloc-lvorm.

    MOVE-CORRESPONDING lfs_matloc TO ls_matloc.

    APPEND ls_matloc TO lt_matlocdel.

    lv_flg_del = gc_set.

    ELSE.

    lfs_display-status = text-021.

    lfs_display-light = gc_green.

    ENDIF.

    ENDLOOP.

    IF lv_flg_del = gc_set. " Deletion failed for atleast one prod

    Deletion failed for some products.

    MODIFY /sapapo/matloc FROM TABLE lt_matlocdel.

    MESSAGE s064.

    ELSE.

    Deletion successful for all the products

    MESSAGE s065.

    ENDIF.

    ENDIF. " For IF p_test gc_set.

    Display the ALV List Display

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = ls_layout

    it_fieldcat = gt_fcat

    i_tabname = gc_tabname

    it_events = lt_events

    TABLES

    t_outtab = lt_display

    EXCEPTIONS

    program_error = 1

    maximum_of_appends_reached = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    IF p_test IS INITIAL.

    PERFORM f_get_events_prd CHANGING lt_eventsprd.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_3 gc_prodct lc_tabprd text-003 gc_len_prod gc_left,

    gc_pos_4 gc_prod_des lc_tabprd text-004 gc_len_p_des gc_left.

    IF p_test gc_set.

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_2 gc_status lc_tabprd text-019 gc_len_stat gc_left,

    gc_pos_1 gc_light lc_tabprd space gc_len_lt gc_center.

    Check the Products from the /SAPAPO/MATKEY to check for deletion

    SELECT matid matnr INTO TABLE ct_matid_all

    FROM /sapapo/matkey

    FOR ALL ENTRIES IN lt_displayprd

    WHERE matnr = lt_displayprd-prod.

    LOOP AT lt_displayprd ASSIGNING lfs_displayprd.

    READ TABLE ct_matid_all INTO ls_matid

    WITH KEY matnr = lfs_displayprd-prod.

    IF sy-subrc = 0.

    lfs_displayprd-status = text-020.

    lfs_displayprd-light = gc_red.

    lv_flg_del = gc_set.

    ELSE.

    lfs_displayprd-status = text-021.

    lfs_displayprd-light = gc_green.

    ENDIF.

    ENDLOOP.

    IF lv_flg_del = gc_set. " Deletion failed for atleast one prod

    Deletion failed for some products.

    MESSAGE s064.

    ELSE.

    Deletion successful for all the products

    MESSAGE s065.

    ENDIF.

    ENDIF.

    Display the ALV List Display

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = ls_layout

    it_fieldcat = gt_fcat

    i_tabname = lc_tabprd

    it_events = lt_eventsprd

    TABLES

    t_outtab = lt_displayprd

    EXCEPTIONS

    program_error = 1

    maximum_of_appends_reached = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDIF.

    Displays the ALV list

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    ENDFORM. " f_display_alv

    ----

    * Form f_get_events

    ----

    Get the TOP OF PAGE event

    ----

    --CT_EVENTS Itab with the events to be triggred

    ----

    FORM f_get_events CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = slis_ev_top_of_page.

    ENDIF.

    ENDFORM. " f_get_events

    ----

    * Form vpopulate_fieldcat

    ----

    Populate the fieldcatelog for ALV report

    ----

    --IV_CPOS Column Position

    --IV_FNAM Field Name

    --IV_TABNAM Internal Table Name

    --IV_TITLE Column Title

    --IV_OPT_LEN Output Length

    --IV_JUSTIFY Justify left / right

    ----

    FORM f_populate_fieldcat USING iv_cpos TYPE lvc_colpos

    iv_fnam TYPE lvc_fname

    iv_tabnam TYPE lvc_tname

    iv_title TYPE reptext

    iv_opt_len TYPE lvc_outlen

    iv_justify TYPE lvc_just.

    Local Data Declaration

    DATA: ls_fcat TYPE slis_fieldcat_alv.

    CLEAR ls_fcat.

    ls_fcat-col_pos = iv_cpos.

    ls_fcat-fieldname = iv_fnam.

    ls_fcat-tabname = iv_tabnam.

    ls_fcat-reptext_ddic = iv_title.

    ls_fcat-outputlen = iv_opt_len.

    ls_fcat-just = iv_justify.

    IF iv_fnam = gc_light.

    ls_fcat-icon = gc_set.

    ENDIF.

    APPEND ls_fcat TO gt_fcat.

    ENDFORM. " f_populate_fieldcat

    ----

    * Form F_SET_PF

    ----

    Set the PF Status for the display and log screen

    ----

    --CT_EXTAB

    ----

    FORM f_set_pf USING ct_extab TYPE slis_t_extab. "#EC CALLED

    Dynamic perform required to set custom PF status for ALV report

    "#EC *

    CT_EXTAB is required as per the standard exit perform of ALVgrid fm

    Local Data Declation.

    DATA: ls_extab TYPE slis_extab,

    lt_extab TYPE STANDARD TABLE OF slis_extab.

    If the Test Run check box is selected then disable the Log Icons

    IF p_test = gc_set.

    ls_extab-fcode = gc_td_log.

    APPEND ls_extab TO lt_extab.

    CLEAR ls_extab.

    SET PF-STATUS 'PF_DISPLAY_LOG' EXCLUDING lt_extab.

    ENDIF.

    IF gt_tlane IS INITIAL.

    ls_extab-fcode = gc_tlane.

    APPEND ls_extab TO lt_extab.

    CLEAR ls_extab.

    ENDIF.

    SET PF-STATUS 'PF_DISPLAY_LOG' EXCLUDING lt_extab.

    ENDFORM. " F_SET_PF

    ----

    * Form f_show_log

    ----

    Display Log report using

    ----

    -- iv_ucomm OK Code for the user command

    -- is_selfield Selected field information

    ----

    FORM f_show_log USING iv_ucomm TYPE sy-ucomm

    is_selfield TYPE slis_selfield. "#EC CALLED

    Dynamic perform for displaying log based on user action

    "#EC *

    IS_SELFIELD is passed as per the standard exit perform for ALVgrid

    IF iv_ucomm = gc_td_log.

    Local Data Delaration.

    DATA: lt_msg_dtl TYPE STANDARD TABLE OF bdcmsgcoll,

    lv_mode TYPE char1,

    lv_error TYPE char1,

    lv_date TYPE char10,

    lv_time TYPE char8,

    lv_date_to TYPE char10,

    lv_time_to TYPE char8.

    Field-Symbols

    FIELD-SYMBOLS: lfs_msg_dtl TYPE bdcmsgcoll.

    REFRESH gt_bdc_tab.

    CLEAR: lv_date, lv_time.

    CONCATENATE gv_date_before6(2) gv_date_before4(2)

    gv_date_before+0(4) INTO lv_date SEPARATED BY gc_dot.

    CONCATENATE gv_time_before0(2) gv_time_before2(2)

    gv_time_before+4(2) INTO lv_time SEPARATED BY gc_colon.

    CONCATENATE sy-datum6(2) sy-datum4(2)

    sy-datum+0(4) INTO lv_date_to SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-uzeit2(2)

    sy-uzeit+4(2) INTO lv_time_to SEPARATED BY gc_colon.

    Populate the BDC Table for SLG1 Transaction

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSLG3' '0100',

    ' ' 'BDC_CURSOR' 'BALHDR-ALPROG',

    ' ' 'BDC_OKCODE' '=SELE',

    ' ' 'BALHDR-OBJECT' '*',

    ' ' 'BALHDR-SUBOBJECT' '*',

    ' ' 'BALHDR-EXTNUMBER' '*',

    ' ' 'BALHDR-ALDATE' lv_date,

    ' ' 'BALHDR-ALTIME' lv_time,

    ' ' '*BALHDR-ALDATE' lv_date_to,

    ' ' '*BALHDR-ALTIME' lv_time_to,

    ' ' 'BALHDR-ALUSER' sy-uname,

    ' ' 'BALHDR-ALTCODE' '*',

    ' ' 'BALHDR-ALPROG' '*',

    ' ' 'MODE_ALL' 'X',

    ' ' 'PROBCLASS_4' 'X'.

    CLEAR lv_error.

    lv_mode = gc_foreground.

    Call Transaction SLG1 for displaying the LOG for the action.

    CALL TRANSACTION gc_slg1 USING gt_bdc_tab MODE lv_mode

    MESSAGES INTO lt_msg_dtl.

    LOOP AT lt_msg_dtl ASSIGNING lfs_msg_dtl WHERE

    msgtyp = gc_error OR

    msgtyp = gc_abend.

    lv_error = gc_set.

    EXIT.

    ENDLOOP.

    IF lv_error = gc_set.

    Error while displaying Log.

    MESSAGE i049.

    ENDIF.

    ELSEIF iv_ucomm = gc_tlane.

    Display Tlane deletion data.

    PERFORM f_display_tlane USING gt_tlane.

    ENDIF.

    ENDFORM. " f_show_log

    ----

    * Form top_of_page

    ----

    Write Header details in the TOP OF PAGE for ALV report

    ----

    FORM top_of_page. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-015,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space.

    If Test Run then select

    IF p_test = gc_set. " IF test run

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-013,

    gs_type_a space text-014.

    ELSEIF gv_msg_error = gc_set. "IF error in call trns

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-018.

    ELSEIF gv_flg_error = gc_set. " IF error in deletion

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-012.

    ELSEIF gv_flg_error gc_set. " IF no error

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-011.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " top_of_page

    ----

    * Form f_populate_top_page

    ----

    Populate the Header for ALV top of page with parameters passed

    ----

    --IV_TYPE Line Type

    --IV_KEY Key

    --IV_INFO Info to be printed

    ----

    FORM f_populate_top_page USING iv_type TYPE char1

    iv_key TYPE any

    iv_info TYPE any.

    Local Data Declaration

    DATA: ls_top_page TYPE slis_listheader.

    CLEAR ls_top_page.

    ls_top_page-typ = iv_type.

    ls_top_page-key = iv_key.

    ls_top_page-info = iv_info.

    APPEND ls_top_page TO gt_top_page.

    ENDFORM. " f_populate_top_page

    ----

    * Form f_populate_range_table_LOCID

    ----

    Populate the Range thable wiht the values passed

    ----

    --IV_VALUE_LOW Lower Value of the Range

    --CT_RANGE_TAB Table of type Range

    ----

    FORM f_populate_range_table_locid USING iv_value_low TYPE any

    CHANGING ct_range_tab TYPE t_locid_range.

    Local Data Declaration

    DATA: ls_locid TYPE s_range_locid.

    ls_locid-sign = gc_sign_i.

    ls_locid-option = gc_option_eq.

    ls_locid-low = iv_value_low.

    APPEND ls_locid TO ct_range_tab.

    CLEAR ls_locid.

    ENDFORM. " f_populate_range_table_LOCID

    ----

    * Form f_display_tlane

    ----

    Display Transportation lane deletion data

    ----

    --CT_TLANE Itab with details of Tlane deleted

    ----

    FORM f_display_tlane USING ct_tlane TYPE t_tlane_data.

    Local Data Declaration

    DATA: lt_tl_events TYPE STANDARD TABLE OF slis_alv_event.

    Populate the top of page event.

    PERFORM f_get_events_tl CHANGING lt_tl_events.

    REFRESH gt_fcat.

    *MOD-1887120

    SORT CT_TLANE BY LOCFR LOCTO MATID.

    *MOD-1887120

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_1 gc_locfr gc_tl_tab text-023 gc_len_l_des gc_left,

    gc_pos_2 gc_locto gc_tl_tab text-024 gc_len_l_des gc_left,

    gc_pos_3 gc_prod_tl gc_tl_tab text-022 gc_len_l_des gc_left.

    Display the ALV Grid Display

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = sy-repid

    it_fieldcat = gt_fcat

    i_save = gc_save

    it_events = lt_tl_events

    TABLES

    t_outtab = ct_tlane

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " f_display_tlane

    ----

    * Form f_get_events_tl

    ----

    Get event top of page for Tlane report

    ----

    --CT_EVENTS Itab for top of page

    ----

    FORM f_get_events_tl CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_lt_top.

    ENDIF.

    ENDFORM. " f_get_events_tl

    ----

    * Form F_TOP_TL

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_tl. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-025,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space.

    IF p_test IS INITIAL.

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-026.

    ELSE.

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-041.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TL

    ----

    * Form f_adj_screen_flds

    ----

    Adjusts the screen fields

    ----

    FORM f_adj_screen_flds .

    *MOD-1771404 by Aveek

    IF p_mdel IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_LOG' OR

    screen-name = 'S_PRD-LOW' OR

    screen-name = 'S_PRD-HIGH' OR

    screen-name = 'S_MKT-LOW' OR

    screen-name = 'S_MKT-HIGH' OR

    screen-name = 'P_TEST'.

    screen-input = 0.

    REFRESH: s_prd, s_mkt.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    IF p_tlan IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_SRC' OR

    screen-name = 'P_DES' OR

    screen-name = 'P_PRD' OR

    screen-name = 'P_TDAT' OR

    screen-name = 'P_TPRD' OR

    screen-name = 'P_FRD' OR

    screen-name = 'P_TOD'.

    screen-input = 0.

    CLEAR: p_src, p_des, p_prd.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    *

    IF p_tdat IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_FRD' OR

    screen-name = 'P_TOD'.

    screen-input = 0.

    CLEAR: p_frd, p_tod.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    ***MOD-1771404 by Aveek

    ENDFORM. " f_adj_screen_flds

    ----

    * Form f_update_tlane

    ----

    Updates transportation lane

    ----

    **MOD-1771404 by Aveek

    FORM f_update_tlane .

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    PERFORM f_get_locid_for_loc USING p_src

    CHANGING lv_srcid

    lv_dummy.

    PERFORM f_get_locid_for_loc USING p_des

    CHANGING lv_desid

    lv_dummy.

    PERFORM f_get_matid_for_prod USING p_prd

    CHANGING lv_matid.

    ls_matid-matid = lv_matid.

    ls_matid-matnr = p_prd.

    APPEND ls_matid TO lt_matid.

    SELECT bmatid aprvar

    APPENDING TABLE lt_matid

    FROM zap_sign AS a JOIN

    /sapapo/matkey AS b

    ON aprvar = bmatnr

    WHERE pcode = p_prd AND

    ( pdctr = p_src OR

    whse1 = p_src OR

    whse2 = p_src ) AND

    ( whse1 = p_des OR

    whse2 = p_des OR

    markt = p_des ).

    **MOD-1771404 Changed code

    SELECT bmatid aprvar

    APPENDING TABLE lt_matid

    FROM zm_zap_sign AS a JOIN

    /sapapo/matkey AS b

    ON aprvar = bmatnr

    WHERE pcode = p_prd AND

    ( markt = p_src or

    pdctr = p_src OR

    whse1 = p_src OR

    whse2 = p_src ) OR

    ( pdctr = p_des OR

    whse1 = p_des OR

    whse2 = p_des OR

    markt = p_des ).

    *MOD-1771404

    IF sy-subrc 0.

    MESSAGE i072 WITH p_prd p_src p_des.

    LEAVE LIST-PROCESSING.

    ENDIF.

    SELECT * INTO TABLE lt_trprod

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN lt_matid

    WHERE locfr = lv_srcid AND

    locto = lv_desid AND

    matid = lt_matid-matid.

    *MOD-1771404

    SELECT * INTO TABLE lt_trprod

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN lt_matid

    WHERE ( locfr = lv_srcid OR

    locfr = lv_desid ) AND

    matid = lt_matid-matid OR

    ( locto = lv_srcid OR

    locto = lv_desid ) AND

    matid = lt_matid-matid.

    *MOD-1771404

    IF sy-subrc 0.

    MESSAGE i067 WITH p_src p_des p_prd.

    LEAVE LIST-PROCESSING.

    ENDIF.

    Change of validity dates

    IF p_tdat IS NOT INITIAL.

    IF p_frd IS INITIAL OR p_tod IS INITIAL.

    MESSAGE i070.

    LEAVE LIST-PROCESSING.

    ELSE.

    IF p_frd p_tod.

    MESSAGE i071.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDIF.

    CONVERT: DATE p_frd TIME lc_stime

    INTO TIME STAMP lv_valfr TIME ZONE lc_utc,

    DATE p_tod TIME lc_etime

    INTO TIME STAMP lv_valto TIME ZONE lc_utc.

    LOOP AT lt_trprod ASSIGNING lfs_trprod.

    lfs_trprod-valfr = lv_valfr.

    lfs_trprod-valto = lv_valto.

    ENDLOOP.

    *MOD-1771404

    MODIFY /sapapo/trprod FROM TABLE lt_trprod.

    *MOD-1771404

    IF sy-subrc = 0.

    COMMIT WORK AND WAIT.

    MESSAGE s068 WITH p_src p_des p_prd.

    ENDIF.

    ENDIF.

    Removal of product assignment

    IF p_tprd IS NOT INITIAL.

    *MOD-1771404

    DELETE /sapapo/trprod FROM TABLE lt_trprod.

    *MOD-1771404

    IF sy-subrc = 0.

    COMMIT WORK AND WAIT.

    MESSAGE s069 WITH p_prd p_src p_des.

    ENDIF.

    ENDIF.

    Display the lanes updated in an ALV

    CLEAR ls_tlaneupd.

    ls_tlaneupd-locfr = p_src.

    ls_tlaneupd-locto = p_des.

    IF p_tdat IS NOT INITIAL.

    ls_tlaneupd-msg = text-034.

    ELSE.

    ls_tlaneupd-msg = text-035.

    ENDIF.

    LOOP AT lt_matid INTO ls_matid.

    ls_tlaneupd-matnr = ls_matid-matnr.

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *MOD-1771404

    LOOP AT lt_trprod INTO ls_trprod.

    CALL FUNCTION '/SAPAPO/DM_MATID_GET_MATERIAL'

    EXPORTING

    iv_matid = ls_trprod-matid

    iv_langu = sy-langu

    IMPORTING

    ev_matnr = lv_matnr.

    *

    ls_tlaneupd-matnr = lv_matnr.

    ls_tlaneupd-locfr

    ls_tlaneupd-locto

    ls_tlaneupd-matnr

    ls_tlaneupd-matid

    *

    *

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *

    ls_tlaneupd-matnr = ls_matid-matnr.

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *MOD-1771404

    PERFORM display_alv_tlaneupd USING lt_tlaneupd.

    ENDFORM. " f_update_tlane

    ***MOD-1771404 by Aveek

    ----

    * Form display_alv_tlaneupd

    ----

    Displays the ALV for updated Tlane

    ----

    --IT_TLANEUPD Tlane table

    ----

    FORM display_alv_tlaneupd USING it_tlaneupd TYPE t_tlaneupd.

    Local Data Declaration

    DATA: lt_tl_events TYPE STANDARD TABLE OF slis_alv_event.

    Populate the top of page event.

    PERFORM f_get_events_tlupd CHANGING lt_tl_events.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_1 gc_locfr gc_tl_tabu text-023 gc_len_l_des gc_left,

    gc_pos_2 gc_locto gc_tl_tabu text-024 gc_len_l_des gc_left,

    gc_pos_3 gc_matnr gc_tl_tabu text-022 gc_len_l_des gc_left,

    gc_pos_4 gc_msg gc_tl_tabu text-036 gc_len_l_des gc_left.

    Display the ALV Grid Display

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = sy-repid

    it_fieldcat = gt_fcat

    i_save = gc_save

    it_events = lt_tl_events

    TABLES

    t_outtab = it_tlaneupd

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " display_alv_tlaneupd

    ----

    * Form f_get_events_tlupd

    ----

    Gets the events tab

    ----

    --CT_EVENTS Event table

    ----

    FORM f_get_events_tlupd CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_tlupd_top.

    ENDIF.

    ENDFORM. " f_get_events_tlupd

    ----

    * Form F_TOP_TLUPD

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_tlupd. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-037,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space,

    gs_type_a text-010 text-038.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TLUPD

    ----

    * Form f_get_events_prd

    ----

    Gets the events for product

    ----

    --CT_EVENTS Events table

    ----

    FORM f_get_events_prd CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_prd_top.

    ENDIF.

    ENDFORM. " f_get_events_prd

    ----

    * Form F_TOP_PRD

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_prd. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_s gc_space gc_space.

    IF p_test IS NOT INITIAL.

    PERFORM f_populate_top_page USING

    gs_type_a text-010 text-039.

    ELSE.

    PERFORM f_populate_top_page USING

    gs_type_a text-010 text-040.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TLUPD

    ----

    * Form launch_WUF

    ----

    Launches the WUF

    ----

    --IT_CORE_PROD Core product

    --IT_PROD_VAR Product variant

    ----

    FORM launch_wuf USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc.

    CONSTANTS:

    lc_rscsel TYPE fieldname VALUE 'RSCSEL-SLOW_I'.

    DATA: lv_ctu_params TYPE ctu_params,

    lv_fname TYPE dynfnam,

    lv_count(2) TYPE n,

    lt_msg_tab TYPE STANDARD TABLE OF bdcmsgcoll.

    Field-symbols

    FIELD-SYMBOLS: lfs_msg_ret TYPE bdcmsgcoll,

    lfs_data TYPE s_f4_data_loc.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=OBSEL',

    space 'WUF_OBJ_NAME_STRUC-NAME' 'Location Product',

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=MORE__1',

    space 'WUF_OPT_FIELDS-DISPLAY_DEPS' 'X',

    space 'BDC_CURSOR' 'WUF_SEL_FIELDS-LOW__1',

    space 'WUF_SEL_FIELDS-FIELDNAMETXT__1' 'Product',

    'X' 'SAPLALDB' '3000',

    space 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE lc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    ENDLOOP.

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE lc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=EXEC_DIR',

    'X' 'SAPMSSY0' '0120',

    space 'BDC_OKCODE' '=F15',

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=EXIT'.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = 'E'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    CALL TRANSACTION 'WUF' USING gt_bdc_tab OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    ENDFORM. " launch_WUF

    ----

    * Form f_retrieve_masterdata

    ----

    Gets the master data from the SIGN portfolio meeting the

    user selection

    ----

    --ET_MASTERDATA Master data table

    ----

    FORM f_retrieve_masterdata CHANGING et_masterdata TYPE t_masterdata

    et_tship TYPE t_tship

    et_whse TYPE t_whse.

    DATA:

    lt_masterdata TYPE t_masterdata,

    lt_tship TYPE t_tship,

    ls_tship TYPE s_tship,

    ls_whse TYPE s_whse.

    SELECT * INTO TABLE et_masterdata

    FROM zap_scmpf

    WHERE ( pcode = p_prd ) AND

    ( markt = p_src or

    pdctr = p_src ) OR

    ( pdctr = p_des OR

    markt = p_des ) AND

    delfl = space.

    IF sy-subrc 0.

    No sourcing info is maintained for the user selection

    MESSAGE i018.

    LEAVE LIST-PROCESSING.

    ENDIF.

    Obtaining all the possible transhipments in the sourcing

    lt_masterdata = et_masterdata.

    DELETE lt_masterdata WHERE whind IS INITIAL.

    IF lt_masterdata IS INITIAL.

    EXIT.

    ENDIF.

    MOD-1771404

    SELECT * INTO TABLE et_tship

    FROM zap_tshpt

    FOR ALL ENTRIES IN lt_masterdata

    WHERE markt = lt_masterdata-markt AND

    ( pcode = lt_masterdata-pcode OR

    pcode = lt_masterdata-prvar ). " AND

    pcode = lt_masterdata-pcode AND

    pdctr = lt_masterdata-pdctr.

    MOD-1771404

    IF sy-subrc = 0.

    SORT et_tship BY markt pcode pdctr altscn sloc dloc.

    DELETE ADJACENT DUPLICATES FROM et_tship

    COMPARING markt pcode pdctr altscn sloc dloc.

    lt_tship = et_tship.

    SORT lt_tship BY sloc dloc.

    DELETE ADJACENT DUPLICATES FROM lt_tship

    COMPARING sloc dloc.

    LOOP AT lt_tship INTO ls_tship.

    CLEAR ls_whse.

    ls_whse-whse = ls_tship-sloc.

    APPEND ls_whse TO et_whse.

    IF ls_tship-dloc IS INITIAL.

    CONTINUE.

    ENDIF.

    CLEAR ls_whse.

    ls_whse-whse = ls_tship-dloc.

    APPEND ls_whse TO et_whse.

    ENDLOOP.

    SORT et_whse BY whse.

    DELETE ADJACENT DUPLICATES FROM et_whse

    COMPARING whse.

    ENDIF.

    ENDFORM. " f_retrieve_masterdata

    ----

    * Form f_collect_tlanes

    ----

    Collects all possible transportation lanes

    ----

    --IT_MASTERDATA Master data table

    --IT_LOCATION Location table

    --IT_PRODUCT Product table

    --ET_TLANE Transportation lane table

    ----

    FORM f_collect_tlanes USING it_masterdata TYPE t_masterdata

    it_tship TYPE t_tship

    it_location TYPE t_location

    it_product TYPE t_product

    CHANGING et_tlane TYPE t_tlane.

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    DATA:

    ls_tlane TYPE s_tlane.

    DATA: LV_EXIST type i.

    DATA:

    lv_dtfrmin TYPE timestamp,

    lv_dttomax TYPE timestamp,

    lv_tabix TYPE sytabix,

    lv_locfr TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno,

    lv_matnr TYPE /sapapo/matnr.

    DATA:

    ls_masterdata TYPE zap_scmpf.

    FIELD-SYMBOLS:

    lfs_tlanetmp TYPE s_tlane,

    lfs_tlane TYPE s_tlane.

    LOOP AT it_masterdata INTO ls_masterdata

    WHERE status = 'P' OR

    status = 'A'.

    Check if the core product exists in the data base

    READ TABLE it_product TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_masterdata-pcode

    BINARY SEARCH.

    IF sy-subrc 0.

    Core product exists, find the tlanes involving it

    PERFORM f_find_tlane_comb USING ls_masterdata

    it_tship

    gc_core

    it_location

    CHANGING et_tlane.

    ELSE.

    *MOD-1771404

    Product doesnt exist in database, update log

    lv_locfr = ls_masterdata-pdctr.

    lv_locto = ls_masterdata-markt.

    lv_matnr = ls_masterdata-pcode.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_028

    lv_locfr lv_locto lv_matnr

    space space

    CHANGING gt_log_tlane.

    *MOD-1771404

    ENDIF.

    Check if the variant exists in the data base

    READ TABLE it_product TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_masterdata-prvar

    BINARY SEARCH.

    IF sy-subrc 0.

    Variant exists, find the tlanes involving it

    PERFORM f_find_tlane_comb USING ls_masterdata

    it_tship

    gc_var

    it_location

    CHANGING et_tlane.

    ELSE.

    *MOD-1771404

    Product doesnt exist in database, update log

    lv_locfr = ls_masterdata-pdctr.

    lv_locto = ls_masterdata-markt.

    lv_matnr = ls_masterdata-prvar.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_029

    lv_locfr lv_locto lv_matnr

    space space

    CHANGING gt_log_tlane.

    ENDIF.

    *MOD-1771404

    ENDLOOP.

    *MOD-1771404

    IF et_tlane IS INITIAL.

    The location(s)/product(s) not available in the db for tlane creation

    MESSAGE i023.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_023

    space space space

    space space

    CHANGING gt_log_tlane.

    EXIT.

    ENDIF.

    *MOD-1771404

    SORT et_tlane BY locfr locto matnr datfr datto.

    DELETE ADJACENT DUPLICATES FROM et_tlane

    COMPARING locfr locto matnr datfr datto.

    READ TABLE et_tlane ASSIGNING lfs_tlane INDEX 1.

    lv_dtfrmin = lfs_tlane-datfr.

    lv_dttomax = lfs_tlane-datto.

    LOOP AT et_tlane ASSIGNING lfs_tlane.

    IF lfs_tlane-datfr lv_dtfrmin.

    lv_dtfrmin = lfs_tlane-datfr.

    ENDIF.

    IF lfs_tlane-datto lv_dttomax.

    lv_dttomax = lfs_tlane-datto.

    ENDIF.

    AT END OF matnr.

    lfs_tlane-datfr = lv_dtfrmin.

    lfs_tlane-datto = lv_dttomax.

    lv_tabix = sy-tabix + 1.

    READ TABLE et_tlane ASSIGNING lfs_tlanetmp INDEX lv_tabix.

    IF sy-subrc = 0.

    lv_dtfrmin = lfs_tlanetmp-datfr.

    lv_dttomax = lfs_tlanetmp-datto.

    ENDIF.

    ENDAT.

    ENDLOOP.

    SORT et_tlane BY locfr locto matnr datfr ASCENDING datto DESCENDING.

    DELETE ADJACENT DUPLICATES FROM et_tlane

    COMPARING locfr locto matnr.

    Get the internal guids for material and locations

    LOOP AT et_tlane ASSIGNING lfs_tlane.

    PERFORM f_get_locid_from_locno USING lfs_tlane-locfr

    CHANGING lfs_tlane-lidfr.

    PERFORM f_get_locid_from_locno USING lfs_tlane-locto

    CHANGING lfs_tlane-lidto.

    PERFORM f_get_matid_from_matnr USING lfs_tlane-matnr

    CHANGING lfs_tlane-matid.

    ENDLOOP.

    PERFORM f_get_locid_for_loc USING p_src

    CHANGING lv_srcid

    lv_dummy.

    PERFORM f_get_locid_for_loc USING p_des

    CHANGING lv_desid

    lv_dummy.

    PERFORM f_get_matid_for_prod USING p_prd

    CHANGING lv_matid.

    ls_matid-matid = lv_matid.

    ls_matid-matnr = p_prd.

    APPEND ls_matid TO lt_matid.

    loop at et_tlane into ls_tlane.

    READ TABLE lt_matid TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_tlane-matnr

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_exist = 1.

    modify et_tlane from ls_tlane transporting lv_exist.

    endif.

    endloop.

    delete et_tlane where lv_exist = 1.

    ENDFORM. " f_collect_tlanes

    ----

    * Form f_find_tlane_comb

    ----

    Finds tlanes involving a product

    ----

    --IS_MASTERDATA Masterdata table

    --IV_PRDTP Prioduct type

    --IT_LOCATION Location table

    --ET_TLANE Tlane table

    ----

    FORM f_find_tlane_comb USING is_masterdata TYPE zap_scmpf

    it_tship TYPE t_tship

    iv_prdtp TYPE c

    it_location TYPE t_location

    CHANGING et_tlane TYPE t_tlane.

    DATA:

    lv_matnr TYPE /sapapo/matnr,

    ls_tship TYPE s_tship,

    ls_tship_tmp TYPE s_tship,

    lv_locfr TYPE /sapapo/locno,

    lv_locwh TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno.

    CASE iv_prdtp.

    WHEN gc_core.

    lv_matnr = is_masterdata-pcode.

    WHEN gc_var.

    lv_matnr = is_masterdata-prvar.

    ENDCASE.

    First see if the Source and Market exist in the database.

    Check the presence of transhipments in the sourcing. We assume that

    the destination can only be blank for the last entry of a given

    sourcing alternative

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = is_masterdata-markt

    BINARY SEARCH.

    IF sy-subrc 0.

    Market exists in the data base

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = is_masterdata-pdctr

    BINARY SEARCH.

    IF sy-subrc 0.

    Source exists in the data base

    IF is_masterdata-whind IS INITIAL.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1001 gc_ltp_1002

    is_masterdata-datab

    is_masterdata-datbi

    CHANGING et_tlane.

    ELSE.

    LOOP AT it_tship INTO ls_tship

    WHERE markt = is_masterdata-markt AND

    pcode = is_masterdata-pcode AND

    pcode = is_masterdata-prvar AND

    pdctr = is_masterdata-pdctr.

    ls_tship_tmp = ls_tship.

    For every alternative sourcing

    AT NEW altscn.

    Define lane between the source and the first transhipment

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = ls_tship-sloc

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = ls_tship_tmp-sloc.

    PERFORM f_build_tlane USING lv_locfr

    lv_locto

    lv_matnr

    gc_ltp_1001

    gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    lv_locwh = ls_tship-sloc.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_087

    lv_locfr lv_locto

    lv_locwh space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDAT.

    Define lanes between the successive transhipments in the srcing

    IF ls_tship-dloc IS NOT INITIAL.

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = ls_tship-dloc

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_locfr = ls_tship_tmp-sloc.

    lv_locto = ls_tship_tmp-dloc.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    lv_locwh = ls_tship-dloc.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_087

    lv_locfr lv_locto

    lv_locwh space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDIF.

    AT END OF altscn.

    Define lane between the final transhipment and the market

    IF ls_tship_tmp-dloc IS NOT INITIAL.

    lv_locfr = ls_tship_tmp-dloc.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = ls_tship_tmp-sloc.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ENDIF.

    ENDAT.

    CLEAR ls_tship_tmp.

    ENDLOOP.

    ENDIF.

    ELSE.

    Source is yet to be created in the database, update log

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_031

    lv_locfr lv_locto

    lv_matnr space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ELSE.

    Market is yet to be created in the database, update log

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_030

    lv_locfr lv_locto

    lv_matnr space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDFORM. " f_find_tlane_comb

    ----

    * Form f_build_tlane

    ----

    Builds a Tlane

    ----

    --IV_LOCFR Location from

    --IV_LOCTO Location to

    --IV_MATNR Product

    --IV_LTPFR Loctype from

    --IV_LTPTO Loctype to

    --IS_MASTERDATA Master data

    --ET_TLANE Tlane table

    ----

    FORM f_build_tlane USING iv_locfr TYPE /sapapo/locno

    iv_locto TYPE /sapapo/locno

    iv_matnr TYPE /sapapo/matnr

    iv_ltpfr TYPE /sapapo/c_loctype

    iv_ltpto TYPE /sapapo/c_loctype

    iv_datfr TYPE Dats

    iv_datto TYPE dats

    CHANGING et_tlane TYPE t_tlane.

    DATA:

    ls_tlane TYPE s_tlane.

    ls_tlane-locfr = iv_locfr.

    ls_tlane-locto = iv_locto.

    ls_tlane-matnr = iv_matnr.

    ls_tlane-ltpfr = iv_ltpfr.

    ls_tlane-ltpto = iv_ltpto.

    PERFORM f_get_tstamps USING iv_datfr iv_datto

    CHANGING ls_tlane-datfr ls_tlane-datto.

    APPEND ls_tlane TO et_tlane.

    ENDFORM. " f_build_tlane

    ----

    * Form f_get_tstamps

    ----

    Gets the timestamps for the Tlane validity dates

    ----

    --IS_MASTERDATA Master data table

    --EV_DATFR Valid from tstamp

    --EV_DATTO Valid to tstamp

    ----

    FORM f_get_tstamps USING iv_datfr TYPE d

    iv_datto TYPE d

    CHANGING ev_datfr TYPE timestamp

    ev_datto TYPE timestamp.

    CONVERT DATE iv_datfr TIME gc_startti

    INTO TIME STAMP ev_datfr TIME ZONE gc_utc.

    CONVERT DATE iv_datto TIME gc_endti

    INTO TIME STAMP ev_datto TIME ZONE gc_utc.

    ENDFORM. " f_get_tstamps

    ----

    * Form f_update_log_table

    ----

    Update logs

    ----

    --IV_MSGID Message class

    --IV_MSGTY Message type

    --IV_MSGNO Message no

    --IV_MSGV1 Variable1

    --IV_MSGV2 Variable2

    --IV_MSGV3 Variable3

    --IV_MSGV4 Variable4

    --IV_MSG Message

    --ET_LOG_TABLE Log table

    ----

    FORM f_update_log_table USING iv_msgid TYPE symsgid

    iv_msgty TYPE symsgty

    iv_msgno TYPE symsgno

    iv_msgv1 TYPE any

    iv_msgv2 TYPE any

    iv_msgv3 TYPE any

    iv_msgv4 TYPE any

    iv_msg TYPE bapi_msg

    CHANGING et_log_table TYPE t_log_table.

    DATA:

    ls_log_table TYPE bal_s_msg.

    DATA: lv_datto type timestamp.

    ls_log_table-msgty = iv_msgty.

    ls_log_table-msgid = iv_msgid.

    ls_log_table-msgno = iv_msgno.

    ls_log_table-msgv1 = iv_msgv1.

    ls_log_table-msgv2 = iv_msgv2.

    ls_log_table-msgv3 = iv_msgv3.

    ls_log_table-msgv4 = iv_msgv4.

    ls_log_table-context-value = iv_msg.

    APPEND ls_log_table TO et_log_table.

    ENDFORM. " f_update_log_table

    ----

    * Form f_get_locid_from_locno

    ----

    Gets the guid for locations

    ----

    --IV_LOCNO Location no

    --EV_LOCID Location id

    ----

    FORM f_get_locid_from_locno USING iv_locno TYPE /sapapo/locno

    CHANGING ev_locid TYPE /sapapo/locid.

    CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_locno

    IMPORTING

    ev_locid = ev_locid

    EXCEPTIONS

    location_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    ENDFORM. " f_get_locid_from_locno

    **----

    **

    ** Form f_get_locid_from_locno

    **----

    **

    Gets the guid for locations

    **----

    **

    --IV_LOCNO Location no

    --EV_LOCID Location id

    **----

    *MOD-1771404

    *FORM f_get_locid_from_locno USING iv_locno TYPE /sapapo/locno

    CHANGING ev_locid TYPE /sapapo/locid.

    *

    CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_locno

    IMPORTING

    ev_locid = ev_locid

    EXCEPTIONS

    location_not_found = 1

    OTHERS = 2.

    *

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    *

    *

    *ENDFORM. " f_get_locid_from_locno

    *MOD-1771404

    ----

    * Form f_get_matid_from_matnr

    ----

    Gets the guid for material

    ----

    --IV_MATNR Material no

    --EV_MATID Material id

    ----

    FORM f_get_matid_from_matnr USING iv_matnr TYPE /sapapo/matnr

    CHANGING ev_matid TYPE /sapapo/matid.

    CALL FUNCTION '/SAPAPO/DM_MATERIAL_GET_MATID'

    EXPORTING

    iv_matnr = iv_matnr

    IMPORTING

    ev_matid = ev_matid

    EXCEPTIONS

    matid_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    ENDFORM. " f_get_matid_from_matnr

    ----

    * Form f_categorise_tlanes

    ----

    Categorises Transp lanes

    ----

    --IT_TLANE Tlane table

    --ET_TLANE_NEW Tlane table with new entries

    --ET_TLANE_DAT Tlane table with date changes

    ----

    FORM f_categorise_tlanes USING it_tlane TYPE t_tlane

    CHANGING et_tlane_new TYPE t_tlane

    et_tlane_dat TYPE t_tlane.

    DATA:

    lt_tlane_cr TYPE STANDARD TABLE OF /sapapo/trprod,

    ls_tlane_cr TYPE /sapapo/trprod, "#EC NEEDED

    ls_tlane_tmp TYPE s_tlane,

    ls_tlane TYPE s_tlane,

    ls_tlane_new TYPE s_tlane.

    DATA: lv_exist type i.

    DATA: lv_exist1 type i.

    DATA:

    lv_dtfrmin TYPE timestamp,

    lv_dttomax TYPE timestamp,

    lv_tabix TYPE sytabix,

    lv_locfr TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno,

    lv_matnr TYPE /sapapo/matnr.

    DATA:

    ls_masterdata TYPE zap_scmpf.

    FIELD-SYMBOLS:

    lfs_tlanetmp TYPE s_tlane,

    lfs_tlane TYPE s_tlane.

    *MOD-1771404

    SORT it_tlane BY locfr locto matnr datfr datto.

    DELETE ADJACENT DUPLICATES FROM it_tlane

    COMPARING locfr locto matnr datfr datto.

    READ TABLE it_tlane ASSIGNING lfs_tlane INDEX 1.

    lv_dtfrmin = lfs_tlane-datfr.

    lv_dttomax = lfs_tlane-datto.

    LOOP AT it_tlane ASSIGNING lfs_tlane.

    IF lfs_tlane-datfr lv_dtfrmin.

    lv_dtfrmin = lfs_tlane-datfr.

    ENDIF.

    IF lfs_tlane-datto lv_dttomax.

    lv_dttomax = lfs_tlane-datto.

    ENDIF.

    AT END OF matnr.

    lfs_tlane-datfr = lv_dtfrmin.

    lfs_tlane-datto = lv_dttomax.

    lv_tabix = sy-tabix + 1.

    READ TABLE it_tlane ASSIGNING lfs_tlanetmp INDEX lv_tabix.

    IF sy-subrc = 0.

    lv_dtfrmin = lfs_tlanetmp-datfr.

    lv_dttomax = lfs_tlanetmp-datto.

    ENDIF.

    ENDAT.

    ENDLOOP.

    SORT it_tlane BY locfr locto matnr datfr ASCENDING datto DESCENDING.

    DELETE ADJACENT DUPLICATES FROM it_tlane

    COMPARING locfr locto matnr.

    *MOD-1771404

    The table /SAPAPO/TRPROD the key field is /SAPAPO/TRPID.

    But over here we are retrieving data from it with respect to

    the source and destination which anyway is unique for a given

    product involved in the lane.

    SELECT locfr locto matid valfr valto

    INTO CORRESPONDING FIELDS OF TABLE lt_tlane_cr

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN it_tlane

    WHERE locfr = it_tlane-lidfr AND

    locto = it_tlane-lidto.

    valfr = it_tlane-datfr and

    valto = it_tlane-datto.

    *MOD-1771404

    IF sy-subrc = 0.

    SORT lt_tlane_cr BY locfr locto matid valfr valto.

    endif.

    LOOP AT it_tlane INTO ls_tlane.

    READ TABLE lt_tlane_cr INTO ls_tlane_cr

    WITH KEY locfr = ls_tlane-lidfr

    locto = ls_tlane-lidto

    matid = ls_tlane-matid.

    *MOD-1771404

    BINARY SEARCH.

    *MOD-1771404

    IF sy-subrc = 0.

    APPEND ls_tlane TO et_tlane_dat.

    ELSE.

    Check whether a product needs to be assigned to an existing

    Tlane

    READ TABLE lt_tlane_cr INTO ls_tlane_cr

    WITH KEY locfr = ls_tlane-lidfr

    locto = ls_tlane-lidto

    BINARY SEARCH.

    IF sy-subrc = 0.

    Mark the record to denote assignment of prod to existing

    Tlane

    ls_tlane-crtyp = 'X'.

    ENDIF.

    IF ls_tlane-locfr = ls_tlane_tmp-locfr AND

    ls_tlane-locto = ls_tlane_tmp-locto.

    ls_tlane-crtyp = 'X'.

    ENDIF.

    APPEND ls_tlane TO et_tlane_new.

    ENDIF.

    ls_tlane_tmp = ls_tlane.

    CLEAR ls_tlane.

    ENDLOOP.

    *MOD-1771404

    SORT et_tlane_new BY locfr locto matnr.

    SORT et_tlane_dat BY locfr locto matnr.

    if not et_tlane_new[] is initial.

    delete adjacent duplicates from et_tlane_new

    comparing locfr locto matnr.

    endif.

    if not et_tlane_dat[] is initial.

    delete adjacent duplicates from et_tlane_dat

    comparing locfr locto matnr.

    endif.

    *MOD-1771404

    ENDFORM. " f_categorise_tlanes

    ----

    * Form F_GET_LOC_DESC

    ----

    text

    ----

    --P_IT_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM F_GET_LOC_DESC CHANGING LV_WARE_DESC TYPE /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    LOOP AT it_prod_data ASSIGNING lfs_prod_data.

    Check if the Location is a market

    SELECT markt UP TO 1 ROWS

    INTO lv_mkt

    FROM zap_sign

    where markt = lfs_prod_data-locno.

    WHERE markt = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_mkt.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = s_mkt-low.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    endif.

    *MOD-1887120

    exit.

    endif.

    ENDIF.

    endif.

    Check if the Location is a Production center

    SELECT pdctr UP TO 1 ROWS

    INTO lv_pdctr

    FROM zap_sign

    WHERE pdctr IN s_mkt.

    WHERE pdctr = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_pdctr IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_pdctr.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = s_mkt-low.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    endif.

    ENDIF.

    Check if the Location is a Warehouse 1

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt.

    WHERE whse1 = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse1.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = lv_whse1.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    endif.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse2 IN s_mkt.

    WHERE whse2 = s_mkt-low.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse2.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = LV_WHSE2.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    endif.

    ENDLOOP.

    ENDFORM. " F_GET_LOC_DESC

    ----

    * Form GET_DESC_LOC

    ----

    text

    ----

    --P_LFS_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM GET_DESC_LOC USING p_lv_prod_data type s_f4_data_loc

    CHANGING p_LV_WARE_DESC type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    data: lv_ware_desc type /sapapo/loc_descr40.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    Check if the Location is a market

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 eq s_mkt-low.

    WHERE whse1 = p_lv_prod_data-locno.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse1.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO p_lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    lv_ware_desc = p_lv_ware_desc.

    endif.

    exit.

    endif.

    ENDIF.

    ENDFORM. " GET_DESC_LOC

    ----

    * Form GET_DESC_WHSE2

    ----

    text

    ----

    --P_LV_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM GET_DESC_WHSE2 USING p_lv_prod_data type s_f4_data_loc

    CHANGING p_LV_WARE_DESC type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    data: lv_ware_desc type /sapapo/loc_descr40.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    *MOD-1771404

    Check if the Location is a market

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zm_zap_sign

    WHERE whse1 IN s_mkt.

    ENDSELECT.

    *MOD-1771404

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse2.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO p_lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    lv_ware_desc = p_lv_ware_desc.

    endif.

    exit.

    endif.

    ENDIF.

    ENDFORM. " GET_DESC_WHSE2

    ----

    * Form f_clear_tables

    ----

    text

    ----

    -- p1 text

    -- p2 text

    ----

    FORM f_clear_tables.

    REFRESH: IT_ZDM0705, IT_ZDU1002, GT_PROD_DATA,

    GT_CORE_PROD, GT_LOC_DATA.

    CLEAR: IT_ZDM0705, IT_ZDU1002, GT_PROD_DATA,

    GT_CORE_PROD, GT_LOC_DATA.

    ENDFORM. " f_clear_tables

    DB:2.37:Deleting Masterdata In Sap Apo: For Reference Purposes 3a


    **********************************************************************

    ************************************************************************

    PROGRAM--Modification*MOD-1771404

    Program name : ZAXXPR_DELETE_MASTER_DATA

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 15.02.2008

    Initial Change request number : PMI_SIGN_0002

    Author : Aveek Ghose.

    Description :

    *

    ************************************************************************

    ************************************************************************

    MOD-1887120

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 10.03.2008

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA.

    ************************************************************************

    REPORT zaxxpr_delete_master_data MESSAGE-ID zaxxp_sign_fpv.

    Include for global data and constants declaration

    INCLUDE zaxxpr_delete_master_data_top.

    ----

    * Include ZAXXPR_DEL_MASTER_DATA_TOP

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_TOP

    ----

    ************************************************************************

    PROGRAM--INITIAL CREATION

    Description XXXXXXXXXX :

    *

    This is the Top include that contains the global data declarations

    and the selection screen of the main program

    ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    PROGRAM--Modification: MOD-1771404

    Program name : ZAXXPR_DELETE_MASTER_DATA_TOP

    Reference program (copied from) : na.

    Development specification ID :

    Process team contact person/team name: Nandakumar

    Date created : 15.02.2006

    Initial Change request number : PMI_SIGN_0002

    Author : Aveek Ghose..

    Description :

    *

    This is the Top include that contains the global data declarations

    and the selection screen of the main program

    ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    ************************TYPES DECLARATION*****************************

    ************************************************************************

    TYPE-POOLS: slis...

    Types dclaration for view table data.

    TYPES: BEGIN OF s_view_data,

    pcode TYPE matnr, " Product

    maktx TYPE zdmaktx, " Prod Desc

    markt TYPE zdmarkt, " Market

    martx TYPE zdmarkst, " Market Desc

    pdctr TYPE zdpdctr, " Product Center

    pctxt TYPE zdpdcst, " Description

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    vartx TYPE zdvartx, " Variant Description

    status TYPE zdstat1, " Status

    END OF s_view_data,

    t_view_data TYPE STANDARD TABLE OF s_view_data.

    MOD-1771404****

    TYPES: BEGIN OF l_view_data,

    pcode TYPE matnr, " Product

    markt TYPE zdmarkt, " Market

    pdctr TYPE zdpdctr, " Product Center

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    status TYPE zdstat1, " Status

    END OF l_view_data,

    lv_view_data TYPE STANDARD TABLE OF s_view_data.

    MOD-1771404***

    Types declaration for F4 help Product data

    TYPES: BEGIN OF s_f4_data_matnr,

    pcode TYPE matnr, " Product

    maktx TYPE maktx, " Description

    END OF s_f4_data_matnr,

    t_f4_data_matnr TYPE STANDARD TABLE OF s_f4_data_matnr.

    Types declaration for F4 help Location data

    TYPES: BEGIN OF s_f4_data_loc,

    locno TYPE /sapapo/locno, " Location

    desc TYPE /sapapo/loc_descr40, " Description

    pcode TYPE /sapapo/matnr, " Product

    prvar TYPE /sapapo/matnr, " Product Variant

    *MOD-012

    pdctr TYPE ZDPDCTR, "Production Center

    *MOD-012

    vartx TYPE zdvartx, " Variant Description

    maktx TYPE zdmaktx, " Prod Desc

    status TYPE zdstat1, " Status

    loctyp TYPE /sapapo/c_loctype, " Location Type

    whse1 TYPE ZAWHSE1,

    whse2 TYPE ZAWHSE2,

    lv_exist TYPE I, " Variable

    END OF s_f4_data_loc,

    t_f4_data_loc TYPE STANDARD TABLE OF s_f4_data_loc.

    Types declaration for Warehouse description

    TYPES: BEGIN OF s_whse,

    whse TYPE zawhse, " Location

    whdesc TYPE zadesc, " Description

    END OF s_whse,

    t_whse TYPE STANDARD TABLE OF s_whse.

    Types declaration for F4 help Location data

    TYPES: BEGIN OF s_f4_loc,

    locno TYPE /sapapo/locno, " Location

    desc TYPE /sapapo/loc_descr40, " Description

    END OF s_f4_loc,

    t_f4_loc TYPE STANDARD TABLE OF s_f4_loc.

    Types declaration for SCREEN TABLE used in submit statement

    TYPES: t_rsparams TYPE STANDARD TABLE OF rsparams.

    Types declaration for Transportation Lane data

    TYPES: BEGIN OF s_tlane_data,

    trpid TYPE /sapapo/tr_trpid, " Trip Id

    locto TYPE /sapapo/locno, " Location to

    matid TYPE matnr, " Material Id

    locfr TYPE /sapapo/locno, " Location from

    END OF s_tlane_data,

    t_tlane_data TYPE STANDARD TABLE OF s_tlane_data.

    Types Declaration for Range Table

    TYPES: BEGIN OF s_range_matid,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/matid, " Matid low

    high TYPE /sapapo/matid, " Matid high

    END OF s_range_matid,

    t_matid_range TYPE STANDARD TABLE OF s_range_matid.

    Types Declaration for Range Table

    TYPES: BEGIN OF s_range_locid,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/locid, " Locid low

    high TYPE /sapapo/locid, " locid high

    END OF s_range_locid,

    t_locid_range TYPE STANDARD TABLE OF s_range_locid.

    Types Declaration for ALV Display

    TYPES: BEGIN OF s_display,

    prod TYPE /sapapo/matnr, " Product

    p_des TYPE zdmaktx, " Product Desc

    loc TYPE /sapapo/locno, " Location

    l_des TYPE /sapapo/loc_descr40, " Location Desc

    status TYPE char15, " Deletion status

    light TYPE iconname, " Light Indicator

    END OF s_display,

    t_display TYPE STANDARD TABLE OF s_display.

    TYPES: BEGIN OF s_displayprd,

    prod TYPE /sapapo/matnr, " Product

    p_des TYPE zdmaktx, " Product Desc

    status TYPE char15, " Deletion status

    light TYPE iconname, " Light Indicator

    END OF s_displayprd,

    t_displayprd TYPE STANDARD TABLE OF s_displayprd.

    Types Declaration for Product select options

    TYPES: BEGIN OF s_range_product,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE matnr, " Product low

    high TYPE matnr, " Product high

    END OF s_range_product.

    Types Declaration for Location select option

    TYPES: BEGIN OF s_range_location,

    sign TYPE char1, " Sign

    option TYPE char2, " Option

    low TYPE /sapapo/locno, " Location low

    high TYPE /sapapo/locno, " Location high

    END OF s_range_location.

    Types Declaration for Matids for the Products

    TYPES: BEGIN OF s_matid,

    matid TYPE /sapapo/matid, " Matid

    matnr TYPE matnr, " Product

    END OF s_matid,

    t_matid TYPE STANDARD TABLE OF s_matid.

    Types Declaration for Locid and Locations

    TYPES: BEGIN OF s_locid,

    locid TYPE /sapapo/locid, " Matid

    locno TYPE /sapapo/locno, " Product

    END OF s_locid,

    t_locid TYPE STANDARD TABLE OF s_locid.

    TYPES: BEGIN OF s_tlaneupd,

    locfr TYPE /sapapo/locno,

    locto TYPE /sapapo/locno,

    matnr TYPE matnr,

    matid type /SAPAPO/MATID,

    msg TYPE /fre/bif_messagetext,

    END OF s_tlaneupd,

    t_tlaneupd TYPE STANDARD TABLE OF s_tlaneupd.

    TYPES: BEGIN OF s_matloc,

    matnr TYPE matnr,

    locno TYPE /sapapo/locno,

    END OF s_matloc,

    t_matloc TYPE STANDARD TABLE OF s_matloc.

    *MOD-1771404

    TYPES: t_masterdata TYPE STANDARD TABLE OF ZAP_SCMPF,

    s_tship type ZAP_TSHPT,

    t_tship type standard table of s_tship,

    t_log_table TYPE STANDARD TABLE OF bal_s_msg,

    t_log_location TYPE STANDARD TABLE OF bal_s_msg,

    t_log_product TYPE STANDARD TABLE OF bal_s_msg,

    t_log_locprd TYPE STANDARD TABLE OF bal_s_msg,

    t_log_tlane TYPE STANDARD TABLE OF bal_s_msg.

    TYPES: BEGIN OF s_location,

    locno TYPE /sapapo/locno,

    loctp TYPE /sapapo/c_loctype,

    locct TYPE char1,

    END OF s_location,

    t_location TYPE STANDARD TABLE OF s_location,

    BEGIN OF s_product,

    matnr TYPE /sapapo/matnr,

    matct TYPE char1,

    END OF s_product,

    t_product TYPE STANDARD TABLE OF s_product,

    BEGIN OF s_tlane,

    locfr TYPE /sapapo/locno,

    locto TYPE /sapapo/locno,

    matnr TYPE /sapapo/matnr,

    ltpfr TYPE /sapapo/c_loctype,

    ltpto TYPE /sapapo/c_loctype,

    lidfr TYPE /sapapo/locid,

    lidto TYPE /sapapo/locid,

    matid TYPE /sapapo/matid,

    datfr TYPE timestamp,

    datto TYPE timestamp,

    crtyp TYPE flag,

    lv_exist type i,

    END OF s_tlane,

    t_tlane TYPE STANDARD TABLE OF s_tlane,

    BEGIN OF s_loc_extloc,

    locno TYPE /sapapo/locno,

    extloc TYPE /sapapo/loc_extlocno,

    END OF s_loc_extloc,

    t_loc_extloc TYPE STANDARD TABLE OF s_loc_extloc,

    BEGIN OF s_prd_extprd,

    matnr TYPE /sapapo/matnr,

    extmat TYPE /sapapo/ext_matnr,

    END OF s_prd_extprd,

    t_prd_extprd TYPE STANDARD TABLE OF s_prd_extprd,

    BEGIN OF s_locprd,

    locno TYPE /sapapo/locno,

    matnr TYPE /sapapo/matnr,

    loctp TYPE /sapapo/c_loctype,

    prctp TYPE /sapapo/beskz,

    END OF s_locprd,

    t_locprd TYPE STANDARD TABLE OF s_locprd.

    DATA: t_sign type standard table of zap_sign.

    DATA: t_sign1 type standard table of zap_sign.

    DATA: IT_ZDU1002 type standard table of zdu1002.

    DATA: it_zdm0705 type standard table of zdm0705.

    *MOD-1771404

    ************************************************************************

    ********************CONSTANTS DECLARATION*****************************

    ************************************************************************

    CONSTANTS:

    Selection Screen field names

    gc_prd_low TYPE dynfnam VALUE 'S_PRD-LOW',

    gc_prd_high TYPE dynfnam VALUE 'S_PRD-HIGH',

    gc_mkt_low TYPE dynfnam VALUE 'S_MKT-LOW',

    gc_mkt_high TYPE dynfnam VALUE 'S_MKT-HIGH',

    Transaction Name and Program Names

    gc_bp2 TYPE baltcode VALUE '/SAPAPO/BP2',

    gc_slg1 TYPE baltcode VALUE 'SLG1',

    gc_mode_e TYPE ctu_mode VALUE 'E',

    gc_mode_n TYPE ctu_mode VALUE 'N',

    gc_foreground TYPE char1 VALUE 'A',

    gc_rscsel TYPE dynfnam VALUE 'RSCSEL-SLOW_I',

    gc_l_brac TYPE char1 VALUE '(',

    gc_r_brac TYPE char1 VALUE ')',

    Selection Screen Elements for /SAPAPO/RLCDELETE

    gc_radio_btn TYPE rsscr_kind VALUE 'R',

    gc_parameter TYPE rsscr_kind VALUE 'P',

    gc_sel_optn TYPE rsscr_kind VALUE 'S',

    gc_sign_i TYPE tvarv_sign VALUE 'I',

    gc_option_eq TYPE tvarv_opti VALUE 'EQ',

    gc_manual_sel TYPE rsscr_name VALUE 'SHUF_PA1',

    gc_product TYPE rsscr_name VALUE 'SEL_PROD',

    gc_location TYPE rsscr_name VALUE 'SEL_LOC',

    gc_plan_vrsn TYPE rsscr_name VALUE 'P_VERSIO',

    gc_fixed_ord TYPE rsscr_name VALUE 'P_FIXED',

    gc_category TYPE rsscr_name VALUE 'RB_CAT',

    gc_key_fig TYPE rsscr_name VALUE 'RB_KEYF',

    gc_only_apo TYPE rsscr_name VALUE 'P_APO',

    gc_test_run TYPE rsscr_name VALUE 'P_TEST',

    gc_pvrsn_000 TYPE tvarv_val VALUE '000',

    Selection screen fields for /SAPAPO/DELETE_PP_ORDER

    gc_pl_vrsn TYPE rsscr_name VALUE 'LV_SIMID',

    gc_prod TYPE rsscr_name VALUE 'LT_MATAB',

    gc_loc TYPE rsscr_name VALUE 'LT_LOTAB',

    gc_plan_prod TYPE rsscr_name VALUE 'LV_EXT',

    gc_contract TYPE rsscr_name VALUE 'LV_SUBCO',

    gc_display_ord TYPE rsscr_name VALUE 'LV_LIST',

    gc_delete_ord TYPE rsscr_name VALUE 'LV_DEL',

    gc_send_delete TYPE rsscr_name VALUE 'LV_EVENT',

    ALV grid display fields

    gc_pos_1 TYPE lvc_colpos VALUE '0001',

    gc_pos_2 TYPE lvc_colpos VALUE '0002',

    gc_pos_3 TYPE lvc_colpos VALUE '0003',

    gc_pos_4 TYPE lvc_colpos VALUE '0004',

    gc_pos_5 TYPE lvc_colpos VALUE '0005',

    gc_pos_6 TYPE lvc_colpos VALUE '0006',

    gc_prodct TYPE lvc_fname VALUE 'PROD',

    gc_status TYPE lvc_fname VALUE 'STATUS',

    gc_light TYPE lvc_fname VALUE 'LIGHT',

    gc_prod_des TYPE lvc_fname VALUE 'P_DES',

    gc_loctn TYPE lvc_fname VALUE 'LOC',

    gc_loc_des TYPE lvc_fname VALUE 'L_DES',

    gc_tabname TYPE lvc_tname VALUE 'LT_DISPLAY',

    gc_left TYPE lvc_just VALUE 'L',

    gc_center TYPE lvc_just VALUE 'C',

    gc_len_prod TYPE lvc_outlen VALUE '18',

    gc_len_p_des TYPE lvc_outlen VALUE '40',

    gc_len_loc TYPE lvc_outlen VALUE '20',

    gc_len_l_des TYPE lvc_outlen VALUE '30',

    gc_len_stat TYPE lvc_outlen VALUE '20',

    gc_len_lt TYPE lvc_outlen VALUE '5',

    gc_set_pf TYPE slis_formname VALUE 'F_SET_PF',

    gc_show_log TYPE slis_formname VALUE 'F_SHOW_LOG',

    gc_lt_top TYPE slis_formname VALUE 'F_TOP_TL',

    gc_tlupd_top TYPE slis_formname VALUE 'F_TOP_TLUPD',

    gc_prd_top TYPE slis_formname VALUE 'F_TOP_PRD',

    gc_td_log TYPE gui_code VALUE 'TD_LOG',

    gc_tlane TYPE gui_code VALUE 'TLANE',

    gs_type_s TYPE char1 VALUE 'S',

    gs_type_h TYPE char1 VALUE 'H',

    gs_type_a TYPE char1 VALUE 'A',

    gc_save TYPE char1 VALUE 'A',

    gc_red TYPE iconname VALUE '@5C@',

    gc_green TYPE iconname VALUE '@5B@',

    ALV display for Tlane

    gc_prod_tl TYPE lvc_fname VALUE 'MATID',

    gc_locto TYPE lvc_fname VALUE 'LOCTO',

    gc_locfr TYPE lvc_fname VALUE 'LOCFR',

    gc_matnr TYPE lvc_fname VALUE 'MATNR',

    gc_msg TYPE lvc_fname VALUE 'MSG',

    gc_tl_tab TYPE lvc_tname VALUE 'GT_TLANE',

    gc_tl_tabu TYPE lvc_tname VALUE 'IT_TLANEUPD',

    Others

    gc_s TYPE ddbool_d VALUE 'S',

    gc_inactive TYPE zdstat1 VALUE 'I',

    gc_set TYPE char1 VALUE 'X',

    gc_set_val TYPE tvarv_val VALUE 'X',

    gc_int_commit TYPE bapi10001commctrl VALUE 'E',

    gc_bs_group TYPE /sapapo/logqs VALUE 'BSGAPO',

    gc_error TYPE bapi_mtype VALUE 'E',

    gc_abend TYPE bapi_mtype VALUE 'A',

    gc_dot TYPE char1 VALUE '.',

    gc_colon TYPE char1 VALUE ':',

    gc_space TYPE char4 VALUE ' ',

    gc_star TYPE char1 VALUE '*',

    *MOD-1771404

    gc_core TYPE char1 VALUE 'C',

    gc_var TYPE char1 VALUE 'V',

    Message class name

    gc_msgid TYPE symsgid VALUE 'ZAXXP_SIGN_FPV',

    Message types

    gc_warn TYPE symsgty VALUE 'W',

    gc_err TYPE symsgty VALUE 'E',

    gc_succ TYPE symsgty VALUE 'S',

    Message nos

    gc_msgno_021 TYPE symsgno VALUE '021',

    gc_msgno_023 TYPE symsgno VALUE '023',

    gc_msgno_024 TYPE symsgno VALUE '024',

    gc_msgno_025 TYPE symsgno VALUE '025',

    gc_msgno_026 TYPE symsgno VALUE '026',

    gc_msgno_027 TYPE symsgno VALUE '027',

    gc_msgno_028 TYPE symsgno VALUE '028',

    gc_msgno_029 TYPE symsgno VALUE '029',

    gc_msgno_030 TYPE symsgno VALUE '030',

    gc_msgno_031 TYPE symsgno VALUE '031',

    gc_msgno_032 TYPE symsgno VALUE '032',

    gc_msgno_033 TYPE symsgno VALUE '033',

    gc_msgno_034 TYPE symsgno VALUE '034',

    gc_msgno_035 TYPE symsgno VALUE '035',

    gc_msgno_037 TYPE symsgno VALUE '037',

    gc_msgno_038 TYPE symsgno VALUE '038',

    gc_msgno_039 TYPE symsgno VALUE '039',

    gc_msgno_040 TYPE symsgno VALUE '040',

    gc_msgno_041 TYPE symsgno VALUE '041',

    gc_msgno_042 TYPE symsgno VALUE '042',

    gc_msgno_043 TYPE symsgno VALUE '043',

    gc_msgno_044 TYPE symsgno VALUE '044',

    gc_msgno_050 TYPE symsgno VALUE '050',

    gc_msgno_051 TYPE symsgno VALUE '051',

    gc_msgno_052 TYPE symsgno VALUE '052',

    gc_msgno_053 TYPE symsgno VALUE '053',

    gc_msgno_054 TYPE symsgno VALUE '054',

    gc_msgno_055 TYPE symsgno VALUE '055',

    gc_msgno_061 TYPE symsgno VALUE '061',

    gc_msgno_075 TYPE symsgno VALUE '075',

    gc_msgno_076 TYPE symsgno VALUE '076',

    gc_msgno_078 TYPE symsgno VALUE '078',

    gc_msgno_087 TYPE symsgno VALUE '087',

    gc_msgno_096 TYPE symsgno VALUE '096',

    gc_msgno_98 TYPE symsgno VALUE '098',

    gc_msgno_100 TYPE symsgno VALUE '100',

    Location types

    gc_ltp_1001 TYPE /sapapo/c_loctype VALUE '1001', "For Prd centre

    gc_ltp_1002 TYPE /sapapo/c_loctype VALUE '1002', "For Mkt/whouse

    Procurement types

    gc_ptp_x TYPE /sapapo/beskz VALUE 'X', "For Prd centre

    gc_ptp_f TYPE /sapapo/beskz VALUE 'F', "For Mkt/whouse

    Variant status

    gc_stat_p TYPE zdstat1 VALUE 'P',

    gc_stat_a TYPE zdstat1 VALUE 'A',

    Timestamps

    gc_startti TYPE syuzeit VALUE '000000',

    gc_endti TYPE syuzeit VALUE '235959',

    Default means of transport

    gc_ttype_0001 TYPE /sapapo/tr_traty VALUE '0001',

    Business system grp

    gc_bsgapo TYPE /sapapo/loc_logqs VALUE 'BSGAPO',

    gc_utc TYPE timezone VALUE 'UTC'. "UTC time zome

    *MOD-1771404

    ************************************************************************

    ************************DATA DECLARATION******************************

    ************************************************************************

    DATA: gv_flgstart type flag,

    gv_prd TYPE matnr,

    gv_mkt TYPE /sapapo/locno,

    gv_date_before TYPE sy-datum,

    gv_time_before TYPE sy-uzeit,

    gv_flg_error TYPE char1,

    gv_msg_error TYPE char1. " Flag for Call Tr fail

    Internal table declarations

    DATA: gt_f4_data_matnr TYPE STANDARD TABLE OF s_f4_data_matnr,

    gt_f4_data_loc TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_matloc TYPE t_matloc,

    gt_prod_data TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_product TYPE STANDARD TABLE OF bapi10001key,

    *MOD-1771404

    gt_new_product TYPE STANDARD TABLE of s_product,

    gt_location TYPE STANDARD TABLE OF s_location,

    gt_new_tlane TYPE STANDARD TABLE OF s_tlane,

    *MOD-1771404

    gt_core_prod TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_prod_var TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_loc_data TYPE STANDARD TABLE OF s_f4_data_loc,

    gt_tlane TYPE STANDARD TABLE OF s_tlane_data,

    gt_matid_all TYPE STANDARD TABLE OF s_matid,

    gt_view_data TYPE STANDARD TABLE OF s_view_data,

    gt_bdc_tab TYPE STANDARD TABLE OF bdcdata,

    gt_variant_table TYPE STANDARD TABLE OF rsparams,

    gt_fcat TYPE STANDARD TABLE OF slis_fieldcat_alv,

    gt_top_page TYPE slis_t_listheader,

    gt_masterdata TYPE t_masterdata,

    gt_tship type t_tship,

    gt_whse type t_whse,

    *MOD-1771404

    gt_log_location TYPE t_log_location,

    gt_log_product TYPE t_log_product,

    gt_log_locprd TYPE t_log_locprd,

    gt_log_tlane TYPE t_log_tlane.

    DATA:

    lt_tlane TYPE t_tlane,

    lt_tlane_new TYPE t_tlane,

    lt_tlane_dat TYPE t_tlane,

    lt_location TYPE t_location,

    lt_product TYPE t_product,

    lt_prd_extprd TYPE t_prd_extprd,

    lt_loc_extloc TYPE t_loc_extloc,

    lt_locprd TYPE t_locprd.

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    *MOD-1771404

    ************************************************************************

    *******************SELECTION SCREEN DEFINITION************************

    ************************************************************************

    Block to enter the product and location data

    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    Option to delete master data

    *************************************************************

    *MOD-001

    *************************************************************

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-033 FOR FIELD p_mdel.

    PARAMETERS: p_mdel RADIOBUTTON GROUP grp1 USER-COMMAND ucom

    DEFAULT 'X'.

    *

    PARAMETERS: p_mdel RADIOBUTTON GROUP grp1.

    *

    PARAMETERS p_mdel AS CHECKBOX DEFAULT 'X'.

    *

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN SKIP.

    selection-screen: begin of line,

    comment (79) text-043.

    selection-screen end of line.

    selection-screen: begin of line,

    comment (79) text-044.

    selection-screen end of line.

    SELECTION-SCREEN SKIP.

    **************************************************************

    *MOD-001

    *************************************************************

    PARAMETERS: p_log TYPE logsys OBLIGATORY MEMORY ID mid.

    SELECT-OPTIONS:

    s_prd FOR gv_prd OBLIGATORY, " Product variant

    s_mkt FOR gv_mkt OBLIGATORY. " Market

    SELECTION-SCREEN: SKIP.

    SELECTION-SCREEN: BEGIN OF LINE.

    SELECTION-SCREEN POSITION 33.

    PARAMETERS: p_test AS CHECKBOX DEFAULT 'X'. "#EC *

    No Selection Text Maintained as we are displaying comment for it

    SELECTION-SCREEN COMMENT 1(16) text-002 FOR FIELD p_test.

    SELECTION-SCREEN: END OF LINE.

    SELECTION-SCREEN PUSHBUTTON 5(10) text-042 USER-COMMAND wuf.

    *MOD-1771404

    Option to update transportation lanes

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-032 FOR FIELD p_tlan.

    PARAMETERS: p_tlan RADIOBUTTON GROUP grp1.

    SELECTION-SCREEN END OF LINE.

    Sourcing for tlane

    SELECTION-SCREEN SKIP.

    PARAMETERS: p_src TYPE /sapapo/locno OBLIGATORY,

    p_des TYPE /sapapo/locno OBLIGATORY,

    p_prd TYPE matnr OBLIGATORY.

    Radio button for validity date change

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-028 FOR FIELD p_tdat.

    PARAMETERS: p_tdat RADIOBUTTON GROUP grp USER-COMMAND ucom

    MODIF ID mod DEFAULT 'X'.

    SELECTION-SCREEN END OF LINE.

    Fields for dates

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 10(15) text-030 FOR FIELD p_frd.

    PARAMETERS p_frd TYPE sydatum.

    SELECTION-SCREEN: COMMENT 40(10) text-031 FOR FIELD p_tod.

    PARAMETERS p_tod TYPE sydatum.

    SELECTION-SCREEN: END OF LINE.

    Radio button for product removal

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN: BEGIN OF LINE,

    COMMENT 5(27) text-029 FOR FIELD p_tprd.

    PARAMETERS: p_tprd RADIOBUTTON GROUP grp.

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN: END OF BLOCK b1.

    *MOD-1771404

    include ZAXXPR_DEL_MASTER_DATA_TOP.

    ************************************************************************

    ************************INITIALIZATION********************************

    ************************************************************************

    INITIALIZATION.

    CLEAR gv_flgstart.

    Gets Product and location data for populatiing the search helps

    PERFORM f_get_f4_data CHANGING gt_f4_data_matnr

    gt_f4_data_loc

    gt_view_data.

    Adjusts screen fields

    PERFORM f_adj_screen_flds.

    ***********************************************************************

    ******************SELECTION SCREEN EVENTS****************************

    ***********************************************************************

    AT SELECTION-SCREEN ON s_prd.

    Validates product against the SIGN view

    PERFORM f_validate_product.

    AT SELECTION-SCREEN ON s_mkt.

    Validate market against the SIGN view

    PERFORM f_validate_market.

    Custom search help for Product-Low

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prd-low.

    PERFORM f_f4_for_prodcentre USING gc_prd_low

    gt_f4_data_matnr.

    Custom search help for Product-High

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prd-high.

    PERFORM f_f4_for_prodcentre USING gc_prd_high

    gt_f4_data_matnr.

    Custom search help for Location-Low

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mkt-low.

    PERFORM f_f4_for_market USING gc_mkt_low

    gt_f4_data_loc.

    Custom search help for Location-High

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mkt-high.

    PERFORM f_f4_for_market USING gc_mkt_high

    gt_f4_data_loc.

    Adjusting the screen fields

    AT SELECTION-SCREEN OUTPUT.

    CLEAR gv_flgstart.

    *mod-099

    PERFORM f_clear_tables.

    *mod-099

    PERFORM f_adj_screen_flds.

    AT SELECTION-SCREEN.

    IF sy-ucomm = 'WUF'.

    REFRESH gt_matloc.

    PERFORM f_check_product_status USING gt_f4_data_loc

    CHANGING gt_prod_data

    gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    MOD-1887120 *

    SORT gt_core_prod BY locno pcode.

    DELETE ADJACENT DUPLICATES FROM gt_core_prod

    COMPARING locno

    pcode.

    SORT gt_prod_var BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM gt_prod_var

    COMPARING locno

    pcode

    prvar.

    MOD-1887120 *

    Call the WUF transaction

    PERFORM launch_wuf USING gt_core_prod

    gt_prod_var.

    ENDIF.

    ************************************************************************

    ************************START OF SELECTION****************************

    ************************************************************************

    START-OF-SELECTION.

    gv_flgstart = 'X'.

    IF p_mdel IS NOT INITIAL.

    Filter all the Products selected for deletion with status inactive

    REFRESH gt_matloc.

    wait up to 5 seconds.

    PERFORM f_check_product_status USING gt_f4_data_loc

    CHANGING gt_prod_data

    gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    Set the Date and Time before deleting the Data.

    gv_date_before = sy-datum.

    gv_time_before = sy-uzeit.

    IF gt_core_prod IS INITIAL.

    MESSAGE i085.

    ENDIF.

    IF gt_prod_var IS INITIAL.

    MESSAGE i086.

    LEAVE LIST-PROCESSING.

    ENDIF.

    IF p_test IS INITIAL.

    Delete the Transactional data for the Product and Location Combination

    Using the call transaction /SAPAPO/BP2

    *MOD-1887120

    SORT gt_core_prod BY locno pcode.

    DELETE ADJACENT DUPLICATES FROM gt_core_prod

    COMPARING locno

    pcode.

    SORT gt_prod_var BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM gt_prod_var

    COMPARING locno

    pcode

    prvar.

    SORT gt_loc_data BY locno.

    DELETE ADJACENT DUPLICATES FROM gt_loc_data

    COMPARING locno.

    *MOD-1887120

    PERFORM f_delete_transactional_data USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_prod_data

    gt_bdc_tab.

    Delete the Transactional data created manually by submitting to the

    SAP standard program /SAPAPO/RLCDEL via selection screen variant.

    PERFORM f_delete_manual_created_data USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_variant_table.

    Delete the PPDS orders for selection screen Product and Location

    Done by submitting to SAP Standard program /SAPAPO/DELETE_PP_ORDER

    Via screen table.

    PERFORM f_delete_ppds_orders USING gt_core_prod

    gt_prod_var

    gt_loc_data

    CHANGING gt_variant_table.

    ENDIF.

    Delete Products from the Transportation Lanes for the Products and

    locations entered at the selection screen.

    PERFORM f_delete_product_from_tlane USING gt_core_prod

    gt_prod_var

    CHANGING gt_loc_data

    gt_matid_all

    gt_tlane.

    Run the Transportation Lane consistency check program

    PERFORM f_run_consistency_check.

    Set the Deletion flag for the Products selected for deletion.

    IF p_test IS INITIAL.

    PERFORM f_set_deletion_flag USING gt_core_prod

    gt_prod_var

    gt_loc_data

    gt_matloc.

    ENDIF.

    Display the ALV Report.

    PERFORM f_display_alv USING gt_prod_data

    gt_matloc

    CHANGING gt_fcat

    gt_matid_all.

    ENDIF.

    If the user chooses to update the transportation lane

    **MOD-1771404

    IF p_tlan IS NOT INITIAL.

    *MOD-1771404

    Retrieve the master data from teh SIGN portfolio meeting the user

    selection

    PERFORM f_retrieve_masterdata CHANGING gt_masterdata

    gt_tship

    gt_whse.

    Collect all possible transportation lanes

    PERFORM f_collect_tlanes USING gt_masterdata

    gt_tship

    gt_location

    gt_new_product

    CHANGING gt_new_tlane.

    IF gt_new_tlane IS INITIAL.

    EXIT.

    ENDIF.

    The Tlanes can be categorised into 3 categories:

    1 To be created fresh

    2 Exists, but new product need to be assigned

    3 Only validity dates need to be changed

    PERFORM f_categorise_tlanes USING gt_new_tlane

    CHANGING lt_tlane_new

    lt_tlane_dat.

    *MOD-1771404 changed by Aveek

    PERFORM f_update_tlane.

    *MOD-1771404 changed by Aveek

    PERFORM f_update_tlane using gt_new_tlane.

    *MOD-1771404

    ENDIF.

    Include for subroutine declaration

    include ZAXXPR_DELETE_MASTER_DATA_F02.

    *Text elements

    *----

    002 Test Delete

    028 Validity Date Change

    029 Product Removal

    030 From date

    031 To date

    032 Transportation Lane

    042 WUF

    *Selection texts

    *----

    P_DES Destination

    P_FRD From Date

    P_LOG Logical system

    P_MDEL Model

    P_PRD Production

    P_SRC Source

    P_TDAT To Date

    P_TEST Test

    P_TLAN Transportation Lane

    P_TOD To Date

    P_TPRD Product Removal

    S_MKT Market

    S_PRD Product

    ----

    *Messages

    ----

    *Message class: ZAXXP_SIGN_FPV

    *005 no sourcing info is maintained in the sign portfolio

    *016 Product does not exist in APO

    *017 Location does not exist in APO

    *056 Both Product and Location can not be multiple

    *059 Product value as * not allowed at the selection screen

    *060 Product value as * not allowed at the selection screen

    *085 Core Product is Initial.

    *086 Product Variant is Initial

    **************************************************************

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F02

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F02

    ----

    ----

    * Include ZAXXPR_DELETE_MASTER_DATA_F01

    ----

    ************************************************************************

    PROGRAM--INITIAL CREATION

    *

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA...

    ************************************************************************

    ************************************************************************

    PROGRAM--Modification MOD-1771404

    ************************************************************************

    *

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 15.02.2006

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose..

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ************************************************************************

    MOD-1887120

    Program name : ZAXXPR_DELETE_MASTER_DATA_F01

    Reference program (copied from) : na.

    Development specification ID :

    Date created : 10.03.2006

    Initial Change request number : PMI_SIGN_2

    Author : Aveek Ghose

    Description :

    *

    This is the Form include that contains the local subroutines of the

    main program ZAXXPR_DELETE_MASTER_DATA

    ************************************************************************

    ----

    * Form f_validate_product

    ----

    Validates the product

    ----

    FORM f_validate_product.

    Local Date Declaration

    DATA: lv_prd TYPE matnr,

    lv_matnr TYPE /sapapo/matnr.

    Field symbols:

    FIELD-SYMBOLS:

    lfs_prd TYPE s_range_product.

    IF p_mdel IS INITIAL.

    EXIT.

    ENDIF.

    Both Product and Location can not be a range at the selection screen

    IF s_prd-low IS NOT INITIAL AND

    s_prd-high IS NOT INITIAL AND

    s_mkt-low IS NOT INITIAL AND

    s_mkt-high IS NOT INITIAL.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    Check if both Product and location dont have multiple entries

    READ TABLE s_prd INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    READ TABLE s_mkt INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    ENDIF.

    Check if user has entered * in the select option for location.

    READ TABLE s_prd ASSIGNING lfs_prd WITH KEY low = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e059.

    ELSE.

    READ TABLE s_prd ASSIGNING lfs_prd WITH KEY high = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e059.

    ENDIF.

    ENDIF.

    SELECT pcode UP TO 1 ROWS

    INTO lv_prd

    FROM zap_sign

    WHERE pcode IN s_prd.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_prd IS INITIAL.

    Product does not exist in APO

    MESSAGE e016.

    ENDIF.

    ENDFORM. " f_validate_product

    ----

    * Form f_validate_market

    ----

    Validates the market

    ----

    FORM f_validate_market .

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    Field Symbols:

    FIELD-SYMBOLS:

    lfs_mkt TYPE s_range_location.

    IF p_mdel IS INITIAL.

    EXIT.

    ENDIF.

    Both Product and Location can not be multiple at the selection screen

    IF s_prd-low IS NOT INITIAL AND

    s_prd-high IS NOT INITIAL AND

    s_mkt-low IS NOT INITIAL AND

    s_mkt-high IS NOT INITIAL.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    Check if both Product and location dont have multiple entries

    READ TABLE s_prd INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    READ TABLE s_mkt INDEX 2 TRANSPORTING NO FIELDS.

    IF sy-subrc = 0.

    Error Message: Both Product and Location can not be multiple

    MESSAGE e056.

    ENDIF.

    ENDIF.

    Check if user has entered * in the select option for location.

    READ TABLE s_mkt ASSIGNING lfs_mkt WITH KEY low = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e060.

    ELSE.

    READ TABLE s_mkt ASSIGNING lfs_mkt WITH KEY high = gc_star.

    IF sy-subrc = 0.

    Product value as * not allowed at the selection screen

    MESSAGE e060.

    ENDIF.

    ENDIF.

    Check if the Location is a market

    SELECT markt UP TO 1 ROWS

    INTO lv_mkt

    FROM zap_sign

    WHERE markt IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Production center

    SELECT pdctr UP TO 1 ROWS

    INTO lv_pdctr

    FROM zap_sign

    WHERE pdctr IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_pdctr IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 1

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse2 IN s_mkt.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS NOT INITIAL.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    ENDFORM. " f_validate_market

    ----

    * Form F_GET_F4_DATA

    ----

    Get all the data required for custom F4 helps

    ----

    --ct_f4_data_matnr Itab with products

    --ct_f4_data_loc Itab with F4 data for location

    --ct_view_data Itab wiht data selected from view table

    ----

    FORM f_get_f4_data CHANGING ct_f4_data_matnr TYPE t_f4_data_matnr

    ct_f4_data_loc TYPE t_f4_data_loc

    ct_view_data TYPE t_view_data.

    Local Data Declaration

    DATA: ls_f4_data_matnr TYPE s_f4_data_matnr,

    ls_f4_data_loc TYPE s_f4_data_loc,

    lts_warehouse TYPE SORTED TABLE OF s_whse

    WITH NON-UNIQUE KEY whse,

    lt_whse TYPE STANDARD TABLE OF s_whse,

    ls_whse TYPE s_whse.

    Local Field-symbols

    FIELD-SYMBOLS: lfs_view TYPE s_view_data,

    lfs_whse TYPE s_whse.

    IF ( ct_f4_data_matnr IS INITIAL AND

    ct_f4_data_loc IS INITIAL ).

    SELECT pcode "Material Number

    maktx "Product Desc

    markt "Market

    pdctr "Production center

    pctxt "Prod center desc

    whse1 "Warehouse 1

    whse2 "Warehouse 2

    prvar "Prod Variant

    vartx "Variant Description

    INTO TABLE ct_view_data

    FROM ZAP_SIGN.

    IF sy-subrc 0.

    no sourcing info is maintained in the sign portfolio

    MESSAGE i005.

    LEAVE LIST-PROCESSING.

    ENDIF.

    LOOP AT ct_view_data ASSIGNING lfs_view.

    ls_whse-whse = lfs_view-whse1.

    APPEND ls_whse TO lt_whse.

    ls_whse-whse = lfs_view-whse2.

    APPEND ls_whse TO lt_whse.

    ENDLOOP.

    SORT lt_whse BY whse.

    DELETE ADJACENT DUPLICATES FROM lt_whse COMPARING whse.

    IF NOT lt_whse IS INITIAL.

    Get the Warehouse Descriptions

    SELECT whse "Warehouse Name

    whdesc "Warehouse Description

    FROM zap_whse

    INTO TABLE lts_warehouse

    FOR ALL ENTRIES IN lt_whse

    WHERE whse = lt_whse-whse.

    ENDIF.

    Populate the Internal Table with Product,Product Variant

    and Location. The location can be the Market,Production center,

    Warehouse 1,Warehouse 2. All the four locations will be clubbed

    under the field Location in the internal table

    LOOP AT ct_view_data ASSIGNING lfs_view.

    ls_f4_data_matnr-pcode = lfs_view-pcode.

    ls_f4_data_matnr-maktx = lfs_view-maktx.

    APPEND ls_f4_data_matnr TO ct_f4_data_matnr.

    CLEAR ls_f4_data_matnr.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_view-martx.

    ls_f4_data_loc-locno = lfs_view-markt.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_view-pctxt.

    ls_f4_data_loc-locno = lfs_view-pdctr.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    Read the description for Warehouse 1

    READ TABLE lts_warehouse ASSIGNING lfs_whse WITH KEY

    whse = lfs_view-whse1.

    IF sy-subrc = 0.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_whse-whdesc.

    ls_f4_data_loc-locno = lfs_view-whse1.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ENDIF.

    Read the description for Warehouse 2

    READ TABLE lts_warehouse ASSIGNING lfs_whse WITH KEY

    whse = lfs_view-whse2.

    IF sy-subrc = 0.

    ls_f4_data_loc-pcode = lfs_view-pcode.

    ls_f4_data_loc-desc = lfs_whse-whdesc.

    ls_f4_data_loc-locno = lfs_view-whse2.

    ls_f4_data_loc-prvar = lfs_view-prvar.

    ls_f4_data_loc-pdctr = lfs_view-pdctr.

    ls_f4_data_loc-vartx = lfs_view-vartx.

    ls_f4_data_loc-maktx = lfs_view-maktx.

    ls_f4_data_loc-status = lfs_view-status.

    APPEND ls_f4_data_loc TO ct_f4_data_loc.

    CLEAR ls_f4_data_loc.

    ENDIF.

    ENDLOOP.

    SORT ct_f4_data_matnr BY pcode.

    DELETE ADJACENT DUPLICATES FROM ct_f4_data_matnr COMPARING pcode.

    ENDIF.

    ENDFORM. " F_GET_F4_DATA

    ----

    * Form f_f4_for_prodcentre

    ----

    Display F4 Help for Product

    ----

    --IV_PRD Field Name for Product

    --IT_F4_DATA Itab with F4 data

    ----

    FORM f_f4_for_prodcentre USING iv_prd TYPE dynfnam

    it_f4_data_matnr TYPE t_f4_data_matnr.

    Local Constants Declaration

    CONSTANTS: lc_pcode TYPE fieldname VALUE 'PCODE'.

    PERFORM f_launch_f4_window USING lc_pcode

    iv_prd

    text-016

    it_f4_data_matnr.

    ENDFORM. " f4_for_prodcentre

    ----

    * Form f_f4_for_market

    ----

    Display F4 Help for locations

    ----

    --IV_LOC Field Name for Location

    --IT_F4_DATA Itab with the F4 Data

    ----

    FORM f_f4_for_market USING iv_loc TYPE dynfnam

    it_f4_data_loc TYPE t_f4_data_loc.

    Local Data Declaratino

    DATA: lt_loc_for_f4 TYPE STANDARD TABLE OF s_f4_loc.

    Local Constants Declaration

    CONSTANTS:

    lc_pdctr TYPE fieldname VALUE 'LOCNO'.

    lt_loc_for_f4 = it_f4_data_loc .

    SORT lt_loc_for_f4 BY locno.

    DELETE ADJACENT DUPLICATES FROM lt_loc_for_f4 COMPARING locno.

    DELETE lt_loc_for_f4 WHERE locno IS INITIAL.

    PERFORM f_launch_f4_window USING lc_pdctr

    iv_loc

    text-017

    lt_loc_for_f4.

    ENDFORM. " f_f4_for_market

    ----

    * Form f_launch_f4_window

    ----

    Displays the Custom F4 Help for the field name passed

    ----

    --IV_RETFLD Return field

    --IV_DYNFLD Screen field

    --IV_WINTITLE Window title

    --IT_VALUETAB Value table

    ----

    FORM f_launch_f4_window USING iv_retfld TYPE fieldname

    iv_dynfld TYPE dynfnam

    iv_wintitle TYPE c

    it_valuetab TYPE STANDARD TABLE.

    DATA:

    lv_dynprog TYPE syrepid,

    lv_dynpnr TYPE sydynnr.

    lv_dynprog = sy-repid.

    lv_dynpnr = sy-dynnr.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = iv_retfld

    dynpprog = lv_dynprog

    dynpnr = lv_dynpnr

    dynprofield = iv_dynfld

    window_title = iv_wintitle

    value_org = gc_s

    TABLES

    value_tab = it_valuetab

    EXCEPTIONS

    parameter_error = 1

    no_values_found = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error while displaying search help

    MESSAGE i058.

    EXIT.

    ENDIF.

    ENDFORM. " f_launch_f4_window

    ----

    * Form f_check_product_status

    ----

    Get all the Products with status Inactive selected for deletion

    ----

    --IT_F4_LOC_DATA Itab wiht the products to be deleted

    --CT_PROD_DATA Itab with the Product and Locs to be deleted

    --CT_CORE_PROD Itab with the core products to be deleted

    --CT_PROD_VAR Itab with the product varients to be deleted

    --CT_LOC_DATA Itab with the locations to be deleted

    ----

    FORM f_check_product_status USING it_f4_data_loc TYPE t_f4_data_loc

    CHANGING ct_prod_data TYPE t_f4_data_loc

    ct_core_prod TYPE t_f4_data_loc

    ct_prod_var TYPE t_f4_data_loc

    ct_loc_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc.

    *MOD-1771404

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    DATA: ls_sign type zap_sign.

    DATA: LV_PDCTR1 TYPE ZDPDCTR,

    LV_LTEXT1 TYPE ZDPDCLT.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid,

    lv_ware_desc type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    DATA:

    lv_matnr TYPE /sapapo/matnr,

    lt_matloc TYPE STANDARD TABLE OF /sapapo/v_matloc,

    lv_prod_data TYPE s_f4_data_loc,

    LV_TABIX TYPE SY-TABIX,

    lv_line type i,

    lv_count type i,

    lv_count1 type i.

    *MOD-011

    RANGES: LV_MKT1 FOR S_MKT.

    DATA: int TYPE i,

    rspar TYPE TABLE OF rsparams,

    wa_rspar LIKE LINE OF rspar,

    lv_indicator type i.

    DATA: lv_indicator1 type i value 0.

    DATA: L_WA_PROD TYPE s_f4_data_loc.

    DATA: IT_ITAB_PROD TYPE standard table of s_f4_data_loc.

    *MOD-011

    FIELD-SYMBOLS:

    lfs_core_prod TYPE s_f4_data_loc,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_tsign TYPE zap_sign.

    lfs_zdm0705 TYPE ZDM0705.

    FIELD-SYMBOLS:

    lfs_view TYPE s_view_data,

    *MOD-1771404

    lfs_loc_data TYPE s_f4_data_loc.

    *MOD-1771404

    ct_prod_data = it_f4_data_loc.

    ***MOD-1771404

    Check if the Location is a market

    SELECT *

    into table t_sign

    FROM zap_sign

    WHERE pcode in s_prd AND

    ( markt in s_mkt or

    pdctr in s_mkt OR

    whse1 in s_mkt or

    whse2 in s_mkt ).

    IF sy-subrc 0.

    MESSAGE I004 with s_prd.

    LEAVE LIST-PROCESSING.

    ENDIF.

    DELETE t_sign WHERE status gc_inactive.

    *MOD-1771404

    DELETE: ct_prod_data WHERE status gc_inactive,

    ct_prod_data WHERE NOT ( pcode IN s_prd ).

    **MOD-1771404: This was commneted out for WHH.

    ct_prod_data WHERE NOT ( locno IN s_mkt ).

    **MOD-1771404: This was commneted out for WHH.

    ***MOD-1771404: This was commneted out for WHH.

    IF not ct_prod_data[] IS INITIAL.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = lfs_prod_data-locno BINARY SEARCH.*

    whse2 = s_mkt-low BINARY SEARCH.

    whse1 = lfs_prod_data-locno BINARY SEARCH.

    IF sy-subrc 0.

    *MOD-1771404

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse1 = lfs_prod_data-locno BINARY SEARCH.

    whse1 = s_mkt-low BINARY SEARCH.

    IF sy-subrc 0.

    *MOD-1771404

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = s_mkt-low binary search.

    *MOD-1887120

    markt = lfs_prod_data-locno binary search.

    *

    *MOD-1887120

    IF sy-subrc 0.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    pdctr = s_mkt-low BINARY SEARCH.

    pdctr IN s_mkt BINARY SEARCH.

    pdctr = lfs_prod_data-locno BINARY SEARCH.

    IF sy-subrc = 0.

    IF s_mkt-low = lfs_prod_data-locno and

    s_mkt-low = lfs_tsign-pdctr.

    lfs_prod_data-lv_exist = 0.

    Continue.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    IF s_mkt-low = lfs_prod_data-locno.

    lfs_prod_data-lv_exist = 0.

    Continue.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    ELSE.

    lfs_prod_data-lv_exist = 1.

    continue.

    ENDIF.

    ELSE.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = lfs_prod_data-locno BINARY SEARCH.

    markt = s_mkt-low BINARY SEARCH.

    pdctr = lfs_prod_data-locno BINARY SEARCH.

    IF SY-SUBRC = 0.

    lfs_prod_data-lv_exist = 0.

    CONTINUE.

    ELSE.

    lfs_prod_data-lv_exist = 1.

    Continue.

    ENDIF.

    ENDIF.

    ELSE.

    lfs_prod_data-lv_exist = 0.

    lfs_prod_data-whse1 = lfs_tsign-whse1.

    EXIT.

    ENDIF.

    ELSE.

    lfs_prod_data-lv_exist = 0.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_tsign-whse1.

    lfs_prod_data-whse2 = lfs_tsign-whse2.

    *MOD-1771404

    EXIT.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    ENDIF.

    *MOD-1887120

    DELETE: ct_prod_data WHERE lv_exist eq 1.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    WHSE1

    WHSE2.

    *

    *MOD-1887120

    *MOD-1887120

    To Handle Multiple production centres

    IF not ct_prod_data[] IS INITIAL.

    SELECT *

    into table t_sign

    FROM zap_sign

    WHERE pcode in s_prd AND

    pdctr in s_mkt.

    IF sy-subrc 0.

    MESSAGE I004 with s_prd.

    ELSE.

    DELETE t_sign WHERE status gc_inactive.

    LV_TABIX = 0.

    IF not T_SIGN IS INITIAL.

    LOOP AT t_sign assigning lfs_tsign.

    LV_TABIX = LV_TABIX + 1.

    LOOP AT S_MKT.

    Get the Warehouse Descriptions

    SELECT pdctr ltext up to 1 rows

    INTO (LV_PDCTR1, LV_LTEXT1)

    FROM ZDU1000

    WHERE PDCTR = S_MKT-LOW.

    ENDSELECT.

    *MOD-1887120

    if sy-subrc = 0.

    *MOD-1887120

    l_wa_prod-locno = lfs_tsign-pdctr.

    l_wa_prod-desc = lv_ltext1.

    l_wa_prod-pcode = lfs_tsign-pcode.

    l_wa_prod-prvar = lfs_tsign-prvar.

    l_wa_prod-vartx = lfs_tsign-vartx.

    l_wa_prod-pdctr = s_mkt-low.

    l_wa_prod-maktx = lfs_tsign-maktx.

    l_wa_prod-whse1 = lfs_tsign-whse1.

    l_wa_prod-whse2 = lfs_tsign-whse2.

    l_wa_prod-status = lfs_tsign-status.

    l_wa_prod-loctyp = lfs_tsign-loctyp.

    APPEND l_wa_prod TO it_itab_prod.

    APPEND LINES OF it_itab_prod TO ct_prod_data.

    *MOD-1887120

    endif.

    *MOD-1887120

    ENDLOOP.

    ENDLOOP.

    ENDIF.

    ENDIF.

    ENDIF.

    *MOD-099

    DELETE: ct_prod_data WHERE lv_exist eq 1.

    *MOD-099

    SORT CT_PROD_DATA BY LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    *MOD-1887120

    IF ct_prod_data IS INITIAL.

    No Inactive products are present in the view table.

    MESSAGE i063.

    LEAVE LIST-PROCESSING.

    ENDIF.

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    locno = ct_prod_data-locno.

    *MOD-1887120

    LOCNO IN S_MKT.

    *MOD-1887120

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    Delete the entries that are not in data base.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    IF sy-subrc 0.

    CLEAR lfs_prod_data-prvar.

    ENDIF.

    ENDLOOP.

    DELETE ct_prod_data WHERE prvar IS INITIAL.

    ct_core_prod = ct_prod_data.

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    SORT ct_core_prod BY pcode.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM ct_core_prod COMPARING pcode.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM CT_CORE_PROD COMPARING

    locno

    pcode

    prvar

    whse1

    whse2.

    SORT CT_PROD_DATA BY LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    DELETE ADJACENT DUPLICATES FROM CT_PROD_DATA COMPARING

    LOCNO

    PCODE

    PRVAR

    PDCTR

    STATUS

    WHSE1

    WHSE2.

    *MOD-1887120

    *MOD-1887120

    DELETE ct_core_prod WHERE pcode IS INITIAL.

    LOOP AT ct_core_prod ASSIGNING lfs_core_prod.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_core_prod-pcode AND

    status 'I'.

    CLEAR lfs_core_prod-pcode.

    EXIT.

    ENDLOOP.

    ENDLOOP.

    DELETE ct_core_prod WHERE pcode IS INITIAL.

    **MOD-1887120

    LV_TABIX = 0.

    IF not S_MKT IS INITIAL.

    LOOP AT S_MKT.

    LV_TABIX = LV_TABIX + 1.

    IF LV_TABIX 1.

    delete: ct_core_prod WHERE NOT ( locno IN s_mkt ).

    ENDIF.

    ENDLOOP.

    ENDIF.

    **MOD-1887120

    *MOD-1771404

    SORT ct_prod_var BY prvar.

    DELETE ADJACENT DUPLICATES FROM ct_prod_var COMPARING prvar.

    *MOD-1771404

    LOOP AT ct_prod_var ASSIGNING lfs_core_prod.

    SELECT SINGLE matnr INTO lv_matnr

    FROM /sapapo/matkey

    WHERE matnr = lfs_core_prod-prvar.

    IF sy-subrc 0.

    CLEAR lfs_core_prod-prvar.

    ENDIF.

    ENDLOOP.

    DELETE ct_prod_var WHERE prvar IS INITIAL.

    *MOD-1771404

    SORT ct_loc_data BY locno.

    DELETE ADJACENT DUPLICATES FROM ct_loc_data COMPARING locno.

    *MOD-1771404

    SORT ct_loc_data BY locno pcode prvar.

    DELETE ADJACENT DUPLICATES FROM ct_loc_data COMPARING locno

    pcode

    prvar.

    *MOD-1771404

    DELETE ct_loc_data WHERE locno IS INITIAL.

    *MOD-1771404

    *MOD-1887120 for multiple locations

    LV_INDICATOR = 0.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE CT_MATLOC TRANSPORTING NO FIELDS

    WITH KEY MATNR = lfs_core_prod-PCODE

    locno = lfs_core_prod-locno binary search.

    if sy-subrc 0.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 = lfs_prod_data-locno or

    whse2 = lfs_prod_data-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    PERFORM GET_DESC_LOC USING lfs_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    lv_indicator = 1.

    endif.

    else.

    lfs_prod_data-LV_EXIST = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    *MOD-1887120

    **MOD-1887120 for multiple locations

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE pdctr = lfs_prod_data-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    lv_indicator = 1.

    else.

    lfs_prod_data-LV_EXIST = 1.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    **MOD-1887120 for multiple locations

    LOOP AT ct_core_prod ASSIGNING lfs_core_prod.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE pdctr = lfs_core_prod-locno and

    pcode in s_prd.

    ENDSELECT.

    IF SY-SUBRC = 0.

    lv_indicator = 1.

    else.

    lfs_core_prod-LV_EXIST = 1.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    *MOD-1771404: 1 warehouse case

    IF LV_INDICATOR NE 1.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    LOOP AT S_MKT.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse1 = s_mkt-low BINARY SEARCH.

    **MOD-1887120

    whse1 = lv_whse1.

    **MOD-1887120

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1887120

    lfs_prod_data-whse1 = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    *MOD-1887120

    PERFORM GET_DESC_LOC USING lv_prod_data

    PERFORM GET_DESC_LOC USING lfs_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    ENDLOOP.

    *MOD-1887120

    ENDIF.

    *MOD-1887120

    **MOD-1887120 Multiple Location Case.

    clear: lv_whse1.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zm_zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    LOOP AT S_MKT.

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    markt = s_mkt-low BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    PERFORM GET_DESC_LOC USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    ENDLOOP.

    ENDLOOP.

    **MOD-1887120

    REFRESH: ct_loc_data, ct_prod_var.

    CLEAR: ct_loc_data, ct_prod_var.

    ct_loc_data = ct_prod_data.

    ct_prod_var = ct_prod_data.

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    *MOD-1887120

    locno IN S_MKT.

    locno = ct_prod_data-locno.

    *MOD-1887120

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    *MOD-1771404

    *MOD-1771404: 2 warehouse case.

    *MOD-1771404

    Check if the Location is a Warehouse 1

    *MOD-1887120

    IF LV_INDICATOR NE 1.

    *MOD-1887120

    CLEAR: LV_WHSE1, LV_WHSE2.

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    EXIT.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS INITIAL.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    **MOD-011

    LOOP AT S_MKT.

    **MOD-011

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = lv_whse2 BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    ENDIF.

    **MOD-011

    ENDLOOP.

    **MOD-011

    ENDLOOP.

    **MOD-1771404

    *MOD-1887120

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    WHSE2 = lv_whse2 binary search.

    whse2 = S_MKT-LOW BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    lfs_prod_data-whse1 = lv_whse1.

    ENDIF.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = s_mkt-low BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_prod_data-whse1.

    lfs_prod_data-whse2 = s_mkt-low.

    *MOD-1771404

    PERFORM GET_DESC_WHSE2 USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE t_sign ASSIGNING lfs_tsign

    WITH KEY pcode = lfs_prod_data-pcode

    prvar = lfs_prod_data-prvar

    whse2 = s_mkt-low BINARY SEARCH.

    whse2 = lv_whse2 BINARY SEARCH.

    if sy-subrc = 0.

    lfs_prod_data-locno = s_mkt-low.

    *MOD-1771404

    lfs_prod_data-whse1 = lfs_prod_data-whse1.

    lfs_prod_data-whse2 = s_mkt-low.

    lfs_prod_data-whse2 = lv_whse2.

    *MOD-1887120

    *MOD-1771404

    PERFORM GET_DESC_WHSE2 USING lv_prod_data

    changing lv_ware_desc.

    if sy-subrc = 0.

    lfs_prod_data-desc = lv_ware_desc.

    endif.

    endif.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ENDLOOP.

    *MOD-1887120

    ELSE.

    DELETE: ct_prod_data WHERE NOT ( locno IN s_mkt ).

    ENDIF.

    *MOD-1887120

    REFRESH: ct_loc_data, ct_prod_var.

    CLEAR: ct_loc_data, ct_prod_var.

    ct_loc_data = ct_prod_data.

    ct_prod_var = ct_prod_data.

    *MOD-1887120

    **MOD-1887120

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    lfs_prod_data-lv_exist = 0.

    ENDLOOP.

    FIELD-SYMBOLs:lfs_matloc TYPE s_matloc.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    ENDLOOP.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    REFRESH: ct_loc_data, ct_prod_var, ct_core_prod.

    CLEAR: ct_loc_data, ct_prod_var, ct_core_prod.

    ct_core_prod = ct_prod_data.

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    *MOD-1887120

    **MOD-1887120 Changes made after release of transport on 28.03

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    REFRESH: it_zdm0705.

    REFRESH: it_zdu1002.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    SELECT * APPENDING TABLE it_zdm0705

    FROM zdm0705

    WHERE parpr = lfs_prod_data-pcode.

    ENDLOOP.

    SELECT * into table it_zdu1002

    FROM zdu1002

    FOR ALL ENTRIES IN it_zdm0705

    WHERE prvar = it_zdm0705-prvar.

    SORT it_zdu1002 BY MARKT prvar.

    DATA: lv_product type ZDPRVAR.

    clear: l_wa_zdu1002.

    clear: l_wa_zdm0705.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT IT_ZDM0705 INTO L_WA_ZDM0705.

    READ TABLE IT_ZDU1002 INTO L_WA_ZDU1002

    WITH KEY PRVAR = L_WA_ZDM0705-PRVAR BINARY SEARCH.

    IF SY-SUBRC = 0.

    lv_count = lv_count + 1.

    IF L_WA_ZDU1002-STATUS NE 'I'.

    lv_indicator1 = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    **MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = l_wa_zdu1002-prvar binary search.

    where dmoap NE 'Z'.

    IF L_WA_ZDU1002-PRVAR NE L_WA_ZDM0705-PRVAR.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    *

    else.

    l_wa_zdm0705-dmoap = 'Z'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    exit.

    ENDLOOP.

    endif.

    **MOD-1887120 Changes made after release of transport on 28.03

    **MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    READ TABLE IT_ZDM0705 ASSIGNING LFS_ZDM0705

    WITH KEY PRVAR = L_WA_ZDU1002-PRVAR BINARY SEARCH.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    IF SY-SUBRC = 0.

    lfs_zdm0705-dmoap = 'X'.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    endif.

    *MOD-1887120 Changes made after release of transport on 28.03

    LOOP AT it_zdu1002 into l_wa_zdu1002.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = l_wa_zdu1002-prvar binary search.

    if sy-subrc ne 0.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    endif.

    ENDLOOP.

    *mod-099

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode binary

    *search.

    if sy-subrc ne 0.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = lfs_prod_data-prvar binary search.

    if sy-subrc ne 0.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    endif.

    endif.

    ENDLOOP.

    **mod-099

    *MOD-1887120 Changes made after release of transport on 28.03

    if lv_indicator1 = 1.

    LOOP AT ct_prod_data ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode

    dmoap = 'X'.

    IF SY-SUBRC = 0.

    delete ct_core_prod where pcode = lfs_prod_data-pcode.

    Indicates that the core product should not be included in

    transportation lane and /sapapo/bp2 transaction.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE CT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    endif.

    ENDLOOP.

    endif.

    DELETE CT_PROD_DATA WHERE LV_EXIST = 1.

    *mod-099 changed on 04042006

    *MOD-099 changed on 04042006

    REFRESH: ct_loc_data, ct_prod_var. " ct_core_prod.

    CLEAR: ct_loc_data, ct_prod_var. " ct_core_prod.

    *MOD-1887120

    ct_core_prod = ct_prod_data.

    *MOD-1887120

    ct_prod_var = ct_prod_data.

    ct_loc_data = ct_prod_data.

    lv_indicator1 = 0.

    *MOD-1887120 Changes made after release of transport on 28.03

    *MOD-1771404

    SELECT matnr locno INTO TABLE ct_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN ct_prod_data

    WHERE ( matnr = ct_prod_data-pcode OR

    matnr = ct_prod_data-prvar ) AND

    **

    locno = ct_prod_data-locno.

    **

    IF sy-subrc 0.

    MESSAGE i066.

    IF gv_flgstart IS NOT INITIAL.

    LEAVE LIST-PROCESSING.

    ELSE.

    LEAVE TO SCREEN 1000.

    ENDIF.

    ENDIF.

    *MOD-1771404

    ENDFORM. " f_check_product_status

    ----

    * Form f_delete_transactional_data

    ----

    Delete the transactional data for the Product and Location

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_PROD_DATA Itab wiht Product and Locations selected

    --CT_BDC_DATA BDC TABLE

    ----

    FORM f_delete_transactional_data USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_prod_data TYPE t_f4_data_loc

    ct_bdc_data TYPE STANDARD TABLE.

    "#EC *

    CT_BDC_DATA is populated in the Perform populate_bdc_tab

    Local Data Declaration

    DATA: lv_ctu_params TYPE ctu_params,

    lv_fname TYPE dynfnam,

    lv_count(2) TYPE n,

    lt_msg_tab TYPE STANDARD TABLE OF bdcmsgcoll.

    DATA: lv_prev_pcode type matnr.

    DATA: percentage_text TYPE c LENGTH 5.

    DATA: LV_TABIX(20).

    DATA: lv_line type i.

    DATA: lv_line1 type i.

    DATA: LV_LINE2 TYPE I.

    DATA: lv_pcode type /SAPAPO/MATNR.

    DATA: s_product TYPE RANGE OF BAPI10001APXPRODLOCKEY-product,

    s_product_wa LIKE LINE OF s_product.

    Field-symbols

    FIELD-SYMBOLS: lfs_msg_ret TYPE bdcmsgcoll,

    lfs_data TYPE s_f4_data_loc,

    lfs_data1 TYPE s_f4_data_loc.

    REFRESH ct_bdc_data.

    *MOD-1887120

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    describe table it_prod_var lines lv_line1.

    lv_line2 = lv_line + lv_line1.

    if lv_line2 = 7.

    *Version 0002

    *MOD-1887120: Code that is fixed till TESTAVEEK27.

    *Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *Populate the select options for Product

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%011'.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    ENDLOOP.

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=ONLI',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    *MOD-1887120: Code that is fixed till TESTAVEEK27.

    *Version 0002

    else.

    **Version 0005

    *CTS D7AK900899 New Version code fixed for testaveek28 case.

    *MOD-1887120: Code that is changed after the release of transport.

    Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000'.

    *MOD-1887120:

    IF NOT IT_CORE_PROD[] IS INITIAL.

    *MOD-1887120:

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_pcode = lfs_data-pcode.

    *lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    describe table it_prod_var lines lv_line.

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1 where pcode = lv_pcode.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    *MOD-1887120: Changed after 04.04.2006

    LOOP AT it_prod_var ASSIGNING lfs_data1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count

    gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    ENDLOOP.

    *MOD-1887120:

    *MOD-1887120:

    ELSE.

    *MOD-1887120:

    describe table it_prod_var lines lv_line.

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1. "where pcode=lv_pcode.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname

    .

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    *MOD-1887120:

    ENDIF.

    *MOD-1887120:

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PRD-LOW',

    ' ' 'BDC_OKCODE' '=%012',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    ***MOD-1887120: Code that is changed after the release of transport.

    *CTS D7AK900899 New Version

    *Code fixed for testaveek28 case.

    **Version 0005

    endif.

    *MOD-1887120

    **Version 0002

    **MOD-1887120: Code that is fixed till TESTAVEEK27.

    **Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    **Populate the select options for Product

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%011'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    *

    ENDLOOP.

    *

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    *

    LOOP AT it_loc_data ASSIGNING lfs_data.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    *

    CLEAR lv_fname.

    *

    ENDLOOP.

    *

    **Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=ONLI',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    *

    **MOD-1887120: Code that is fixed till TESTAVEEK27.

    **Version 0002

    ***Version 0005

    **CTS D7AK900899 New Version code fixed for testaveek28 case.

    **MOD-1887120: Code that is changed after the release of transport.

    Populate the general selection criteria on first screen

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    sort it_core_prod by pcode.

    delete adjacent duplicates from it_core_prod

    comparing pcode.

    describe table it_core_prod lines lv_line.

    *

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000'.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_pcode = lfs_data-pcode.

    **lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-pcode,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    *

    describe table it_prod_var lines lv_line.

    *

    sort lfs_data by locno pcode prvar.

    LOOP AT it_prod_var ASSIGNING lfs_data1 where pcode = lv_pcode.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_line 1.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data1-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    else.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar,

    ' ' 'BDC_OKCODE' '=LINS'.

    endif.

    CLEAR lv_fname.

    ENDLOOP.

    ENDLOOP.

    *

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    *

    Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PRD-LOW',

    ' ' 'BDC_OKCODE' '=%012',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    *

    Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    *

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    *

    CLEAR lv_count.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    lv_count = 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' lv_fname lfs_data-locno,

    ' ' 'BDC_OKCODE' '=LINS'.

    CLEAR lv_fname.

    ENDLOOP.

    *

    **

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    ****MOD-1887120: Code that is changed after the release of transport.

    **CTS D7AK900899 New Version

    **Code fixed for testaveek28 case.

    ***Version 0005

    **Version 0006 latest version.

    **Code for looping at it_prod_var and doing the call transaction for

    **each record

    **CTS D7AK900899 New Version

    *

    sort it_prod_var by pcode prvar.

    delete adjacent duplicates from it_prod_var

    comparing pcode prvar.

    *

    clear: lv_prev_pcode.

    *

    LOOP AT it_prod_var ASSIGNING lfs_data.

    *

    Populate the general selection criteria on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_CURSOR' 'EXT_PROD-LOW',

    ' ' 'BDC_OKCODE' '=%011',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'SIM' space,

    ' ' 'P_LOGDEL' '5'.

    *

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    if lv_prev_pcode ne lfs_data-pcode.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    *

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    clear: lv_count.

    *

    *

    **Populate the select options for the Locations

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=%012'.

    *

    **Populate the select options screen for product

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLALDB' '3000',

    ' ' 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER',

    ' ' 'BDC_OKCODE' '=ACPT'.

    *

    CLEAR lv_count.

    lv_count = lv_count + 1.

    CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-locno.

    CLEAR lv_fname.

    clear: lv_count.

    *

    Populate the objects to be deleted on first screen

    PERFORM f_populate_bdc_tab USING:

    'X' 'APO_BAPI_DEL_TRANS_OBJECTS' '1000',

    ' ' 'BDC_OKCODE' '=DUMMY',

    ' ' 'PLVERS' '000',

    ' ' 'MD_SYS' p_log,

    ' ' 'EXTRB' 'X',

    ' ' 'MO_DEL' 'X',

    ' ' 'MO_STAT' 'X',

    ' ' 'PO_DEL' 'X',

    ' ' 'SL_DEL' 'X',

    ' ' 'ST_DEL' 'X',

    ' ' 'PIR_DEL' 'X',

    ' ' 'SIM' space,

    ' ' ' ' ' '.

    *

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSPO1' '0500',

    ' ' 'BDC_OKCODE' '=OPT1'.

    *

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    *

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS

    FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    *

    clear: ct_bdc_data.

    *

    ENDLOOP.

    ***

    ******MOD-1887120: Code that is changed after the release of transport.

    ****CTS D7AK900899 New Version

    ****Version 0006

    **MOD-1887120:

    CLEAR gv_msg_error.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = gc_mode_e.

    lv_ctu_params-dismode = 'A'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    *

    Call Transaction /SAPAPO/BP2 for deleting the Transactional data

    CALL TRANSACTION gc_bp2 USING ct_bdc_data OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    **MOD-1887120:

    commit work and wait.

    *MOD-1771404

    DO 10 TIMES.

    WAIT UP TO '0.1' SECONDS.

    percentage_text(3) = sy-index.

    percentage_text+3 = '%'.

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    EXPORTING

    percentage = sy-index

    text = percentage_text.

    ENDDO.

    *MOD-1771404

    LOOP AT lt_msg_tab ASSIGNING lfs_msg_ret

    WHERE msgtyp = gc_error OR

    msgtyp = gc_abend.

    gv_msg_error = gc_set.

    EXIT.

    ENDLOOP.

    ENDFORM. " f_delete_transactional_data

    ----

    * Form F_POPULATE_BDC_TAB

    ----

    Pupulates BDC Table with the parameters passed to the perform

    ----

    --IV_FLG Flag for New Screem

    --IV_VAR1 Program Name / Field Name

    --IV_VAR2 Screen Number / Field Value

    ----

    FORM f_populate_bdc_tab USING iv_flg TYPE any

    iv_var1 TYPE any

    iv_var2 TYPE any.

    Local Data Declaration

    DATA: ls_bdc_data TYPE bdcdata.

    Populate the BDC Table with the variables passed in it.

    CLEAR ls_bdc_data.

    IF iv_flg = gc_set. " = 'X'

    ls_bdc_data-program = iv_var1.

    ls_bdc_data-dynpro = iv_var2.

    ls_bdc_data-dynbegin = gc_set.

    ELSE.

    ls_bdc_data-fnam = iv_var1.

    ls_bdc_data-fval = iv_var2.

    ENDIF.

    APPEND ls_bdc_data TO gt_bdc_tab.

    ENDFORM. " F_POPULATE_BDC_TAB

    ----

    * Form f_delete_manual_created_data

    ----

    Delete the Manually entered transactional data for prod and loc

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_VARIANT_TABLE Screen Varient Table.

    ----

    FORM f_delete_manual_created_data USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_variant_table TYPE t_rsparams.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc.

    Populate the selection screen table

    PERFORM f_populate_screen_table USING:

    Field Name Type Sign Option Low Value

    Populate the Additional selection options

    Select the Manual selection button

    gc_manual_sel gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Populate the Planning Version

    gc_plan_vrsn gc_parameter gc_sign_i gc_option_eq gc_pvrsn_000 space.

    Populate the Core Products to be deleted

    LOOP AT it_core_prod ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_product gc_sel_optn gc_sign_i gc_option_eq lfs_data-pcode space.

    ENDLOOP.

    Populate the Product Variants to be deleted

    LOOP AT it_prod_var ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_product gc_sel_optn gc_sign_i gc_option_eq lfs_data-prvar space.

    ENDLOOP.

    Populate the Locations to be deleted.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_location gc_sel_optn gc_sign_i gc_option_eq lfs_data-locno space.

    ENDLOOP.

    Populate the Fixed Orders Checkbox

    PERFORM f_populate_screen_table USING:

    gc_fixed_ord gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Populate the Selection Objects

    Unselect the Key Figure Radio Button

    gc_key_fig gc_radio_btn gc_sign_i gc_option_eq space space,

    By Category Radio Button

    gc_category gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Populate the Settings

    Select Delete Transactional data only in APO Radio Button

    gc_only_apo gc_radio_btn gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Test Run check box.

    gc_test_run gc_parameter gc_sign_i gc_option_eq space space.

    Submit to SAP Standard report /SAPAPO/RLCDELETE

    For deleting manually entered data for the product and location

    SUBMIT /sapapo/rlcdelete WITH SELECTION-TABLE ct_variant_table

    AND RETURN.

    ENDFORM. " f_delete_manual_created_data

    ----

    * Form F_POPULATE_SCREEN_TABLE

    ----

    Populate the screen table with the parameters passed

    ----

    --IV_NAME Screen field Name

    --IV_TYPE Screen field type

    --IV_SIGN Sign I / E

    --IV_OPTION Option BT/EQ

    --IV_LOW Lower value

    --IV_HIGH Higher value

    ----

    FORM f_populate_screen_table USING iv_name TYPE rsscr_name

    iv_type TYPE rsscr_kind

    iv_sign TYPE tvarv_sign

    iv_option TYPE tvarv_opti

    iv_low TYPE any

    iv_high TYPE tvarv_val.

    Local Data Declaration

    DATA: ls_variant TYPE rsparams.

    Populate the Screen Table

    ls_variant-selname = iv_name.

    ls_variant-kind = iv_type.

    ls_variant-sign = iv_sign.

    ls_variant-option = iv_option.

    ls_variant-low = iv_low.

    ls_variant-high = iv_high.

    APPEND ls_variant TO gt_variant_table.

    CLEAR ls_variant.

    ENDFORM. " F_POPULATE_SCREEN_TABLE

    ----

    * Form f_delete_ppds_orders

    ----

    Delete the PPDS orders

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the locations to be deleted

    --CT_VARIANT_TABLE Screen Varient Table.

    ----

    FORM f_delete_ppds_orders USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    CHANGING ct_variant_table TYPE t_rsparams.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc.

    REFRESH ct_variant_table.

    Populate the selection screen variant

    PERFORM f_populate_screen_table USING:

    Field Name Type Sign Option Low Value

    Populate the Location Product details

    gc_pl_vrsn gc_parameter gc_sign_i gc_option_eq gc_pvrsn_000 space.

    Populate the Core Products to be deleted

    LOOP AT it_core_prod ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_prod gc_sel_optn gc_sign_i gc_option_eq lfs_data-pcode space.

    ENDLOOP.

    Populate the Product Variants to be deleted

    LOOP AT it_prod_var ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_prod gc_sel_optn gc_sign_i gc_option_eq lfs_data-prvar space.

    ENDLOOP.

    Populate the Locations to be deleted.

    LOOP AT it_loc_data ASSIGNING lfs_data.

    PERFORM f_populate_screen_table USING:

    gc_loc gc_sel_optn gc_sign_i gc_option_eq lfs_data-locno space.

    ENDLOOP.

    Populate Product planned externally checkbox

    PERFORM f_populate_screen_table USING:

    gc_plan_prod gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Populate Subcontracting Planned Orders

    gc_contract gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Display order check box

    gc_display_ord gc_parameter gc_sign_i gc_option_eq space space,

    Check the Delete Order check box

    gc_delete_ord gc_parameter gc_sign_i gc_option_eq gc_set_val space,

    Uncheck the Send Deleted orders checkbox

    gc_send_delete gc_parameter gc_sign_i gc_option_eq space space.

    Submit standard program /SAPAPO/DELETE_PP_ORDER

    For deleting PPDS orders created for the product and location

    SUBMIT /sapapo/delete_pp_order WITH SELECTION-TABLE ct_variant_table

    AND RETURN.

    ENDFORM. " f_delete_ppds_orders

    ----

    * Form f_delete_product_from_tlane

    ----

    Delete Products from the Transportation Lane

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --CT_LOC_DATA Itab with the locations to be deleted

    --CT_MATID_ALL Itab with Matid for all the Products

    --CT_TLANE Itab with transportation lane data

    ----

    FORM f_delete_product_from_tlane USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    CHANGING ct_loc_data TYPE t_f4_data_loc

    ct_matid_all TYPE t_matid

    ct_tlane TYPE t_tlane_data.

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    Local Data Declaration

    DATA: lv_matid_low TYPE /sapapo/matid,

    lv_locid_low TYPE /sapapo/locid,

    lv_loctyp TYPE /sapapo/c_loctype,

    lr_matid TYPE RANGE OF /sapapo/matid,

    ls_trprod TYPE s_tlane_data,

    lr_locid TYPE RANGE OF /sapapo/locid,

    ls_locid TYPE s_locid,

    ls_loc_new TYPE /sapapo/loc,

    lt_locid_all TYPE STANDARD TABLE OF s_locid,

    lv_locid TYPE /SAPAPO/LOCID,

    lv_locno TYPE /SAPAPO/LOCNO.

    Field-symbols

    FIELD-SYMBOLS: lfs_data TYPE s_f4_data_loc,

    lfs_locid TYPE s_locid,

    lfs_matid TYPE s_matid.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_zdm0705 TYPE zdm0705,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_matloc TYPE s_matloc.

    *MOD-1771404

    TYPES: BEGIN OF s_view_data,

    pcode TYPE matnr, " Product

    maktx TYPE zdmaktx, " Prod Desc

    markt TYPE zdmarkt, " Market

    martx TYPE zdmarkst, " Market Desc

    pdctr TYPE zdpdctr, " Product Center

    pctxt TYPE zdpdcst, " Description

    whse1 TYPE zawhse1, " Warehouse1

    whse2 TYPE zawhse2, " Warehouse2

    prvar TYPE zdprvar, " Product Variant

    vartx TYPE zdvartx, " Variant Description

    status TYPE zdstat1, " Status

    END OF s_view_data,

    lv_view_data TYPE STANDARD TABLE OF s_view_data.

    For Core Products

    LOOP AT it_core_prod ASSIGNING lfs_data.

    Get the MATID for the Core Products

    PERFORM f_get_matid_for_prod USING lfs_data-pcode

    CHANGING lv_matid_low.

    ls_matid-matid = lv_matid_low.

    ls_matid-matnr = lfs_data-pcode.

    APPEND ls_matid TO ct_matid_all.

    CLEAR ls_matid.

    Populate the Range Table with the Core Products

    PERFORM f_populate_range_table_matid USING lv_matid_low

    CHANGING lr_matid.

    CLEAR lv_matid_low.

    ENDLOOP.

    For Product Variants

    LOOP AT it_prod_var ASSIGNING lfs_data.

    Get the MATID for the Core Products

    PERFORM f_get_matid_for_prod USING lfs_data-prvar

    CHANGING lv_matid_low.

    ls_matid-matnr = lfs_data-prvar.

    ls_matid-matid = lv_matid_low.

    APPEND ls_matid TO ct_matid_all.

    CLEAR ls_matid.

    Populate the Range Table with the Core Products

    PERFORM f_populate_range_table_matid USING lv_matid_low

    CHANGING lr_matid.

    CLEAR lv_matid_low.

    ENDLOOP.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM LR_matid COMPARING SIGN OPTION

    LOW HIGH.

    *MOD-1771404

    For Locations

    LOOP AT ct_loc_data ASSIGNING lfs_data.

    Get the Locid for the Location

    PERFORM f_get_locid_for_loc USING lfs_data-locno

    CHANGING lv_locid_low

    lv_loctyp.

    lfs_data-loctyp = lv_loctyp.

    ls_locid-locno = lfs_data-locno.

    ls_locid-locid = lv_locid_low.

    APPEND ls_locid TO lt_locid_all.

    CLEAR ls_locid.

    Populate the Range Table with the Location

    PERFORM f_populate_range_table_locid USING lv_locid_low

    CHANGING lr_locid.

    CLEAR: lv_locid_low, lv_loctyp.

    ENDLOOP.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM LR_LOCID COMPARING SIGN OPTION

    LOW HIGH.

    *MOD-1771404

    *MOD-1771404

    Get all the transportation lanes for the above Product and Locations

    SELECT *

    FROM /sapapo/trprod

    INTO TABLE lt_trprod

    WHERE matid IN lr_matid AND

    ( locfr IN lr_locid OR

    locto IN lr_locid ).

    IF sy-subrc 0.

    No Transportation lane selected for deletion

    MESSAGE i047.

    EXIT.

    ENDIF.

    *MOD-1771404

    Get all the transportation lanes for the above Product and Locations

    SELECT *

    FROM /sapapo/trprod

    INTO TABLE lt_trprod

    WHERE matid IN lr_matid AND

    ( locfr IN lr_locid OR

    locto IN lr_locid ).

    IF sy-subrc 0.

    No Transportation lane selected for deletion

    MESSAGE i047.

    EXIT.

    ENDIF.

    *MOD-1771404

    DELETE ADJACENT DUPLICATES FROM lt_locid_all COMPARING locid locno.

    *MOD-1771404

    LOOP AT lt_trprod ASSIGNING lfs_trprod.

    READ TABLE lt_locid_all ASSIGNING lfs_locid WITH KEY

    locid = lfs_trprod-locto.

    IF sy-subrc = 0.

    ls_trprod-locto = lfs_locid-locno.

    ENDIF.

    CLEAR ls_loc_new.

    CALL FUNCTION '/SAPAPO/CMDS_LOC_SINGLE'

    EXPORTING

    iv_locid = lfs_trprod-locfr

    IMPORTING

    es_loc = ls_loc_new

    EXCEPTIONS

    empty_locid = 1

    no_location_found = 2

    OTHERS = 3.

    IF sy-subrc = 0.

    ls_trprod-locfr = ls_loc_new-locno.

    ENDIF.

    *MOD-1771404

    clear: lv_locid, lv_locno.

    SELECT single locid locno

    FROM /sapapo/loc

    INTO (lv_locid, lv_locno)

    WHERE locid = lfs_trprod-locto.

    IF SY-SUBRC = 0.

    IF ls_trprod-locto is initial.

    ls_trprod-locto = lv_locno.

    ENDIF.

    ENDIF.

    *MOD-1771404

    READ TABLE ct_matid_all ASSIGNING lfs_matid WITH KEY

    matid = lfs_trprod-matid.

    IF sy-subrc = 0.

    ls_trprod-matid = lfs_matid-matnr.

    ENDIF.

    APPEND ls_trprod TO ct_tlane.

    CLEAR ls_trprod.

    ENDLOOP.

    **MOD-1887120 Changes made after release of transport on 28.03

    DATA: L_WA_zdm0705 type zdm0705.

    DATA: L_WA_ZDU1002 type zdu1002.

    DATA: lv_prvar type ZDPRVAR.

    DATA: lv_indicator1 type i.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    **MOD-1887120

    DATA: lv_product type ZDPRVAR.

    clear: l_wa_zdu1002.

    clear: l_wa_zdm0705.

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    LOOP AT IT_ZDM0705 INTO L_WA_ZDM0705.

    READ TABLE IT_ZDU1002 INTO L_WA_ZDU1002

    WITH KEY PRVAR = L_WA_ZDM0705-PRVAR BINARY SEARCH.

    IF SY-SUBRC = 0.

    IF L_WA_ZDU1002-STATUS NE 'I'.

    lv_indicator1 = 1.

    ENDIF.

    ENDIF.

    ENDLOOP.

    ***MOD-1887120 Changes made after release of transport on 28.03

    SORT it_zdm0705 BY prvar parpr.

    DELETE ADJACENT DUPLICATES FROM it_zdm0705 COMPARING ALL FIELDS.

    if lv_indicator1 = 1.

    LOOP AT it_zdu1002 into l_wa_zdu1002 WHERE STATUS NE 'I'.

    READ TABLE IT_ZDM0705 ASSIGNING LFS_ZDM0705

    WITH KEY PRVAR = L_WA_ZDU1002-PRVAR BINARY SEARCH.

    LOOP AT IT_ZDM0705 into l_wa_zdm0705

    WHERE prvar = l_wa_zdu1002-prvar.

    IF SY-SUBRC = 0.

    lfs_zdm0705-dmoap = 'X'.

    l_wa_zdm0705-dmoap = 'X'.

    modify it_zdm0705 from l_wa_zdm0705 transporting dmoap.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    endif.

    *

    **MOD-1887120 Changes made after release of transport on 28.03

    if lv_indicator1 = 1.

    LOOP AT it_prod_var ASSIGNING lfs_prod_data.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = lfs_prod_data-pcode

    dmoap = 'X'.

    IF SY-SUBRC = 0.

    delete it_core_prod where pcode = lfs_prod_data-pcode.

    Indicates that the core product should not be included in

    transportation lane and /sapapo/bp2 transaction.

    READ TABLE GT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-pcode

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    READ TABLE GT_MATLOC ASSIGNING lfs_matloc with key

    matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    if sy-subrc ne 0.

    lfs_prod_data-lv_exist = 1.

    endif.

    endif.

    endif.

    ENDLOOP.

    endif.

    DELETE it_prod_var WHERE LV_EXIST = 1.

    *MOD-1887120 Changes made after release of transport on 28.03

    LOOP AT CT_TLANE INTO LS_TRPROD.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    prvar = ls_trprod-matid

    dmoap = 'X'.

    if sy-subrc = 0.

    LS_TRPROD-MATID = 'X'.

    MODIFY CT_TLANE FROM LS_TRPROD TRANSPORTING MATID.

    COMMIT WORK AND WAIT.

    else.

    READ TABLE IT_ZDM0705 into l_wa_zdm0705 with key

    parpr = ls_trprod-matid

    dmoap = 'X'.

    if sy-subrc = 0.

    LS_TRPROD-MATID = 'X'.

    MODIFY CT_TLANE FROM LS_TRPROD TRANSPORTING MATID.

    COMMIT WORK AND WAIT.

    endif.

    endif.

    ENDLOOP.

    DELETE CT_TLANE WHERE MATID = 'X'.

    **MOD-1887120 Changes made after release of transport on 28.03

    IF p_test IS NOT INITIAL.

    EXIT.

    ENDIF.

    *MOD-1771404

    Delete SAP Table /SAPAPO/TRPROD

    DELETE /sapapo/trprod FROM TABLE lt_trprod.

    IF sy-subrc = 0.

    COMMIT WORK.

    ELSE.

    ROLLBACK WORK.

    ENDIF.

    *MOD-1771404

    ENDFORM. " f_delete_product_from_tlane

    ----

    * Form f_get_matid_for_prod

    ----

    Get the MATID for the material passed

    ----

    --IV_PRD Product (Material Number)

    --CV_MATID MATID for the above material no

    ----

    FORM f_get_matid_for_prod USING iv_prd TYPE any

    CHANGING cv_matid TYPE /sapapo/matid.

    Local Data Declaration

    DATA: lv_matnr TYPE /sapapo/matnr.

    CHECK NOT iv_prd IS INITIAL.

    CLEAR lv_matnr.

    lv_matnr = iv_prd.

    CALL FUNCTION '/SAPAPO/DM_MATERIAL_GET_MATID'

    EXPORTING

    iv_matnr = lv_matnr

    IMPORTING

    ev_matid = cv_matid

    EXCEPTIONS

    matid_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    CLEAR cv_matid.

    ENDIF.

    ENDFORM. " f_get_matid_for_prod

    ----

    * Form f_get_locid_for_loc

    ----

    Get the LOCID for the Location passed

    ----

    --IV_MKT Location Number

    --CV_LOCID LOCID for the above Location

    --CV_LOCTYP Location Type

    ----

    FORM f_get_locid_for_loc USING iv_mkt TYPE /sapapo/locno

    CHANGING cv_locid_low TYPE /sapapo/locid

    cv_loctyp TYPE /sapapo/c_loctype.

    Local Data Declaration

    DATA: ls_loc TYPE /sapapo/loc.

    CHECK NOT iv_mkt IS INITIAL.

    CLEAR ls_loc.

    CALL FUNCTION '/SAPAPO/LOC_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_mkt

    IMPORTING

    ev_locid = cv_locid_low

    es_location = ls_loc

    EXCEPTIONS

    location_not_found = 1

    not_qualified = 2

    OTHERS = 3.

    IF sy-subrc 0.

    CLEAR cv_locid_low.

    ELSE.

    cv_loctyp = ls_loc-loctype.

    cv_locid_low = ls_loc-locid.

    ENDIF.

    ENDFORM. " f_get_locid_for_loc

    ----

    * Form f_populate_range_table_matid

    ----

    Populate the Range thable wiht the values passed

    ----

    --IV_VALUE_LOW Lower Value of the Range

    --ES_RANGE Structure of type Range

    --CT_RANGE_TAB Table of type Range

    ----

    FORM f_populate_range_table_matid USING iv_value_low TYPE any

    CHANGING ct_range_tab TYPE t_matid_range.

    Local Data Declaration

    DATA: ls_locid TYPE s_range_locid.

    ls_locid-sign = gc_sign_i.

    ls_locid-option = gc_option_eq.

    ls_locid-low = iv_value_low.

    APPEND ls_locid TO ct_range_tab.

    CLEAR ls_locid.

    ENDFORM. " f_populate_range_table_matid

    ----

    * Form f_set_deletion_flag

    ----

    Set the deletion flag for the Products to be deleted

    ----

    --IT_CORE_PROD Itab with the core products to be deleted

    --IT_PROD_VAR Itab with the product varients to be deleted

    --IT_LOC_DATA Itab with the location details

    ----

    FORM f_set_deletion_flag USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc

    it_loc_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc.

    Local Data Declaration

    DATA: lv_own_sys TYPE bapiapologsys,

    lv_matnr TYPE /sapapo/matnr,

    lt_product TYPE STANDARD TABLE OF bapi10001key,

    ls_product TYPE bapi10001key,

    ls_prod_key TYPE bapi_prodloc_key,

    lt_prod_key TYPE STANDARD TABLE OF bapi_prodloc_key,

    lt_matloc TYPE t_matloc,

    lt_return TYPE STANDARD TABLE OF bapiret2.

    Field Symbols

    FIELD-SYMBOLS: lfs_mat TYPE s_f4_data_loc,

    lfs_product TYPE bapi10001key,

    lfs_loc TYPE s_f4_data_loc,

    lfs_return TYPE bapiret2.

    *MOD-1771404

    *MOD-1887120

    SORT IT_PROD_VAR BY locno

    pcode

    prvar.

    delete adjacent duplicates from it_prod_var comparing locno

    pcode

    prvar.

    SORT it_loc_data by locno

    pcode

    prvar

    loctyp

    whse1.

    delete adjacent duplicates from it_loc_data comparing locno

    pcode

    prvar

    loctyp

    whse1.

    *MOD-1771404

    Populate the Core Product

    LOOP AT it_core_prod ASSIGNING lfs_mat.

    LOOP AT it_loc_data ASSIGNING lfs_loc.

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-pcode

    locno = lfs_loc-locno.

    IF sy-subrc = 0.

    ls_prod_key-loctype = lfs_loc-loctyp.

    ls_prod_key-product = lfs_mat-pcode.

    ls_prod_key-location = lfs_loc-locno.

    APPEND ls_prod_key TO lt_prod_key.

    CLEAR ls_prod_key.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    *MOD-1887120

    sort lt_prod_key by product location loctype.

    delete adjacent duplicates from lt_prod_key

    comparing product

    location

    loctype.

    *MOD-1887120

    Populate the Product Variant

    LOOP AT it_prod_var ASSIGNING lfs_mat.

    LOOP AT it_loc_data ASSIGNING lfs_loc.

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-prvar

    locno = lfs_loc-locno.

    IF sy-subrc = 0.

    ls_prod_key-loctype = lfs_loc-loctyp.

    ls_prod_key-product = lfs_mat-prvar.

    ls_prod_key-location = lfs_loc-locno.

    APPEND ls_prod_key TO lt_prod_key.

    CLEAR ls_prod_key.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    *MOD-1771404

    *MOD-1887120

    sort lt_prod_key by product location loctype.

    *MOD-1887120

    delete adjacent duplicates from lt_prod_key comparing product

    location

    loctype.

    *MOD-1771404

    Get the Own Logical system name

    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

    IMPORTING

    own_logical_system = lv_own_sys

    EXCEPTIONS

    own_logical_system_not_defined = 1

    OTHERS = 2.

    IF sy-subrc 0.

    CLEAR lv_own_sys.

    ENDIF.

    This BAPI will set the deletion flag for the materials selected

    for deletion in the SAP table /SAPAPO/MATLOC

    CALL FUNCTION 'BAPI_PRDSRVAPS_REMOVEITEMS'

    EXPORTING

    logical_system = lv_own_sys

    business_system_group = gc_bs_group

    commit_control = space

    TABLES

    product_location_keys = lt_prod_key

    return = lt_return.

    CLEAR gv_flg_error.

    LOOP AT lt_return ASSIGNING lfs_return

    WHERE type = gc_error OR

    type = gc_abend .

    gv_flg_error = gc_set.

    EXIT.

    ENDLOOP.

    IF gv_flg_error = gc_set.

    Product deletion failed for all the selected products

    MESSAGE i048.

    ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

    Delete the Products using the SAP report /SAPAPO/DELETE_PRODUCTS

    SUBMIT /sapapo/delete_products AND RETURN.

    SORT lt_prod_key BY product.

    DELETE ADJACENT DUPLICATES FROM lt_prod_key

    COMPARING product.

    Look for products which dont have a location

    SELECT matnr locno

    INTO TABLE lt_matloc

    FROM /sapapo/v_matloc

    FOR ALL ENTRIES IN gt_prod_data

    WHERE matnr = gt_prod_data-pcode OR

    matnr = gt_prod_data-prvar.

    SORT lt_matloc BY matnr.

    DELETE ADJACENT DUPLICATES FROM lt_matloc

    COMPARING matnr.

    LOOP AT gt_prod_data ASSIGNING lfs_mat.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-pcode

    BINARY SEARCH.

    IF sy-subrc 0.

    ls_product-product = lfs_mat-pcode.

    APPEND ls_product TO lt_product.

    ENDIF.

    READ TABLE lt_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_mat-prvar

    BINARY SEARCH.

    IF sy-subrc 0.

    ls_product-product = lfs_mat-prvar.

    APPEND ls_product TO lt_product.

    ENDIF.

    ENDLOOP.

    SORT lt_product.

    DELETE ADJACENT DUPLICATES FROM lt_product COMPARING ALL FIELDS.

    In case of copre products check if they have any active variants

    before deleting them

    LOOP AT lt_product ASSIGNING lfs_product.

    SELECT SINGLE matnr INTO lv_matnr

    FROM /sapapo/matkey

    WHERE matnr = lfs_product-product.

    IF sy-subrc 0.

    CLEAR lfs_product-product.

    CONTINUE.

    ENDIF.

    FIND gc_dot IN lfs_product-product.

    IF sy-subrc 0.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_product-product AND

    status 'I'.

    CLEAR lfs_product-product.

    EXIT.

    ENDLOOP.

    ENDIF.

    ENDLOOP.

    DELETE lt_product WHERE product IS INITIAL.

    REFRESH gt_product.

    gt_product = lt_product.

    IF lt_product IS NOT INITIAL.

    Delete the products which dont have any locations

    CALL FUNCTION 'BAPI_PRDSRVAPS_DELMULTI'

    EXPORTING

    logical_system = lv_own_sys

    business_system_group = gc_bs_group

    commit_control = space

    TABLES

    product_keys = lt_product

    return = lt_return.

    CLEAR gv_flg_error.

    LOOP AT lt_return ASSIGNING lfs_return

    WHERE type = gc_error OR

    type = gc_abend .

    gv_flg_error = gc_set.

    EXIT.

    ENDLOOP.

    IF gv_flg_error = gc_set.

    Product deletion failed for all the selected products

    MESSAGE i048.

    ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'.

    Delete the Products using the SAP report /SAPAPO/DELETE_PRODUCTS

    SUBMIT /sapapo/delete_products AND RETURN.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDFORM. " f_set_deletion_flag

    ----

    * Form f_display_alv

    ----

    Display ALV report with selected Product and Locations

    ----

    --IT_PROD_DATA Itab with the Product and Location combs

    --CT_FCAT Itab for Field Catelogue

    --CT_MATID_ALL Itab with Matid for all the Products

    ----

    FORM f_display_alv USING it_prod_data TYPE t_f4_data_loc

    ct_matloc TYPE t_matloc

    CHANGING ct_fcat TYPE slis_t_fieldcat_alv

    ct_matid_all TYPE t_matid.

    *Local constants:

    CONSTANTS:

    lc_tabprd TYPE tabname VALUE 'LT_DISPLAYPRD'.

    Local Data Declaration

    DATA: ls_display TYPE s_display,

    ls_product TYPE bapi10001key,

    ls_layout TYPE slis_layout_alv,

    ls_displayprd TYPE s_displayprd,

    lt_displayprd TYPE t_displayprd,

    lv_flg_del TYPE char1,

    lv_flg_prd TYPE flag,

    lv_repid TYPE syrepid,

    lt_events TYPE STANDARD TABLE OF slis_alv_event,

    lt_eventsprd TYPE STANDARD TABLE OF slis_alv_event,

    lt_display TYPE STANDARD TABLE OF s_display,

    lt_prod_1 TYPE STANDARD TABLE OF s_f4_data_loc,

    lt_prod_2 TYPE STANDARD TABLE OF s_f4_data_loc,

    lt_matloc TYPE STANDARD TABLE OF /sapapo/v_matloc,

    lt_matlocdel TYPE STANDARD TABLE OF /sapapo/matloc,

    ls_matloc TYPE /sapapo/matloc,

    ls_matid TYPE s_matid.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid,

    lv_ware_desc type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2, " Warehouse2

    l_wa_matloc type s_matloc.

    DATA: l_wa_display type s_display.

    lv_repid = sy-repid.

    Field-Symbols

    FIELD-SYMBOLS: lfs_prod TYPE s_f4_data_loc,

    lfs_prod_data TYPE s_f4_data_loc,

    lfs_display TYPE s_display,

    lfs_displayprd TYPE s_displayprd,

    lfs_matloc TYPE /sapapo/v_matloc,

    lfs_matid TYPE s_matid.

    **MOD-1887120

    LOOP AT IT_PROD_DATA ASSIGNING lfs_prod_data.

    READ TABLE ct_matloc into l_wa_matloc

    WITH KEY matnr = lfs_prod_data-prvar

    locno = lfs_prod_data-locno.

    IF sy-subrc = 0.

    CLEAR: ls_display, ls_displayprd.

    ls_display-prod = lfs_prod_data-prvar.

    ls_display-p_des = lfs_prod_data-vartx.

    **MOD-1771404

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    **MOD-1771404

    ls_display-loc = l_wa_matloc-LOCNO.

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    lfs_prod_data-locno = l_wa_matloc-LOCNO.

    ENDIF.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod_data-prvar.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod_data-prvar.

    ls_displayprd-p_des = lfs_prod_data-vartx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDLOOP.

    **MOD-1887120

    lt_prod_1 = it_prod_data.

    lt_prod_2 = it_prod_data.

    CLEAR lv_flg_del.

    *MOD-1887120

    SORT lt_prod_1 BY prvar locno.

    SORT lt_prod_1 BY locno pcode prvar pdctr status whse1 whse2.

    DELETE ADJACENT DUPLICATES FROM lt_prod_1 COMPARING prvar locno.

    DELETE ADJACENT DUPLICATES FROM lt_prod_1 COMPARING locno

    pcode

    prvar

    pdctr

    status

    whse1

    whse2.

    *MOD-1887120

    *MOD-1887120

    SORT lt_prod_2 BY pcode locno.

    SORT lt_prod_2 BY locno pcode prvar pdctr status whse1 whse2.

    DELETE ADJACENT DUPLICATES FROM lt_prod_2 COMPARING pcode locno.

    DELETE ADJACENT DUPLICATES FROM lt_prod_2 COMPARING locno

    pcode

    prvar

    pdctr

    status

    whse1

    whse2.

    *MOD-1887120

    **MOD-1771404

    PERFORM F_GET_LOC_DESC USING IT_PROD_DATA

    CHANGING lv_ware_desc.

    **MOD-1771404

    LOOP AT lt_prod_1 ASSIGNING lfs_prod.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod-prvar

    locno = s_mkt-low.

    *MOD-1887120

    locno = lfs_prod-locno.

    *MOD-1887120

    IF sy-subrc = 0.

    CLEAR: ls_display, ls_displayprd.

    ls_display-prod = lfs_prod-prvar.

    ls_display-p_des = lfs_prod-vartx.

    *MOD-1771404

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    *MOD-1771404

    *MOD-1887120

    ls_display-loc = S_MKT-LOW.

    *MOD-1887120

    *MOD-1887120

    ls_display-loc = lfs_prod-locno.

    *MOD-1887120

    **MOD-1887120

    PERFORM F_GET_LOC_DESC CHANGING lv_ware_desc.

    **MOD-1887120

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    ENDIF.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod-prvar.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod-prvar.

    ls_displayprd-p_des = lfs_prod-vartx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    LOOP AT lt_prod_2 ASSIGNING lfs_prod.

    *MOD-1887120

    LOOP AT S_MKT.

    *MOD-1887120

    READ TABLE ct_matloc TRANSPORTING NO FIELDS

    WITH KEY matnr = lfs_prod-pcode

    locno = s_mkt-low.

    *MOD-1887120

    locno = lfs_prod-locno.

    *MOD-1887120

    IF sy-subrc = 0.

    CLEAR: ls_display, lv_flg_prd.

    LOOP AT gt_view_data TRANSPORTING NO FIELDS

    WHERE pcode = lfs_prod-pcode AND

    status 'I'.

    lv_flg_prd = 'X'.

    ENDLOOP.

    IF lv_flg_prd IS INITIAL.

    ls_display-prod = lfs_prod-pcode.

    ls_display-p_des = lfs_prod-maktx.

    ls_display-loc = lfs_prod-locno.

    ls_display-l_des = lfs_prod-desc.

    *MOD-1887120

    ls_display-loc = S_MKT-LOW.

    *MOD-1887120

    ls_display-loc = lfs_prod-locno.

    *MOD-1887120

    **MOD-1887120

    PERFORM F_GET_LOC_DESC USING lt_prod_2

    PERFORM F_GET_LOC_DESC CHANGING lv_ware_desc.

    **MOD-1887120

    ls_display-l_des = lv_ware_desc.

    APPEND ls_display TO lt_display.

    READ TABLE gt_product TRANSPORTING NO FIELDS

    WITH KEY product = lfs_prod-pcode.

    IF sy-subrc = 0.

    ls_displayprd-prod = lfs_prod-pcode.

    ls_displayprd-p_des = lfs_prod-maktx.

    APPEND ls_displayprd TO lt_displayprd.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDLOOP.

    ENDLOOP.

    LOOP AT gt_product INTO ls_product.

    ls_displayprd-prod = ls_product.

    FIND gc_dot IN ls_product.

    IF sy-subrc = 0.

    READ TABLE gt_prod_data ASSIGNING lfs_prod

    WITH KEY prvar = ls_product-product.

    IF sy-subrc = 0.

    ls_displayprd-p_des = lfs_prod-vartx.

    ENDIF.

    ELSE.

    READ TABLE it_prod_data ASSIGNING lfs_prod

    WITH KEY pcode = ls_product-product.

    IF sy-subrc = 0.

    ls_displayprd-p_des = lfs_prod-maktx.

    ENDIF.

    ENDIF.

    ENDLOOP.

    SORT lt_display BY prod loc.

    *MOD-1887120

    DELETE ADJACENT DUPLICATES FROM lt_display

    COMPARING prod loc.

    *MOD-1887120

    **MOD-1887120

    *LOOP AT lt_display into l_wa_display.

    READ TABLE CT_MATLOC INTO L_WA_MATLOC

    WITH KEY matnr = l_wa_display-prod

    locno = l_wa_display-loc.

    IF sy-subrc ne 0.

    l_wa_display-status = 'X'.

    modify lt_display from l_wa_display transporting status.

    ENDIF.

    *ENDLOOP.

    *DELETE lt_display WHERE status = 'X'.

    **MOD-1887120

    SORT lt_displayprd BY prod.

    DELETE ADJACENT DUPLICATES FROM lt_displayprd

    COMPARING prod.

    IF lt_display IS INITIAL.

    EXIT.

    ENDIF.

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    i_callback_program = lv_repid

    i_callback_user_command = gc_show_log

    i_callback_pf_status_set = gc_set_pf.

    Populate the top of page event.

    PERFORM f_get_events CHANGING lt_events.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_3 gc_prodct gc_tabname text-003 gc_len_prod gc_left,

    gc_pos_4 gc_prod_des gc_tabname text-004 gc_len_p_des gc_left,

    gc_pos_5 gc_loctn gc_tabname text-005 gc_len_loc gc_left,

    gc_pos_6 gc_loc_des gc_tabname text-006 gc_len_l_des gc_left.

    If not test mode then display status of deletion

    IF p_test gc_set.

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_2 gc_status gc_tabname text-019 gc_len_stat gc_left,

    gc_pos_1 gc_light gc_tabname space gc_len_lt gc_center.

    SELECT *

    FROM /sapapo/v_matloc

    INTO TABLE lt_matloc

    FOR ALL ENTRIES IN lt_display

    WHERE matnr = lt_display-prod AND

    locno = lt_display-loc.

    *Check if the product is deleted.

    LOOP AT lt_display ASSIGNING lfs_display.

    READ TABLE lt_matloc ASSIGNING lfs_matloc

    WITH KEY matnr = lfs_display-prod

    locno = lfs_display-loc.

    IF sy-subrc = 0.

    lfs_display-status = text-020.

    lfs_display-light = gc_red.

    CLEAR lfs_matloc-lvorm.

    MOVE-CORRESPONDING lfs_matloc TO ls_matloc.

    APPEND ls_matloc TO lt_matlocdel.

    lv_flg_del = gc_set.

    ELSE.

    lfs_display-status = text-021.

    lfs_display-light = gc_green.

    ENDIF.

    ENDLOOP.

    IF lv_flg_del = gc_set. " Deletion failed for atleast one prod

    Deletion failed for some products.

    MODIFY /sapapo/matloc FROM TABLE lt_matlocdel.

    MESSAGE s064.

    ELSE.

    Deletion successful for all the products

    MESSAGE s065.

    ENDIF.

    ENDIF. " For IF p_test gc_set.

    Display the ALV List Display

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = ls_layout

    it_fieldcat = gt_fcat

    i_tabname = gc_tabname

    it_events = lt_events

    TABLES

    t_outtab = lt_display

    EXCEPTIONS

    program_error = 1

    maximum_of_appends_reached = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    IF p_test IS INITIAL.

    PERFORM f_get_events_prd CHANGING lt_eventsprd.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_3 gc_prodct lc_tabprd text-003 gc_len_prod gc_left,

    gc_pos_4 gc_prod_des lc_tabprd text-004 gc_len_p_des gc_left.

    IF p_test gc_set.

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_2 gc_status lc_tabprd text-019 gc_len_stat gc_left,

    gc_pos_1 gc_light lc_tabprd space gc_len_lt gc_center.

    Check the Products from the /SAPAPO/MATKEY to check for deletion

    SELECT matid matnr INTO TABLE ct_matid_all

    FROM /sapapo/matkey

    FOR ALL ENTRIES IN lt_displayprd

    WHERE matnr = lt_displayprd-prod.

    LOOP AT lt_displayprd ASSIGNING lfs_displayprd.

    READ TABLE ct_matid_all INTO ls_matid

    WITH KEY matnr = lfs_displayprd-prod.

    IF sy-subrc = 0.

    lfs_displayprd-status = text-020.

    lfs_displayprd-light = gc_red.

    lv_flg_del = gc_set.

    ELSE.

    lfs_displayprd-status = text-021.

    lfs_displayprd-light = gc_green.

    ENDIF.

    ENDLOOP.

    IF lv_flg_del = gc_set. " Deletion failed for atleast one prod

    Deletion failed for some products.

    MESSAGE s064.

    ELSE.

    Deletion successful for all the products

    MESSAGE s065.

    ENDIF.

    ENDIF.

    Display the ALV List Display

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    is_layout = ls_layout

    it_fieldcat = gt_fcat

    i_tabname = lc_tabprd

    it_events = lt_eventsprd

    TABLES

    t_outtab = lt_displayprd

    EXCEPTIONS

    program_error = 1

    maximum_of_appends_reached = 2

    OTHERS = 3.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDIF.

    Displays the ALV list

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    ENDFORM. " f_display_alv

    ----

    * Form f_get_events

    ----

    Get the TOP OF PAGE event

    ----

    --CT_EVENTS Itab with the events to be triggred

    ----

    FORM f_get_events CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = slis_ev_top_of_page.

    ENDIF.

    ENDFORM. " f_get_events

    ----

    * Form vpopulate_fieldcat

    ----

    Populate the fieldcatelog for ALV report

    ----

    --IV_CPOS Column Position

    --IV_FNAM Field Name

    --IV_TABNAM Internal Table Name

    --IV_TITLE Column Title

    --IV_OPT_LEN Output Length

    --IV_JUSTIFY Justify left / right

    ----

    FORM f_populate_fieldcat USING iv_cpos TYPE lvc_colpos

    iv_fnam TYPE lvc_fname

    iv_tabnam TYPE lvc_tname

    iv_title TYPE reptext

    iv_opt_len TYPE lvc_outlen

    iv_justify TYPE lvc_just.

    Local Data Declaration

    DATA: ls_fcat TYPE slis_fieldcat_alv.

    CLEAR ls_fcat.

    ls_fcat-col_pos = iv_cpos.

    ls_fcat-fieldname = iv_fnam.

    ls_fcat-tabname = iv_tabnam.

    ls_fcat-reptext_ddic = iv_title.

    ls_fcat-outputlen = iv_opt_len.

    ls_fcat-just = iv_justify.

    IF iv_fnam = gc_light.

    ls_fcat-icon = gc_set.

    ENDIF.

    APPEND ls_fcat TO gt_fcat.

    ENDFORM. " f_populate_fieldcat

    ----

    * Form F_SET_PF

    ----

    Set the PF Status for the display and log screen

    ----

    --CT_EXTAB

    ----

    FORM f_set_pf USING ct_extab TYPE slis_t_extab. "#EC CALLED

    Dynamic perform required to set custom PF status for ALV report

    "#EC *

    CT_EXTAB is required as per the standard exit perform of ALVgrid fm

    Local Data Declation.

    DATA: ls_extab TYPE slis_extab,

    lt_extab TYPE STANDARD TABLE OF slis_extab.

    If the Test Run check box is selected then disable the Log Icons

    IF p_test = gc_set.

    ls_extab-fcode = gc_td_log.

    APPEND ls_extab TO lt_extab.

    CLEAR ls_extab.

    SET PF-STATUS 'PF_DISPLAY_LOG' EXCLUDING lt_extab.

    ENDIF.

    IF gt_tlane IS INITIAL.

    ls_extab-fcode = gc_tlane.

    APPEND ls_extab TO lt_extab.

    CLEAR ls_extab.

    ENDIF.

    SET PF-STATUS 'PF_DISPLAY_LOG' EXCLUDING lt_extab.

    ENDFORM. " F_SET_PF

    ----

    * Form f_show_log

    ----

    Display Log report using

    ----

    -- iv_ucomm OK Code for the user command

    -- is_selfield Selected field information

    ----

    FORM f_show_log USING iv_ucomm TYPE sy-ucomm

    is_selfield TYPE slis_selfield. "#EC CALLED

    Dynamic perform for displaying log based on user action

    "#EC *

    IS_SELFIELD is passed as per the standard exit perform for ALVgrid

    IF iv_ucomm = gc_td_log.

    Local Data Delaration.

    DATA: lt_msg_dtl TYPE STANDARD TABLE OF bdcmsgcoll,

    lv_mode TYPE char1,

    lv_error TYPE char1,

    lv_date TYPE char10,

    lv_time TYPE char8,

    lv_date_to TYPE char10,

    lv_time_to TYPE char8.

    Field-Symbols

    FIELD-SYMBOLS: lfs_msg_dtl TYPE bdcmsgcoll.

    REFRESH gt_bdc_tab.

    CLEAR: lv_date, lv_time.

    CONCATENATE gv_date_before6(2) gv_date_before4(2)

    gv_date_before+0(4) INTO lv_date SEPARATED BY gc_dot.

    CONCATENATE gv_time_before0(2) gv_time_before2(2)

    gv_time_before+4(2) INTO lv_time SEPARATED BY gc_colon.

    CONCATENATE sy-datum6(2) sy-datum4(2)

    sy-datum+0(4) INTO lv_date_to SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-uzeit2(2)

    sy-uzeit+4(2) INTO lv_time_to SEPARATED BY gc_colon.

    Populate the BDC Table for SLG1 Transaction

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLSLG3' '0100',

    ' ' 'BDC_CURSOR' 'BALHDR-ALPROG',

    ' ' 'BDC_OKCODE' '=SELE',

    ' ' 'BALHDR-OBJECT' '*',

    ' ' 'BALHDR-SUBOBJECT' '*',

    ' ' 'BALHDR-EXTNUMBER' '*',

    ' ' 'BALHDR-ALDATE' lv_date,

    ' ' 'BALHDR-ALTIME' lv_time,

    ' ' '*BALHDR-ALDATE' lv_date_to,

    ' ' '*BALHDR-ALTIME' lv_time_to,

    ' ' 'BALHDR-ALUSER' sy-uname,

    ' ' 'BALHDR-ALTCODE' '*',

    ' ' 'BALHDR-ALPROG' '*',

    ' ' 'MODE_ALL' 'X',

    ' ' 'PROBCLASS_4' 'X'.

    CLEAR lv_error.

    lv_mode = gc_foreground.

    Call Transaction SLG1 for displaying the LOG for the action.

    CALL TRANSACTION gc_slg1 USING gt_bdc_tab MODE lv_mode

    MESSAGES INTO lt_msg_dtl.

    LOOP AT lt_msg_dtl ASSIGNING lfs_msg_dtl WHERE

    msgtyp = gc_error OR

    msgtyp = gc_abend.

    lv_error = gc_set.

    EXIT.

    ENDLOOP.

    IF lv_error = gc_set.

    Error while displaying Log.

    MESSAGE i049.

    ENDIF.

    ELSEIF iv_ucomm = gc_tlane.

    Display Tlane deletion data.

    PERFORM f_display_tlane USING gt_tlane.

    ENDIF.

    ENDFORM. " f_show_log

    ----

    * Form top_of_page

    ----

    Write Header details in the TOP OF PAGE for ALV report

    ----

    FORM top_of_page. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-015,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space.

    If Test Run then select

    IF p_test = gc_set. " IF test run

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-013,

    gs_type_a space text-014.

    ELSEIF gv_msg_error = gc_set. "IF error in call trns

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-018.

    ELSEIF gv_flg_error = gc_set. " IF error in deletion

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-012.

    ELSEIF gv_flg_error gc_set. " IF no error

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-011.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " top_of_page

    ----

    * Form f_populate_top_page

    ----

    Populate the Header for ALV top of page with parameters passed

    ----

    --IV_TYPE Line Type

    --IV_KEY Key

    --IV_INFO Info to be printed

    ----

    FORM f_populate_top_page USING iv_type TYPE char1

    iv_key TYPE any

    iv_info TYPE any.

    Local Data Declaration

    DATA: ls_top_page TYPE slis_listheader.

    CLEAR ls_top_page.

    ls_top_page-typ = iv_type.

    ls_top_page-key = iv_key.

    ls_top_page-info = iv_info.

    APPEND ls_top_page TO gt_top_page.

    ENDFORM. " f_populate_top_page

    ----

    * Form f_populate_range_table_LOCID

    ----

    Populate the Range thable wiht the values passed

    ----

    --IV_VALUE_LOW Lower Value of the Range

    --CT_RANGE_TAB Table of type Range

    ----

    FORM f_populate_range_table_locid USING iv_value_low TYPE any

    CHANGING ct_range_tab TYPE t_locid_range.

    Local Data Declaration

    DATA: ls_locid TYPE s_range_locid.

    ls_locid-sign = gc_sign_i.

    ls_locid-option = gc_option_eq.

    ls_locid-low = iv_value_low.

    APPEND ls_locid TO ct_range_tab.

    CLEAR ls_locid.

    ENDFORM. " f_populate_range_table_LOCID

    ----

    * Form f_display_tlane

    ----

    Display Transportation lane deletion data

    ----

    --CT_TLANE Itab with details of Tlane deleted

    ----

    FORM f_display_tlane USING ct_tlane TYPE t_tlane_data.

    Local Data Declaration

    DATA: lt_tl_events TYPE STANDARD TABLE OF slis_alv_event.

    Populate the top of page event.

    PERFORM f_get_events_tl CHANGING lt_tl_events.

    REFRESH gt_fcat.

    *MOD-1887120

    SORT CT_TLANE BY LOCFR LOCTO MATID.

    *MOD-1887120

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_1 gc_locfr gc_tl_tab text-023 gc_len_l_des gc_left,

    gc_pos_2 gc_locto gc_tl_tab text-024 gc_len_l_des gc_left,

    gc_pos_3 gc_prod_tl gc_tl_tab text-022 gc_len_l_des gc_left.

    Display the ALV Grid Display

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = sy-repid

    it_fieldcat = gt_fcat

    i_save = gc_save

    it_events = lt_tl_events

    TABLES

    t_outtab = ct_tlane

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " f_display_tlane

    ----

    * Form f_get_events_tl

    ----

    Get event top of page for Tlane report

    ----

    --CT_EVENTS Itab for top of page

    ----

    FORM f_get_events_tl CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_lt_top.

    ENDIF.

    ENDFORM. " f_get_events_tl

    ----

    * Form F_TOP_TL

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_tl. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-025,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space.

    IF p_test IS INITIAL.

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-026.

    ELSE.

    PERFORM f_populate_top_page USING:

    gs_type_a text-010 text-041.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TL

    ----

    * Form f_adj_screen_flds

    ----

    Adjusts the screen fields

    ----

    FORM f_adj_screen_flds .

    *MOD-1771404 by Aveek

    IF p_mdel IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_LOG' OR

    screen-name = 'S_PRD-LOW' OR

    screen-name = 'S_PRD-HIGH' OR

    screen-name = 'S_MKT-LOW' OR

    screen-name = 'S_MKT-HIGH' OR

    screen-name = 'P_TEST'.

    screen-input = 0.

    REFRESH: s_prd, s_mkt.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    IF p_tlan IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_SRC' OR

    screen-name = 'P_DES' OR

    screen-name = 'P_PRD' OR

    screen-name = 'P_TDAT' OR

    screen-name = 'P_TPRD' OR

    screen-name = 'P_FRD' OR

    screen-name = 'P_TOD'.

    screen-input = 0.

    CLEAR: p_src, p_des, p_prd.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    *

    IF p_tdat IS INITIAL.

    LOOP AT SCREEN.

    IF screen-name = 'P_FRD' OR

    screen-name = 'P_TOD'.

    screen-input = 0.

    CLEAR: p_frd, p_tod.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    ***MOD-1771404 by Aveek

    ENDFORM. " f_adj_screen_flds

    ----

    * Form f_update_tlane

    ----

    Updates transportation lane

    ----

    **MOD-1771404 by Aveek

    FORM f_update_tlane .

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    PERFORM f_get_locid_for_loc USING p_src

    CHANGING lv_srcid

    lv_dummy.

    PERFORM f_get_locid_for_loc USING p_des

    CHANGING lv_desid

    lv_dummy.

    PERFORM f_get_matid_for_prod USING p_prd

    CHANGING lv_matid.

    ls_matid-matid = lv_matid.

    ls_matid-matnr = p_prd.

    APPEND ls_matid TO lt_matid.

    SELECT bmatid aprvar

    APPENDING TABLE lt_matid

    FROM zap_sign AS a JOIN

    /sapapo/matkey AS b

    ON aprvar = bmatnr

    WHERE pcode = p_prd AND

    ( pdctr = p_src OR

    whse1 = p_src OR

    whse2 = p_src ) AND

    ( whse1 = p_des OR

    whse2 = p_des OR

    markt = p_des ).

    **MOD-1771404 Changed code

    SELECT bmatid aprvar

    APPENDING TABLE lt_matid

    FROM zm_zap_sign AS a JOIN

    /sapapo/matkey AS b

    ON aprvar = bmatnr

    WHERE pcode = p_prd AND

    ( markt = p_src or

    pdctr = p_src OR

    whse1 = p_src OR

    whse2 = p_src ) OR

    ( pdctr = p_des OR

    whse1 = p_des OR

    whse2 = p_des OR

    markt = p_des ).

    *MOD-1771404

    IF sy-subrc 0.

    MESSAGE i072 WITH p_prd p_src p_des.

    LEAVE LIST-PROCESSING.

    ENDIF.

    SELECT * INTO TABLE lt_trprod

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN lt_matid

    WHERE locfr = lv_srcid AND

    locto = lv_desid AND

    matid = lt_matid-matid.

    *MOD-1771404

    SELECT * INTO TABLE lt_trprod

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN lt_matid

    WHERE ( locfr = lv_srcid OR

    locfr = lv_desid ) AND

    matid = lt_matid-matid OR

    ( locto = lv_srcid OR

    locto = lv_desid ) AND

    matid = lt_matid-matid.

    *MOD-1771404

    IF sy-subrc 0.

    MESSAGE i067 WITH p_src p_des p_prd.

    LEAVE LIST-PROCESSING.

    ENDIF.

    Change of validity dates

    IF p_tdat IS NOT INITIAL.

    IF p_frd IS INITIAL OR p_tod IS INITIAL.

    MESSAGE i070.

    LEAVE LIST-PROCESSING.

    ELSE.

    IF p_frd p_tod.

    MESSAGE i071.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDIF.

    CONVERT: DATE p_frd TIME lc_stime

    INTO TIME STAMP lv_valfr TIME ZONE lc_utc,

    DATE p_tod TIME lc_etime

    INTO TIME STAMP lv_valto TIME ZONE lc_utc.

    LOOP AT lt_trprod ASSIGNING lfs_trprod.

    lfs_trprod-valfr = lv_valfr.

    lfs_trprod-valto = lv_valto.

    ENDLOOP.

    *MOD-1771404

    MODIFY /sapapo/trprod FROM TABLE lt_trprod.

    *MOD-1771404

    IF sy-subrc = 0.

    COMMIT WORK AND WAIT.

    MESSAGE s068 WITH p_src p_des p_prd.

    ENDIF.

    ENDIF.

    Removal of product assignment

    IF p_tprd IS NOT INITIAL.

    *MOD-1771404

    DELETE /sapapo/trprod FROM TABLE lt_trprod.

    *MOD-1771404

    IF sy-subrc = 0.

    COMMIT WORK AND WAIT.

    MESSAGE s069 WITH p_prd p_src p_des.

    ENDIF.

    ENDIF.

    Display the lanes updated in an ALV

    CLEAR ls_tlaneupd.

    ls_tlaneupd-locfr = p_src.

    ls_tlaneupd-locto = p_des.

    IF p_tdat IS NOT INITIAL.

    ls_tlaneupd-msg = text-034.

    ELSE.

    ls_tlaneupd-msg = text-035.

    ENDIF.

    LOOP AT lt_matid INTO ls_matid.

    ls_tlaneupd-matnr = ls_matid-matnr.

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *MOD-1771404

    LOOP AT lt_trprod INTO ls_trprod.

    CALL FUNCTION '/SAPAPO/DM_MATID_GET_MATERIAL'

    EXPORTING

    iv_matid = ls_trprod-matid

    iv_langu = sy-langu

    IMPORTING

    ev_matnr = lv_matnr.

    *

    ls_tlaneupd-matnr = lv_matnr.

    ls_tlaneupd-locfr

    ls_tlaneupd-locto

    ls_tlaneupd-matnr

    ls_tlaneupd-matid

    *

    *

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *

    ls_tlaneupd-matnr = ls_matid-matnr.

    APPEND ls_tlaneupd TO lt_tlaneupd.

    ENDLOOP.

    *MOD-1771404

    PERFORM display_alv_tlaneupd USING lt_tlaneupd.

    ENDFORM. " f_update_tlane

    ***MOD-1771404 by Aveek

    ----

    * Form display_alv_tlaneupd

    ----

    Displays the ALV for updated Tlane

    ----

    --IT_TLANEUPD Tlane table

    ----

    FORM display_alv_tlaneupd USING it_tlaneupd TYPE t_tlaneupd.

    Local Data Declaration

    DATA: lt_tl_events TYPE STANDARD TABLE OF slis_alv_event.

    Populate the top of page event.

    PERFORM f_get_events_tlupd CHANGING lt_tl_events.

    REFRESH gt_fcat.

    Populate the Field Catelog

    PERFORM f_populate_fieldcat USING :

    Position Field TABLE TITLE OUTPUT_LEN JUSTIFY

    gc_pos_1 gc_locfr gc_tl_tabu text-023 gc_len_l_des gc_left,

    gc_pos_2 gc_locto gc_tl_tabu text-024 gc_len_l_des gc_left,

    gc_pos_3 gc_matnr gc_tl_tabu text-022 gc_len_l_des gc_left,

    gc_pos_4 gc_msg gc_tl_tabu text-036 gc_len_l_des gc_left.

    Display the ALV Grid Display

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = sy-repid

    it_fieldcat = gt_fcat

    i_save = gc_save

    it_events = lt_tl_events

    TABLES

    t_outtab = it_tlaneupd

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Error in displaying end report

    MESSAGE e062.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " display_alv_tlaneupd

    ----

    * Form f_get_events_tlupd

    ----

    Gets the events tab

    ----

    --CT_EVENTS Event table

    ----

    FORM f_get_events_tlupd CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_tlupd_top.

    ENDIF.

    ENDFORM. " f_get_events_tlupd

    ----

    * Form F_TOP_TLUPD

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_tlupd. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_h gc_space text-037,

    gs_type_s text-007 sy-uname,

    gs_type_s text-008 lv_date,

    gs_type_s text-009 lv_time,

    gs_type_s gc_space gc_space,

    gs_type_a text-010 text-038.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TLUPD

    ----

    * Form f_get_events_prd

    ----

    Gets the events for product

    ----

    --CT_EVENTS Events table

    ----

    FORM f_get_events_prd CHANGING ct_events TYPE slis_t_event.

    Field Symbols

    FIELD-SYMBOLS: lfs_events TYPE slis_alv_event.

    Collect all the events triggered

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    IMPORTING

    et_events = ct_events

    EXCEPTIONS

    list_type_wrong = 1

    OTHERS = 2.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    SORT ct_events BY name.

    READ TABLE ct_events ASSIGNING lfs_events

    WITH KEY name = slis_ev_top_of_page

    BINARY SEARCH.

    IF sy-subrc = 0.

    lfs_events-form = gc_prd_top.

    ENDIF.

    ENDFORM. " f_get_events_prd

    ----

    * Form F_TOP_PRD

    ----

    Write Header details in the TOP OF PAGE for TLANE report

    ----

    FORM f_top_prd. "#EC CALLED

    Dynamic perform for displaying the Top of Page heading in ALV report

    Local Data Declaration

    DATA: lv_time TYPE char8,

    lv_date TYPE char10.

    REFRESH gt_top_page.

    CLEAR: lv_time,lv_date.

    CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4) INTO lv_date

    SEPARATED BY gc_dot.

    CONCATENATE sy-uzeit0(2) sy-datum2(2) sy-datum+4(2) INTO lv_time

    SEPARATED BY gc_dot.

    Populate the Header

    PERFORM f_populate_top_page USING:

    gs_type_s gc_space gc_space.

    IF p_test IS NOT INITIAL.

    PERFORM f_populate_top_page USING

    gs_type_a text-010 text-039.

    ELSE.

    PERFORM f_populate_top_page USING

    gs_type_a text-010 text-040.

    ENDIF.

    Write the Header in the TOP OF PAGE of ALV

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = gt_top_page.

    ENDFORM. " F_TOP_TLUPD

    ----

    * Form launch_WUF

    ----

    Launches the WUF

    ----

    --IT_CORE_PROD Core product

    --IT_PROD_VAR Product variant

    ----

    FORM launch_wuf USING it_core_prod TYPE t_f4_data_loc

    it_prod_var TYPE t_f4_data_loc.

    CONSTANTS:

    lc_rscsel TYPE fieldname VALUE 'RSCSEL-SLOW_I'.

    DATA: lv_ctu_params TYPE ctu_params,

    lv_fname TYPE dynfnam,

    lv_count(2) TYPE n,

    lt_msg_tab TYPE STANDARD TABLE OF bdcmsgcoll.

    Field-symbols

    FIELD-SYMBOLS: lfs_msg_ret TYPE bdcmsgcoll,

    lfs_data TYPE s_f4_data_loc.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=OBSEL',

    space 'WUF_OBJ_NAME_STRUC-NAME' 'Location Product',

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=MORE__1',

    space 'WUF_OPT_FIELDS-DISPLAY_DEPS' 'X',

    space 'BDC_CURSOR' 'WUF_SEL_FIELDS-LOW__1',

    space 'WUF_SEL_FIELDS-FIELDNAMETXT__1' 'Product',

    'X' 'SAPLALDB' '3000',

    space 'BDC_OKCODE' '=ACPT'.

    CLEAR lv_count.

    LOOP AT it_core_prod ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE lc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-pcode.

    CLEAR lv_fname.

    ENDLOOP.

    LOOP AT it_prod_var ASSIGNING lfs_data.

    lv_count = lv_count + 1.

    CONCATENATE lc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.

    PERFORM f_populate_bdc_tab USING:

    ' ' lv_fname lfs_data-prvar.

    CLEAR lv_fname.

    ENDLOOP.

    PERFORM f_populate_bdc_tab USING:

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=EXEC_DIR',

    'X' 'SAPMSSY0' '0120',

    space 'BDC_OKCODE' '=F15',

    'X' 'SAPLWUF_SELECTION' '0100',

    space 'BDC_OKCODE' '=EXIT'.

    lv_ctu_params-nobinpt = space.

    lv_ctu_params-dismode = 'E'.

    lv_ctu_params-updmode = 'S'.

    lv_ctu_params-racommit = 'X'.

    CALL TRANSACTION 'WUF' USING gt_bdc_tab OPTIONS FROM lv_ctu_params

    MESSAGES INTO lt_msg_tab.

    ENDFORM. " launch_WUF

    ----

    * Form f_retrieve_masterdata

    ----

    Gets the master data from the SIGN portfolio meeting the

    user selection

    ----

    --ET_MASTERDATA Master data table

    ----

    FORM f_retrieve_masterdata CHANGING et_masterdata TYPE t_masterdata

    et_tship TYPE t_tship

    et_whse TYPE t_whse.

    DATA:

    lt_masterdata TYPE t_masterdata,

    lt_tship TYPE t_tship,

    ls_tship TYPE s_tship,

    ls_whse TYPE s_whse.

    SELECT * INTO TABLE et_masterdata

    FROM zap_scmpf

    WHERE ( pcode = p_prd ) AND

    ( markt = p_src or

    pdctr = p_src ) OR

    ( pdctr = p_des OR

    markt = p_des ) AND

    delfl = space.

    IF sy-subrc 0.

    No sourcing info is maintained for the user selection

    MESSAGE i018.

    LEAVE LIST-PROCESSING.

    ENDIF.

    Obtaining all the possible transhipments in the sourcing

    lt_masterdata = et_masterdata.

    DELETE lt_masterdata WHERE whind IS INITIAL.

    IF lt_masterdata IS INITIAL.

    EXIT.

    ENDIF.

    MOD-1771404

    SELECT * INTO TABLE et_tship

    FROM zap_tshpt

    FOR ALL ENTRIES IN lt_masterdata

    WHERE markt = lt_masterdata-markt AND

    ( pcode = lt_masterdata-pcode OR

    pcode = lt_masterdata-prvar ). " AND

    pcode = lt_masterdata-pcode AND

    pdctr = lt_masterdata-pdctr.

    MOD-1771404

    IF sy-subrc = 0.

    SORT et_tship BY markt pcode pdctr altscn sloc dloc.

    DELETE ADJACENT DUPLICATES FROM et_tship

    COMPARING markt pcode pdctr altscn sloc dloc.

    lt_tship = et_tship.

    SORT lt_tship BY sloc dloc.

    DELETE ADJACENT DUPLICATES FROM lt_tship

    COMPARING sloc dloc.

    LOOP AT lt_tship INTO ls_tship.

    CLEAR ls_whse.

    ls_whse-whse = ls_tship-sloc.

    APPEND ls_whse TO et_whse.

    IF ls_tship-dloc IS INITIAL.

    CONTINUE.

    ENDIF.

    CLEAR ls_whse.

    ls_whse-whse = ls_tship-dloc.

    APPEND ls_whse TO et_whse.

    ENDLOOP.

    SORT et_whse BY whse.

    DELETE ADJACENT DUPLICATES FROM et_whse

    COMPARING whse.

    ENDIF.

    ENDFORM. " f_retrieve_masterdata

    ----

    * Form f_collect_tlanes

    ----

    Collects all possible transportation lanes

    ----

    --IT_MASTERDATA Master data table

    --IT_LOCATION Location table

    --IT_PRODUCT Product table

    --ET_TLANE Transportation lane table

    ----

    FORM f_collect_tlanes USING it_masterdata TYPE t_masterdata

    it_tship TYPE t_tship

    it_location TYPE t_location

    it_product TYPE t_product

    CHANGING et_tlane TYPE t_tlane.

    CONSTANTS:

    lc_stime TYPE t VALUE '000000',

    lc_etime TYPE t VALUE '235959',

    lc_utc TYPE timezone VALUE 'UTC'.

    DATA:

    lv_dummy TYPE /sapapo/c_loctype,

    lv_valfr TYPE timestamp,

    lv_valto TYPE timestamp,

    lv_matid TYPE /sapapo/matid,

    lv_srcid TYPE /sapapo/locid,

    lv_desid TYPE /sapapo/locid.

    DATA:

    lt_trprod TYPE STANDARD TABLE OF /sapapo/trprod,

    lt_matid TYPE t_matid,

    ls_matid TYPE s_matid,

    lt_tlaneupd TYPE t_tlaneupd,

    ls_tlaneupd TYPE s_tlaneupd.

    FIELD-SYMBOLS:

    lfs_trprod TYPE /sapapo/trprod.

    DATA:

    ls_tlane TYPE s_tlane.

    DATA: LV_EXIST type i.

    DATA:

    lv_dtfrmin TYPE timestamp,

    lv_dttomax TYPE timestamp,

    lv_tabix TYPE sytabix,

    lv_locfr TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno,

    lv_matnr TYPE /sapapo/matnr.

    DATA:

    ls_masterdata TYPE zap_scmpf.

    FIELD-SYMBOLS:

    lfs_tlanetmp TYPE s_tlane,

    lfs_tlane TYPE s_tlane.

    LOOP AT it_masterdata INTO ls_masterdata

    WHERE status = 'P' OR

    status = 'A'.

    Check if the core product exists in the data base

    READ TABLE it_product TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_masterdata-pcode

    BINARY SEARCH.

    IF sy-subrc 0.

    Core product exists, find the tlanes involving it

    PERFORM f_find_tlane_comb USING ls_masterdata

    it_tship

    gc_core

    it_location

    CHANGING et_tlane.

    ELSE.

    *MOD-1771404

    Product doesnt exist in database, update log

    lv_locfr = ls_masterdata-pdctr.

    lv_locto = ls_masterdata-markt.

    lv_matnr = ls_masterdata-pcode.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_028

    lv_locfr lv_locto lv_matnr

    space space

    CHANGING gt_log_tlane.

    *MOD-1771404

    ENDIF.

    Check if the variant exists in the data base

    READ TABLE it_product TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_masterdata-prvar

    BINARY SEARCH.

    IF sy-subrc 0.

    Variant exists, find the tlanes involving it

    PERFORM f_find_tlane_comb USING ls_masterdata

    it_tship

    gc_var

    it_location

    CHANGING et_tlane.

    ELSE.

    *MOD-1771404

    Product doesnt exist in database, update log

    lv_locfr = ls_masterdata-pdctr.

    lv_locto = ls_masterdata-markt.

    lv_matnr = ls_masterdata-prvar.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_029

    lv_locfr lv_locto lv_matnr

    space space

    CHANGING gt_log_tlane.

    ENDIF.

    *MOD-1771404

    ENDLOOP.

    *MOD-1771404

    IF et_tlane IS INITIAL.

    The location(s)/product(s) not available in the db for tlane creation

    MESSAGE i023.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_023

    space space space

    space space

    CHANGING gt_log_tlane.

    EXIT.

    ENDIF.

    *MOD-1771404

    SORT et_tlane BY locfr locto matnr datfr datto.

    DELETE ADJACENT DUPLICATES FROM et_tlane

    COMPARING locfr locto matnr datfr datto.

    READ TABLE et_tlane ASSIGNING lfs_tlane INDEX 1.

    lv_dtfrmin = lfs_tlane-datfr.

    lv_dttomax = lfs_tlane-datto.

    LOOP AT et_tlane ASSIGNING lfs_tlane.

    IF lfs_tlane-datfr lv_dtfrmin.

    lv_dtfrmin = lfs_tlane-datfr.

    ENDIF.

    IF lfs_tlane-datto lv_dttomax.

    lv_dttomax = lfs_tlane-datto.

    ENDIF.

    AT END OF matnr.

    lfs_tlane-datfr = lv_dtfrmin.

    lfs_tlane-datto = lv_dttomax.

    lv_tabix = sy-tabix + 1.

    READ TABLE et_tlane ASSIGNING lfs_tlanetmp INDEX lv_tabix.

    IF sy-subrc = 0.

    lv_dtfrmin = lfs_tlanetmp-datfr.

    lv_dttomax = lfs_tlanetmp-datto.

    ENDIF.

    ENDAT.

    ENDLOOP.

    SORT et_tlane BY locfr locto matnr datfr ASCENDING datto DESCENDING.

    DELETE ADJACENT DUPLICATES FROM et_tlane

    COMPARING locfr locto matnr.

    Get the internal guids for material and locations

    LOOP AT et_tlane ASSIGNING lfs_tlane.

    PERFORM f_get_locid_from_locno USING lfs_tlane-locfr

    CHANGING lfs_tlane-lidfr.

    PERFORM f_get_locid_from_locno USING lfs_tlane-locto

    CHANGING lfs_tlane-lidto.

    PERFORM f_get_matid_from_matnr USING lfs_tlane-matnr

    CHANGING lfs_tlane-matid.

    ENDLOOP.

    PERFORM f_get_locid_for_loc USING p_src

    CHANGING lv_srcid

    lv_dummy.

    PERFORM f_get_locid_for_loc USING p_des

    CHANGING lv_desid

    lv_dummy.

    PERFORM f_get_matid_for_prod USING p_prd

    CHANGING lv_matid.

    ls_matid-matid = lv_matid.

    ls_matid-matnr = p_prd.

    APPEND ls_matid TO lt_matid.

    loop at et_tlane into ls_tlane.

    READ TABLE lt_matid TRANSPORTING NO FIELDS

    WITH KEY matnr = ls_tlane-matnr

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_exist = 1.

    modify et_tlane from ls_tlane transporting lv_exist.

    endif.

    endloop.

    delete et_tlane where lv_exist = 1.

    ENDFORM. " f_collect_tlanes

    ----

    * Form f_find_tlane_comb

    ----

    Finds tlanes involving a product

    ----

    --IS_MASTERDATA Masterdata table

    --IV_PRDTP Prioduct type

    --IT_LOCATION Location table

    --ET_TLANE Tlane table

    ----

    FORM f_find_tlane_comb USING is_masterdata TYPE zap_scmpf

    it_tship TYPE t_tship

    iv_prdtp TYPE c

    it_location TYPE t_location

    CHANGING et_tlane TYPE t_tlane.

    DATA:

    lv_matnr TYPE /sapapo/matnr,

    ls_tship TYPE s_tship,

    ls_tship_tmp TYPE s_tship,

    lv_locfr TYPE /sapapo/locno,

    lv_locwh TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno.

    CASE iv_prdtp.

    WHEN gc_core.

    lv_matnr = is_masterdata-pcode.

    WHEN gc_var.

    lv_matnr = is_masterdata-prvar.

    ENDCASE.

    First see if the Source and Market exist in the database.

    Check the presence of transhipments in the sourcing. We assume that

    the destination can only be blank for the last entry of a given

    sourcing alternative

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = is_masterdata-markt

    BINARY SEARCH.

    IF sy-subrc 0.

    Market exists in the data base

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = is_masterdata-pdctr

    BINARY SEARCH.

    IF sy-subrc 0.

    Source exists in the data base

    IF is_masterdata-whind IS INITIAL.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1001 gc_ltp_1002

    is_masterdata-datab

    is_masterdata-datbi

    CHANGING et_tlane.

    ELSE.

    LOOP AT it_tship INTO ls_tship

    WHERE markt = is_masterdata-markt AND

    pcode = is_masterdata-pcode AND

    pcode = is_masterdata-prvar AND

    pdctr = is_masterdata-pdctr.

    ls_tship_tmp = ls_tship.

    For every alternative sourcing

    AT NEW altscn.

    Define lane between the source and the first transhipment

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = ls_tship-sloc

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = ls_tship_tmp-sloc.

    PERFORM f_build_tlane USING lv_locfr

    lv_locto

    lv_matnr

    gc_ltp_1001

    gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    lv_locwh = ls_tship-sloc.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_087

    lv_locfr lv_locto

    lv_locwh space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDAT.

    Define lanes between the successive transhipments in the srcing

    IF ls_tship-dloc IS NOT INITIAL.

    READ TABLE it_location TRANSPORTING NO FIELDS

    WITH KEY locno = ls_tship-dloc

    BINARY SEARCH.

    IF sy-subrc 0.

    lv_locfr = ls_tship_tmp-sloc.

    lv_locto = ls_tship_tmp-dloc.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    lv_locwh = ls_tship-dloc.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_087

    lv_locfr lv_locto

    lv_locwh space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDIF.

    AT END OF altscn.

    Define lane between the final transhipment and the market

    IF ls_tship_tmp-dloc IS NOT INITIAL.

    lv_locfr = ls_tship_tmp-dloc.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ELSE.

    lv_locfr = ls_tship_tmp-sloc.

    lv_locto = is_masterdata-markt.

    PERFORM f_build_tlane USING lv_locfr lv_locto lv_matnr

    gc_ltp_1002 gc_ltp_1002

    ls_tship_tmp-datab

    ls_tship_tmp-datbi

    CHANGING et_tlane.

    ENDIF.

    ENDAT.

    CLEAR ls_tship_tmp.

    ENDLOOP.

    ENDIF.

    ELSE.

    Source is yet to be created in the database, update log

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_031

    lv_locfr lv_locto

    lv_matnr space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ELSE.

    Market is yet to be created in the database, update log

    lv_locfr = is_masterdata-pdctr.

    lv_locto = is_masterdata-markt.

    PERFORM f_update_log_table USING gc_msgid

    gc_err

    gc_msgno_030

    lv_locfr lv_locto

    lv_matnr space

    space

    CHANGING gt_log_tlane.

    ENDIF.

    ENDFORM. " f_find_tlane_comb

    ----

    * Form f_build_tlane

    ----

    Builds a Tlane

    ----

    --IV_LOCFR Location from

    --IV_LOCTO Location to

    --IV_MATNR Product

    --IV_LTPFR Loctype from

    --IV_LTPTO Loctype to

    --IS_MASTERDATA Master data

    --ET_TLANE Tlane table

    ----

    FORM f_build_tlane USING iv_locfr TYPE /sapapo/locno

    iv_locto TYPE /sapapo/locno

    iv_matnr TYPE /sapapo/matnr

    iv_ltpfr TYPE /sapapo/c_loctype

    iv_ltpto TYPE /sapapo/c_loctype

    iv_datfr TYPE Dats

    iv_datto TYPE dats

    CHANGING et_tlane TYPE t_tlane.

    DATA:

    ls_tlane TYPE s_tlane.

    ls_tlane-locfr = iv_locfr.

    ls_tlane-locto = iv_locto.

    ls_tlane-matnr = iv_matnr.

    ls_tlane-ltpfr = iv_ltpfr.

    ls_tlane-ltpto = iv_ltpto.

    PERFORM f_get_tstamps USING iv_datfr iv_datto

    CHANGING ls_tlane-datfr ls_tlane-datto.

    APPEND ls_tlane TO et_tlane.

    ENDFORM. " f_build_tlane

    ----

    * Form f_get_tstamps

    ----

    Gets the timestamps for the Tlane validity dates

    ----

    --IS_MASTERDATA Master data table

    --EV_DATFR Valid from tstamp

    --EV_DATTO Valid to tstamp

    ----

    FORM f_get_tstamps USING iv_datfr TYPE d

    iv_datto TYPE d

    CHANGING ev_datfr TYPE timestamp

    ev_datto TYPE timestamp.

    CONVERT DATE iv_datfr TIME gc_startti

    INTO TIME STAMP ev_datfr TIME ZONE gc_utc.

    CONVERT DATE iv_datto TIME gc_endti

    INTO TIME STAMP ev_datto TIME ZONE gc_utc.

    ENDFORM. " f_get_tstamps

    ----

    * Form f_update_log_table

    ----

    Update logs

    ----

    --IV_MSGID Message class

    --IV_MSGTY Message type

    --IV_MSGNO Message no

    --IV_MSGV1 Variable1

    --IV_MSGV2 Variable2

    --IV_MSGV3 Variable3

    --IV_MSGV4 Variable4

    --IV_MSG Message

    --ET_LOG_TABLE Log table

    ----

    FORM f_update_log_table USING iv_msgid TYPE symsgid

    iv_msgty TYPE symsgty

    iv_msgno TYPE symsgno

    iv_msgv1 TYPE any

    iv_msgv2 TYPE any

    iv_msgv3 TYPE any

    iv_msgv4 TYPE any

    iv_msg TYPE bapi_msg

    CHANGING et_log_table TYPE t_log_table.

    DATA:

    ls_log_table TYPE bal_s_msg.

    DATA: lv_datto type timestamp.

    ls_log_table-msgty = iv_msgty.

    ls_log_table-msgid = iv_msgid.

    ls_log_table-msgno = iv_msgno.

    ls_log_table-msgv1 = iv_msgv1.

    ls_log_table-msgv2 = iv_msgv2.

    ls_log_table-msgv3 = iv_msgv3.

    ls_log_table-msgv4 = iv_msgv4.

    ls_log_table-context-value = iv_msg.

    APPEND ls_log_table TO et_log_table.

    ENDFORM. " f_update_log_table

    ----

    * Form f_get_locid_from_locno

    ----

    Gets the guid for locations

    ----

    --IV_LOCNO Location no

    --EV_LOCID Location id

    ----

    FORM f_get_locid_from_locno USING iv_locno TYPE /sapapo/locno

    CHANGING ev_locid TYPE /sapapo/locid.

    CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_locno

    IMPORTING

    ev_locid = ev_locid

    EXCEPTIONS

    location_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    ENDFORM. " f_get_locid_from_locno

    **----

    **

    ** Form f_get_locid_from_locno

    **----

    **

    Gets the guid for locations

    **----

    **

    --IV_LOCNO Location no

    --EV_LOCID Location id

    **----

    *MOD-1771404

    *FORM f_get_locid_from_locno USING iv_locno TYPE /sapapo/locno

    CHANGING ev_locid TYPE /sapapo/locid.

    *

    CALL FUNCTION '/SAPAPO/DM_LOCNO_GET_LOCID'

    EXPORTING

    iv_locno = iv_locno

    IMPORTING

    ev_locid = ev_locid

    EXCEPTIONS

    location_not_found = 1

    OTHERS = 2.

    *

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    *

    *

    *ENDFORM. " f_get_locid_from_locno

    *MOD-1771404

    ----

    * Form f_get_matid_from_matnr

    ----

    Gets the guid for material

    ----

    --IV_MATNR Material no

    --EV_MATID Material id

    ----

    FORM f_get_matid_from_matnr USING iv_matnr TYPE /sapapo/matnr

    CHANGING ev_matid TYPE /sapapo/matid.

    CALL FUNCTION '/SAPAPO/DM_MATERIAL_GET_MATID'

    EXPORTING

    iv_matnr = iv_matnr

    IMPORTING

    ev_matid = ev_matid

    EXCEPTIONS

    matid_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    Do nothing

    ENDIF.

    ENDFORM. " f_get_matid_from_matnr

    ----

    * Form f_categorise_tlanes

    ----

    Categorises Transp lanes

    ----

    --IT_TLANE Tlane table

    --ET_TLANE_NEW Tlane table with new entries

    --ET_TLANE_DAT Tlane table with date changes

    ----

    FORM f_categorise_tlanes USING it_tlane TYPE t_tlane

    CHANGING et_tlane_new TYPE t_tlane

    et_tlane_dat TYPE t_tlane.

    DATA:

    lt_tlane_cr TYPE STANDARD TABLE OF /sapapo/trprod,

    ls_tlane_cr TYPE /sapapo/trprod, "#EC NEEDED

    ls_tlane_tmp TYPE s_tlane,

    ls_tlane TYPE s_tlane,

    ls_tlane_new TYPE s_tlane.

    DATA: lv_exist type i.

    DATA: lv_exist1 type i.

    DATA:

    lv_dtfrmin TYPE timestamp,

    lv_dttomax TYPE timestamp,

    lv_tabix TYPE sytabix,

    lv_locfr TYPE /sapapo/locno,

    lv_locto TYPE /sapapo/locno,

    lv_matnr TYPE /sapapo/matnr.

    DATA:

    ls_masterdata TYPE zap_scmpf.

    FIELD-SYMBOLS:

    lfs_tlanetmp TYPE s_tlane,

    lfs_tlane TYPE s_tlane.

    *MOD-1771404

    SORT it_tlane BY locfr locto matnr datfr datto.

    DELETE ADJACENT DUPLICATES FROM it_tlane

    COMPARING locfr locto matnr datfr datto.

    READ TABLE it_tlane ASSIGNING lfs_tlane INDEX 1.

    lv_dtfrmin = lfs_tlane-datfr.

    lv_dttomax = lfs_tlane-datto.

    LOOP AT it_tlane ASSIGNING lfs_tlane.

    IF lfs_tlane-datfr lv_dtfrmin.

    lv_dtfrmin = lfs_tlane-datfr.

    ENDIF.

    IF lfs_tlane-datto lv_dttomax.

    lv_dttomax = lfs_tlane-datto.

    ENDIF.

    AT END OF matnr.

    lfs_tlane-datfr = lv_dtfrmin.

    lfs_tlane-datto = lv_dttomax.

    lv_tabix = sy-tabix + 1.

    READ TABLE it_tlane ASSIGNING lfs_tlanetmp INDEX lv_tabix.

    IF sy-subrc = 0.

    lv_dtfrmin = lfs_tlanetmp-datfr.

    lv_dttomax = lfs_tlanetmp-datto.

    ENDIF.

    ENDAT.

    ENDLOOP.

    SORT it_tlane BY locfr locto matnr datfr ASCENDING datto DESCENDING.

    DELETE ADJACENT DUPLICATES FROM it_tlane

    COMPARING locfr locto matnr.

    *MOD-1771404

    The table /SAPAPO/TRPROD the key field is /SAPAPO/TRPID.

    But over here we are retrieving data from it with respect to

    the source and destination which anyway is unique for a given

    product involved in the lane.

    SELECT locfr locto matid valfr valto

    INTO CORRESPONDING FIELDS OF TABLE lt_tlane_cr

    FROM /sapapo/trprod

    FOR ALL ENTRIES IN it_tlane

    WHERE locfr = it_tlane-lidfr AND

    locto = it_tlane-lidto.

    valfr = it_tlane-datfr and

    valto = it_tlane-datto.

    *MOD-1771404

    IF sy-subrc = 0.

    SORT lt_tlane_cr BY locfr locto matid valfr valto.

    endif.

    LOOP AT it_tlane INTO ls_tlane.

    READ TABLE lt_tlane_cr INTO ls_tlane_cr

    WITH KEY locfr = ls_tlane-lidfr

    locto = ls_tlane-lidto

    matid = ls_tlane-matid.

    *MOD-1771404

    BINARY SEARCH.

    *MOD-1771404

    IF sy-subrc = 0.

    APPEND ls_tlane TO et_tlane_dat.

    ELSE.

    Check whether a product needs to be assigned to an existing

    Tlane

    READ TABLE lt_tlane_cr INTO ls_tlane_cr

    WITH KEY locfr = ls_tlane-lidfr

    locto = ls_tlane-lidto

    BINARY SEARCH.

    IF sy-subrc = 0.

    Mark the record to denote assignment of prod to existing

    Tlane

    ls_tlane-crtyp = 'X'.

    ENDIF.

    IF ls_tlane-locfr = ls_tlane_tmp-locfr AND

    ls_tlane-locto = ls_tlane_tmp-locto.

    ls_tlane-crtyp = 'X'.

    ENDIF.

    APPEND ls_tlane TO et_tlane_new.

    ENDIF.

    ls_tlane_tmp = ls_tlane.

    CLEAR ls_tlane.

    ENDLOOP.

    *MOD-1771404

    SORT et_tlane_new BY locfr locto matnr.

    SORT et_tlane_dat BY locfr locto matnr.

    if not et_tlane_new[] is initial.

    delete adjacent duplicates from et_tlane_new

    comparing locfr locto matnr.

    endif.

    if not et_tlane_dat[] is initial.

    delete adjacent duplicates from et_tlane_dat

    comparing locfr locto matnr.

    endif.

    *MOD-1771404

    ENDFORM. " f_categorise_tlanes

    ----

    * Form F_GET_LOC_DESC

    ----

    text

    ----

    --P_IT_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM F_GET_LOC_DESC CHANGING LV_WARE_DESC TYPE /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    LOOP AT it_prod_data ASSIGNING lfs_prod_data.

    Check if the Location is a market

    SELECT markt UP TO 1 ROWS

    INTO lv_mkt

    FROM zap_sign

    where markt = lfs_prod_data-locno.

    WHERE markt = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_mkt.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = s_mkt-low.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    endif.

    *MOD-1887120

    exit.

    endif.

    ENDIF.

    endif.

    Check if the Location is a Production center

    SELECT pdctr UP TO 1 ROWS

    INTO lv_pdctr

    FROM zap_sign

    WHERE pdctr IN s_mkt.

    WHERE pdctr = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_pdctr IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_pdctr.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = s_mkt-low.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    endif.

    ENDIF.

    Check if the Location is a Warehouse 1

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 IN s_mkt.

    WHERE whse1 = s_mkt-low.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_whse1 IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse1.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = lv_whse1.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    endif.

    ENDIF.

    Check if the Location is a Warehouse 2

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse2 IN s_mkt.

    WHERE whse2 = s_mkt-low.

    ENDSELECT.

    IF sy-subrc 0 OR

    lv_whse2 IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse2.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    *MOD-1887120

    LFS_PROD_DATA-LOCNO = LV_WHSE2.

    LFS_PROD_DATA-DESC = lv_ware_desc.

    *MOD-1887120

    exit.

    endif.

    Location does not exist in APO

    MESSAGE e017.

    ENDIF.

    endif.

    ENDLOOP.

    ENDFORM. " F_GET_LOC_DESC

    ----

    * Form GET_DESC_LOC

    ----

    text

    ----

    --P_LFS_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM GET_DESC_LOC USING p_lv_prod_data type s_f4_data_loc

    CHANGING p_LV_WARE_DESC type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    data: lv_ware_desc type /sapapo/loc_descr40.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    Check if the Location is a market

    SELECT whse1 UP TO 1 ROWS

    INTO lv_whse1

    FROM zap_sign

    WHERE whse1 eq s_mkt-low.

    WHERE whse1 = p_lv_prod_data-locno.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse1.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO p_lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    lv_ware_desc = p_lv_ware_desc.

    endif.

    exit.

    endif.

    ENDIF.

    ENDFORM. " GET_DESC_LOC

    ----

    * Form GET_DESC_WHSE2

    ----

    text

    ----

    --P_LV_PROD_DATA text

    --P_LV_WARE_DESC text

    ----

    FORM GET_DESC_WHSE2 USING p_lv_prod_data type s_f4_data_loc

    CHANGING p_LV_WARE_DESC type /SAPAPO/LOC_DESCR40.

    *MOD-1771404

    FIELD-SYMBOLS:

    lfs_prod_data TYPE s_f4_data_loc.

    *MOD-1771404

    DATA: lv_locid type /sapapo/locid.

    data: lv_ware_desc type /sapapo/loc_descr40.

    Local Date Declaration

    DATA: lv_mkt TYPE zdmarkt, " Market

    lv_pdctr TYPE zdpdctr, " Production center

    lv_whse1 TYPE zawhse1, " Warehouse1

    lv_whse2 TYPE zawhse2. " Warehouse2

    *MOD-1771404

    Check if the Location is a market

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zm_zap_sign

    WHERE whse1 IN s_mkt.

    ENDSELECT.

    *MOD-1771404

    SELECT whse2 UP TO 1 ROWS

    INTO lv_whse2

    FROM zap_sign

    WHERE whse1 IN s_mkt or

    whse2 in s_mkt and

    pcode in s_prd.

    ENDSELECT.

    IF sy-subrc = 0 OR

    lv_mkt IS NOT INITIAL.

    SELECT locid up to 1 rows

    into lv_locid

    from /sapapo/loc

    where locno = lv_whse2.

    ENDSELECT.

    if sy-subrc = 0.

    SELECT DESCR40 UP TO 1 ROWS

    INTO p_lv_ware_desc

    FROM /SAPAPO/LOCT

    WHERE locid = lv_locid.

    ENDSELECT.

    if sy-subrc = 0.

    lv_ware_desc = p_lv_ware_desc.

    endif.

    exit.

    endif.

    ENDIF.

    ENDFORM. " GET_DESC_WHSE2

    ----

    * Form f_clear_tables

    ----

    text

    ----

    -- p1 text

    -- p2 text

    ----

    FORM f_clear_tables.

    REFRESH: IT_ZDM0705, IT_ZDU1002, GT_PROD_DATA,

    GT_CORE_PROD, GT_LOC_DATA.

    CLEAR: IT_ZDM0705, IT_ZDU1002, GT_PROD_DATA,

    GT_CORE_PROD, GT_LOC_DATA.

    ENDFORM. " f_clear_tables

  • RELEVANCY SCORE 2.37

    DB:2.37:Table Name For Shipping Type Descriptions dk



    I am looking for the table name that contains the Shipping type descriptions. When I look in the BP Master at the shipping type and look at the data it gives me a numeric value.

    THanks Jim Dyer

    DB:2.37:Table Name For Shipping Type Descriptions dk


    The table name is OSHP. You can find all detail info there.

    Thanks,

    GOrdon

  • RELEVANCY SCORE 2.36

    DB:2.36:Macro To Delete Rows Based On Criteria 71


    I have a spreadsheet with 50,000 rows andam struggling to develop a macro to delete rows based on a criteria.

    Column K contains address details (the same addressesappear many times within the spreadsheet)Column J contains product descriptions (eg. product descriptions) Column P contains type descriptions (eg. order, invoice, quote) Column Q contains Status (eg. Back Order, Waiting Payment, Completed)
    I would like to delete rows with a macro where: -

    Column K contains an address that is duplicated in another row - and Column J contains the sameproduct descriptions eg.K1 and K10 contain the same address and J1 and J10 contain the same product descriptions - andColumn P contains type descriptions "Order" - and Column Q contains "Waiting Payment"
    Thendelete rows

    DB:2.36:Macro To Delete Rows Based On Criteria 71

    Hi,
    The crude piece of code below; I think, demonstrates the point. Use the loop from 1 to 16384 and the range is created abd selected correctly.
    Use the loop to 16386 and it seems to work OK but in fact the last numbered cell in column A (8193) does not get included in the range. No error is generated.
    If you use delete instead of select the results are the same. I have no reason to suppose building the range using UNION would behave differently but I don't have the patience to test it, it takes too long to build.

    Sub nn()
    Range("A:A").ClearContents
    y = 1
    'For x = 1 To 16384 Step 2
    For x = 1 To 16386 Step 2
    Cells(x, 1) = y
    y = y + 1
    Next
    Selection.SpecialCells(xlCellTypeConstants, 1).Select
    Set MyRange = Selection
    Range("A1").Select
    MyRange.Select
    End Sub

    If this post answers your question, please mark it as the Answer.
    Mike H

  • RELEVANCY SCORE 2.36

    DB:2.36:Api To Register Event Dm_Checkin For Notification For A Sepcifice User?? 33


    does anyone the dql syntax set event notification on Check In for a specific user on all docs within folder structure(or of a specific type)???We have a requirement where a a few users need an email spawned when a doc is checked back in -- all the docs are in the same cabinet and are of the same type.Is there a better way to do this with out reinventing the wheel?Help is greatly appreciated!!!!Rob

    DB:2.36:Api To Register Event Dm_Checkin For Notification For A Sepcifice User?? 33

    you right though -- i will need to change the users to sysadmins while i make the update

  • RELEVANCY SCORE 2.36

    DB:2.36:Mod Wheel In Exs24 x3


    Whenever I try to set the mod wheel to control something like resonance in EXS24, the samples (the included flute and clarinet sounds so far) become short and staccato-like without any sustain when I have the mod wheel up all the way. This problem also happens when I don't even have the mod wheel set to anything. Is the mod wheel automatically set to change samples or something else?

    DB:2.36:Mod Wheel In Exs24 x3

    Got it! Under "groups" in the instrument editor it lets me decide when I want to access the samples. I just have all the mod wheel values set to trigger the sustained flute sounds instead of the staccato at the half way point. Thanks again for your help!

  • RELEVANCY SCORE 2.36

    DB:2.36:Error Retrieving The Event Description m7


    all warnings and errors have the same description - 'error retrieving [...] description'
    is there any source for error and warning descriptions?

    DB:2.36:Error Retrieving The Event Description m7

    I am having the same problem, Error retrieving the event description.  This on Windows Server 2008.  I tried viewing from FCM by clicking 'Recent Cluster Events' and clicking 'Cluster Events' in the pane on the left.  I checked the System logs in the Event Viewer and they seem fine but only up to a certain point, after which the events aren't in the System log but are listed in the areas stated above.

  • RELEVANCY SCORE 2.36

    DB:2.36:Event Descriptions sk


     
    Hi ,
    I am not able to get event description for the events logged into event viewer.
    I need a code snippet to use loadlibrary and formatmessage functions to get event description.
    Amit

    DB:2.36:Event Descriptions sk

    See The scope of this forum
    Search the MSDN for samples. Search these forums for samples. Search the Platform SDK samples for samples. Search other web sites such as CodeProject and CodeGuru for samples. Search ......
     

  • RELEVANCY SCORE 2.35

    DB:2.35:Erro Scom sm


    Senhores, bom dia! Está aparecendo os erros abaixo em um servidor Windows 2003 Server, por este motivo estou conseguindo monitorar apenas o basico, Disco / Processamento e memoria. Event Type:    Warning Event Source:    HealthService Event Category:    Health Service Event ID:    1103 Date:        26/10/2009 Time:        11:19:16 User:        N/A Computer:    Servidor Description: Summary: 1 rule(s)/monitor(s) failed and got unloaded, 1 of them reached the failure limit that prevents automatic reload. Management group XXXXXXX. This is summary only event, please see other events with descriptions of unloaded rule(s)/monitor(s). For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Event Type:    Error Event Source:    Health Service Modules Event Category:    None Event ID:    10102 Date:        26/10/2009 Time:        11:19:16 User:        N/A Computer:    WEB5 Description: In PerfDataSource, could not resolve counter Network Interface, Bytes Received/sec, Broadcom NetXtreme Gigabit Ethernet. Module will be unloaded. One or more workflows were affected by this.  Workflow name: Microsoft.Windows.Server.2003.NetworkAdapter.BytesReceivedPerSec.Collection Instance name: VLAN2 - xxx.xxx.xxx.xxx Instance ID: {1070A19F-F6B3-27B1-0585-23807EE68C12} Management group: XXXXXXXXX For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Sera que alguem pode me ajudar?

    DB:2.35:Erro Scom sm

    Estou marcando este tópico como respondido para manter a organização do fórum, caso for necessário tirar alguma dúvida relacionada sugiro a abertura de um novo post. J
     
    Abraços,
     
    Cleber Marques
    Microsoft MVP MCT | Charter Member: SCVMM MDOPProjeto MOF Brasil: Simplificando o Gerenciamento de Serviços de TIMeu Blog | MOF.com.br | CleberMarques.com | CanalSystemCenter.com.br

  • RELEVANCY SCORE 2.35

    DB:2.35:Wheel Mouse And Event fm


    Is there a simple way to implement wheel mous movement into LV7 event structure? I think of generating an event on wheel movement.thanks in advancePawel

    DB:2.35:Wheel Mouse And Event fm

    I downloaded and ran your example and it works. I am running LV8.5 and when I use the mouse to expand the event I don't see Mouse Move in the list. How did you get it to start with?

  • RELEVANCY SCORE 2.35

    DB:2.35:What Version Of Earl Is Present When The Bshow Mod/B Command Output States Nffc+? a9



    Mod Sub-Type Sub-Model Sub-Serial Sub-Hw

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

    1 NFFC+ WS-F5531 0012749635 1.0

    ---------------------x----------------------

    Also, if the output states NetFlow Feature Card II (NFFC II):

    Mod Sub-Type Sub-Model Sub-Serial Sub-Hw

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

    1 NFFC II WS-F5531 0012155842 1.0

    DB:2.35:What Version Of Earl Is Present When The Bshow Mod/B Command Output States Nffc+? a9


    The versions are listed below:

    EARL 1/1+ - ws-x5530-e1

    NFFC/NFFC+ - ws-x5530-e2 Earl II

    NFFC II - ws-x5530-e2 Earl III

  • RELEVANCY SCORE 2.35

    DB:2.35:Event Descriptions sp


    I've been using iCal for some time now and have been wondering why sometimes I'll type in an event on a certain date and part of the description doesn't show up on that date, it seems to get cut off. For example, I may type "Graduation Party @ Rec. Center 1" but on that date it'll only show "Graduation Party".

    I was assuming that it was because the description was too long, but sometimes I'd type a description that was even longer and the entire description would appear on that date.

    DB:2.35:Event Descriptions sp

    I looked at the events with the "@" symbol, no difference. Here's something interesting, I thought it might be getting cut off because there wasn't enough room so I expanded the calendar so that it was the maximum width. That didn't work, so I tried shortening it and that seemed to do it. When I narrowed the width of the window all the event descriptions that had previously gotten cut short were now fully visible. Not sure why this is but at least I found a way to view all the descriptions.

    Do you know of any web-based calendars that are free? That way I or anyone else can access my calendar.

    Thanks for your help!

    PowerBook G4 15 Aluminum Mac OS X (10.4.9)

  • RELEVANCY SCORE 2.35

    DB:2.35:Relate Unstructured Data (E.G. Job Descriptions In Adobe Portable Document Format) To Objects In The Org Management Structure (E.G. Object Type C Job) am



    My client has a requirement to relate many job descriptions with file extension, for example .pdf, to jobs in the OM structure and search for job descriptions using elements of the OM structure (e.g. person, position, and job).

    Has anyone come across a solution to this type of requirement in their experience?

  • RELEVANCY SCORE 2.35

    DB:2.35:Automate Mod Wheel? m8


    I cant seem to figure out how I might be able to do this. Is it possible?

  • RELEVANCY SCORE 2.35

    DB:2.35:Mouse Wheel Event Does Not Exist j1


    I have install windows7 on myPCbut the mouse wheel option does not exist in the mouse options mouse properties have only buttons, pointers, pointeroptions and hardware , so could you please help me to recover this problem
    thanks

    DB:2.35:Mouse Wheel Event Does Not Exist j1

    Additional mouse buttons/wheels are often configured with software/drivers specific to the mouse. Go to the mouse manufacturer's website and see if there is any such software/drivers available to download and install.
    (at the minute you are probably just using a generic mouse driver that provides only basic functionality)

  • RELEVANCY SCORE 2.35

    DB:2.35:Mouse Wheel On Safari dd


    I'm trying to handle mouse wheel event, it works on IE
    FF, but I see that nothing work under safari.
    Any suggestions?

    DB:2.35:Mouse Wheel On Safari dd

    I'm trying to handle mouse wheel event, it works on IE
    FF, but I see that nothing work under safari.
    Any suggestions?

  • RELEVANCY SCORE 2.35

    DB:2.35:Bug In Modifier Plugin 3z


    If you chose convert Mod wheel to Expression, no way to turn off, or remove plugin, it set Expression to zero.To get sound back you need resend Expression to plugin.

    DB:2.35:Bug In Modifier Plugin 3z

    If you chose convert Mod wheel to Expression, no way to turn off, or remove plugin, it set Expression to zero.To get sound back you need resend Expression to plugin.

  • RELEVANCY SCORE 2.35

    DB:2.35:Xsi Mod Tool Failed To Save Before System Failure fc


    Hi,sorry for my english, i'm French.i'm just new with XSI Mod tool and i get always the same error "failed to save before system failure"I have a notbook HP AMD Turion 1.6GhZ with windows XP sp3 and a Geforce go 7600.i'm using Build version 6 Mod Tool 2007 0814I notice that happen when i click and move very fast up and down on the mouse wheel to zoom on an object.To reproduce the Bug:Load Noesis_QS1.exp located in Noesi_QS_databaseuse the pan , orbit and click on the mouse wheel to zoom very fast.I have looked on google for the same problem. i would like to say that i don't have QT or itunes installed.Any help

    DB:2.35:Xsi Mod Tool Failed To Save Before System Failure fc

    Hi,sorry for my english, i'm French.i'm just new with XSI Mod tool and i get always the same error "failed to save before system failure"I have a notbook HP AMD Turion 1.6GhZ with windows XP sp3 and a Geforce go 7600.i'm using Build version 6 Mod Tool 2007 0814I notice that happen when i click and move very fast up and down on the mouse wheel to zoom on an object.To reproduce the Bug:Load Noesis_QS1.exp located in Noesi_QS_databaseuse the pan , orbit and click on the mouse wheel to zoom very fast.I have looked on google for the same problem. i would like to say that i don't have QT or itunes installed.Any help

  • RELEVANCY SCORE 2.34

    DB:2.34:Storage Type Descriptions mj



    Hi All,

    Can someone help me find out where in SAP do we maintain the Storage Type descriptions in different languages. I found it is stored in table T301T but since it is a standard table I cant maintain entries in it thru SM30 .Can someone pls let me know from where I can maitain these Storage Type descriptions.

    DB:2.34:Storage Type Descriptions mj


    Hi

    the table is V_T3010 and field is LGTYP

    Hope it helps!

  • RELEVANCY SCORE 2.34

    DB:2.34:Copy New Movement Type 261 1d



    hi

    i had copy new movement type from 261. how to change the account mod.? and how i know which account mod should be used?

    DB:2.34:Copy New Movement Type 261 1d


    Just type in a new account modifier. You need not define it anywhere.

    Which modifier to uses? Simply create a new one, preferably starting with Z (since SAP will not provide any in that namespace).

    You need to add this in OBYC afterwards for account determination.

    Lakshman

  • RELEVANCY SCORE 2.34

    DB:2.34:Table Fields Required For The Following Descriptions ! pm



    What is the table and the fields with following descriptions?

    1.Partner type Description

    2.Partner type name

    3.Partner No

    I am talking about SD module

    DB:2.34:Table Fields Required For The Following Descriptions ! pm


    Hi,

    1. TVPAT-VTEXT

    2. TVPA-NRART

    3. VBPA-KUNNR

    Good luck!

    Jo

  • RELEVANCY SCORE 2.34

    DB:2.34:7.1.1 "Export Track As Audio" 39


    This feature, which worked OK in 7.1 now omits controller from the bounce, so all volume, mod wheel, etc. info is not written to the audio bounce.
    Any help out there?

    DB:2.34:7.1.1 "Export Track As Audio" 39

    Didn't know if this ever worked.. I get no volume or panning automation in my bounces when using "Export Track as Audio File" in 7.1. I haven't tried 7.1.1

  • RELEVANCY SCORE 2.34

    DB:2.34:How Do I Keep Bookmark Properties Descriptions From Appearing When I Type In A Url In The Url Location Bar Slot? s7



    I would like such Bookmark Properties Descriptions to remain PRIVATE, as some contain Usernames/Passwords, etc. (inported from Netscape 7.1 recently. Note that I DON'T want the Descriptions to disappear from the Bookmarks detail. I just don't want others to see them should they use my computer type in URL's. (E.g., a Description for Citibank.)

    DB:2.34:How Do I Keep Bookmark Properties Descriptions From Appearing When I Type In A Url In The Url Location Bar Slot? s7


    I would like such Bookmark Properties Descriptions to remain PRIVATE, as some contain Usernames/Passwords, etc. (inported from Netscape 7.1 recently. Note that I DON'T want the Descriptions to disappear from the Bookmarks detail. I just don't want others to see them should they use my computer type in URL's. (E.g., a Description for Citibank.)

  • RELEVANCY SCORE 2.34

    DB:2.34:Where Can I Download Windows2003 Security Event Descriptions? sp


    i use logparser and i want to find event which i should concern about. so where can i download windows2003  security event descriptions?

  • RELEVANCY SCORE 2.34

    DB:2.34:Mouse Event zp


    i'd like to know how to catch the mouse wheel event for resizing an object

    DB:2.34:Mouse Event zp

    Mouse Wheel events need to be processed through the DOM. There is a good discussion at.
    http://adomas.org/javascript-mouse-wheel/

  • RELEVANCY SCORE 2.34

    DB:2.34:Proclarity Event Id 3j


    I'm looking for a list of the event Id numbers and their descriptions for ProClarity.  Does anyone know if something like this exists?

    DB:2.34:Proclarity Event Id 3j

     
    MFC,
     
    We've got a sample DTS package that parses the ProClarity log and puts it into dimensional format.  You could match the ID with the description and pull those columns into your reporting DB.  Let me know if you need a copy.
     
    -Joey

  • RELEVANCY SCORE 2.34

    DB:2.34:Map Mod &Amp; Pitch Wheel To Ctrl. 4 &Amp; 11 Greyed Out! 3k


    I've been trying to edit my Orchestral Template in LP9 using the GB Jam Pack Orchstral instruments and other libraries. When I try to edit some of the other EXS instruments to respond to the mod and pitch wheel like the GB Orch instruments, the "Map Mod amp; Pitch Wheel to Ctrl. 4 amp; 11" is greyed out and I can't change it. Also, in the EXS editor the GB instruments won't allow me to "uncheck" this feature. (I did this in my problem solving experiments) I created this orchestral template with all EXS instruments and would like it if all of the brass, woodwinds, and strings responded the way that the GB Orch instruments respond for crescendo, decrescendo, and articulations. Thanks for any ideas about what's going on!

    DB:2.34:Map Mod &Amp; Pitch Wheel To Ctrl. 4 &Amp; 11 Greyed Out! 3k

    Thanks CCTM! I had to tick "show all" under the groups tab to find the select by control #4. Your help is greatly appreciated! You must be the same CCT from the Logic Pro Files bulliten board. Cheers

  • RELEVANCY SCORE 2.34

    DB:2.34:Dont Miss It To Watch Tv Sunday? d8


    http://www.last.fm/event/3858955VIDEO:GameofThronesSeason4Episode3OnlineFullPutlocker
    http://forum.epicdragonica.com/entry.php?31864-HBO-Game-of-Thrones-Season-4-Episode-3-Online-4x3-Free-Full-HD
    http://thesewingsourceinc.com/forum/index.php?topic=36250.0
    http://xcloudgame.com/forum.php?mod=viewthreadtid=175170
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176009
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176201
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176306
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176414

    DB:2.34:Dont Miss It To Watch Tv Sunday? d8

    http://www.last.fm/event/3858955VIDEO:GameofThronesSeason4Episode3OnlineFullPutlocker
    http://forum.epicdragonica.com/entry.php?31864-HBO-Game-of-Thrones-Season-4-Episode-3-Online-4x3-Free-Full-HD
    http://thesewingsourceinc.com/forum/index.php?topic=36250.0
    http://xcloudgame.com/forum.php?mod=viewthreadtid=175170
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176009
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176201
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176306
    http://xcloudgame.com/forum.php?mod=viewthreadtid=176414

  • RELEVANCY SCORE 2.33

    DB:2.33:Mouse Scrool Wheel Events 9f



    Hello!

    I noted that in CVI 9.0 when using a slide control (hot mode) with the mouse scroll wheel, the only event generated is EVENT_MOUSE_WHEEL_SCROLL.

    But in CVI 2013 the same control generates EVENT_MOUSE_WHEEL_SCROLL, EVENT_VAL_CHANGED and EVENT_COMMIT.

    Is thisbehavior correct?

    Thanks in advance.







    Solved!
    Go to Solution.

  • RELEVANCY SCORE 2.33

    DB:2.33:Pitchbend 3j


    i cant seem to get orchestral sounds to respond to the pitchbend wheel or to the manually inputed pitchbend data. mod wheel, fine. it also works fine with any of the 'synth string' type of sounds (any other sounds actually) but not with the xtra orchestral instruments or orchestral jam packs. anyone any thoughts?

    thanks.

    DB:2.33:Pitchbend 3j

    i cant seem to get orchestral sounds to respond to the pitchbend wheel or to the manually inputed pitchbend data. mod wheel, fine. it also works fine with any of the 'synth string' type of sounds (any other sounds actually) but not with the xtra orchestral instruments or orchestral jam packs. anyone any thoughts?

    thanks.

  • RELEVANCY SCORE 2.33

    DB:2.33:Colour Alternative Rows Where Some Are Filtered Out ap


    The following works a treat until rows are filtered out.

    With FormatRange
    ' remove current cf
    .FormatConditions.Delete
    ' add row striping
    .FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=0"
    'colour alternate rows
    .FormatConditions(1).Interior.ColorIndex = 24
    'add top border to row
    .FormatConditions(1).Borders(xlTop).LineStyle = xlContinuous
    'add bottom border to row
    .FormatConditions(1).Borders(xlBottom).LineStyle = xlContinuous
    End With

    Without having to re-invent the wheel, can the above be adapted to cope with hidden rows?

    DB:2.33:Colour Alternative Rows Where Some Are Filtered Out ap

    You will have to use SUBSTOTAL() with one of the function_numparameters that discards hidden rows. Maybe
    103for a COUNTA()?

  • RELEVANCY SCORE 2.33

    DB:2.33:Automation Of Multi Timbral Instruments In Logic?? jd


    OK, I've read a lot on this, and seen it happen to me. You get an instance of Kontakt, fill it up with instruments, and find that any midi volume (C7) moves you make seem to affect the output of the main VI.

    What I was seeing tonight though, is that the same is true of Mod Wheel information. So...if I have multiple parts in a VI, and I want to send discrete midi messages (C7, Mod Wheel, etc) to a given sound on a given midi channel within the VI.....how do you do it in L9?

    Thanks
    Tom

    DB:2.33:Automation Of Multi Timbral Instruments In Logic?? jd

    When using Kontakt as a multitimbral Instr it's better to use the Controller assignments within Kontakt.
    Kontakt's definition of how it's setup for automation at the instrument level is different from PLAY, Omnisphere, SampleTank, etc...

    I find it easier to setup automation within Logic as a multitrimbral and specifying the number of channels (16 for Kontakt, 9 for Play, 8 for Omnisphere, etc...) and when loading the AU instrument, specify the multiout (16 stereo Kontakt, 9 stereo PLAY, 8 stereo Omnisphere) and automate on the aux outputs of each of the aux channels you create in the mixer window for the channel strip of the instrument in question.

    Of course for Kontakt, there's an extra setup you need to do by creating your multi outputs for Kontakt so that Logic can see those, but you can save it as a preset for later use.

    If you really need instrument specific automation, it just might be easier to create that instrument as stereo and to "instrument specific" automate knowing that you're just going to affect one loaded instrument.

  • RELEVANCY SCORE 2.32

    DB:2.32:Event Description On Windows Vista Event Log Not Available From Windows 2000 pk


    I am trying to enumerate the Events from the Event Logs. While fetching the event description I am getting errors such as,
    The description for Event ID ( 9002 ) in Source ( Desktop Window Manager ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: .
    I am fetching the resource name from the EventMessageFile String value under the particular source type under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application. I then use the LoadLibraryEx API to load the library and then pass the returned handle to FormatMessage API to retrieve the event description. The FormatMessage API is returning 0 indicating a failure. This behaviour can be reproduced using the native eventvwr.msc tool. I tried to test from win2k sp4 and winxp sp2 machines. The behaviour is same for my code as well as the native tool.
    Any ideas why is this logic failing.
    I checked out the new native functions in the Windows Event Log SDK (EvtXXX functions).The Windows SDK requires the following:
      1.. One of the following operating systems: Windows Vista Beta 2, Windows Server 2003 Service Pack 2, or Windows XP Professional Service Pack 2.  2.. Microsoft .NET Framework version 2.0.
    Also, the EvtXXX functions has the following requirements,
      1.. Client: Requires Windows Longhorn.  2.. Server: Requires Windows Server Longhorn.
    Is there no way i can access the Windows Vista Event Log from my Windows 2000 machines.I even tried to get the required information using WMI. The WMI reported data is better but still not complete. I could fetch the message descriptions for some of the events but some had empty descriptions.
    Thanks in advance,
    Vineet Kumar Das

    DB:2.32:Event Description On Windows Vista Event Log Not Available From Windows 2000 pk

    I am trying to enumerate the Events from the Event Logs. While fetching the event description I am getting errors such as,
    The description for Event ID ( 9002 ) in Source ( Desktop Window Manager ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: .
    I am fetching the resource name from the EventMessageFile String value under the particular source type under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application. I then use the LoadLibraryEx API to load the library and then pass the returned handle to FormatMessage API to retrieve the event description. The FormatMessage API is returning 0 indicating a failure. This behaviour can be reproduced using the native eventvwr.msc tool. I tried to test from win2k sp4 and winxp sp2 machines. The behaviour is same for my code as well as the native tool.
    Any ideas why is this logic failing.
    I checked out the new native functions in the Windows Event Log SDK (EvtXXX functions).The Windows SDK requires the following:
      1.. One of the following operating systems: Windows Vista Beta 2, Windows Server 2003 Service Pack 2, or Windows XP Professional Service Pack 2.  2.. Microsoft .NET Framework version 2.0.
    Also, the EvtXXX functions has the following requirements,
      1.. Client: Requires Windows Longhorn.  2.. Server: Requires Windows Server Longhorn.
    Is there no way i can access the Windows Vista Event Log from my Windows 2000 machines.I even tried to get the required information using WMI. The WMI reported data is better but still not complete. I could fetch the message descriptions for some of the events but some had empty descriptions.
    Thanks in advance,
    Vineet Kumar Das

  • RELEVANCY SCORE 2.32

    DB:2.32:***New Contest!*** Design A Mod For A Mod! cz



    Hello Racers!

    During our weekly event tonight it was decided that a new contest shall take place! Design a Mod for a Mod!

    This is a no holds barred design contest. Naturally staying with the forum rules, design the coolest, slickest, funniest, whateverist mod you can think up!

    Send us your creations!

    DB:2.32:***New Contest!*** Design A Mod For A Mod! cz


    Wow... Freshwick just made the coolest mod yet!

    Prepare to go down, Penguin!!

  • RELEVANCY SCORE 2.32

    DB:2.32:Frappr Map For These Forums. xa


    Go the idea from the psp forums!!!

    Instead of all this "where are you?" followed by vague descriptions, you can now put yourself on the map.

    Find it here:
    http://www.frappr.com/sonyeuplaystationforummember​s

    By the way can a mod pin this?



    DB:2.32:Frappr Map For These Forums. xa

    By the way people its also a chatroom!!!



  • RELEVANCY SCORE 2.32

    DB:2.32:Event Id: 4509 And Event Id: 1103 On Rms Server js


    Hi

    We are getting the below Error and warning in the Operation Manager Event viewer of RMS serevr.

    Event Type: Error
    Event Source: HealthService
    Event Category: Health Service
    Event ID: 4509
    Date: 6/13/2011
    Time: 11:45:59 AM
    User: N/A
    Computer: IND-AP142
    Description:
    The constructor for the managed module type Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.GroupCalculationModule threw an exception. This module was running in rule BlueService_371c20c7b27b4ca68d3e317e7fe7ceb5_SCPopulation running for instance
    RISFileWatcher with id:{CC12CF8C-6519-7A67-004F-5C3AAFF9E766} in management group MG_IND.

    The exception text is:
    Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.DatabaseQueryModuleException: ManagedTypeId = 7e24e76e-ef6a-524b-3aa6-88b770091af0 --- Microsoft.EnterpriseManagement.Common.DataItemDoesNotExistException: ManagedTypeId = 7e24e76e-ef6a-524b-3aa6-88b770091af0
    at Microsoft.EnterpriseManagement.Mom.DataAccess.TypeSpaceCache.GetManagedType(Guid managedTypeId)
    at Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.MembershipSubscription.Create(IXPathNavigable configurationXml, RelationshipQueryResultMethod relationshipQueryResultMethod, NotifyFatalErrorMethod notifyFatalErrorMethod)
    --- End of inner exception stack trace ---
    at Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.MembershipSubscription.Create(IXPathNavigable configurationXml, RelationshipQueryResultMethod relationshipQueryResultMethod, NotifyFatalErrorMethod notifyFatalErrorMethod)
    at Microsoft.EnterpriseManagement.Mom.DatabaseQueryModules.GroupCalculationModule..ctor(ModuleHost`1 moduleHost, XmlReader configuration, Byte[] previousState)

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    -------------------------------------------------------
    Event Type: Warning
    Event Source: HealthService
    Event Category: Health Service
    Event ID: 1103
    Date: 6/13/2011
    Time: 11:45:39 AM
    User: N/A
    Computer: IND-AP142
    Description:
    Summary: 1 rule(s)/monitor(s) failed and got unloaded, 1 of them reached the failure limit that prevents automatic reload. Management group MG_IND. This is summary only event, please see other events with descriptions of unloaded rule(s)/monitor(s).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Please help us to resolve this issue.

    Regards
    Donald Dsouza

    DB:2.32:Event Id: 4509 And Event Id: 1103 On Rms Server js

    Hi,
    Please check if information on the following thread will help:
    http://social.technet.microsoft.com/Forums/en/operationsmanagergeneral/thread/a2de1514-57d6-4f73-952e-39db4d9eb385Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • RELEVANCY SCORE 2.32

    DB:2.32:Datagriview Scroll - Using Mouse Wheel 9d


    I know the option to scroll down the dgv using the mouse-wheel is associated with the scroll bars.
    i had to disable the scroll bars but would still like to enable the use of the mouse wheel to scroll down the grid.
    i have no idea how, nor i have seen an event for the mouse wheel.
    any help would be appreciated

    DB:2.32:Datagriview Scroll - Using Mouse Wheel 9d

    Hi,
    add the handler manually - the event exists

    Partial Public Class Form1
    Inherits Form
    Public Sub New()
    InitializeComponent()
    AddHandler Me.DataGridView1.MouseWheel, AddressOf dataGridView1_MouseWheel
    End Sub

    Private Sub dataGridView1_MouseWheel(ByVal sender As Object, ByVal e As MouseEventArgs)
    'do what you need
    End Sub
    End Class

    'or, if derived from datagridview

    Public Class dgv
    Inherits DataGridView
    Protected Overrides Sub OnMouseWheel(ByVal e As MouseEventArgs)
    MyBase.OnMouseWheel(e)

    'do what you want
    End Sub
    End Class

  • RELEVANCY SCORE 2.32

    DB:2.32:Could Not Load Annotationconfiguration m3



    Hello to all!

    I have a problem with "Run SchemaExport" with these lines in my hibernate.cfg.xml:
    !-- Envers --
    event type="post-insert"
    listener/
    /event
    event type="post-update"
    listener/
    /event
    event type="post-delete"
    listener/
    /event
    event type="pre-collection-update"
    listener/
    /event
    event type="pre-collection-remove"
    listener/
    /event
    event type="post-collection-recreate"
    listener/
    /event

    DB:2.32:Could Not Load Annotationconfiguration m3


    I solved the problem. I have to install HibernateTools 3.3.1 instead of the old one 3.2.4.

    You have to choose in Eclipse the update site

    http://download.jboss.org/jbosstools/updates/stable/galileo

    instead of

    http://download.jboss.org/jbosstools/updates/stable

    Best Regards.

  • RELEVANCY SCORE 2.32

    DB:2.32:Gear Wheel Broken At A Printercp6015dn a1



    Hello,

    Our printer type CP6015 DN is broken, the failure is a broken gear wheel behind the fuser kit.

    In the right upper corner.

    Is it possible to buy this particular gear wheel, and where can i buy it????

    info gear wheel : CR1-8922

    I hope that you can help me,

    sincerely Mikevil.

    DB:2.32:Gear Wheel Broken At A Printercp6015dn a1


    Hi mikevil,

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial product. You can do this at http://h30499.www3.hp.com/hpeb/Hope this helps, have a good one!

  • RELEVANCY SCORE 2.32

    DB:2.32:Using Breath Controller To Control Modulation f9


    I recently bought a breath controller in order to control velocity x fades for my virtual string libraries.
    However, the velocity fades in these libraries operate with the mod wheel. Does anyone know how to transform breath control data into mod wheel control data so I can acomplish this? I think it has something to do with the transform function in the environment but to be honest, I can't really figure this out from the manual.
    Any help would be great!!!
    Thanks...
    Matthew

    DB:2.32:Using Breath Controller To Control Modulation f9

    I recently bought a breath controller in order to control velocity x fades for my virtual string libraries.
    However, the velocity fades in these libraries operate with the mod wheel. Does anyone know how to transform breath control data into mod wheel control data so I can acomplish this? I think it has something to do with the transform function in the environment but to be honest, I can't really figure this out from the manual.
    Any help would be great!!!
    Thanks...
    Matthew

  • RELEVANCY SCORE 2.32

    DB:2.32:Uwl - Releasecode Has No Value m7



    Hi,

    Can anyone tell me whats wrong with the XML code below ??

    I keep getting the messege "Container check: Mandatory import element RELEASECODE has no value"

    when I press the button trying to release the purchase requisition.

    (TS90100067 is the task for releasing pur requisitions)

    ?xml version="1.0" encoding="UTF-8"?

    !DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN' 'uwl_configuration.dtd'

    UWLConfiguration version="1.0"

    ItemTypes

    ItemType name="uwl.task.webflow.TS90100067" connector="WebFlowConnector" defaultView="PurchaseApproval67"

    ItemTypeCriteria externalType="TS90100067" connector="WebFlowConnector"/

    CustomAttributes

    CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="BUS2009" cacheValidity="final"

    Attribute name="PRICEUNIT" type="string"displayName="Price" /

    Attribute name="QUANTITYREQUESTED" type="string"displayName="quantity" /

    Attribute name="VALUATIONPRICE" type="string"displayName="total" /

    /CustomAttributeSource

    CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="externalId" objectType="WebFlowContainer" cacheValidity="final"

    Attribute name="_WORKITEM" type="string" displayName="_WORKITEM"/

    Attribute name="RELEASECODE" type="string"displayName="releaseCode" /

    /CustomAttributeSource

    CustomAttributeSource id="UM" objectIdHolder="creatorId" objectType="user"cacheValidity="final"

    Attribute name="firstName" type="string" displayName="firstName"/

    Attribute name="lastName" type="string" displayName="lastName"/

    /CustomAttributeSource

    /CustomAttributes

    Actions

    Action name="launchSAPAction" groupAction="" handler="SAPIACLauncher" returnToDetailViewAllowed="yes" launchInNewWindow="yes" launchNewWindowFeatures="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no"

    Properties

    Property name="GuiType" value="WebGui"/

    Property name="openInNewWindow" value="yes"/

    /Properties

    /Action

    Action name="released" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="releaseStepCreated"/

    Property name="objectType" value="BUS2009"/

    Property name="objectId" value="${item.externalobjectid}"/

    Property name="RELEASECODE" value="${item.RELEASECODE}"/

    /Properties

    Descriptions default="Release"/

    /Action

    Action name="rejected" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="rejection_start"/

    Property name="objectType" value="BUS2009"/

    Property name="objectId" value="${item.externalObjectId}"/

    Property name="ReleaseCode" value="${item.ReleaseCode}"/

    /Properties

    Descriptions default="Reject"/

    /Action

    /Actions

    /ItemType

    ItemType name="uwl.task.webflow.TS90200002" connector="WebFlowConnector" defaultView="ProjectManagerApprovalView" defaultAction="launchSAPAction" executionMode="default"

    ItemTypeCriteria externalType="TS90200002" connector="WebFlowConnector"/

    CustomAttributes

    CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="ZCATS" cacheValidity="final"

    Attribute name="TS_ENAME" type="string"displayName="Name" /

    Attribute name="TS_PERNR" type="string"displayName="ID" /

    Attribute name="TS_ROLE" type="string"displayName="Released by" /

    /CustomAttributeSource

    /CustomAttributes

    /ItemType

    /ItemTypes

    Views

    View name="PurchaseApproval67" width="98%"supportedItemTypes="uwl.task.webflow.TS90100067"

    columnOrder="subject, createdDate, PRICEUNIT, QUANTITYREQUESTED,VALUATIONPRICE,RELEASECODE,rejectCol, approveCol"

    sortby="createdDate" selectionMode="SINGLESELECT" tableDesign="ALTERNATING"

    tableNavigationFooterVisible="yes" emphasizedItems="new" visibleRowCount="15"

    Descriptions default="Purchase Requests to Approve"

    ShortDescriptions

    Description Language="en" Description="00 Purchase Requests to Approve" /

    /ShortDescriptions

    /Descriptions

    DisplayAttributes

    DisplayAttribute name="PRICEUNIT" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Price of Unit is"

    ShortDescriptions

    Description Language="en" Description="Price of Unit is" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="QUANTITYREQUESTED" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Qty. of items"

    ShortDescriptions

    Description Language="en" Description="Quantity of items requested" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="VALUATIONPRICE" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Total Price"

    ShortDescriptions

    Description Language="en" Description="Total Price" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="ReleaseCode" type="string" width="" sortable="yes" format="medium"

    Descriptions default="ReleaseCode"

    ShortDescriptions

    Description Language="en" Description="REL CODE" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="rejectCol" type="checkbox" width="" actionRef="rejected" vAlign="TOP" hAlign="CENTER"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Reject"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="approveCol" type="checkbox" width="" actionRef="released" vAlign="TOP" hAlign="CENTER"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Released"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    /DisplayAttributes

    Actions

    Action name="released" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="releaseStepCreated"/

    Property name="objectType" value="BUS2009"/

    Property name="objectId" value="${item.externalObjectId}"/

    Property name="ReleaseCode" value="${item.ReleaseCode}"/

    /Properties

    Descriptions default="Release"/

    /Action

    Action name="rejected" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="rejection_start"/

    Property name="objectType" value="BUS2009"/

    Property name="objectId" value="${item.externalObjectId}"/

    Property name="ReleaseCode" value="${item.ReleaseCode}"/

    /Properties

    Descriptions default="Reject"/

    /Action

    Action reference="submitUserDecisions" /

    /Actions

    /View

    View name="ProjectManagerApprovalView" width="98%"supportedItemTypes="uwl.task.webflow.TS90200002"

    columnOrder="TS_ENAME, TS_PERNR, TS_ROLE,rejectCol, approveCol"

    sortby="TS_ENAME" selectionMode="SINGLESELECT" tableDesign="ALTERNATING"

    tableNavigationFooterVisible="yes" emphasizedItems="new" visibleRowCount="15"

    Descriptions default="Purchase Requests to Approve"

    ShortDescriptions

    Description Language="en" Description="Managers Approve View" /

    /ShortDescriptions

    /Descriptions

    DisplayAttributes

    DisplayAttribute name="TS_ENAME" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Name"

    ShortDescriptions

    Description Language="en" Description="Name" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="TS_PERNR" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Id"

    ShortDescriptions

    Description Language="en" Description="Id" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="TS_ROLE" type="string" width="" sortable="yes" format="medium"

    Descriptions default="Released by"

    ShortDescriptions

    Description Language="en" Description="Released by" /

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="rejectCol" type="checkbox" width="" actionRef="rejected" vAlign="TOP" hAlign="CENTER"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Reject"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    DisplayAttribute name="approveCol" type="checkbox" width="" actionRef="approved" vAlign="TOP" hAlign="CENTER"

    Descriptions default=""

    ShortDescriptions

    Description Language="en" Description="Approve"/

    /ShortDescriptions

    /Descriptions

    /DisplayAttribute

    /DisplayAttributes

    Actions

    Action name="approved" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="Completed"/

    Property name="objectType" value="ZCATS"/

    Property name="objectId" value="${item.externalObjectId}"/

    /Properties

    Descriptions default="Release"/

    /Action

    Action name="rejected" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"

    Properties

    Property name="eventName" value="rejected"/

    Property name="objectType" value="ZCATS"/

    Property name="objectId" value="${item.externalObjectId}"/

    /Properties

    Descriptions default="Reject"/

    /Action

    Action reference="submitUserDecisions" /

    /Actions

    /View

    /Views

    NavigationNode name="root" view="" referenceGroup="" visible="yes" keepItemCountUpdated="no"

    NavigationNode name="Main" view="" referenceGroup="" visible="yes" keepItemCountUpdated="no"

    NavigationNode name="CombinedTask" view="DefaultView" referenceGroup="" visible="yes" keepItemCountUpdated="no"

    Descriptions default="Inbox"

    ShortDescriptions

    Description Language="en" Description="Ness Inbox"/

    /ShortDescriptions

    /Descriptions

    NavigationNode name="task2" view="DefaultView" referenceGroup="UWL_ADD_DYNAMIC_VIEWS" visible="yes" keepItemCountUpdated="no" referenceBundle="new_and_inprogress_tasks"

    NavigationNode name="PersonalViewPlaceHolderTask2" view="" referenceGroup="UWL_PERSONAL" visible="yes" keepItemCountUpdated="no"/

    /NavigationNode

    /NavigationNode

    NavigationNode name="PurchuaseInbox" view="PurchaseApproval67" referenceGroup="" visible="yes" keepItemCountUpdated="no"

    Descriptions default="Purchase and Requisition Requests"

    ShortDescriptions

    Description Language="en" Description="Purchase and Requisition Requests"/

    /ShortDescriptions

    /Descriptions

    NavigationNode name="task67" view="PurchaseApproval67" referenceGroup="UWL_ADD_DYNAMIC_VIEWS" visible="yes"

    Descriptions default="Purchase Requests to Approve 67"

    ShortDescriptions

    Description Language="en" Description="Purchase Requests to Approve 67"/

    /ShortDescriptions

    /Descriptions

    NavigationNode name="PurchaseApproval67" view="" referenceGroup="UWL_PERSONAL" visible="yes" /

    /NavigationNode

    /NavigationNode

    NavigationNode name="EssInbox" view="ProjectManagerApprovalView" referenceGroup="" visible="yes" keepItemCountUpdated="no" referenceBundle="tasks"

    Descriptions default="Ess Inbox"

    ShortDescriptions

    Description Language="en" Description="Ess Inbox"/

    /ShortDescriptions

    /Descriptions

    NavigationNode name="EssTasksInbox" view="ProjectManagerApprovalView" referenceGroup="UWL_ADD_DYNAMIC_VIEWS" visible="yes"

    Descriptions default="Project Manager Approval View"

    ShortDescriptions

    Description Language="en" Description="Project Manager Approval View"/

    /ShortDescriptions

    /Descriptions

    NavigationNode name="ProjectManagerApprovalView" view="" referenceGroup="UWL_PERSONAL" visible="yes" /

    /NavigationNode

    /NavigationNode

    /NavigationNode

    /NavigationNode

    /UWLConfiguration

    DB:2.32:Uwl - Releasecode Has No Value m7


    {?xml version="1.0" encoding="UTF-8"?}

    {!DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN' 'uwl_configuration.dtd' }

    {UWLConfiguration version="1.0"}

    {ItemType name="uwl.task.webflow.TS90100067" connector="WebFlowConnector" defaultView="PurchaseApproval67" }

    {ItemTypeCriteria externalType="TS90100067" connector="WebFlowConnector"/}

    {CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="BUS2009" cacheValidity="final"}

    {Attribute name="PRICEUNIT" type="string"displayName="Price" /}

    {Attribute name="QUANTITYREQUESTED" type="string"displayName="quantity" /}

    {Attribute name="VALUATIONPRICE" type="string"displayName="total" /}

    {/CustomAttributeSource}

    {CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="externalId" objectType="WebFlowContainer" cacheValidity="final"}

    {Attribute name="_WORKITEM" type="string" displayName="_WORKITEM"/}

    {Attribute name="RELEASECODE" type="string"displayName="releaseCode" /}

    {/CustomAttributeSource}

    {CustomAttributeSource id="UM" objectIdHolder="creatorId" objectType="user"cacheValidity="final"}

    {Attribute name="firstName" type="string" displayName="firstName"/}

    {Attribute name="lastName" type="string" displayName="lastName"/}

    {/CustomAttributeSource}

    {/CustomAttributes}

    {Action name="launchSAPAction" groupAction="" handler="SAPIACLauncher" returnToDetailViewAllowed="yes" launchInNewWindow="yes" launchNewWindowFeatures="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no"}

    {Property name="GuiType" value="WebGui"/}
    {Property name="openInNewWindow" value="yes"/}

    {/Properties}
    {/Action}
    {Action name="released" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"}

    {Property name="eventName" value="releaseStepCreated"/}

    {Property name="objectType" value="BUS2009"/}

    {Property name="objectId" value="${item.externalobjectid}"/}

    {Property name="RELEASECODE" value="${item.RELEASECODE}"/}

    {/Properties}

    {Descriptions default="Release"/}

    {/Action}

    {Action name="rejected" userDecision="yes" groupAction="yes" handler="TerminatingEventHandler"}

    {Property name="eventName" value="rejection_start"/}

    {Property name="objectType" value="BUS2009"/}

    {Property name="objectId" value="${item.externalObjectId}"/}

    {Property name="ReleaseCode" value="${item.ReleaseCode}"/}

    {/Properties}

    {Descriptions default="Reject"/}

    {/Action}

    {/Actions}

    {/ItemType}

  • RELEVANCY SCORE 2.32

    DB:2.32:How To Use Mouse Wheel To Move The Array's Scroll Bar When Running? cd



    Hi,

    How to use mouse wheel to move the array's scroll bar when running?

    Can I make it without using the Event Structure and as easy as possible?

    Thank you.

    DB:2.32:How To Use Mouse Wheel To Move The Array's Scroll Bar When Running? cd


    Hello Anand,

    Thank you for your reply. I have tried and it failed.

    You can use the vi attached to have a try. It doesn't work when it run on my computer (LV 2010).










    Attachments:







    test.vi ‏8 KB

  • RELEVANCY SCORE 2.32

    DB:2.32:Midi Keyboard Gets Random Delays cj


    I have an axiom61 that I use to play software instruments in Logic Pro. Everything is right on with no delay on any of the keys on the keyboard. However when I used the mod wheel or some of the pressure pads the delay is extremely noticeable and I have to reset the device get rid of the delay. Everytime I need to use that pads or mod wheel same thing. The weird thing is I have been using this keyboard for the same purpose for over a year now with no problems. Please help!

    DB:2.32:Midi Keyboard Gets Random Delays cj

    I have an axiom61 that I use to play software instruments in Logic Pro. Everything is right on with no delay on any of the keys on the keyboard. However when I used the mod wheel or some of the pressure pads the delay is extremely noticeable and I have to reset the device get rid of the delay. Everytime I need to use that pads or mod wheel same thing. The weird thing is I have been using this keyboard for the same purpose for over a year now with no problems. Please help!

  • RELEVANCY SCORE 2.32

    DB:2.32:Mouse Wheel On Safari On Windows fx


    Is there any way to get the kEventMouseWheelMoved mouse wheel event in Safari?
    I'm not sure where to find docs on the mouse wheel for Safari on Windows.
    Is there support for this feature?

    DB:2.32:Mouse Wheel On Safari On Windows fx

    Is there any way to get the kEventMouseWheelMoved mouse wheel event in Safari?
    I'm not sure where to find docs on the mouse wheel for Safari on Windows.
    Is there support for this feature?

  • RELEVANCY SCORE 2.32

    DB:2.32:Custom Attributes In Uwl 8s



    Hi All,

    i am trying to add Custom attributes in uwl view but value is not comming for that corresponding attributes.

    My code is below

    CustomAttributes
    CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="externalId" objectType="WebflowContainer" cacheValidity="final"

    Attribute name="Reason" type="string" displayName="Reason"/
    Attribute name="BeginDate" type="string" displayName="Trip Start Date"/

    /CustomAttributeSource
    /CustomAttributes

    DisplayAttribute name="Reason" type ="string" width="" sortable="yes" format="medium"
    Descriptions default="Reason"
    ShortDescriptions
    Description Language="en" Description="Reason"/
    /ShortDescriptions
    /Descriptions
    /DisplayAttribute

    DisplayAttribute name="BeginDate" type ="date" width="" sortable="yes" format="medium"
    Descriptions default="Trip Start Date"
    ShortDescriptions
    Description Language="en" Description="Trip Start Date"/
    /ShortDescriptions
    /Descriptions
    /DisplayAttribute

    DB:2.32:Custom Attributes In Uwl 8s


    solved,

    problwm was from workflow side.

  • RELEVANCY SCORE 2.32

    DB:2.32:Retain Event Descriptions In Nt_Evinsts.Km 7p



    I have having a little problem with the "Retain Event Descriptions" in the NT event log KM. I need to get the information from a Event Id:560 security alert. Here is the part of the alert I am having problems with.The alert has this information for the Accesses:Accesses READ_CONTROL WRITE_DAC ReadAttributes and when I retrieve the information from the RetainInfo value all I get is this:Accesses READ_CONTROL Thanks in advance.John M. LockeMGM MIRAGE

    DB:2.32:Retain Event Descriptions In Nt_Evinsts.Km 7p


    Hi,we had similar problems with event descriptions containing strange characters. The cause of this problem was also patevmon.exe and support also fixed it for us.Bye,Herman.

  • RELEVANCY SCORE 2.32

    DB:2.32:Mouse Wheel Event In Silverlight pp


    How do you use the Mouse scroll event in Silverlight?

  • RELEVANCY SCORE 2.32

    DB:2.32:Event Id: 1103 In Rms Server px


    Hi
    We are using SCOM R2 with CU4. When we checked in opsmgr log in RMS we are getting every minute 20 Event id:1103 warnigs.
    Event Type: Warning
    Event Source: HealthService
    Event Category: Health Service
    Event ID: 1103
    Date: 7/14/2011
    Time: 11:24:10 AM
    User: N/A
    Computer: IND-AP142
    Description:
    Summary: 1 rule(s)/monitor(s) failed and got unloaded, 1 of them reached the failure limit that prevents automatic reload. Management group MG_IND. This is summary only event, please see other events with descriptions of unloaded rule(s)/monitor(s).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Help us to resolve the issue.
    Regards
    Donald D'souza

    DB:2.32:Event Id: 1103 In Rms Server px

    It's definitely a group that was created with the console tools - so you or someone with admin permissions would have created it. If the things it is looking for have been deleted (an MP that is deleted?) then the group is probably a hold-over, and
    can safely be deleted.
    Microsoft Corporation

  • RELEVANCY SCORE 2.32

    DB:2.32:How To Disable Mouse Wheel Event? 97


    Can anyone help me how to disable mousewheel event for VE map? My application want to disable the mouse wheel action for zooming.

    DB:2.32:How To Disable Mouse Wheel Event? 97

    I have a somewhat similar problem:

    I am using embedded PDF files as a way to easily display reports through a browser (FireFox). The actual PDF is about 10 pages long, but the HTML page is coded with the embed tag and uses the Open Parameters to display just a few aspects of the PDF, in
    an easy to read format. The annoying part is that the embedded PDF sections can accidentally be scrolled with the mousewheel, which ruins the look of the report in the browser. Is there a way to disable this?

    my html has about 16 different divs, all with embed tags within, pointing to separate sections of the same pdf document using the open parameters... here is the code:

    ********************************************************************************
    !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
    html

    head

    META HTTP-EQUIV=REFRESH CONTENT=2000
    link rel=stylesheet type=text/css href=db.css /

    script type=text/javascript
    if(document.addEventListener){ /* Chrome, Safari, Firefox */
    document.addEventListener('DOMMouseScroll', stopWheel, false);
    }
    function stopWheel(e){
    if(e.preventDefault) { e.preventDefault(); } /* Chrome, Safari, Firefox */
    }
    /script

    /head

    body id=pdf

    div id=mid onMouseOver=stopWheel(e);embed src=run_rate_original_test.pdf#page=1toolbar=0navpanes=0scrollbar=0zoom=100,135,400 width=900 height=325//div
    div id=l1embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,105 width=119 height=83//div
    div id=l2embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,105 width=119 height=83//div
    div id=l3embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,835,105 width=119 height=83//div
    div id=l4embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,233 width=119 height=83//div
    div id=l5embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,233 width=119 height=83//div
    div id=l6embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,835,233 width=119 height=83//div
    div id=l7embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,361 width=119 height=83//div
    div id=l8embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,361 width=119 height=83//div
    div id=l9embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,835,361 width=119 height=83//div
    div id=l10embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,489 width=119 height=83//div
    div id=l11embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,489 width=119 height=83//div
    div id=l12embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,835,489 width=119 height=83//div
    div id=l13embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,617 width=119 height=83//div
    div id=l14embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,617 width=119 height=83//div
    div id=l15embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,835,617 width=119 height=83//div
    div id=l16embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,134,745 width=119 height=83//div
    div id=l17embed src=run_rate_original_test.pdf#page=5toolbar=0navpanes=0scrollbar=0zoom=75,484,745 width=119 height=83//div

    /body
    /html
    ********************************************************************************

    As you can see in the first div, i was trying to use javascript to disable the mouse wheel, which did not work. I like the sound of your solution, but would you be able to provide an explanation of the html that resolved that could resolve this?

  • RELEVANCY SCORE 2.31

    DB:2.31:Violin Solo In Jp5! Part Ii 77


    Hello

    So, to turn the Fiddle into a Violin, do the following:
    1. In GarageBand, load up the Irish Fiddle.
    2. In the Track Info window, click on the Pencil Button (In the row labeled "Generator"
    3. Drag the "Attack" slider to the right slightly.
    TA DAAA!

    Now, for playing.
    Make sure you have an expression pedal.
    Move the mod wheel all the way up to get a full vibrato.
    If you want a trill one whole step up, move the mod wheel to a lower middle position.
    If you want a trill one half step up, then move the mod wheel to an upper middle position.
    Use the expression pedal to add crescendi and decrescendi.

    Hope this works!
    So long!

    DB:2.31:Violin Solo In Jp5! Part Ii 77

    Hello

    So, to turn the Fiddle into a Violin, do the following:
    1. In GarageBand, load up the Irish Fiddle.
    2. In the Track Info window, click on the Pencil Button (In the row labeled "Generator"
    3. Drag the "Attack" slider to the right slightly.
    TA DAAA!

    Now, for playing.
    Make sure you have an expression pedal.
    Move the mod wheel all the way up to get a full vibrato.
    If you want a trill one whole step up, move the mod wheel to a lower middle position.
    If you want a trill one half step up, then move the mod wheel to an upper middle position.
    Use the expression pedal to add crescendi and decrescendi.

    Hope this works!
    So long!

  • RELEVANCY SCORE 2.31

    DB:2.31:How Do I Make Mouse Wheel Event Match To Scrollviewers Scroll Event 7x


    hi, i have a scrollviewer control, and placed a lot of controls in it, i wish i can scroll the scrollviewer content by mouse wheel by default.
    but currently only when i focus on the scrollviewer's scrollbar area can the mouse wheel event drive the scrollviewer's content according, when the scrollbar lost focus the mouse wheel event does not work. i have override the scrollviewer's lostFocus and
    place the focus to scrollviewer, it does not works.
    What should i do for this problem?

    DB:2.31:How Do I Make Mouse Wheel Event Match To Scrollviewers Scroll Event 7x

    Not sure I fully understand. MouseWheel (PointerWheel) event goes to the UI Element that is under the mouse pointer. From that UI Element the event bubbles up. A ScrollViewer handles the PointerWheel event and will scroll. There isn't a way to change how
    the PointerWheel event occurs such as making it not work based upon starting at the mouse position.

    Thanks
    -mark
    Program Manager
    Microsoft
    This post is provided as-is

  • RELEVANCY SCORE 2.31

    DB:2.31:When The Mousewheel Event Called sa


    Hi,
         In my application vertical scrollbar control is there. Its working fine if i scroll it
    manually. But, to work with mouse wheel, i added the mouse wheel event of the control.
    But this event is not at all getting called.  Actually when the mouse wheel event is called.
    Any suggestions.....
    Thank u.

    DB:2.31:When The Mousewheel Event Called sa

    Odd as it may seem, a VScrollBar doesn't use the MouseWheel event but passes it to its parent instead.  Here's an example of a form that scrolls with the MouseWheel event:using System;using System.Drawing;using System.Windows.Forms;namespace WindowsApplication1 {  public partial class Form1 : Form {    public Form1() {      InitializeComponent();      this.AutoScroll = true;      this.AutoScrollMinSize = new Size(0, 3 * this.ClientSize.Height);      this.MouseWheel += new MouseEventHandler(Form1_MouseWheel);    }    private void Form1_MouseWheel(object sender, MouseEventArgs e) {      this.AutoScrollPosition = new Point(0, this.AutoScrollPosition.Y + e.Delta);    }  }}If you want to use a VScrollBar control, change its position in the Form1_MouseWheel event handler.

  • RELEVANCY SCORE 2.31

    DB:2.31:Exs Articulation Id, Smart Controls &Amp; Cc#1 37


    I've been programming some EXS instruments with custom samples and saving them as patches with custom channel strips and smart controls so I can add them quickly to new arrangements. On some of my new patches everything works fine. On some, when I programmed the smart controls with articulation ID switches, the Mod Wheel (CC#1) no longer switches articulations even though it's programmed in the mod matrix of the EXS24 to do so. I can't figure out what's going wrong.
    One of my patches isn't even receiving ANY MIDI (Logic shows notes coming in, but EXS doesn't respond). Some patches with the EXS24 will playback regions correctly where I used the event list to change articulation, but I STILL can't switch the articulations as I play with the Mod wheel. Weird! Does a Smart Control assigned to Art. ID interrupt CC#1 from changing the Art. IDs?
    After much experimentation, I'm still flummoxed. Any ideas?

    DB:2.31:Exs Articulation Id, Smart Controls &Amp; Cc#1 37

    I've been programming some EXS instruments with custom samples and saving them as patches with custom channel strips and smart controls so I can add them quickly to new arrangements. On some of my new patches everything works fine. On some, when I programmed the smart controls with articulation ID switches, the Mod Wheel (CC#1) no longer switches articulations even though it's programmed in the mod matrix of the EXS24 to do so. I can't figure out what's going wrong.
    One of my patches isn't even receiving ANY MIDI (Logic shows notes coming in, but EXS doesn't respond). Some patches with the EXS24 will playback regions correctly where I used the event list to change articulation, but I STILL can't switch the articulations as I play with the Mod wheel. Weird! Does a Smart Control assigned to Art. ID interrupt CC#1 from changing the Art. IDs?
    After much experimentation, I'm still flummoxed. Any ideas?

  • RELEVANCY SCORE 2.31

    DB:2.31:Larger And Darker Type 9z


    The descriptions under my desktop icons are small and light ...

    How do you make these descriptions ... larger and darker ??

    Thanks

  • RELEVANCY SCORE 2.31

    DB:2.31:Microsoft Dynamics Crm 2013 Event Documentation 7c


    Any documentation available for the complete microsoft dynamics crm 2013 event ids and descriptions?

    DB:2.31:Microsoft Dynamics Crm 2013 Event Documentation 7c

    Hi Sumith,
    Following MSDN articles will help you if you are looking for JScript events documentation:
    http://msdn.microsoft.com/en-us/library/gg334481.aspx
    http://msdn.microsoft.com/en-us/library/bf64f471-7582-45e7-b8ed-370bfbecda68#BKMK_GetSaveModeVikranth Pandiri Blog:
    http://howto-mscrm.blogspot.com Twitter:
    @TweetVikranth Please Mark it as answer if it helps in resolving your query

  • RELEVANCY SCORE 2.31

    DB:2.31:Mouse Scroll Wheel Event? sk


    Hello,
    There are any mouse scroll wheel event?
    Thank´s

    DB:2.31:Mouse Scroll Wheel Event? sk

    The MS didn't add Mouse-Wheel Support into Silverlight (weuse JavaScript for this purpose), see

    my post with code example that may help you.
    Enjoy,
    Maxim.

  • RELEVANCY SCORE 2.31

    DB:2.31:G25 Steering Wheel f3



    Hi,

    Just bought a G25 wheel, now i was under impression that GT5 prologe supported this wheel,

    but when i go into the settings and look for this type of wheel it does not showup, other wheels

    are listed but no sign of a G25 wheel, any 1 help with this so i can set it up .....

    Thanks ...

    DB:2.31:G25 Steering Wheel f3

    IronbruKid wrote:
    Hi,

    Just bought a G25 wheel, now i was under impression that GT5 prologe supported this wheel,

    but when i go into the settings and look for this type of wheel it does not showup, other wheels

    are listed but no sign of a G25 wheel, any 1 help with this so i can set it up .....

    Thanks ...
    Without turning the game on to check I think you set it up under the settings for "driving force pro".



    PSN: DrTrouserPlankXBL: AgentKillmore

  • RELEVANCY SCORE 2.31

    DB:2.31:Korg Kontrol49 Mod Wheel + Logic 8 7m


    Has anyone figured out how to get the mod wheel to work in Logic 8? I've read a few posts but the replies seem to be 'RTFM' or the need for a hack / additional software to make the mod wheel work...

    I'm new to MIDI controllers (though not a complete idiot...)

    I see where I can set up the K49 as a control surface, and has a learn function, but the mod wheel ends up being 'pan'.

    Any help would be appreciated, as it seems the manual for the K49 was written before Logic 8.

    DB:2.31:Korg Kontrol49 Mod Wheel + Logic 8 7m

    Has anyone figured out how to get the mod wheel to work in Logic 8? I've read a few posts but the replies seem to be 'RTFM' or the need for a hack / additional software to make the mod wheel work...

    I'm new to MIDI controllers (though not a complete idiot...)

    I see where I can set up the K49 as a control surface, and has a learn function, but the mod wheel ends up being 'pan'.

    Any help would be appreciated, as it seems the manual for the K49 was written before Logic 8.

  • RELEVANCY SCORE 2.31

    DB:2.31:Table Fields Required 9x



    What is the table and the fields with following descriptions

    1.Partner type Description

    2.Partner type name

    3.Partner name

    DB:2.31:Table Fields Required 9x


    The partner details can be found in the table EDPP1 or AT81 or EDIPHONE.