Truck number

Hello,
could you pls let us know how to make mandatory fields in Header data for "Forwarding agent" and "Truck number" while creating STO in IS oil senarios.
thanks,
SapNA

You have add coding in include ZXM06U43 of user exit  EXIT_SAPMM06E_012  of project MM06E005 in cmod.
code attached
***Material Code Mandatory with Acct Assignment Q-End.
***To disallow PO without GR Indicator for document type other than HR
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = space .
  message e000(zmm) with 'Fill the Mode of Transport in Header Section'.
endif.
if i_ekko-bsart = 'UB' and  i_ekko-oic_mot = 5 and ( i_ekko-oic_ptrip = space OR i_ekko-oic_pbatch = space ) .
  message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Header Section'.
endif.
*---item level check start-----
if i_ekko-bsart = 'UB' and  ( i_ekko-oic_mot = 5 or i_ekko-oic_mot = 1 oR i_ekko-oic_mot = 2 ) .
  read table tekpo index 1.
  read table tekpo with key oic_mot  =  space  .
  if sy-subrc = 0.
    message e000(zmm) with 'Enter Item Mode of Transport' .
  endif.
endif.
if i_ekko-bsart = 'UB' and   i_ekko-oic_mot = 5  .
  read table tekpo index 1.
  read table tekpo with key oic_mot  =  5   .
  if sy-subrc = 0.
  else.
    message e000(zmm) with 'Enter Item Mode of Transport as 5' .
  endif.
endif.
if i_ekko-bsart = 'UB' and   i_ekko-oic_mot = 2  .
  read table tekpo index 1.
  read table tekpo with key oic_mot  =  2   .
  if sy-subrc = 0.
  else.
    message e000(zmm) with 'Enter Item Mode of Transport as 2' .
  endif.
endif.
if i_ekko-bsart = 'UB' and   i_ekko-oic_mot = 1  .
  read table tekpo index 1.
  read table tekpo with key oic_mot  =  1   .
  if sy-subrc = 0.
  else.
    message e000(zmm) with 'Enter Item Mode of Transport as 1' .
  endif.
endif.
if i_ekko-bsart = 'UB' and i_ekko-oic_mot = 5.
  read table tekpo index 1.
  if tekpo-oic_ptrip = space or tekpo-oic_pbatch = space.
    message e000(zmm) with 'Enter Pipe Line,Batch and Trip Number in Item Section'.
  endif.
endif.
if i_ekko-bsart = 'UB' .
  read table tekpo index 1.
  if ( tekpo-oiumbar ne 'OWN-BOND' or tekpo-oiumbar ne 'OWN-BONDBR' ) and  tekpo-bwtar = space .
    if tekpo-matnr ne 'MTBE01'.
      message e000(zmm) with 'Enter VAL Type of supplying and receiving plant in Item Section'.
    endif.
  endif.
regards
Dipak

Similar Messages

  • To make Truck Number Field Mandatory

    Hi,
    In Delivery creation / Change (VL01N / VL02N),  at item level details , we have Extternal Details button, in this we have Truck number. This fields (OIC_TRUCKN) we can find in LISP table.
    My requirment is to make this field as Mandatory (i.e to make required field) based on certern contion like Delivary type and shipping point.
    Could any one let me know how to resolve this requirement and is there and BADI or User Exits.
    Thanks.
    KK

    Hi,
    Did you try BADI LE_SHP_DELIVERY_PROC or the old style sales exit in program SAPMV50A (include MV50AFZ1), form USEREXIT_SAVE_DOCUMENT_PREPARE ?
    Best regards,  Andy

  • Need Help with complex query and computing values

    I have an issue trying to combine data from several tables. I need help trying to compute the "Total Hours", "Max Pressure" ,"Average Pressure" while displaying the "Manufacturer",
    "Part Type" , "Serial Number", "District", "Status","Truck Type",and "truck number" for a certain Part on all Trucks. I need to be able check and see if the serial number was on
    a particular job and calculate the hours of that serial number if it was on that job and the jobdate falls between the install date and removal date. Ive tried but keep getting either
    repeating rows, total hrs of the truck instead of the serial number. Ive considered doing a pivot to display it but have been having trouble putting it together.
    table 1
    (*records of parts*)
     Contains  serial number,truck number, part type, part number, install date, removal date, status
    table 2
    (*records of Jobs*)
    contains Jobnumber, JobStartdate, Max pressure, average pressure, and Totalhrs
    table 3
    (records related to jobs and trucks)
    contains jobnumber, district , and truck numbers
    Table 4
    (records of manufacturers and part numbers)
    contains partnumber, manufacturer name, and truck type
    I would like to get it to show like below
    SerialNo   PrtType       
    MFG      TruckNo  
     TrkType    TtlHrs 
       MaxPr   AvgPr 
      Status    
    Dst
    AB345     1200series  
    NGK        2G34        
    Boss X       400     10,000 
     9500  NonOp    
    NE
    Thanks in advance

    Hope this helps
    Note: (Date of Mar 1 2014 was just extended to a further date so the system would know that its still operating when calculating current hours)
    Table 1
    SerialNo    TruckNo  InstallDate RemovalDate      Status       PartNo      PartType
    BJ1002       F917   2013-09-17   2014-03-01   Oper         L871235       BJ 3000 GL
    CWS1002   F104   2012-11-21   2013-03-29   NonOper   L76088-450   CWS 2000
    CWS1003   F104   2013-04-24   2013-08-01   NonOper   L76088-450   CWS 2000
    CWS1005   F187   2012-11-21   2013-04-04   NonOper   L76088-450   CWS 2000
    CWS1006   F187   2013-04-24   2013-06-30   NonOper   L76088-450   CWS 2000
    CWS1007   F187   2013-06-30   2013-03-01   Oper         L76088-450   CWS 2000
    CWS1009   2F60   2013-05-05   2013-03-01   Oper         L76088-450   CWS 2000
    CWS1011   F809   2013-05-28   2013-08-28   NonOper   L76088-400   CWS 2000
    CWS1013   F990   2013-06-11   2013-10-29   NonOper   L76088-450   CWS 2000
    CWS1015   F783   2013-06-28   2013-03-01   Oper         L76088-450   CWS 2000
    Table 2
    JobNumber    Date                 District         PrAvTreat PrMaxTr TotalHrs
    553811287    2012-01-19    Fairmount    7337        8319     1.53
    652110088    2012-08-20    San Antonio  6340       7075      0.47
    652110090    2012-08-21    San Antonio  6134       7131      0.62
    652110091    2012-08-22    San Antonio  6180       2950      0.58
    652110092    2012-08-23    San Antonio  5959       6789      0.64
    652110093    2012-08-23    San Antonio  6165       7466      0.62
    Table 3
    TruckNo District    JobNumber
    1F01      Odessa   10011012329
    1F01      Odessa   10011012333
    1F01      Odessa   10011014831
    1F01      Odessa   10011014834
    1F01      Odessa   10011012332
    1F01      Odessa   10011012328
    1F01      Odessa   10011014829
    Table 4
    PartNumber    Manufacturer  TruckType
    L322020-2     Jimmy Dean   Ford T
    L322738-2     Lucas             Ford T
    L47869-1       Jimmy Dean   Ford T
    L76070-650   NGK               Ford T   
    Sam Howard

  • Help with event listener

    I'm having some trouble trying to figure out how this event listener will work.
    The main application is building an arrayCollection of a calendarDay custom components which is displayed by a DataGroup.
    Within each calendarDay custom component i may create an arrayList of a DriverDetailComponent custom components displayed within the calendarDay by a DataGroup.
    If a user double clicks on the DriverDetailComponent that is two layers in I would like to change states of the main application.  I'm having trouble figuring out what item in the main application to set the listener on.  Please help.
    I can't figure out how to post the below as scrollable code snips so this is very long.
    Main application code:
    <code><?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:components="components.*"
                   preinitialize="readDataFile()"
                   creationComplete="buildRowTitles()"
                   width="1024" height="512"  backgroundColor="#A4BDD8">
        <s:states>
            <s:State name="State1"/>
            <s:State name="driverDetailState"/>
        </s:states>
        <!--
        <fx:Style source="EventCalendar.css"/>
        creationComplete="readDataFile()"    creationComplete="driversList.send()"-->
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->       
            <mx:DateFormatter id="myDateFormatter"
                              formatString="EEE, MMM D, YYYY"/>
            <!--<s:HTTPService id="driversList"
                           url="files/drivers.xml"
                           result="driversList_resultHandler(event)"
                           fault="driversList_faultHandler(event)"/>
            <s:HTTPService id="postDriversList"
                           url="files/drivers.xml"
                           method="POST"
                           result="postDriversList_resultHandler(event)"
                />-->
            <!--<s:Move id="expandTab"
                    target="{labelTab}"
                    xBy="250"/>-->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import components.CalendarDay;
                import components.TruckDriver;
                import components.calendarDay;
                import events.CancelChangeDriversEvent;
                import events.ChangeDriversEvent;
                import events.EditDriverEvent;
                import mx.collections.ArrayCollection;
                import mx.collections.ArrayList;
                import mx.containers.Form;
                import mx.controls.Alert;
                import mx.controls.CalendarLayout;
                import mx.core.FlexGlobals;
                import mx.core.IVisualElement;
                import mx.core.WindowedApplication;
                import mx.printing.FlexPrintJob;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.rpc.xml.SimpleXMLEncoder;
                import spark.components.Application;
                import utilities.FormatUtil;
                import utilities.ObjectToXML;
                /* public var prefsFile:File; */ // The preferences prefsFile
                [Bindable] public var driversXML:XML; // The XML data
                public var stream:FileStream; // The FileStream object used to read and write prefsFile data.
                public var fileName:String="driversArrayCollection";
                public var directory:String = "AceTrackerData";
                public var dataFile:File = File.documentsDirectory.resolvePath(directory + "\\" + fileName);
                [Bindable]
                public var drivers:ArrayCollection=new ArrayCollection();
                private var fileStream:FileStream;
                [Bindable]
                public var calendarDayArray:ArrayCollection = new ArrayCollection;
                public var i:int;
                [Bindable]
                public var weekOneTitle:String;
                [Bindable]
                public var weekTwoTitle:String;
                [Bindable]
                public var weekThreeTitle:String;
                [Bindable]
                public var weekFourTitle:String;
                public var day:Object;
                protected function readDataFile():void
                    if(dataFile.exists)
                        fileStream = new FileStream();
                        fileStream.open(dataFile, FileMode.READ);
                        drivers = fileStream.readObject() as ArrayCollection;
                        fileStream.close();
                    else
                        drivers = new ArrayCollection();
                        var driver:TruckDriver = new TruckDriver("New", "Driver", 000);
                        drivers.addItem(driver);
                        saveData(drivers);
                    buildCalendarArray();
                protected function buildCalendarArray():void
                    calendarDayArray.removeAll();
                    for (i=0; i<28; i++)
                        var cd:calendarDay = new calendarDay;
                        cd.dateOffset= i-7
                        cd.drivers=drivers;
                         cd.addEventListener("editDriverEvent",editDriverEvent_Handler);
                        calendarDayArray.addItem(cd);
              private function saveData(obj:Object):void//this is called on the postDriversList result handler to create and write XML data to the file
                    var fs:FileStream = new FileStream();
                    fs.open(dataFile, FileMode.WRITE);
                    /* fs.writeUTFBytes(myXML); */
                    fs.writeObject(drivers);
                    fs.close();
                protected function driverschedule1_changeDriversHandler(event:ChangeDriversEvent):void
                    saveData(drivers); 
                    readDataFile();//i read the drivers file again, this refreshes my data, and removes any temporary data that may have been stored in the drivers array
                    buildCalendarArray();
                    currentState = 'State1';//this hides the driversdetail window after we've clicked save
                    /* postDriversList.send(event.driverInfo); */  //this needs to be different
                    /* Alert.show("TEST"); */
                protected function driverschedule1_cancelChangeDriversHandler(event:CancelChangeDriversEvent):void
                    /* Alert.show("Changes have been canceled."); */
                    readDataFile();//this re-reads the saved data file so that the changes that were made in the pop up window
                    // are no longer reflected if you reopen the window
                    buildCalendarArray();
                    currentState = 'State1';  //this hides the driversdetail window after we've clicked cancel
                protected function buildRowTitles():void
                    var calendarDay0:Object;
                    var calendarDay6:Object;
                    calendarDay0=calendarDayArray.getItemAt(0);
                    calendarDay6=calendarDayArray.getItemAt(6);
                    weekOneTitle = calendarDay0.getDayString() + " - " + calendarDay6.getDayString();
                    weekTwoTitle=calendarDayArray.getItemAt(7).getDayString()+ " - " + calendarDayArray.getItemAt(13).getDayString();
                    weekThreeTitle=calendarDayArray.getItemAt(14).getDayString()+ " - " + calendarDayArray.getItemAt(20).getDayString();
                    weekFourTitle=calendarDayArray.getItemAt(21).getDayString()+ " - " + calendarDayArray.getItemAt(27).getDayString();
            ]]>
        </fx:Script>
        <s:Group height="100%" width="100%">
            <s:layout>
                <s:BasicLayout/>  <!--This is the outermost layout for the main application MXML-->
            </s:layout>
        <s:Scroller width="95%" height="100%"  >
        <s:Group height="100%" width="100%"  ><!--this groups the vertically laid out row titles hoizontally with the large group of calendar days and day titles-->
            <s:layout>
                <s:HorizontalLayout/>
            </s:layout>
        <s:Group height="95%" width="50" ><!--this is the group of row titles layed out vertically-->
            <s:layout>
                <s:VerticalLayout paddingLeft="40" paddingTop="35"/>
            </s:layout>
            <s:Label text="{weekOneTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
            <s:Label text="{weekTwoTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center" />
            <s:Label text="{weekThreeTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
            <s:Label text="{weekFourTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
        </s:Group>
        <s:Group height="100%" width="100%" >
            <!--this vertically groups together the horizontal day names group and the tile layout datagroup of calendar days-->
            <s:layout>
                <s:VerticalLayout paddingLeft="5"/>
            </s:layout>
        <s:Group width="100%" >
            <s:layout><!--this group horizontal layout is for the Day names at the top-->
                <s:HorizontalLayout paddingTop="10"/>
            </s:layout>
            <s:Label id="dayNames" text="Sunday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Monday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Tuesday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Wednesday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Thursday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Friday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Saturday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
        </s:Group>
            <!--<s:SkinnableContainer width="16%">-->
                <s:DataGroup id="calendarDataGroup"
                             dataProvider="{calendarDayArray}"
                             itemRenderer="{null}"  resizeMode="scale"
                              height="100%" width="100%"
                              >  <!--  I had to use a null renderer because otherwise each instance is added in a group container renderers.DriverScheduleRenderer-->
                    <s:layout >
                        <s:TileLayout requestedColumnCount="7" />
                    </s:layout>
                </s:DataGroup>
            <!--</s:SkinnableContainer>-->
        <!--<mx:FormItem label="Today's Date:">
            <s:TextInput id="dateToday"
                         text="{myDateFormatter.format(testDate)}"/>
        </mx:FormItem>-->
        <!--<components:DriverSchedule drivers="{drivers}"
                                   changeDriversEvent="driverschedule1_changeDriversHandler(event)"/>-->
            <s:HGroup>  <!--this groups together my drivers button and my print button at the bottom of the calendar-->
            <s:Button id="showDriverDetailButton"
                      label="Driver List"
                      click="currentState = 'driverDetailState'">
                <!--</s:Button>
                <s:Button id="printButton"
                    label="Print"
                    >  click="printButton_clickHandler(event)"-->
                </s:Button>
            </s:HGroup>    <!--this is the end of the small hgroup which pairs my drivers button with the print button-->                  
        </s:Group><!--this ends the vertical grouping of the day names and the tile layout calendar-->   
    </s:Group>        <!--this ends the horizontal grouping of the calendar (names and days) with the week labels at the left-->
        </s:Scroller>
            <s:SkinnableContainer includeIn="driverDetailState"
                                  width="95%" height="95%"  horizontalCenter="0" verticalCenter="0"
                                  backgroundColor="#989898" backgroundAlpha="0.51">
                <s:BorderContainer horizontalCenter="0" verticalCenter="0">
                <components:DriverSchedule id="driverSchedule"
                                            drivers="{drivers}"
                                           changeDriversEvent="driverschedule1_changeDriversHandler(event)"
                                           cancelChangeDriversEvent="driverschedule1_cancelChangeDriversHandler(event)"
                                           />
                </s:BorderContainer>
            </s:SkinnableContainer>
        </s:Group>  <!--end of basic layout group-->
    </s:WindowedApplication>
    </code>
    calendarDay.mxml code:
    <code>
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx"
             creationComplete="initDay()"
              width="100%">  <!--width="16%" height="25%"  width="160" height="112"-->
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <mx:DateFormatter id="myDateFormatter"
                              formatString="MMM D"/>
        </fx:Declarations>
        <fx:Metadata>
            [Event(name = "editDriverEvent", type="events.EditDriverEvent")]
        </fx:Metadata>
        <fx:Script>
            <![CDATA[
                import components.CalendarDay;
                import components.DriverDetailComponent;
                import events.EditDriverEvent;
                import mx.collections.ArrayCollection;
                import mx.collections.ArrayList;
                import mx.controls.CalendarLayout;
                import mx.controls.DateField;
                [Bindable]
                public var todayCollection:ArrayCollection = new ArrayCollection;
                [Bindable]
                public var todayList:ArrayList=new ArrayList; //arraylist created as data provider for dataGroup, this is where all drivers with an arrival date of today are added
                [Bindable]
                public var currDate:Date =new Date; //this will be used to contain the current real world date
                [Bindable]
                public var calDate:Date = new Date; //this is used below to determine the date of the calender day that is being created
                [Bindable] 
                public var todaysDate:CalendarDay;
                [Bindable]
                public var currDay:int;
                [Bindable]
                public var dateOffset:int;
                public var drivers:ArrayCollection= new ArrayCollection();
                   public var driver:Object;  
                public var rowLabel:String;
                public function initDay():void
                    todaysDate  = new CalendarDay(currDate, currDate.day, dateOffset)//currDate represents the day the operating system says today is
                        currDay=todaysDate.returnDate().getDate();//currDay is an int representing the day of the month
                        calDate=todaysDate.returnDate();//calDate represents the actual date on the calendar (MM-DD-YYY) that is currently being evaluated
                        /* if (currDay ==currDate.getDate()) //i want to highlight the day if it is in fact today
                            cont.styleName="Today";
                            if (calDate.getDate() == currDate.getDate())
                            calDayBorder.setStyle("backgroundColor", "#FFFF00");
                        else
                            calDayBorder.setStyle("backgroundColor", "#EEEEEE");
                         addDrivers(); 
                    return;
                  public function addDrivers():void
                       var count:int = 0;
                      /*var driverDetail:DriverDetailComponent;
                      var driver =  */
                    for each (driver in drivers)
                    {//i check the date value based on data entry of mm-dd-yy format against the calculated date for the day
                        //the calender is building and if it is equal the drivers information is added to this day of the calendar
                        if (DateField.stringToDate(driver.arrivalDate,"MM/DD/YYYY").getDate() == calDate.getDate())
                                var driverDetail:DriverDetailComponent = new DriverDetailComponent; //i create a new visual component that adds the id and destination to the calendar day
                                driverDetail.driverid = drivers[count].id; //i feed the id property which is the truck# - firstName
                                driverDetail.driverToLoc=drivers[count].toLoc; //i feed the toLoc which is the current destination of the driver
                                driverDetail.driverArrayLocation=count;   //here i feed the location of this driver in the "drivers" array so i know where it's at for the click listener
                                todayList.addItem(driverDetail);
                            //this concatenates the drivers truck number first name and destination to display in the calendar day
                                /* todayList.addItem(driver.truckNumber + " - " + driver.firstName + " - " + driver.toLoc); */
                    count ++;
                public function getDayString():String
                    rowLabel =myDateFormatter.format(calDate);
                    return rowLabel;
            ]]>
        </fx:Script>
        <s:BorderContainer id="calDayBorder" width="160" styleName="Today" cornerRadius="2" dropShadowVisible="true" height="100%">
            <s:layout>
                <s:BasicLayout/>   
            </s:layout>
            <!--I need to make a custom item renderer for my calendar days that limits the height and width of the day, and also puts the items
            closer together so i can fit maybe 5 drivers on a single day-->
            <s:DataGroup dataProvider="{todayList}"
                         itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"
                         bottom="-2"
                         width="115" left="2">  <!--width="94%"  width="100"  width="16%"-->
                <s:layout >
                    <s:VerticalLayout gap="-4"/> <!--The reduced gap pushes the drivers together if there are serveral on one day. This helps cleanly show several drivers on one day-->
                </s:layout>
            </s:DataGroup >
            <s:Label  text="{currDay}" right="3" top="2" fontSize="14" fontWeight="bold"/>
        </s:BorderContainer>
    </s:Group>
    </code>
    DriverDetailComponent code:
    <code><?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Metadata>
            [Event(name = "editDriverEvent", type="events.EditDriverEvent")]
        </fx:Metadata>
        <fx:Script>
            <![CDATA[
                import events.EditDriverEvent;
                import mx.controls.Alert;
                [Bindable]
                public var driverid:String;
                [Bindable]
                public var driverArrayLocation:int;
                [Bindable]
                public var driverToLoc:String;
                protected function label1_doubleClickHandler(event:MouseEvent):void
                    Alert.show("You have selected " +driverid +" at location "  + driverArrayLocation.toString() +" in the drivers ArrayCollection.");
                    var eventObject:EditDriverEvent = new EditDriverEvent("editDriverEvent",driverArrayLocation);
                    dispatchEvent(eventObject);
            ]]>
        </fx:Script>
        <s:Label id="driverDetailLabel" text="{driverid} - {driverToLoc}"  doubleClick="label1_doubleClickHandler(event)" doubleClickEnabled="true"/>
    </s:Group>
    </code>

    lkb3 wrote:
    I'm trying to add a listener to [this JOptionPane pane dialog box|http://beidlers.net/photos/d/516-1/search_screenshot.JPG|my dialog box], so that when it pops up, the cursor is in the text box, but then if the user clicks a button other than the default, the cursor reverts back into the text box.
    The code I have is this:
      // BUILD DIALOG BOX
    JLabel option_label = new JLabel("Select a search option:");
    // Create the button objects
    JRadioButton b1 = new JRadioButton("Search PARTS by name");
    JRadioButton b2 = new JRadioButton("Search ASSEMBLIES by name");
    JRadioButton b3 = new JRadioButton("Search DRAWINGS by name");
    JRadioButton b4 = new JRadioButton("Search all by DESCRIPTION");
    b1.setSelected(true);
    // Tie them together in a group
    ButtonGroup group = new ButtonGroup();
    group.add(b1);
    group.add(b2);
    group.add(b3);
    group.add(b4);
    // Add them to a panel stacking vertically
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
    panel.add(b1);
    panel.add(b2);
    panel.add(b3);
    panel.add(b4);
    JLabel name_label = new JLabel("Enter a search term (add *'s as required)");
    JTextField name = new JTextField(30);
    name.addComponentListener(new ComponentListener() {
    public void componentHidden(ComponentEvent ce) { }
    public void componentMoved(ComponentEvent ce) { }
    public void componentResized(ComponentEvent ce) {
    ce.getComponent().requestFocus();
    public void componentShown(ComponentEvent ce) { }
    Object[] array = { option_label, panel, name_label, name };
    // GET INPUT FROM USER
    int res = JOptionPane.showConfirmDialog(null, array, "Select", JOptionPane.OK_CANCEL_OPTION);
    String searchTerm = name.getText();This sucessfully has the focus in the text box when opened; is there a way to get the focus to go back into the text box after the user clicks a radio button?
    Thanks!
    [this JOptionPane pane dialog box|http://beidlers.net/photos/d/516-1/search_screenshot.JPG|dialog Joption]
    you will need to add ItemListener to the JRadioButtons

  • BAPI for Sales Order Creation.

    Hello gurus,
    I want to create a sales order using BAPI.
    I have tried some BAPI's like BAPI_SALESORDER_CREATEFROMDAT1, BAPI_SALESORDER_CREATEFROMDAT2, BAPI_SALESORDER_CREATEFROMDATA, BAPI_SALESDOCU_CREATEWITHDIA.
    But I am not able to update the Miscellaneous Information like Mode of transport(VBAP-OIC_MOT), Forwarding Agent(VBAP-OIC_LIFNR), Base Location(VBAP-OIA_BASELO), Truck Number(VBAP-OIC_TRUCKN), Pipeline trip No.(VBAP-OIC_PTRIP), Pipeline operator´s external batch number(VBAP-OIC_PBATCH).
    Is there any other BAPI thru which i can update these fields while creation of Sales Order.
    The Fields which I can provide to BAPI as import parameter is:
    Order Type(VBAK-AUART),
    Contract(VBAK_VGBEL),
    SALES Org (VBAK-VGORT),
    Dist Channel(VBAK-VTWEG),
    Division (VBAK-SPART),
    Open Quantity (VBAK-KWMENG)
    Plant(VBAP-WERKS)
    Storage Location (VBAP-LGORT)
    Mode of transport(VBAP-OIC_MOT), Forwarding Agent(VBAP-OIC_LIFNR), Base Location(VBAP-OIA_BASELO), Truck Number(VBAP-OIC_TRUCKN), Pipeline trip No.(VBAP-OIC_PTRIP), Pipeline operator´s external batch number(VBAP-OIC_PBATCH).
    Thanks In Advance,
    Points will be rewarded for Best Solution......
    Yogesh Sharma

    hi,
    I can give u a suggestion .. try it ..
    its a quite a long process....
    in BAPI_SALESORDER_CREATEFROMDAT2
    there is a table EXTENSIONIN...
    here u can add append structure and carry on ur sales order creation
    Follow the process
    Customer Enhancement for VBAK, VBAP, VBEP
    Description
    You can use this parameter to transfer user-specific enhancments to a BAPI. The customer has to complete the EXTENSION structure and the system automatically continues processing it. If you have not defined any user-specific fields, then you can transfer a blank EXTENSIONIN structure.
    Technical information about Customer Enhancements
    The following description uses an example to explain how to proceed with customer enhancements to the SD tables VBAK, VBKD, VBAP and VBEP.
    The customer has added their own fields to table VBAP using the INCLUDE structure CUTEST. This structure contains 2 fields:
    CFIELD1, CHAR 10
    CFIELD2, CHAR 3.
    The customer also requires that these two fields can be maintained with the BAPI.
    1. Maintain structure CUTEST in table VBAP
    2. Because the BAPIs work with checkboxes, you must also define a CUTESTX checkbox for the customer structure. It should be structured like this:
    Field name       Data element
    CFIELD1            CHAR1
    CFIELD2          CHAR1
    3. Define these customer structures in the structures VBAPKOZ und VBAPKOZX using INCLUDE or APPEND.
    4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
    5. Adjust the following structures for customer enhancements to table VBAK:
    a) VBAKKOZ
    b) VBAKKOZX
    c) BAPE_VBAK
    d) BAPE_VBAKX
    6. Adjust the following structures for customer enhancements to table VBEK:
    a) VBEPKOZ
    b) VBEPKOZX
    c) BAPE_VBEP
    d) BAPE_VBEPX
    7. Generally, the data should be added to the BAPI interface in the internal communication structures (VBAKKOM, and so on). There, you can process the data in the SD tables (VBAK, and so on).
    8. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
    For example:
    You want to change customer field VBAP-CFIELD2 for item 20 to "XYZ" in order 4711.
    The following entries are expected:
    Import:     BAPIVBELN-VBELN       = '0000004711'  Document number
                BAPISDHD1X-UPDATEFLAG = 'U'           UPDKZ for doc header
    Tables:     BAPISDITM-ITM_NUMBER  = '000020'      Item number
                BAPISDITMX-ITM_NUMBER = '000020'      Item number
              + BAPISDITMX-UPDATEFLAG = 'U'           UPDKZ for item
    You must complete the EXTENSION table as follows:
    STRUCTURE                          VALUEPART1       1234561234567890123
    BAPE_VBAP                       0000004711000020                 XYZ
    BAPE_VBAPX                      0000004711000020       X
    Further Information
    You can find more information in the BAPI programming guide in the chapter for enhancements to BAPIs.
    Notes
    You must complete the STRUCTURE field with the name of the relevant enhancement structure (BAPE_VBAK, BAPE_VBAP, BAPE_VBEP). You can complete the remaining fields with the append structures from the enhancement structures.
    At the moment, you can use the BAPI to store enhancements in the following structures:
    VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
    VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
    VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
    VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
    If you also want to work with checkboxes, each X-structure must also contain an append structure.
    For example:
    A customer has created an order and wants to include the material long text (50 digits long).
    The EXTENSIONIN structure must be completed with BAPE_VBAP. Two fields have fixed definitions in this structure. These are in the VBAP host key (VBELN, POSNR). The customer sets up an append structure that contains field ZMAT50.
    Because the VBELN is normally blank when you create an order, the data can look like this:
    STRUCTURE   |BAPE_VBAP
    VALUEPART1  |          000010Customermateriallongtext50
                  VBELN     POSNR ZMAT50

  • Required Shade column

    Hello Abap Gurus;
    I have a report of invoice list.In this report i want shade column
    of the SD document: Delivery: Item data in which the shade is displayed.I m attaching the code also.
    *& Report  ZRPT_SD_002
    REPORT  zrpt_sd_002 LINE-SIZE 70 NO STANDARD PAGE HEADING
                            MESSAGE-ID zcvs.
                              TABLES
    TABLES : vbak  ,              " Sales Document Header
             vbap  ,              " Sales Document Item
             kna1  ,              " Customer Master
             vbkd  ,              " Business Data
             t023t ,              " MAterial Group
             ekkn  ,
             mara ,
             lfa1,
             t134t ,              " Material Type
             t024d ,              " MAterial Controller
             t188t ,              " Zone
             tvkbt ,              " Sales OFfice Text
             tvaut ,              " Order Reason
             vbfa  ,              " Order Status
             vbep  ,              " Schedule Line Data
             mska  ,              " Sales Order Stock
             vbrp  ,              " Billing Header
             afko  ,              " Production Order
             vbrk  ,              " Billing Header
             konv  ,              " Condition Type Table
             likp  ,              " Delivery Header
             knb1  ,
             bkpf  ,
             cabnt , vttp,vttk,
             tvro,vbpa.
    TYPE-POOLS
    TYPE-POOLS : slis.
    VARIABLE DECLARATION
    DATA       : maktx  LIKE makt-maktx,
                 knttp  LIKE ekpo-knttp,
                 city1  LIKE adrc-city1,
                 tknum  LIKE vttk-tknum,
                 name1  LIKE lfa1-name1,
                 lzone  LIKE kna1-lzone,
                 mtbez  LIKE t134t-mtbez,
                 wgbez  LIKE t023t-wgbez,            " Material Group Text
                 bezei  LIKE tvaut-bezei,            " Order Reason Text
                 kvgr1  LIKE vbak-kvgr1,             " Product Manager
                 vtext  LIKE t188t-vtext,            " Product Manager Text
                 vtext2 LIKE t188t-vtext,            " Regional Mgnr Text
                 vtext3 LIKE t188t-vtext,            " Key Account Group
                 vtext4 LIKE t188t-vtext,            " Special Group
                 vtext5 LIKE t188t-vtext,            " Executive
                 vbezei LIKE tvkbt-bezei,            " Sales office
                 matkl  LIKE mara-matkl,             " Material Group
                 mtart  LIKE mara-mtart,             " Material Type
                 erdat  LIKE vbak-erdat,
                 audat  LIKE vbak-audat,
                 auart  LIKE vbak-auart,
                 bstkd  LIKE vbkd-bstkd,
                 prdha  LIKE mara-prdha,
                 belnr  LIKE bkpf-belnr,
                 text(30)   TYPE  c ,
                 v_tabix LIKE sy-tabix,
                 lifnr    LIKE lfa1-lifnr,
                 tname    LIKE lfa1-name1,
                 bstdk    LIKE vbkd-bstdk,
                 ordat    LIKE vbrk-erdat,
                 stext    LIKE tspat-vtext,
                 ktext    LIKE t151t-ktext,
                 v_brtxt  LIKE t016t-brtxt,
                 v_month  TYPE i,p_mon  TYPE i,
                 v_mname(20),p_mname(20),
                 v_ptext  LIKE t052u-text1.
    DATA : cl_data LIKE clobjdat OCCURS 0 WITH HEADER LINE.
    DATA : i_cl_data LIKE clobjdat OCCURS 0 WITH HEADER LINE.
    DATA :       dmbtr LIKE bseg-dmbtr,
                 gbsta LIKE vbup-gbsta,
                 mbdat LIKE vbep-mbdat,
                 kalab LIKE mska-kalab,
                 bonba LIKE vbrp-bonba,
                 gltrp LIKE afko-gltrp,
                 mblnr LIKE mseg-mblnr,
                 budat LIKE mkpf-budat,
                 prtext  LIKE t179t-vtext,
                 signi LIKE vttk-signi,       " Truck Number
                 landx LIKE t005t-landx.
    DATA :       BEGIN OF tline OCCURS 0 .
            INCLUDE STRUCTURE tline .
    DATA :       END OF tline .
    DATA :       soh LIKE rstxt-tdname ,
                 destcty(30).
    DATA :       klmeng LIKE  vbap-klmeng.
    DATA :       tabix  LIKE  sy-tabix.
    DATA :       cmgst  LIKE  vbuk-cmgst,
                 option(10) TYPE c .
    DATA : BEGIN OF delivery_header.
            INCLUDE STRUCTURE likp.
    DATA : END OF delivery_header.
    DATA : BEGIN OF shipment_header.
            INCLUDE STRUCTURE vttk.
    DATA : END OF shipment_header.
    DATA : BEGIN OF ivbrk OCCURS 0.
            INCLUDE STRUCTURE vbrk.
    DATA : brsch LIKE kna1-brsch,
           name1 LIKE kna1-name1,
           ort01  LIKE kna1-ort01.
    DATA : END OF ivbrk.
    DATA : v_regio LIKE kna1-regio,
           v_brsch LIKE kna1-brsch,
           v_ort01 LIKE kna1-ort01,
           v_land1  LIKE kna1-land1.
    New For Days Start
    DATA: len TYPE i.
    DATA : BEGIN OF head OCCURS 0,
           field(5),
           text(30),
           END OF head.
    DATA :   p_ftext1(30),
             p_ftext2(30),
             p_ftext3(30),
             p_ftext4(30),
             p_ftext5(30),
             p_ftext6(30).
    New For Days End
                          DECLARATION FOR ALV
    DATA: fieldtab TYPE slis_t_fieldcat_alv,
           heading  TYPE slis_t_listheader,
           layout   TYPE slis_layout_alv,
           events   TYPE slis_t_event,
           repname  LIKE sy-repid,
           f2code   LIKE sy-ucomm VALUE  '&ETA',
           g_save(1) TYPE c,
           g_variant LIKE disvariant,
           gx_variant LIKE disvariant,
           g_exit(1) TYPE c.
    DATA: keyinfo  TYPE slis_keyinfo_alv.
    CONSTANTS: formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    DATA: alv_print        TYPE slis_print_alv.
    DATA: alv_detail_func(30).
    DATA: g_pos TYPE i.
    DATA: tabname   TYPE slis_tabname.
    INTERNAL TABLES DECLARATION
    DATA : BEGIN OF ivbeln OCCURS 1,
           vbeln    LIKE vbrk-vbeln,         " Billing Document
           posnr    LIKE vbrp-posnr,         " Billing Doc Item
           fkart    LIKE vbrk-fkart,         " Billing Type
           vbtyp    LIKE vbrk-vbtyp,         " SD Docnument Category
           vbtyp_desc(35)         ,          " Vbtyp description
           vkgrp    LIKE vbrp-vkgrp,         " Sales Group
           fkdat    LIKE vbrk-fkdat,         " Billing Date
           matnr    LIKE vbrp-matnr,         " Material
           arktx    LIKE vbrp-arktx,         " Material Desc
           kunnr    LIKE vbrk-kunag,         " Customer Code
           name1    LIKE kna1-name1,         " Customer Name
           ort01    LIKE kna1-ort01,         " Customer City
           fkimg    LIKE vbrp-fkimg,         " Billed Qty
           werks    LIKE vbrp-werks,         " Plant
           pl_land1 LIKE t001w-land1,        " Plant Country
           pl_regio LIKE t001w-regio,        " Plant Region Code
           regio_tx LIKE t005u-bezei,        " Plant Region Name
           netwr    LIKE vbrp-netwr,         " Net Price
           vkorg    LIKE vbrk-vkorg,         " Sales Organisation
           vtext    LIKE tvkot-vtext,        " Sales Org.Text
           vtweg    LIKE vbrk-vtweg,         " Distribution Channel
           vttxt    LIKE tvtwt-vtext,        " Dist.Channel Text
           vkbur    LIKE vbrp-vkbur,         " Sales Office
           vbezei   LIKE tvkbt-bezei,        " Sales Office Text
           spart    LIKE vbrp-spart,         " Division
           stext    LIKE tspat-vtext,        " Sales Division Text
           kvgr1    LIKE vbrp-kvgr1,         " District
           vtext1   LIKE tvv1t-bezei,        " District Name
           kvgr2    LIKE vbrp-kvgr2,         " Taluka
           vtext2   LIKE t188t-vtext,        " Taluka Name
           kvgr3    LIKE vbrp-kvgr3,         " Village
           vtext3   LIKE t188t-vtext,        " Village Name
           kvgr4    LIKE vbrp-kvgr4,         " Special Group
           vtext4   LIKE t188t-vtext,        " Special Group
           kvgr5    LIKE vbrp-kvgr5,         " Executive
           vtext5   LIKE t188t-vtext,        " Executive Text
          ZZLZONE  LIKE  VBAP-ZZLZONE ,     " Transport.Zone(Sold To Party)
           lztxt    LIKE  tzont-vtext,       " Trans.Zone Desc(Sold To Party)
           waerk    LIKE vbap-waerk,         " Document Currency
           inco1    LIKE vbkd-inco1,         " Inco Terms1
           inco2    LIKE vbkd-inco2,         " Inco Terms2
           bukrs    LIKE vbrk-bukrs,         " Company Code
           lgort    LIKE vbrp-lgort,         " Storage Loc
           vrkme    LIKE  vbrp-vrkme,        " Sales Unit
           aubel    LIKE  vbrp-aubel,        " Sales Doc
           aupos    LIKE  vbrp-aupos,        " Sales Doc Item
           audat    LIKE  vbak-audat,        " Sales Order Date
           klmeng   LIKE  vbap-klmeng,       " Sales Qty
           knumv    LIKE  konv-knumv,        " Cond.Doc No
           frate    LIKE  konv-kbetr,        " Rate
           fvalue   LIKE  konv-kwert,        " Value
           erate    LIKE  konv-kbetr,        " Excise Rate
           evalue   LIKE  konv-kwert,        " Excise Value
           kschl    LIKE  konv-kschl,        " Condition Type
           mtart    LIKE  mara-mtart,        " Material TYpe
           matkl    LIKE  mara-matkl,        " Material Group
           stceg    LIKE  vbrk-stceg,        " VAT Reg.No
           sfakn    LIKE  vbrk-sfakn,        " Cancelled Bill Doc No
           sfakn1   LIKE  vbrk-sfakn,        " Reversed Bill Doc No
           rfbsk    LIKE  vbrk-rfbsk,        " Accounting Transfer Status
           fksto    LIKE  vbrk-fksto,        " Bill Doc.Cancel Ind
           fksto_tx(60),                     " Bill Doc.Cancel text
           erdat    LIKE  vbrk-erdat,        " Creation Date
           erzet    LIKE  vbrk-erzet,        " Creattion Time
           regio    LIKE  kna1-regio,        " Region
           pstyv    LIKE  vbrp-pstyv,        " Sales Doc Item Cat.
           vgbel    LIKE  vbak-vgbel,        " Ref.Doc No
           vgpos    LIKE  vbap-vgpos,        " Ref.Doc.Item.No
           cmgst    LIKE  vbuk-cmgst,        " Credit Status
           zterm    LIKE  vbrk-zterm,        " Pay Term
           auart    LIKE  vbak-auart,        " Sales Order Type
           bstkd    LIKE  vbkd-bstkd,        " Cust.PO No
           bstdk    LIKE  vbkd-bstdk,        " Cust.PO Date
           mwsbp    LIKE  vbrp-mwsbp,        " Tax Amount
           belnr    LIKE  bkpf-belnr,        " Acc.Doc No
           kzwi1    LIKE  vbrp-kzwi1  ,      " Base Price
           kzwi2    LIKE  vbrp-kzwi2  ,      "
           kzwi3    LIKE  vbrp-kzwi3  ,      " Discounts
           kzwi4    LIKE  vbrp-kzwi4,        " Packing and forwarding
           kzwi5    LIKE  vbrp-kzwi5  ,      " Excise
           kzwi6    LIKE  vbrp-kzwi6  ,      " LST/ CST
           mtbez    LIKE  t134t-mtbez,       " Material Type Text
           wgbez    LIKE t023t-wgbez,        " Material Group Text
           land1    LIKE vbrk-land1,         " Country
           landx(20),                        " Country Text
           abrvw    LIKE tvlvt-abrvw,        " Usage Ind.
           reasn    LIKE tvlvt-bezei,        " Desc
           prdha    LIKE mara-prdha,         " Prod Hir.
           edg(2),
           char1    LIKE  ausp-atwrt ,       " Characteristic
           char2    LIKE  ausp-atwrt ,       " Characteristic
           char3    LIKE  ausp-atwrt ,       " Characteristic
           char4    LIKE  ausp-atwrt ,       " Characteristic
           char5    LIKE  ausp-atwrt ,       " Characteristic
           char6    LIKE  ausp-atwrt ,       " Characteristic
           char7    LIKE  ausp-atwrt ,       " Characteristic
           char8    LIKE  ausp-atwrt ,       " Characteristic
           char9    LIKE  ausp-atwrt ,       " Characteristic
           char10   LIKE ausp-atwrt ,        " Characteristic
           char11   LIKE ausp-atwrt ,        " Characteristic
           char12   LIKE ausp-atwrt ,        " Characteristic
           char13   LIKE ausp-atwrt ,        " Characteristic
           char14   LIKE ausp-atwrt ,        " Characteristic
           char15   LIKE ausp-atwrt ,        " Characteristic
           char16   LIKE ausp-atwrt ,        " Characteristic
           lifnr    LIKE lfa1-lifnr,         " Vendor
           tname    LIKE lfa1-name1,         " Vendor Name
           ordat    LIKE vbrk-fkdat,         " order Date
           charg    LIKE vbrp-charg,         " Batch
           kdgrp_auft LIKE vbrp-kdgrp_auft,  " Customer Sales Group
           ktext    LIKE t151t-ktext,        " Customer Sales Group Text
           signi    LIKE vttk-signi,         " License No
           route    LIKE likp-route,         " Route
           routid   LIKE tvro-routid,        " Route ID
           rt_bezei LIKE tvrot-bezei,        " Route Desc
           vstel    LIKE likp-vstel,         " Shipping Point
           sp_vtext LIKE tvstt-vtext,        " Ship Point Desc
           distz    LIKE v_tvro_com-distz,   " Distance
           brsch    LIKE kna1-brsch,         " Industry Key
           brtxt    LIKE t016t-brtxt,        " Industry Name
           mname    LIKE kna1-name1,         " Name
           exnum    LIKE j_1iexchdr-exnum,   " Ex.Number
           exdat    LIKE j_1iexchdr-exdat,   " Ex.Date
           exbed    LIKE j_1iexcdtl-exbed,   " Ex.BED Amt
           ecs      LIKE j_1iexcdtl-ecs,     " Ex.ECESS Amt
           expind   LIKE j_1iexchdr-expind,  " Export Ind.
           expind_desc LIKE dd07t-ddtext,    " Export Ind.Desc
           exgrp    LIKE j_1iexchdr-exgrp,   " Exc.Group
           srgrp    LIKE j_1iexchdr-srgrp,   " Series Group
           sanum    LIKE vbap-vbeln,         " Sales Order No
           sapos    LIKE vbap-posnr,         " SO Item No
           tknum    LIKE vttk-tknum,         " Shipment No
           exti1    LIKE vttk-exti1,         " Vehicle Number
           exti2    LIKE vttk-exti2,         " Driver Name
           tr_count TYPE i,                  " Truck Count
           vsart    LIKE vttk-vsart,         " Shipment Type
           st_bezei LIKE t173t-bezei,        " Shipment Type Desc
           zb00     LIKE konv-kbetr,         " Basic Rate
           xcpdk    LIKE vbpa-xcpdk,         " One Time Account
           adrnr    LIKE vbpa-adrnr,         " Address Number
           shpcd    LIKE kna1-kunnr,         " Ship to Party
           shpnm    LIKE kna1-name1,         " Ship to Party Name
           sh_regio LIKE kna1-regio,         " Region(SH)
           sh_land1 LIKE kna1-land1,         " Country
          SH_LZONE LIKE  VBAP-ZZLZONE ,     " Transport.Zone(Ship To Party)
           sh_lztxt LIKE  tzont-vtext,       " Trans.Zone Desc(Ship To Party)
           mblnr    LIKE mseg-mblnr,         " Material Doc No
           budat    LIKE mkpf-budat,         " Doc Date
           konda    LIKE vbrk-konda,         " Sales Zone
           ptext    LIKE t188t-vtext,        " Text
           zrbat    LIKE konv-kwert,         " Rebate Amount
           serdt    LIKE vbak-erdat,         " S.A Create Date
           groes    LIKE mara-groes,         " Size/Dimensions
           dtext(20),                        "
           prodt(20),                        "
           mtext(20),                        "
           prdqy    LIKE vbrp-fkimg,         "
           aufnr    LIKE afko-aufnr,         " Order No
           city1    LIKE adrc-city1,         " City
           packno(3),                        " Pack No
           inv_rate LIKE konv-kbetr,         " Inv Rate
           inv_amt  LIKE konv-kwert,         " Inv Amount
           frt_rate LIKE konv-kbetr,         " Frt Rate
           frt_amt  LIKE konv-kwert,         " Frt Amount
           td_fkimg LIKE vbrp-fkimg,         " Trade Inv.Qty
           nt_fkimg LIKE vbrp-fkimg,         " Non-Trade Inv.Qty
           st_fkimg LIKE vbrp-fkimg,         " Stk.Trsf.Inv.Qty
           tot_fkimg LIKE vbrp-fkimg,        " Total
           or_dl_vbeln  LIKE lips-vbeln,     " Original Delivery
           or_dl_posnr  LIKE lips-posnr,     " Original Del.Item
           or_in_vbeln  LIKE vbrp-vbeln,     " Original Invoice
           or_in_fkdat  LIKE vbrk-fkdat,     " Original Inv.Date
           or_in_posnr  LIKE vbrp-posnr,     " Original Inv.Item
           or_in_knumv  LIKE vbrk-knumv,     " Original Inv.Cond.No
           or_in_frt_amt LIKE konv-kwert,    " Original Frt Amount
           or_in_fkimg   LIKE vbrp-fkimg,    " Original Qty
           diff_date  TYPE  p,               " Date Differance
           pfield1      LIKE vbrp-fkimg,                        " Day 1
           pfield2      LIKE vbrp-fkimg,                        " Day 2
           pfield3      LIKE vbrp-fkimg,                        " Day 3
           pfield4      LIKE vbrp-fkimg,                        " Day 4
           pfield5      LIKE vbrp-fkimg,                        " Day 5
           pfield6      LIKE vbrp-fkimg,     " Above Days
           pfield7      LIKE vbrp-fkimg,     " TOTAL DAYS
           bolnr        LIKE likp-bolnr,    " LR/DC No
           INCLUDE STRUCTURE ZSD_MATGROUPS.  " Inc.For Mat.Groups
           chaname TYPE lfa1-name1,
           lcnum  TYPE vbkd-lcnum,
           tdline TYPE tline-tdline,
           docno  type j_1iexchdr-docno.
    DATA:  END   OF ivbeln.
    DATA  : BEGIN OF i_mat_tab OCCURS 0,
            dtext LIKE ivbeln-dtext,
            prodt(20),
            mtext(20),
            name1 LIKE ivbeln-name1,
            kunnr LIKE ivbeln-kunnr,
            fkimg LIKE ivbeln-fkimg,
            END OF i_mat_tab.
    DATA  : BEGIN OF it_vbtyp OCCURS 0.
            INCLUDE STRUCTURE dd07v.
    DATA  : END OF it_vbtyp.
    DATA  : BEGIN OF i_mseg OCCURS 0.
            INCLUDE STRUCTURE mseg.
    DATA  : END OF i_mseg.
    DATA  : BEGIN OF i_mseg_coll OCCURS 0,
            matnr  LIKE mseg-matnr,
            charg  LIKE mseg-charg,
            menge  LIKE mseg-menge,
            aufnr  LIKE mseg-aufnr,
            werks  LIKE mseg-werks,
            END OF i_mseg_coll.
    *-- For Sales Plan Details
    DATA  : exnum    LIKE j_1iexchdr-exnum,
            exdat    LIKE j_1iexchdr-exdat,
            exbed    LIKE j_1iexchdr-exbed,
            expind   LIKE j_1iexchdr-expind,
            exgrp    LIKE j_1iexchdr-exgrp,
            srgrp    LIKE j_1iexchdr-srgrp,
            shpcd    LIKE kna1-kunnr,
            shpnm    LIKE kna1-name1,
            shreg    LIKE kna1-regio,
            shlnd    LIKE kna1-land1,
            xcpdk    LIKE vbpa-xcpdk,
            adrnr    LIKE vbpa-adrnr,
            sanum    LIKE vbap-vbeln,
            serdt    LIKE vbak-erdat,
            ptext    LIKE t188t-vtext,
            sapos    LIKE vbap-posnr.
    DATA  : BEGIN OF iitem OCCURS 1,
            kunnr LIKE ivbeln-kunnr,
            name1 LIKE ivbeln-name1,
            vkbur LIKE ivbeln-vkbur,
            vbezei LIKE ivbeln-vbezei,
            dtext LIKE tvtwt-vtext,
            matnr LIKE ivbeln-matnr,
            arktx LIKE ivbeln-arktx,
           VTWEG LIKE ZCVI_VBRKVBRP-VTWEG,
            land1 LIKE kna1-land1,
            landx LIKE t005t-landx,
            END OF iitem.
    DATA  : BEGIN OF t_konv OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            krech LIKE konv-krech,
            kwert LIKE konv-kwert,
            kbetr LIKE konv-kbetr,
            kawrt LIKE konv-kawrt,
            kschl LIKE konv-kschl,
            END OF t_konv.
    DATA  : kunnr LIKE kna1-name1,
            pdate LIKE sy-datum,
            frate LIKE konv-kbetr,
            erate LIKE konv-kbetr,
            evalue LIKE konv-kwert,
            fvalue LIKE konv-kwert,
            zwels LIKE knb1-zwels.
    *DATA  : BEGIN OF ISDCHAR OCCURS 0 .
           INCLUDE STRUCTURE ZCTA_SDCHAR .
    *DATA    END   OF ISDCHAR .
    DATA  : BEGIN OF it_char OCCURS 0.
    DATA  : tabix(2)     TYPE c,
            atbez(30),
            descrp(30)   TYPE c.
            INCLUDE STRUCTURE vbmuez.
    DATA  : END   OF it_char.
    DATA  : ichar LIKE sel_char OCCURS 0 WITH HEADER LINE.
    DATA  : reasn   LIKE tvlvt-bezei.
                          FIELD-SYMBOLS                                  *
    FIELD-SYMBOLS : <table>    TYPE  table ,
                    <struc> ,
                    <field> ,
                    <component> .
    Data Declaration for Dynamic Assignment                              *
    DATA : alv_fieldcat    TYPE                 slis_t_fieldcat_alv,
           lt_alv_cat      TYPE TABLE OF        lvc_s_fcat,
           it_fieldcat     LIKE LINE  OF        lt_alv_cat.
    DATA : i_table         TYPE REF   TO        data,
           i_structure     TYPE REF   TO        data.
    DATA : new_tabix  LIKE sy-tabix.
    DATA : v_ebeln LIKE ekkn-ebeln ,
           v_ebelp LIKE ekkn-ebelp ,
           groes   LIKE mara-groes.
    DATA : t_char LIKE sel_char OCCURS 0 WITH HEADER LINE.
         Macro Definition for assigning and unassigning component
    Assign a field to a component and component to a structure
    DEFINE assign_component.
      assign &1 to <component>.
      assign component <component> of structure <struc> to <field>.
    END-OF-DEFINITION.
    Unassign a Component.
    DEFINE unassign_field.
      if &1 is assigned.
        unassign &1.
      endif.
    END-OF-DEFINITION.
                    SELECTION - SCREEN
    *For ALV Variant
    SELECTION-SCREEN BEGIN OF BLOCK d WITH FRAME TITLE text-s01.
    PARAMETERS: p_vari LIKE disvariant-variant. " ALV Variant
    SELECTION-SCREEN END OF BLOCK d.
    For Basic Data
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-s02.
    SELECT-OPTIONS: s_kunnr FOR vbrk-kunrg MATCHCODE OBJECT debi,
                    s_vbeln FOR vbrk-vbeln MATCHCODE OBJECT vmva,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY,
                    s_matnr FOR vbrp-matnr MATCHCODE OBJECT mat1,
                    s_fkart FOR vbrk-fkart ,
                    s_pstyv FOR vbap-pstyv,
                    s_spart FOR vbrk-spart.
    SELECTION-SCREEN END OF BLOCK a.
    For Organisational Data
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-s03.
    SELECT-OPTIONS: s_vkorg FOR vbrk-vkorg,
                    s_vtweg FOR vbrk-vtweg,
                    s_bukrs FOR vbrk-bukrs,
                    s_vkbur FOR vbrp-vkbur,
                    s_regio FOR kna1-regio,
                    s_werks FOR vbrp-werks,
                    s_brsch FOR kna1-brsch.         " Industry Key
    SELECTION-SCREEN END OF BLOCK b.
    NEW ADDED  BY AJAY 22-06-2006
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-d01.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) text-d02.
    SELECTION-SCREEN POSITION 32.
    PARAMETERS : p_field1(3) TYPE n DEFAULT '001',
                 p_field2(3) TYPE n DEFAULT '005',
                 p_field3(3) TYPE n DEFAULT '007',
                 p_field4(3) TYPE n DEFAULT '009',
                 p_field5(3) TYPE n DEFAULT '015'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK c.
    NEW ADDED END BY AJAY 22-06-2006
                          INITIALIZATION
    INITIALIZATION.
      repname = sy-repid.
      PERFORM build_eventtab USING events[].
      PERFORM build_layout .
      PERFORM initialize_variant.
                          AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    AT SELECTION-SCREEN.
      PERFORM pai_of_selection_screen.
      PERFORM check_input.
                          START OF SELECTION
    START-OF-SELECTION.
      PERFORM build_comment USING heading[].
      PERFORM get_day_label.
      PERFORM get_data.
      PERFORM segregate_dist_chann_qty.
      PERFORM initialise_fieldtab.
      PERFORM attach_char_to_fieldcat.
      PERFORM get_transporter_data.
      PERFORM get_sd_matgroups.
      PERFORM get_plant_from_po.
      PERFORM get_excise_details.
      PERFORM display_data.
                          END OF SELECTION
    END-OF-SELECTION.
                              FORMS
    *&      Form  get_data
    *&      Extracts data as per the users selection criteria.
    FORM get_data.
      DATA domname LIKE dd07v-domname.
      DATA it_vrpma LIKE vrpma OCCURS 0 WITH HEADER LINE.
    In case Doc No is specified in Selection use VBRK
    Else use VRPMA(Material wise Billing Doc)
      IF NOT s_vbeln IS INITIAL.
        SELECT * FROM vbrk CLIENT SPECIFIED
                           INTO CORRESPONDING FIELDS OF TABLE ivbrk
                           WHERE mandt EQ sy-mandt
                                 AND   vbeln IN s_vbeln
                                 AND   fkart IN s_fkart
                                 AND   fkdat IN s_fkdat
                                 AND   kunag IN s_kunnr
                                 AND   vkorg IN s_vkorg
                                 AND   vtweg IN s_vtweg
                                 AND   bukrs IN s_bukrs
                                 AND   rfbsk NE 'E'
                                 AND   sfakn EQ space
                                 AND   fksto EQ space.
      ELSE.
        SELECT * FROM vrpma CLIENT SPECIFIED
                            INTO CORRESPONDING FIELDS OF TABLE it_vrpma
                            WHERE mandt EQ sy-mandt
                                  AND  matnr IN s_matnr
                                  AND  vkorg IN s_vkorg
                                  AND  fkdat IN s_fkdat
                                  AND  vtweg IN s_vtweg
                                  AND  fkart IN s_fkart
                                  AND  kunag IN s_kunnr
                                  AND  fkart NE 'ZCMR'
                                  AND  vbeln IN s_vbeln.
        CHECK NOT it_vrpma[] IS INITIAL.
        SORT it_vrpma BY vbeln.
        SELECT * FROM vbrk INTO CORRESPONDING FIELDS OF TABLE ivbrk
                           FOR ALL ENTRIES IN it_vrpma
                           WHERE vbeln = it_vrpma-vbeln
                                 AND   rfbsk NE 'E'
                                 AND   sfakn EQ space
                                 AND   fksto EQ space.
      ENDIF.
      domname = 'VBTYP'.
    Get the List of all Document Types
      PERFORM get_domtext TABLES it_vbtyp USING domname.
      IF NOT ivbrk[] IS INITIAL.
        SORT ivbrk BY kunag.
        LOOP AT ivbrk.
          v_tabix = sy-tabix.
    Get the Region,Industry Key, Name for Sold To Party
          ON CHANGE OF ivbrk-kunag.
            CLEAR : v_regio,v_brsch,name1,v_ort01,v_land1.
            SELECT SINGLE regio brsch name1 ort01 land1 FROM kna1
                                      CLIENT SPECIFIED
                                      INTO (v_regio,v_brsch,
                                            name1,v_ort01,v_land1 )
                                      WHERE mandt = sy-mandt
                                            AND kunnr = ivbrk-kunag.
          ENDON.
    Check for Region,Industry Key as per the Parameter
          IF NOT s_regio[] IS INITIAL.
            IF NOT v_regio IN s_regio.
              DELETE ivbrk INDEX v_tabix.
              CONTINUE.
            ENDIF.
          ENDIF.
          IF NOT s_brsch[] IS INITIAL.
            IF NOT v_brsch IN s_brsch.
              DELETE ivbrk INDEX v_tabix.
              CONTINUE.
            ENDIF.
          ENDIF.
          ivbrk-regio = v_regio.
          ivbrk-brsch = v_brsch.
          ivbrk-name1 = name1.
          ivbrk-ort01 = v_ort01.
          ivbrk-land1 = v_land1.
          ivbrk-netwr = 0.
          MODIFY ivbrk TRANSPORTING regio brsch
                                    name1 netwr ort01 land1.
          CLEAR  ivbrk.
        ENDLOOP.
    Get the Invoice Details from VBRP Table
        IF NOT ivbrk[] IS INITIAL.
          SELECT * FROM vbrp CLIENT SPECIFIED
                           INTO CORRESPONDING FIELDS OF TABLE ivbeln
                           FOR ALL ENTRIES IN ivbrk
                           WHERE mandt = sy-mandt
                                 AND vbeln = ivbrk-vbeln
                                 AND fkimg NE 0
                                 AND matnr IN s_matnr
                                 AND pstyv IN s_pstyv
                                 AND spart IN s_spart
                                 AND werks IN s_werks
                                 AND vkbur IN s_vkbur.
        ENDIF.
      ENDIF.
      IF NOT ivbeln[] IS INITIAL.
        LOOP AT ivbeln.
          READ TABLE ivbrk WITH KEY vbeln = ivbeln-vbeln.
          IF sy-subrc EQ 0.
            IF ivbrk-netwr IS INITIAL.
              ivbrk-netwr = ivbeln-netwr.
            ENDIF.
            MOVE-CORRESPONDING ivbrk TO ivbeln.
            CLEAR it_vbtyp.
            READ TABLE it_vbtyp WITH KEY domvalue_l = ivbrk-vbtyp.
            ivbeln-vbtyp_desc = it_vbtyp-ddtext.
            MOVE ivbrk-kunag TO ivbeln-kunnr.
            MODIFY ivbeln .
            CLEAR  ivbeln.
          ENDIF.
        ENDLOOP.
        SORT ivbeln BY vbeln posnr.
        DELETE ADJACENT DUPLICATES FROM ivbeln COMPARING ALL FIELDS.
        CLEAR  ivbeln.
    Get the Material Type, Group and Production Hiearchy
        LOOP AT ivbeln.
          ON CHANGE OF ivbeln-matnr.
            CLEAR : mtart,matkl,prdha.
            SELECT SINGLE  mtart matkl prdha FROM mara CLIENT SPECIFIED
                                 INTO (mtart,matkl,prdha)
                                 WHERE mandt EQ sy-mandt
                                       AND matnr EQ ivbeln-matnr.
          ENDON.
          ivbeln-mtart = mtart.
          ivbeln-matkl = matkl.
          ivbeln-prdha = prdha.
          MODIFY ivbeln TRANSPORTING  mtart matkl prdha.
          CLEAR ivbeln.
        ENDLOOP.
        LOOP AT ivbeln.
    Retrieving Sales Order Date ,Customer PO No,Customer PO Date
          ON CHANGE OF ivbeln-aubel.
            CLEAR : bstkd,bstdk,ordat,audat.
            SELECT SINGLE bstkd bstdk  FROM vbkd
                                  CLIENT SPECIFIED
                                  INTO  (bstkd,bstdk)
                                  WHERE mandt EQ sy-mandt
                                        AND vbeln EQ ivbeln-aubel.
            SELECT SINGLE erdat audat FROM  vbak CLIENT SPECIFIED
                                INTO  (ordat,audat)
                                WHERE mandt = sy-mandt
                                      AND vbeln = ivbeln-aubel.
           In case of Stock Transfer, Or Export Excise GP
           SO is really a PO Hence Date is tajken from EKKO
            IF ivbeln-fkart EQ 'ZSTF' OR ivbeln-fkart EQ 'ZSTE'.
              SELECT SINGLE bedat FROM  ekko CLIENT SPECIFIED
                                INTO  (audat)
                                WHERE mandt = sy-mandt
                                      AND ebeln = ivbeln-aubel.
            ENDIF.
          ENDON.
          IF ivbeln-erzet GE '000000' AND ivbeln-erzet LE '070000'.
            ivbeln-erdat = ivbeln-erdat - 1.
          ENDIF.
    Get the Counry Descripion
          ON CHANGE OF ivbeln-land1.
            CLEAR : landx.
            SELECT SINGLE landx INTO landx FROM t005t
                               WHERE land1 EQ ivbeln-land1
                                     AND  spras EQ  sy-langu.
          ENDON.
    For retrieving text for Customer Group
          ON CHANGE OF ivbeln-kdgrp_auft.
            CLEAR : ktext.
            SELECT SINGLE ktext FROM t151t
                                INTO ktext
                                WHERE spras EQ sy-langu
                                AND   kdgrp EQ ivbeln-kdgrp_auft.
          ENDON.
    For Retrieving texts for KVGR1 KVGR2 KVGR3 KVGR4 KVGR5
          ON CHANGE OF ivbeln-kvgr1.
            CLEAR : vtext.
            SELECT SINGLE bezei INTO vtext FROM tvv1t
                                           WHERE kvgr1 EQ ivbeln-kvgr1
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr2.
            CLEAR :vtext2.
            SELECT SINGLE bezei INTO vtext2 FROM tvv2t
                                           WHERE kvgr2 EQ ivbeln-kvgr2
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr3.
            CLEAR :vtext3.
            SELECT SINGLE bezei INTO vtext3 FROM tvv3t
                                           WHERE kvgr3 EQ ivbeln-kvgr3
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr4.
            CLEAR :vtext4.
            SELECT SINGLE bezei INTO vtext4 FROM tvv4t
                                           WHERE kvgr4 EQ ivbeln-kvgr4
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr5.
            CLEAR : vtext5.
            SELECT SINGLE bezei INTO vtext5 FROM tvv5t
                                           WHERE kvgr5 EQ ivbeln-kvgr5
                                                 AND spras EQ sy-langu.
          ENDON.
    Get the Description for Usage Indicator
          ON CHANGE OF ivbeln-abrvw.
            CLEAR : reasn.
            SELECT SINGLE bezei INTO reasn FROM tvlvt CLIENT SPECIFIED
                                           WHERE mandt = sy-mandt
                                                 AND abrvw EQ ivbeln-abrvw
                                                 AND spras EQ sy-langu.
          ENDON.
    Get Account Document
          ON CHANGE OF ivbeln-vbeln.
            CLEAR : belnr.
            SELECT SINGLE belnr INTO belnr FROM bkpf
                                     CLIENT SPECIFIED
                                           WHERE mandt = sy-mandt
                                             AND awtyp EQ 'VBRK'
                                             AND awkey EQ ivbeln-vbeln.
          ENDON.
    Get Division Text
          ON CHANGE OF ivbeln-spart.
            CLEAR : stext.
            SELECT SINGLE vtext INTO stext FROM tspat
                                           WHERE spart EQ ivbeln-spart
                                            AND spras EQ sy-langu.
          ENDON.
    Get Price group Text
          ON CHANGE OF ivbeln-konda.
            CLEAR : ptext.
            SELECT SINGLE vtext INTO ptext FROM t188t
                                           WHERE konda EQ ivbeln-konda
                                            AND spras EQ sy-langu.
          ENDON.
    Get Transporter Code ,Name
          ON CHANGE OF ivbeln-vbeln.
            CLEAR : lifnr,name1.
            SELECT SINGLE lifnr INTO lifnr FROM vbpa
                                           WHERE vbeln EQ ivbeln-vbeln
                                                 AND parvw EQ 'V1'.
            IF NOT lifnr IS INITIAL.
              SELECT SINGLE name1 FROM lfa1 INTO name1
                                            WHERE lifnr EQ lifnr.
            ENDIF.
    *Ship To party Details
            CLEAR: shpcd,shpnm,city1,kna1,xcpdk,adrnr.
            SELECT SINGLE kunnr xcpdk adrnr
                          INTO (shpcd,xcpdk,adrnr)
                          FROM vbpa
                          WHERE vbeln EQ ivbeln-vbeln
                                AND   parvw EQ 'WE'.
            IF NOT shpcd IS INITIAL.
              IF xcpdk EQ 'X'.
                SELECT SINGLE name1 city1 transpzone region country
                          FROM adrc
                          INTO (shpnm,city1,lzone,shreg,shlnd)
                              WHERE addrnumber EQ adrnr.
              ELSE.
                SELECT SINGLE name1 ort01 lzone regio land1
                          FROM kna1
                          CLIENT SPECIFIED
                          INTO (shpnm,city1,lzone,shreg,shlnd)
                              WHERE mandt = sy-mandt
                              AND kunnr EQ shpcd.
              ENDIF.
            ENDIF.
          ENDON.
    Retrieve Text for Sales Office
          ON CHANGE OF ivbeln-vkbur.
            CLEAR : vbezei.
            SELECT SINGLE bezei FROM tvkbt
                                INTO vbezei
                                WHERE spras EQ sy-langu
                                AND   vkbur EQ ivbeln-vkbur.
          ENDON.
    Retrieve Text for Industry Key
          ON CHANGE OF ivbeln-brsch.
            CLEAR : v_brtxt.
            SELECT SINGLE brtxt FROM t016t
                                INTO v_brtxt
                                WHERE spras EQ sy-langu
                                AND   brsch EQ ivbeln-brsch.
          ENDON.
    Retrieve Text for Payment Terms
          ON CHANGE OF ivbeln-zterm.
            CLEAR : v_ptext.
            SELECT SINGLE text1 FROM t052u
                                INTO v_ptext
                                WHERE spras EQ sy-langu
                                AND   zterm EQ ivbeln-zterm.
          ENDON.
    Get Material Type Description,Material Group Desc
          ON CHANGE OF ivbeln-mtart OR ivbeln-matkl.
            CLEAR : wgbez,mtbez.
            SELECT SINGLE wgbez FROM t023t
                               INTO wgbez
                               WHERE spras EQ sy-langu
                               AND   matkl EQ ivbeln-matkl.
            SELECT SINGLE mtbez FROM t134t
                                INTO mtbez
                                WHERE spras EQ sy-langu
                                AND   mtart EQ ivbeln-mtart.
          ENDON.
    Get Delivery doc Number.
          SELECT SINGLE vbeln erdat FROM vbfa INTO
                                    (mblnr,budat)
                                    WHERE vbelv = ivbeln-vgbel
                                    AND   posnv = ivbeln-vgpos
                                    AND    vbtyp_n = 'R'.
          CLEAR : exnum,exdat.
    Get the Excise Related Data
          SELECT SINGLE exnum exdat FROM j_1iexchdr CLIENT SPECIFIED
                                    INTO (exnum,exdat)
                                    WHERE  mandt = sy-mandt
                                           AND  trntyp = 'DLFC'
                                           AND  rdoc   = ivbeln-vbeln
                                           AND  rind   = 'N'
                                           AND  status = 'C'.
          IF sy-subrc = 0.
            SELECT SINGLE exbed ecs INTO (ivbeln-exbed,ivbeln-ecs)
                                    FROM j_1iexcdtl
                                    CLIENT SPECIFIED
                                          WHERE mandt = sy-mandt
                                            AND rdoc2 = ivbeln-vbeln
                                            AND ritem2 = ivbeln-posnr.
            IF sy-subrc NE 0.
              ivbeln-exbed = 0.
              CLEAR ivbeln-exnum.
            ENDIF.
          ENDIF.
    Read Characteristics
          IF NOT ichar[] IS INITIAL.
            PERFORM  read_characteristics   TABLES   ichar
                                            USING    ivbeln-we

    I have solved my query....

  • Process Mapping Help Needed

    Dear Gurus,
        Hope to find you well, we have to redefine our processes of sales. Now stock from a remote site will be transferred to inventory in transit warehouse recorded using Truck Number and Document Number of Inventory. And Crystal Reports will be used to get the data. My Query is how can this be achieved in SAP B1 2007 A Patch 10. Please advice.
    Faisal

    Hi!
    In SAP B1, there is no process for Stock in Transit.
    As an workaround, you can either use
    1. Create a Transit Warehouse and book the stock there and transfer to main warehouse once stock received physically.
    in this process, as you are booking the transit stock in your warehouse your Accounts (Asset) also booked.
    2. Create a UDO, and record the Stock in Transit. This will not have any Accounts or Inventory effect, you can use this for reports alone.

  • Problem in printing main window

    Hi all
    i have to print  first four coloums with multiple records and fifth coloumn with data shown below ,how can i print this
    i have to display like this(ABCDE are my five coloumns)under coloumn E , i have to display text and values like shown,and first four coloumns are like shown.and heading for coloumn e is not required.i have to print this in main window.
    A-B-C--D----E
    1-1-11----point of departure = india
    2-22-2----
    point of arrival-US
    3-3-3--3--
    truck number=3442
    4-444---
    5---55-5----
    6--6-6-6---

    Hi gopaludu,
    Create the table in that draw the cells for the 5 columns.
    In table --> Header area : Declare the fields for all 5 fields.
                     Main area : In the 5th columns drag and drop the   
                                      fields required.
    Regards,
    Sravamthi

  • Query /report asking for input ? in Apex

    Hello all, my name is John and I am asking for help with the following,
    I am new to Oracle, Apex and SQL, PL/SQL (as you can tell from my query below.)
    I have the very basics of Apex (in that of making reports,forms etc).
    I created this query on a view in SQL Developer where it is asking for start and end dates to filter the report. , which is what I want it to do and returns the results I want.
    Now I would like to create a report in Apex where it asks for the between dates as it does in the posted query, When that is done I want to pass it to the bipublisher report for pdf printing.
    I am running this query as a totals report already (without the line with WHERE clause query asking of course.) in an apex application, crude as it may be.
    I have it running as a Interactive reports and can filter the dates that way of couse but I want to learn to create the user input type query/report in Apex.
    I have been reading that I would need to use a "pl/sql anonymous block with a "declare' and a page process?. (gettting confused in the "declare" variables and the execute sections)
    I have looked at numerous samples and still do not quite getting the blocks down.
    If you could point me in the right direction of where to go or better yet if someome could show me coding on how to get this to work in apex report/query (s)?
    Slow learn I guess
    I am using APEX 3.1.2 on 11g database.
    Thanks in advance for help on this.
    ++++++++++++++++++++++++++++++++++++
    ----query for truck totals from view-----------
    ,select
    trucktotals.truck_number as "Truck Number",
    trucktotals. truck_type as "Truck Type",
    sum (trucktotals.end_miles-trucktotals.begin_miles) as "Total Miles",
    sum (trucktotals.reg_hours+trucktotals.ot_hours) as "Total Hours",
    sum (trucktotals.total_net_tons) as "Total Tons",
    avg (trucktotals.equip_rent) as "EQR P_HR"from "trucktotals"
    <strong>where trucktotals.wage_date between to_date(:Start_date) and to_date(:end_date)</strong>
    group by trucktotals.truck_number, trucktotals.truck_type
    order by trucktotals.Truck_Number----end query for truck totals from view------------------+++++++++++++++++++++++++++++++++++++
    Edited by: [email protected] on Oct 31, 2008 12:49 PM
    Edited by: [email protected] on Oct 31, 2008 12:53 PM
    Edited by: [email protected] on Oct 31, 2008 12:54 PM

    Hi Martin,
    Thank you for the information, it is a real help to me and gives me more insight toward my learning .
    It took me little while , the condition had to be modified a little bit
    (had to put parentheses around the :PXXX_START_DATE .... END_DATE, and remove the period to get it to work).
    where (:PXXX_START_DATE) is not null and (:PXXX_END_DATE) is not null
    It does work to the sense it shows the start and end date fields and the button and the report results below that, and you can enter the dates and the results change.
    Looking at my question, I should have been a little more clear in the fact I want query to ask for the dates first in a pop up type window, when you press the "Show Report" button,
    and then branches off to show the report. That is the reason I think, I referred to a block or procedure to acomplish this?
    Thanks and still learning
    John

  • Problem in main window

    Hi all,
    i have to print some data in coloumn wise and some data in row wise in same row,like 4 coloumns of data and in fifth coloumn i have to display 3 rows of text and their values which are not dependent on first four coloumns,can any one give me solution for this(this should be done in main window,even though first four coloumns have multiple records,5th coloumn is having singe record,so i have to print single record in fifth coloumn and multiple records in first four coloumns)
    thanks and regards,
    gopal
    Edited by: gopaludu p on Oct 15, 2008 6:59 AM

    Thanks viswa,
    but my first four coloums are having multiple records,how can i use template for that.
    i have to display like this(ABCDE are my five coloumns)under coloumn E , i have to display text and values like shown,and first four coloumns are like shown.and heading for coloumn e is not required.
    A-B-C--D----E
    1-1-11----point of departure = india
    2-22-2----
    point of arrival-US
    3-3-3--3--
    truck number=3442
    4-444---
    5---55-5----
    6--6-6-6---
    Edited by: gopaludu p on Oct 15, 2008 7:11 AM

  • BAPI for adding text in the delivery Header Text Tab?

    Dear All,
    We are using the SAP standard BAPI to create the delivery Document by inputing sales order number.
    The issue is that the customer is maintaining the Truck number in the delivery Header Level Text Tab, now he wants that he will give the sales order number and truck number as inputs the BAPI as to create the Delivery document and the truck number should appear in the Deliver header level text tab ("Truck No" text object maintained)
    Please suggest asap.
    Regards,
    Javal;

    Dear Javali,
    Have you tried the function module 'CREATE_TEXT' ?
    Check and revert back.
    Thanks & Regards,
    Hegal

  • Getting text between two special characters as a new line

    Hi all ,
    I hope some one can point me in the right direction or tell me if its possible or if there is a function that can do this in tsql. I have table with two fields in a table ORDERNUM,NARRATIVE. The values in the NARRATIVE field are some what like this (they
    come from a flat while and are delimited by a "^"). The examples are like :
    OREDERNUM NARRATIVE
    1234           ^Parcel shipped^picked^entry passed then returned back^white ford truck number 78455333^freight charges entered^parcel weight entered^parcel supervised^ticketsscannned^broken glass on
    floor^
    what i want to is seperate the text between the "^" as new line like
    1234 parcel shipped
    1234 picked
    1234 entry passed then returned back
    1234 white ford truck number 78455333
    Can anyone please help me, is there a way or can any one show me what function does this? SUBSTRING for sure is not an answer as there is no fixed length for this.
    Thanks
    SV

    CASE_NUMBER NARRATIVE
    000000GA ^000000G-A CHIEF OF POLICE 02-02-95 PGE 1^***BATCH RUN COPY***^INCIDENT: MOLEST OTHER^LOCATION: 00416 N COLORADO AV OTHER:^EI20^ATTENTION:^ SEX OFFENSE^NOTIFIED: 02-01-95 2300 HRS BY: OTHER INVEST 02-01-95 2305 HRS^ARRESTS: 00 INJURED: 00 DEAD: 00 VEH TOWED: 00 BEAT: B51^^PERSON 01^VICTIM-PERSON^STEVE WOOLBRIGHT NH/W/M/14/08-31-80^SUBPEONA: N^ADDRESS: 00416 N COLORADO AV^HOME-PHONE: 322-9249^^^NARRATIVE:^REPORT MADE FROM STATE 310 REPORT STATING ABOVE-LISTED SUBJECT^HAS BEEN SEXUALLY MOLESTED. INVESTIGATION REQUESTED.^^4725 POPCHEFF A P4687^^02-01-95 2025 HRS - WILDER EULA W3163 TAPE:02^^ 95.033 00:23-END OF REPORT-95.033 00:26^^^
    000718GB ^000718G-B ADDITION CHIEF OF POLICE 08-08-95 PGE 1^***BATCH RUN COPY***^INCIDENT: RECOVERED STOL. VEH PUBLIC STREET-ALLEY^LOCATION: PLAINFIELD,IN OTHER:^OCCURED: 04-01-93 TIME UNKNOWN EO11^ATTENTION:^ AUTO DESK AUTO THEFT WEST DISTRICT^NOTIFIED: 08-07-95 1600 HRS BY: OTHER INVEST 08-07-95 1600 HRS^ARRESTS: 00 INJURED: 00 DEAD: 00 VEH TOWED: 00 BEAT: OJ^^PERSON 01^OWNER/OPERATOR^DAVID FURMAN NH/W/M/ 08-20-57^DRIVERS LICENSE/SSN: 310702334^ADDRESS: 02495 AVON RD PLAINFIELD IN^HOME-PHONE: 838-0467^^^VEHICLE 01^PICKUP^BLACK 91 FORD F350 2DR^VIN: 2FTJW35G6MCA99397^DISPOSITION: RECOVERED^COMMENTS: OWNER RECOVERED VEHICLE IN 1993^^NARRATIVE:^ON 08/07/95, I RECEIVED A PHONE CALL FROM JAMES BEARD OF THE^^ -CONTINUED-^
    000718GB ^000718G-B ADDITION CHIEF OF POLICE 08-08-95 PGE 2^^NATIONAL INSURANCE CRIME BUREAU WHO STATED HE WAS DOING A^CHECK OF HIS RECORDS AND CAME ACROSS A VEHICLE THAT WAS^STOLEN ON 04/24/92, UNDER IPD CASE #00718GA. HE STATED HE HAD^SPOKEN TO THE INSURANCE COMPANY ON THIS CASE AND THEY STATED^THEY HAD PAID OFF ON THE VEHICLE AND SOLD THE VEHICLE BACK TO^THE OWNER. APPARENTLY THE PERSON REPORTING THE EVENT, DAVID^FURMAN, REPORTED HIS VEHICLE STOLEN ON 04/24/92, APPROXIMATELY^1 YEAR LATER HE WAS CONTACTED BY AN UNIDENTIFIED PERSON AND^TOLD HIM TO MEET HIM ON A CORNER IN THE INDIANAPOLIS AREA AND TO^GIVE THE MAN $5,000.00 AND HE WOULD GIVE HIM HIS TRUCK BACK.^MR. FURMAN HAD ALREADY BEEN PAID BY THE INSURANCE COMPANY^APPROXIMATELY $31,000.00 IN RESTITUTION FOR HIS VEHICLE.^MR. FURMAN THEN WENT TO THIS CORNER LOT AND MET WITH THIS^UNIDENTIFIED W/M AND PAID HIM $5,000 CASH. THE MAN THEN TURNED^THE 1991 PICKUP TRUCK OVER TO MR. FURMAN. MR. FURMAN THEN^SETTLED WITH THE INSURANCE COMPANY AND PAID THEM $19,000.00 AND^BOUGHT THE VEHICLE BACK FROM THE INSURANCE COMPANY AND IT IS^NOW TITLED TO HIM AND REGISTERED TO HIM. HOWEVER, AT NO^POINT DID MR. FURMAN OR THE INSURANCE COMPANY CONTACT THE^POLICE DEPARTMENT TO TAKE THE VEHICLE OUT OF THE SYSTEM AS^BEING STOLEN. THAT IS THE REASON FOR THE REPORT. THE VEHICLE^SHOULD BE REPORTED AS A RECOVERED AND RELEASED TO OWNER. DAMAGE^UNKNOWN.^^^^ -CONTINUED-^
    select TOP 214
    CASE_NUMBER,
    splitdata
    from
    SELECT F1.CASE_NUMBER,
    O.splitdata
    FROM
    SELECT *,
    cast('<X>'+replace(F.NARRATIVE,'^','</X><X>')+'</X>' as XML) as xmlfilter from [dbo].[CECASRPT] F
    )F1
    CROSS APPLY
    SELECT fdata.D.value('.','varchar(5000)') as splitdata
    FROM f1.xmlfilter.nodes('X') as fdata(D)) O
    )t
    where t.splitdata <> ''
    SV

  • Urgent-Inputs at the time of GR.

    Hi
    My client wants L.R. number,Truck number,waybill number to be entered while doing GR.
    Can any one give any idea how to do it?

    Hi,
    Generally in indian scenarios BILL OF LADING will be used for this purpose.
    Find it in header of thr GR.
    Regards
    Krishna

  • Transportation

    hi GURUS
    first thanks in advance
    my problem is my client wants to assign the perticular truck no. to a sales order or delivery document & also the crete arrangement should shows in the sales order
    so is there any setting to maintain the master data of vehicle[truck] in the system
    and plz send the total configuration of transportation related to SD
    Thanks
    Amol Gawai

    Hi,
    Please check with following link
    http://help.sap.com/saphelp_47x200/helpdata/en/93/743c21546011d1a7020000e829fd11/frameset.htm
    Regarding to the truck number, you can use the Transportation ID code field under Header -> Shipment in your Delivery (If it is not used anywhere else in your business)
    Reward point if it helps.
    Regards,
    Harsh

  • Field population In MIGO on F4

    Hello Guru's,
    I am struck at one point
    In the MIGO transaction I added a Field (GR Number).
    Also In the PO Srch Help I Included a Srch Help For my requirement .
    Following Search Help is in MIGO for searching PO.
    a. GR Number
    b. Challan Number
    c. Truck Number
    d. Receipt Date: From & To
    e. PO Number
    f. Material Code
    Now when I am pressing the F4 help for the PO (EBELN). I m getting the data in the
    Included srch help from Ztable.Once I clicked on the PO Number in the srch help I want to populate the GR Number against that PO number in the Field (GR Number).
    GR Number for that PO is stored in the Ztable.
    How can I do that .Plz suggest me with some example.
    Thanx in advance
    Harman

    What is the movement type you using in MB21???
    Say if it is 201 then you need to go tcode OMJJ select mvt type as 201 then enter on the screen you will get the field Account control. Wherein check options available in drop down. Then select blank option ie. Entry in this field is optional from the dropdown adn then save. Now check in MIGO the G/L account field would be editable.
    Hope this solve your problem.
    Enjoy SAP,
    Parag M

Maybe you are looking for

  • How can I duplicate a page in Pages 5.1

    I am unable to duplicate pages in Pages 5.1 as part of a flowing document. This is one of the most basic functions which I do not seem to find any longer in the updated version of Pages. Has this been removed? If so, why would one possible remove one

  • Boot from second hard drive with ZFS in Solaris 10 x86

    Hi, The usual menu.lst to boot Solaris10 x86 with a boot environment that contains a ZFS boot loader is this one title Solaris 10 5/08 s10x_nbu6wos_nightly X86 findroot (pool_rpool,0,a) kernel$  /platform/i86pc/multiboot  -B $ZFS-BOOTFS module /platf

  • How to disable the edit Permission after the task approval in project server 2010.

    Hi , Can this be done. How to disable the edit Permission after the task approval in project server 2010. I mean How to Disable approve/Reject Permission Once task approved in project server 2010. Any Help Would be more than Welcome.

  • External Data in Customs Declarations

    Hello - What BAdIs can be used to default external data from the Feeder System (but not from a PO, Inbound Delivery, or Goods Receipt document) into a GTS Customs Declaration?

  • 32 Bit c\c++ code with 64 bit Windows 2003 exproc

    NOTE - This was posted previously under ther PLSQL forum. If this forum is also incorrect, I apologize - please guide me to the correct location. Several years ago we implemented the Shell exproc example ( Metalink Note:136527.1) on our NT server – I