Hinding code with Optional Regions

I am getting an error:
HERE
I know why, it is because I have to use: <body
onload="load()" onunload="GUnload()"> in the line:
<body class="thrColFixHdr"
onload="P7_TMclass();P7_TMopen();load()"
onunload="GUnload()","P7_TMclass();P7_TMopen();MM_preloadImages('images/layout-images/clo se-tabs-over.gif')">
This is used to display a google map in my 'Location' page
but this is the only place I need that code and where the map does
not exist (all other pages) I get the error.
Is there any way of hiding part of that code in my template?
I have tried to have two versions of the line with and
without the map code in 'Optional Regions' but no luck.
Some expert advice greatly appreciated.
Cheers,
Richard

> 1. If I add: <!-- TemplateParam name="MapScript"
type="boolean"
> value="false"
> --> to my template and make it true on the page with
the google map I get
> the
> Load() error on all other pages.
Yes - well, this is a problem with a template controlled
page. The body tag
is NOT editable. You *can* use an editable attribute on the
body tag for
the onload attribute, which would allow you to access the
values associated
with that attribute on each child page, but it's all-or-none
in the sense
that you would have to add the full text of that attribute on
each child
page (adding or subtracting the 'load()' call).
Are you using server scripting on these pages?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"RICH POW" <[email protected]> wrote in
message
news:ful2gl$lqf$[email protected]..
> Thanks for the reply...
>
> I'm in a bit of a vicious circle here.
>
> 1. If I add: <!-- TemplateParam name="MapScript"
type="boolean"
> value="false"
> --> to my template and make it true on the page with
the google map I get
> the
> Load() error on all other pages.
>
> 2. If I leave the script in I get a Null Value error on
all pages except
> the
> google map page.
>
> Do you know a way I can include that map just on that
page?
> Do you know how I can add the whole page with SSI or add
the <body
> onload="load()" onunload="GUnload()"> to the body tag
with an option
> region?
>
> Here is the map in it's simplest form:
>
http://adelantedesign.co.uk/websites/adelante/googlemap.html
>
> Thanks again for your time.
>
> Richard
>

Similar Messages

  • Error while executing BBP_UPDATE_PORG Tr Code with ADD Option

    Hi All,
    I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
    We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data  with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
    Example Scenario:
    step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
    and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
    step 2: I run the BBPUPDVD in SRM System.
    Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
    Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
    Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
    Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
    For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
    Runtime Error          DYNPRO_SEND_IN_BACKGROUND
    Date and Time          09/15/2008 10:56:58
    ShrtText
         Screen output without connection to user.
    What happened?
         Error in ABAP application program.
         The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
          one of the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
    Information on where terminated
        The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in      "BBP_PORG_INSERT".
        The main program was "RSM13000 ".
        The termination occurred in line 59 of the source code of the (Include)      program "LBBP_PARTNER_MAINTU11"
        of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor      590).
        The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
       56
       57 * update database
       58   IF NOT LT_FRG0060_NEW[] IS INITIAL.
    >>>>>     INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
       60   ENDIF.
       61
       62   IF NOT LT_FRG0061_NEW[] IS INITIAL.
       63     INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
       64   ENDIF.
    Kindly guide me or provide solution.
    We are in SRM 4.0 and ECC 5.0.
    Thanks a lot in advance.
    Regards,
    Sudarsan
    Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
    Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PM

    Hi All,
    I changed the Back end Vendor Master Data - Purchasing View (Example Accounting Number) and run the BBPUPDVD Tr code in SRM. The Business Partner (Vendor) data is updated correctly in SRM System from Back End System.
    We have set of purchasing organisations like one local (SRM) Purchasing Organisation and respective Back end Purchasing Organisation (account number). When ever I run BBPUPDVD, the SRM system updates the backend vendor master data  with back end purchasing organisation into SRM Standard tables. Then I am running BBP_UPDATE_PORG Tr code to have updated data into SRM Local Purchasing Organisation. I am receiving error message.
    Example Scenario:
    step 1: Present values in Vendor Master Vendor Number 100250, Purchaing Organisation : 1010 A/c Number: 100250-1010
    and I changed the account number as 10025o-test for vendor 100250 and pur organisation 1010.
    step 2: I run the BBPUPDVD in SRM System.
    Step 3: I checked the values in BBPMAININT - vendor data (for backend vendor number 100250 and backend pur organisation - 1010). The SRM system replicates the values correct.
    Step 4: I executed BBP_UPDATE_PORG and replaced the local (SRM) business partner (for local vendor number - 100250 and local purchasing organisation) - REPLACE Option. Then SRM replaces the SRM Business Partner (local) Data with Back end Vendor Master Data and also Back End vendor master data is deleted in SRM System. Now I have updated business partner details in SRM System as SRM Local an no SRM Back End Vendor Master Data in SRM System. This step is working fine.
    Step 5: One more time I am executing BBP_UPDATE_PORG Tr code with Add option to have SRM Back End Details (in SRM System) from SRM Local Details (SRM System). Then the system is error message in SM13 Tr code.
    Kind Note: There is no SRM Back End Vendor details in SRM System which I want to have with the help of executing BBP_UPDATE_PORG Tr code with Add option.
    For analysis I went to ST22 (dump Analysis), the SRM gave an error message like:
    Runtime Error          DYNPRO_SEND_IN_BACKGROUND
    Date and Time          09/15/2008 10:56:58
    ShrtText
         Screen output without connection to user.
    What happened?
         Error in ABAP application program.
         The current ABAP program "SAPLBBP_PARTNER_MAINT" had to be terminated because
          one of the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
    Information on where terminated
        The termination occurred in the ABAP program "SAPLBBP_PARTNER_MAINT" in      "BBP_PORG_INSERT".
        The main program was "RSM13000 ".
        The termination occurred in line 59 of the source code of the (Include)      program "LBBP_PARTNER_MAINTU11"
        of the source code of program "LBBP_PARTNER_MAINTU11" (when calling the editor      590).
        The program "SAPLBBP_PARTNER_MAINT" was started in the update system.
       56
       57 * update database
       58   IF NOT LT_FRG0060_NEW[] IS INITIAL.
    >>>>>     INSERT BBPM_BUT_FRG0060 FROM TABLE LT_FRG0060_NEW.
       60   ENDIF.
       61
       62   IF NOT LT_FRG0061_NEW[] IS INITIAL.
       63     INSERT BBPM_BUT_FRG0061 FROM TABLE LT_FRG0061_NEW.
       64   ENDIF.
    Kindly guide me or provide solution.
    We are in SRM 4.0 and ECC 5.0.
    Thanks a lot in advance.
    Regards,
    Sudarsan
    Edited by: KOYYA SUDARSANA NAIDU on Sep 15, 2008 9:09 PM
    Edited by: KOYYA SUDARSANA NAIDU on Sep 17, 2008 8:46 PM

  • Are Multiple-If Optional Regions Can Be Implemented with DW 8???

    Hi,
    I read about them in DW MX Templates by Brad Halstead and Murrray Summers?

    I am not 100% sure what you're asking, but yes:
    - you can use multiple optional regions in a template.
    - you can use multiple if sections responding to the same template property variable
    (You might even be able to nest an optional region within another optional when using sub-templates, but I dont think I ever tried that..)
    Hope that helps..

  • Change tr bgcolor based on optional region

    Hello, dear DW wizards,
    I would like to automatically change the background color of a table row based upon wether an optional region is visible in a document or not.
    I created an optional region in a template and set its default state to show. In another region I made the tr tag of a table row editable. The default bgcolor for that row is red.
    If the optional region in an html file based on this template is hidden, the bgcolor of the table row should automatically change to blue.
    Is this possible with conditional expressions? I find no detailed info on the programming and don't know Javascript (which DW expression language is similar to).
    Thanks for you help
    Bernhard

    Your best bet with questions like this is to post your code so we can see exactly what is happening.  Nevertheless, the 'guess' answer to your question is "yes" you can do such things with conditional expressions.  You would make the color for the <tr> test the template parameter that controls the visibility of the optional region:
    <tr style="background-color:@@(param==true ? #AAAAAA : #BBBBBB)@@"

  • Problems with the system decimal point with german regional settings

    I have a Labview 6 app that needs deploying to Germany.
    My app sends strings over VISA RS232 and GPIB instruments with floating point numbers.
    When changing from English to German regional settings, in Windows XP, periods are now interpreted as commas and the app starts truncating my decimal numbers. So in the English Regional Setting when I send 1.234 I get 1.234 but in the German Regional Settings when I send 1.234 I get 1.000.
    I have turned off the "Use localized decimal point" in Tools - Options - Front Panel as well as set any function (Frac/Exp String to Number) that has a "Use System Decimal Point" connector to FALSE.
    Now here's my problem....
    This fixed the issue I was having as long as I am in the development environment, however, once I build the application I still get the truncated numbers. Example: I send 1.234 to an instrument and it sees 1.000.
    Again this works fine in the development enviroment, sending 1.234 reads 1.234 with German regional settings.
    Any help is appreciated.
    Adam

    You can use a simple function of the "Scan from string" function.
    Place "%.;" (Without the quotes) in the scanning string, and this will tell LV to use a decimal point for interpretation. If you place "%,;", this will tell it to use a comma.
    You can place this at the beginning of your format string, and it simply tells the parser how to work, it doesn't otherwise produce an output.
    Using simply "%;" sets the seperator to the system default (maybe the best idea after the code has been run as the changed decimal point character apparently remains changed otherwise). From the LV help
    The following codes control the decimal separator used for numeric output. These codes do not cause any input or output to occur. They change the decimal separator for all further inputs/outputs until the next %; is found.
    %,; comma decimal separator
    %.; period decimal separator
    %; system default separator
    Hope this helps
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Studio 12: C compiler generates bad code with -m64 -KPIC -xO2

    Hello,
    after upgrading my Solaris 10/x64 machine from Studio 11 to Studio 12 some problems were fixed, but others came up; like this one:
    I have a code snippet that obviously causes the C compiler to generate wrong code if compiled with options -m64 -KPIC -xO2. If any of these options are missing, it runs fine. Here's the example code:
    #include <stdio.h>
    #include <strings.h>
    static int do_something() { return 0; }
    static int foo() {
        fprintf(stderr, "\n!! BUG: BAD CODE! unexpected function call foo()!\n\n");
        return 222;
    static int bar() {
        fprintf(stdout, "\nOK: bar() called\n\n");
        return 0;
    static const struct {
        const char* name;
        int (*func)();
        int flag;
    } tab[] = {
        { "foo",  &foo,  0 },
        { "bar",  &bar,  0 },
        { 0, 0, 0 }
    int main(int argc, const char** argv) {
        int i;
        for (i=0; tab.name; i++) {
    if( strcmp(tab[i].name, "bar") == 0 ) {
    if(tab[i].flag) {   /* not reached */
    if(!do_something()) {
    return 2;
    return (*tab[i].func)();
    return 1; /* not reached */
    Many lines seem to be bogus, but they are actually needed to reproduce the problem.
    This is what happens:# cc -m64 -KPIC -xO2 bug.c && ./a.out ; echo $?
    !! BUG: BAD CODE! unexpected function call foo()!
    222
    If I compile with debugging information (-g), I get expected behavior, which is:# cc -m64 -KPIC -g bug.c && ./a.out ; echo $?
    OK: bar() called
    0
    While creating the test case I've also seen SIGSEGV at runtime in the bug case - which is probably due to a wrong calculated function address for jmp (just guessing).
    Does anyone know if this is a known bug?
    Any help is appreciated.
    The rest of this posting is information about my system and Studio 12 patch level:# uname -a
    SunOS v20 5.10 Generic_137112-08 i86pc i386 i86pc
    # /usr/SUNWspro/bin/version
    Machine hardware: i86pc
    OS version: 5.10
    Processor type: i386
    Hardware: i86pc
    The following components are installed on your system:
    Sun Studio 12
    Sun Studio 12 C Compiler
    Sun Studio 12 C++ Compiler
    Sun Studio 12 Tools.h++ 7.1
    Sun Studio 12 C++ Standard 64-bit Class Library
    Sun Studio 12 Garbage Collector
    Sun Studio 12 Fortran 95
    Sun Studio 12 Debugging Tools (including dbx)
    Sun Studio 12 IDE
    Sun Studio 12 Debugger GUI
    Sun Studio 12 Performance Analyzer (including collect, ...)
    Sun Studio 12 X-Designer
    Sun Studio 12 VIM editor
    Sun Studio 12 XEmacs editor
    Sun Studio 12 Performance Library
    Sun Studio 12 LockLint
    Sun Studio 12 Building Software (including dmake)
    Sun Studio 12 Documentation Set
    Sun Studio 12 /usr symbolic links and GNOME menu item
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9 SunOS_i386 Patch 124868-07 2008/10/07
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9 SunOS_i386 Patch 124864-08 2008/10/16
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.3 SunOS_i386 Patch 127002-04 2008/04/16
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.6 SunOS_i386 Patch 124873-06 2008/08/20
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.6 SunOS_i386 Patch 126996-04 2008/09/03
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.8 SunOS_i386 Patch 126504-01 2007/07/19

    I'm watching Bug ID: [6774287|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6774287] for quite a while and it seems to be fixed some time ago (State: 8-Fix Available, bug). Does anybody know if the fix made it in some officially available SunStudio 12 C compiler (backend) patch already? I'm using this SS12 patch-level meanwhile:
    # /usr/SUNWspro/bin/version
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9 SunOS_i386 Patch 124868-08 2008/11/25
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9 SunOS_i386 Patch 124864-09 2008/12/16
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.3 SunOS_i386 Patch 127002-05 2008/10/21
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.6 SunOS_i386 Patch 124873-06 2008/08/20
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.6 SunOS_i386 Patch 126996-04 2008/09/03
    version of "/usr/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.8 SunOS_i386 Patch 126504-01 2007/07/19

  • The "always open with-"  option doesn't work!

    Is there a way to get the "Always open with" option when doing a (control) (option) click on a file to actually ALWAYS open with the application I choose? Could this feature be broken or perhaps mislabeled?
    Here's what happens; I'll set a file to "always open with" one application. I work on that file and save it. The next time I try to open that file it opens with the snow leopard default application instead of using the application I directed it to "Always open with".
    I don't want to open every file type with this application so I'm not setting "apply to all" in the info window/ inspector, I simply want this one file to always open with the application I've selected.
    I'm hoping some of you super mac users will know a trick to make this work.

    I want to open a few select files with a non-default application (now that the creation code is not used.)...If I work on the file and make/save any changes, it reverts to the default app.
    Aha! Okay, I don't think any of us were getting that in the initial posts. You are correct. Snow Leopard no longer uses Type and Creator codes by default, but they are still there. Various things are keeping you from doing what you want.
    1) Newer programs that do not use Type and Creator codes at all still need a way to tell the OS what files belong to them. Since at least back as far as Leopard (likely earlier), the system now uses Uniform Type Identifiers. As far as keeping track of what files belong to what applications, they serve the same purpose as Type and Creator codes. So when you save changes, it will indeed revert back to the default app since the file once again gets saved with that program's UTI data.
    2) Some programs use both UTI and Type and Creator codes. Usually older apps that have come from PPC code. I would guess that would be either because the developer doesn't want to waste time removing the code that adds the Type and Creator codes to the files, or more likely, to make sure files passed to other users still on older Macs that don't use UTI won't have trouble opening them.
    3) I use some much older apps which have still not been rewritten at all for Intel Macs and are still all PPC code. They still write Type and Creator codes.

  • Error: Reason codes with automatic charge-off are not permitted here(F-28)

    Hi All
    I creted a reason code in obxl t-code and assigned a gl code in OBXL transaction code, But when I am trying to clear a payment with reason code in F-28, System is throwing the following error..Can some one tell me why i am getting this error?
    Reason codes with automatic charge-off are not permitted here
    Message no. F5605
    Diagnosis
    The reason code entered is designed to ensure that the payment difference amount is posted to an account specially set up for this purpose.  Postings of this nature usually require additional specifications (e.g. tax code, business area). If the difference stems from a single open item, the necessary specifications can be taken from that item. In the case that led to this error message, however, the difference does not stem soley from one item, which means that this method cannot be used.
    System Response
    The reason code entered is not accepted.
    Procedure
    You can either select a different reason code, which would create a new open item for the customer or vendor OR write off the difference using the function Charge off diff.. This function either takes you into a pre-configured account assignment model or into the document overview. From here you can enter the required difference postings.

    Hi Venkata,
    It seems while entering the payment (partial payment / residual items) ... you are clearing multiple items with differences. (e.g. if the difference amount is $30, then may the difference consists of two invoices underpaid by $15 each). In this scenario, F-28 doesn't know which additional account assignment fields should be picked up ... hence the error.
    First of all, to validate that this indeed is the case, try clearing a payment with the same reason code where difference can be attributed to a single invoice. If you still get an error, then there is some other problem.
    Then, to take care of a the business scenario where the difference can indeed be due to multiple documents, select "charge off difference" option and create an entry to post the difference as necessary.
    HTH,
    Manish Patel
    Sr. SAP Solutions Consultant

  • BUG: Popup in page fragment; with many regions and popup binded to backing.

    BUG: Popup in page fragment; with many regions and popup or parent binded to backing bean.
    JDEV11.1.2.1 Popup will not popup.(sometimes works if using RichPopup.Show() in backing bean Java code.)
    I have a bug (Popup will not popup)that only happens when I have more than one of the same region.
    And I have a popup in the page fragment is binded to backing bean.
    My SR guy is out today but we plan to enter one.
    test.jspx
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
        <jsp:directive.page contentType="text/html;charset=UTF-8"/>
        <f:view>
            <af:document title="test" id="d1">
                <af:form id="f1">
                    <af:panelGroupLayout id="pgl1" layout="horizontal">
                        <af:outputText value="BUG JDEV11.1.2.1 and IE7. Broken Popup! If I have a jsff fragment and I have many regions of this fragment."
                                       id="ot2"/>
                        <af:outputText value="Inside the fragment I have a popup. If that popup or its parent are binded to a Backing Bean the popup doesn't work."
                                       id="ot1"/>
                    </af:panelGroupLayout>
                    <!-- with a single region it also works (with bindings in place in fragment). -->
                    <af:region value="#{bindings.taskflowemp1.regionModel}" id="r1"/>
                    <af:region value="#{bindings.taskflowemp2.regionModel}" id="r2"/>    
                    <!--
                    <af:region value="#{bindings.taskflowemp3.regionModel}" id="r3"/>
                    <af:region value="#{bindings.taskflowemp4.regionModel}" id="r4"/>
                    -->
                </af:form>
            </af:document>
        </f:view>
    </jsp:root>region.jsff
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
      <af:group id="g1">
      <!-- If I remove the binding for popop or popup group, the popup works fine. -->
    <!--Working code here
        <af:group id="g2">
          <af:popup childCreation="deferred" autoCancel="disabled" id="p1" >
        -->
           <!-- Problem code here   -->
        <af:group id="g2" binding="#{TestBean.popupGroup}">
          <af:popup childCreation="deferred" autoCancel="disabled" id="p1" binding="#{TestBean.testPopup}"> 
            <!-- End problem code -->
            <af:dialog id="d2" title="Dialog Title">
              <f:facet name="buttonBar"/>
              <af:outputText value="Dialog Contents" id="ot100"/>
            </af:dialog>
          </af:popup>
        </af:group>
        <af:panelGroupLayout id="pgl1">
          <af:panelBox text="Region" id="pb1">
            <f:facet name="toolbar"/>
            <af:commandButton text="showPopupBehavior" id="cb1" >
              <af:showPopupBehavior popupId="p1"/>
            </af:commandButton>
            <af:commandButton text="AdfPage.PAGE.findComponent JavaScript" id="cb2" actionListener="#{TestBean.popupTestJavaScript}"/>
            <af:commandButton text="RichPopup.Show() Java" id="cb3" actionListener="#{TestBean.popupTestJava}"/>
          </af:panelBox>
        </af:panelGroupLayout>
      </af:group>
    </jsp:root>TestBean.java
    package view;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ActionEvent;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import org.apache.myfaces.trinidad.component.UIXGroup;
    import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
    import org.apache.myfaces.trinidad.util.Service;
    public class TestBean {
        private RichPopup testPopup;
        private UIXGroup popupGroup;
        public TestBean() {
        public void setTestPopup(RichPopup testPopup) {
            this.testPopup = testPopup;
        public RichPopup getTestPopup() {
            return testPopup;
        public void popupTestJava(ActionEvent actionEvent) {
            if(testPopup != null){
                RichPopup.PopupHints ph = new RichPopup.PopupHints();
                testPopup.show(ph);
            }else{
                System.err.println("TestBean.testPopop IS NULL!");
        public void popupTestJavaScript(ActionEvent actionEvent) {
            showPopupTest("r1:0:p1");
        private static void showPopupTest(String popupId) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExtendedRenderKitService service =
                Service.getRenderKitService(facesContext,
                                            ExtendedRenderKitService.class);
            service.addScript(facesContext,
                              "AdfPage.PAGE.findComponent('" + popupId + "').show();");
        public void setPopupGroup(UIXGroup popupGroup) {
            this.popupGroup = popupGroup;
        public UIXGroup getPopupGroup() {
            return popupGroup;
    }

    Thanks that fixed the problem.
    "a user error"
    Well I followed your book! Chapter 6 of the "Oracle Fusion Developer Guide - Working with Bounded Task Flows in ADF Regions". I think this comes back to book writer error. I found almost no mention of BackingBeanScope in this chapter. Don't you think this would be an important note?
    "did you know that there is a Java API (on the RichPopup instance) to launch a popup ?"
    Yes I posted in my code! If you read the above code you would see it there.
    I don't really understand why the scope of the bean has anything to do with af:showPopupBehavior or AdfPage.PAGE.findComponent.

  • How does this LINQ query work with Option Infer Off?

    How should value and filtered be declared?  It doesn't work when I turn Option Infer Off.  Originally, it worked with Option Infer On. There was no Dim statement on the first line, but the Dim keyword was placed before the
    filtered = line.  As soon as I turned Option Infer Off, all sorts of errors showed up.  How should the code be adjusted?  (Option Strict is On.)
    Dim element, value, filtered As Integer
    Dim values() As Integer = {2, 9, 5, 0, 3, 7, 1, 4, 8, 6}
    filtered =
    From value In values
    Where (value > 4)
    Select value
    For Each element In filtered
    Console.Write(element & " ")
    Next
    Solitaire

    Hi Solitaire,
    the Option Infer Off version would be:
    Option Strict On
    Option Infer Off
    Imports System
    Imports System.Collections.Generic
    Imports System.Linq
    Public Class Class1
    Public Shared Sub LinqWithNoInfer()
    Dim values() As Integer = {2, 9, 5, 0, 3, 7, 1, 4, 8, 6}
    ' compiled to
    ' filtered = values.Where(Function(value As Integer) value > 4).Select(Function(value As Integer) value)
    value)
    Dim filtered As IEnumerable(Of Integer) =
    From value In values
    Where (value > 4)
    Select value
    For Each element As Integer In filtered
    Console.Write(element & " ")
    Next
    End Sub
    End Class
    The type for filtered is determined by the Select statement, that is
    Enumerable.Select, and will return an
    IEnumerable(Of T) and T is an Integer here.
    Option Infer looks for the return value of Select and will give the same result.
    Note: For Lambda Expressions Option Infer Off is ignored and the type is inferred - both are valid:
    filtered = values.Where(Function(value) value > 4).Select(Function(value) value)
    filtered = values.Where(Function(value As Integer) value > 4).Select(Function(value As Integer) value)
    Regards, Elmar

  • Report code with ALV

    Hi
    Can any body provide me the code for report with selection screen using ALV.
    Thanks in advance
    Prasanna Kumar

    Hi Prasanna,
    Below is an example of ALV reporting.
    *& Report  ZVVF_MR028_STOCKLEDGER                                      *
    REPORT  ZVVF_MR028_STOCKLEDGER                  .
    *       Tables
    TABLES:      EKKO,    "PURCHASING DOC. HEADER
                 EKPO,    "PURCHASING DOC. ITEM
                 MAKT,    "MATERIAL DISCRIPTION
                 LFA1,    "VENDOR MASTER
                 RSEG,    "DOC. ITEM - INCOMING INVOICE
                 KONV,    "CONDITION (TRANSECTION DATA - CLUSTER TABLE)
                 EKPA,    "Partner Roles in Purchasing
                 MSEG,
                 t247,
                 mardh,
                 mara.
    *       Types                    Begin with TY_
    TYPE-POOLS slis.
    TYPES  :  BEGIN OF ty_head,
                  p_date TYPE dats,
                  matnr LIKE mseg-matnr,
                  maktx LIKE makt-maktx,
                  openbal LIKE mardh-labst,
                  r_po LIKE mseg-menge,
                  r_prodord LIKE mseg-menge,
                  r_byprod LIKE mseg-menge,
                  r_others LIKE mseg-menge,
                  R_TOTAL TYPE mseg-menge,
                  i_prod LIKE mseg-menge,
                  i_cust LIKE mseg-menge,
                  i_costcen LIKE mseg-menge,
                  i_scrapping LIKE mseg-menge,
                  i_subcontractor LIKE mseg-menge,
                  i_sampling LIKE mseg-menge,
                  purret LIKE mseg-menge,
                  i_total like mseg-menge,
                  stock_out LIKE mseg-menge,
                  stock_in LIKE mseg-menge,
                  stock_transit LIKE mseg-menge,
                  m_to_m_transit  LIKE mseg-menge,
                  phy_loss LIKE mseg-menge,
                  phy_gain LIKE mseg-menge,
                  closing_bal LIKE mseg-menge,
                  current_bal LIKE mseg-menge,
                  bwart like mseg-bwart,
                  werks like mseg-werks,
              END OF ty_head.
    types :  begin of ty_docs,
             matnr like mseg-matnr,  "Material
             budat like mkpf-budat,  "Posting date
             menge like mseg-menge,  "Qty
             xblnr like mkpf-xblnr,  "Ref doc
             end of ty_docs.
    data : w_cnt type I.
    data : w_chk type i.
    TYPES: BEGIN OF TY_KONV,
                 KNUMV LIKE KONV-KNUMV,
                 KBETR LIKE KONV-KBETR,
                 KSCHL LIKE KONV-KSCHL,
                 KWERT LIKE KONV-KAWRT,
           END OF TY_KONV.
    TYPES: BEGIN OF TY_KBETR,
    *              KBETR LIKE KONV-KBETR,
                  KWERT LIKE KONV-KWERT,
              END OF TY_KBETR.
    TYPES: BEGIN OF TY_RSEG,
                  EBELN LIKE RSEG-EBELN,
                  MATNR LIKE RSEG-MATNR,
                  WRBTR LIKE RSEG-WRBTR,
                  KSCHL LIKE RSEG-KSCHL,
                  LIFNR LIKE RSEG-LIFNR,
              END OF TY_RSEG.
    TYPES: BEGIN OF TY_NAME1,
                  NAME1 LIKE LFA1-NAME1,
           END OF TY_NAME1.
    ** Each Condition and their values w.r.t different docu types
    *data: begin of temp_head occurs 0,
    *        kschl  like  konv-kschl,  " Condition type
    *        kwert  like  konv-kwert,  " Condition value
    *      end of temp_head.
    *       Constants                Begin with C_
    CONSTANTS: st_formname_top_of_page TYPE slis_formname
                                  VALUE 'TOP_OF_PAGE-ALV'.
    *       Data                     Begin with W_
    *-------- Declarations for ALV Grid.
    DATA:   it_st_list_top_of_page TYPE slis_t_listheader,
            it_st_fieldcat TYPE slis_t_fieldcat_alv,
            it_st_events   TYPE slis_t_event,
            st_layout   TYPE slis_layout_alv,
            s_status TYPE slis_formname VALUE 'STANDARD_ST01',
            s_user_command TYPE slis_formname VALUE 'USER_COMMAND-ALV',
            s_repid LIKE sy-repid,
            s_save(1) TYPE c,
            s_variant LIKE disvariant,
            code LIKE disvariant-handle.
    data : begin of it_stockclose occurs 0,
           werks like s031-werks,   "Plant
           matnr like mara-matnr,   "Material
           lgort like mard-lgort,   "Storage Loc
           labst like mardh-labst,  "Unrestricted Stock
           insme like mardh-insme,  "Inspection Stock
           speme like mardh-speme,  "Safety stock
           einme like mardh-einme,  "Total stock of rest batches
           retme like mardh-retme,  "Blocked stock returns
           end of it_stockclose.
    data : begin of it_finalstock occurs 0,
           werks like mseg-werks,   "Plant
           matnr like mseg-matnr,   "Material code
           lgort like mard-lgort,   "Sto Loc
           menge like mseg-menge,   "Qty
    *       budat like mkpf-budat,   "Posting Date
           end of it_finalstock.
    data : begin of it_docs occurs 0,
           matnr like mseg-matnr,   "Material code
           budat like mkpf-budat,   "Posting date
           bwart like mseg-bwart,   "Movement type
           menge like mseg-menge,   "Quantity
           werks like mseg-werks,   "Plant
           shkzg like mseg-shkzg,   "Credit/debit
           lgort like mseg-lgort,   "Sto Loc
           maktx like makt-maktx,   "Material Discription
           end of it_docs.
    data : begin of it_mkpf occurs 0,
           budat like mkpf-budat,   "Posting date
           mblnr like mkpf-mblnr,   "Material Doc
           xblnr like mkpf-xblnr,   "Delivery ref no
           mjahr like mkpf-mjahr,   "Fiscal yr
           cpudt like mkpf-cpudt,
           end of it_mkpf.
    data : begin of it_mseg occurs 0,
           matnr like mseg-matnr,   "Material
           bwart like mseg-bwart,   "Movement type
           menge like mseg-menge,   "Qty
           werks like mseg-werks,   "Plant
           mjahr like mseg-mjahr,   "Fiscal yr
           shkzg like mseg-shkzg,   "Credit/Debit Indicator
           lgort like mard-lgort,   "Sto loc
           budat like mkpf-budat,   "Posting date
           xblnr like mkpf-xblnr,   "Delivery ref
           cpudt like mkpf-cpudt,
           end of it_mseg.
    data : begin of it_matnr occurs 0,
           matnr like mara-matnr,   "Material
           end of it_matnr.
    data : w_monat  type monat.    "Month number
    data : w_gjahr like sy-datum,    "Date
           w_date_fiscal(4) type n,  "Year
           w_date like sy-datum,     "Date
           w_buper like t009b-poper, "Posting period
           w_year like t009b-bdatj,  "Posting date
           w_datum(2) type n.        "Date
    *       Internal tables          Begin with IT_
    DATA    :  IT_HEAD TYPE STANDARD TABLE OF TY_HEAD WITH HEADER LINE.
    ***Issues and receipts
    data : it_issue type ty_docs occurs 0 with header line,
           it_receipt type ty_docs occurs 0 with header line,
           it_issue_date type ty_docs occurs 0 with header line,
           it_receipt_date type ty_docs occurs 0 with header line.
    data:   w_dval like mseg-menge,
            w_opbal like mseg-menge.
    **  WORK AREAS: Begin with WA_
    *DATA: wa_HEAD type TY_HEAD.
    *data: w_tkwert    type p decimals 2 value 0,
    *      grmenge     like ekpo-menge,
    *      w_tot_kwert type p decimals 2 value 0,
    *      w_tmp_kwert type p decimals 2 value 0,
    *      w_finalsum  type p decimals 2 value 0,                "#EC *
    *      w_finalrate type p decimals 4 value 0.                "#EC *
    *       R A N G E S
    ranges: r_loekz  for  ekko-loekz.  " Deletion Indicator
    ranges : r_movtype for mseg-bwart,   "Movement type
             r_date for sy-datum.        "Date
    *       Select Options          Begin with SO_
    SELECTION-SCREEN BEGIN OF BLOCK MAIN WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 2.
    *SELECT-OPTIONS : SO_LIFNR FOR EKKO-LIFNR.
    *SELECT-OPTIONS : SO_EKORG FOR EKKO-EKORG .
    *SELECT-OPTIONS : SO_WERKS FOR MSEG-WERKS .
    *SELECT-OPTIONS : SO_EBELN FOR EKKO-EBELN.
    *SELECT-OPTIONS : SO_DATE for sy-datum obligatory no-extension.
    *SELECT-OPTIONS : SO_EKGRP FOR EKKO-EKGRP.
    *SELECT-OPTIONS : SO_BSART FOR EKKO-BSART DEFAULT 'NB'.
    *SELECT-OPTIONS : SO_MATKL FOR EKPO-MATKL.
    *SELECT-OPTIONS : SO_MATNR FOR MSEG-MATNR.
    select-options   : so_werks for mseg-werks default 'P001'. "Plant
    select-options   : so_lgort for mseg-lgort. " Sto. Location
    select-options   : so_matnr for mseg-matnr obligatory. "Material code
    select-options   : so_mtart for mara-mtart. "Material type
    SELECT-OPTIONS   : SO_MATKL FOR EKPO-MATKL. "Material Group
    select-options   : so_date for sy-datum obligatory no-extension.
    SELECTION-SCREEN SKIP 2.
    selection-screen: skip,
                      begin of line,
                      comment (15) text-034.
    parameters:     p_all    radiobutton group del.
    selection-screen comment 25(9) for field p_all.
    parameters:     p_del    radiobutton group del.
    selection-screen comment 45(12) for field p_del.
    parameters:     p_undel  radiobutton group del default 'X'.
    selection-screen comment 65(14) for field p_undel.
    selection-screen end of line.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN END OF BLOCK MAIN.
    *       Parameters              Begin with PR_
    *       Initialisation
    INITIALIZATION.
      s_repid = sy-repid.
      s_save = 'A'.
      perform f000_initialize_mov_type changing r_movtype[].
      PERFORM eventtab_build USING it_st_events[].
      PERFORM variant_init.
    *       S T A R T   O F   S E L E C T I O N
    START-OF-SELECTION.
      PERFORM initialize.
      perform f001_determine_fiscal_period.
      perform f002_determine_closing_stock changing it_stockclose[].
      if not so_date-low+6(2) eq '01'.
        perform f003_change_closing_stock changing  it_stockclose[].
      endif.
      perform f004_determine_mat_docs changing it_mkpf[]
                                                 it_mseg[].
      perform f005_receipts_issues using    it_mseg[]
                                     changing it_issue[]
                                              it_receipt[]
                                              it_matnr[].
    *---alv
      PERFORM comment_build USING it_st_list_top_of_page[].
      PERFORM fieldcat USING it_st_fieldcat[].
      PERFORM layout_build USING st_layout.
      PERFORM reuse_alv_list_display.
    END-OF-SELECTION.
    form initialize.
      clear:   r_loekz.
      refresh: r_loekz.
    *--- Deleted PO's only
      if p_del = 'X'.
        r_loekz-sign   = 'I'.
        r_loekz-option = 'EQ'.
        r_loekz-low    = 'L'.
        append r_loekz.
      endif.
    *--- UnDeleted PO's only
      if p_undel = 'X'.
        r_loekz-sign   = 'E'.
        r_loekz-option = 'EQ'.
        r_loekz-low    = ' '.
        append r_loekz.
      endif.
    endform.                    "initialize
    *&      Form  f000_initialize_mov_type
    *       Desc : Initialization of movement types
    form f000_initialize_mov_type  changing p_r_movtype like r_movtype[].
      data : lwa_movtype like line of p_r_movtype.
      lwa_movtype-sign = 'I'.
      lwa_movtype-option = 'EQ'.
      lwa_movtype-low = '101'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '102'.
      append lwa_movtype to p_r_movtype.
    * Additional changes done for other movement types--> by deepak
      lwa_movtype-low = '103'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '104'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '105'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '106'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '122'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '123'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '161'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '162'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '201'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '202'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '261'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '262'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '301'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '302'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '303'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '304'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '305'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '306'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '309'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '310'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '331'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '332'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '333'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '334'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '335'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '336'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '511'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '512'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '531'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '532'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '541'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '542'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '561'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '562'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '601'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '602'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '641'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '642'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '643'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '644'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '701'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '702'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '909'.
      append lwa_movtype to p_r_movtype.
      lwa_movtype-low = '910'.
      append lwa_movtype to p_r_movtype.
    endform.                    " f000_initialize_mov_type
    *&      Form  f001_determine_fiscal_period
    *       Desc  Determination of fiscal period
    form f001_determine_fiscal_period .
      clear : w_monat,
              w_gjahr,
              w_date,
              w_buper,
              w_year.
      w_monat = so_date-low+4(2).
      if w_monat = '01'.
        w_monat = '12'.
        w_gjahr = so_date-low+0(4).
        w_date_fiscal = w_gjahr+0(4) - 1.
        w_gjahr = w_date_fiscal.
      else.
        w_monat = w_monat - 1.
        w_gjahr = so_date-low+0(4).
      endif.
      concatenate w_gjahr w_monat '01'  into w_gjahr.
    *****Determines Fiscal yr and period
      call function 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date  = w_gjahr
          i_periv = 'V3'
        IMPORTING
          e_buper = w_buper
          e_gjahr = w_year.
      if sy-subrc <> 0.
      endif.
      w_datum = w_buper+1(2).
    **Month text
      select single ltx from t247 into t247-ltx
             where spras = 'E'
             and   mnr   = so_date-low+4(2).
    endform.                    " f001_determine_fiscal_period
    *&      Form  f001_determine_closing_stock
    *       Desc : Determination of closing stock
    form f002_determine_closing_stock
                       changing p_it_stockclose like it_stockclose[].
      data : lw_recs type i,
             w_dval like mseg-menge,
             w_opbal like mseg-menge.
      data : begin of lit_stockclose occurs 0,
             lfgja like mardh-lfgja,   "Fiscal yr
             lfmon like mardh-lfmon,   "Period
             werks like s031-werks,   "Plant
             matnr like mara-matnr,   "Material
             lgort like mseg-lgort,   "Storage Loc
             labst like mardh-labst,  "Unrestricted Stock
           end of lit_stockclose.
      data : begin of lit_mard occurs 0,
             matnr like mara-matnr,
             werks like mseg-werks,
             lgort like mseg-lgort,
             end of lit_mard.
      data : lwa_stockclose like line of p_it_stockclose.
      select matnr werks lgort from mard
      into corresponding fields of table lit_mard
      where matnr in so_matnr
      and werks in so_werks.
      refresh it_stockclose.
      clear   it_stockclose.
    *****Fetch Closing stock
    *If the entry is found in MARD then consider the same
    *else fetch the closing stock from MARDH.
      loop at lit_mard.
        refresh lit_stockclose.
        clear   lit_stockclose.
        select werks matnr lgort labst
              insme speme einme retme
              lfgja lfmon
               into corresponding fields of
                table lit_stockclose
               from mard
        where   lfmon = w_datum
        and     lfgja = w_year
        and     werks = lit_mard-werks
        and     matnr = lit_mard-matnr
        and     lgort = lit_mard-lgort.
        clear lw_recs.
        describe table lit_stockclose lines lw_recs.
    *If no entry in MARD fetch from MARDH.
        if lw_recs = 0.
          select werks matnr lgort labst
                insme speme einme retme
                lfgja lfmon
                 into corresponding fields of
                table lit_stockclose
                from mardh
         where   lfmon = w_datum
         and     lfgja = w_year
         and     werks = lit_mard-werks
         and     matnr = lit_mard-matnr
         and     lgort = lit_mard-lgort.
        endif.
        sort lit_stockclose by lfgja lfmon descending.
        read table lit_stockclose index 1.
        if sy-subrc eq 0.
          move-corresponding lit_stockclose to lwa_stockclose.
          append  lwa_stockclose to p_it_stockclose.
          clear  lwa_stockclose.
        endif.
      endloop.
    endform.                    " f001_determine_closing_stock
    *&      Form   f003_change_closing_stock
    *       Desc : Selection of the mat docs for the intermediate
    *              days if the selection begin date is not from
    *              first date of the corresponding month.
    form f003_change_closing_stock changing
                                       p_it_stockclose like it_stockclose[].
      data : lwa_stockclose like line of p_it_stockclose[].
      refresh : r_date,
                it_docs,
                it_finalstock.
      clear : r_date,
              lwa_stockclose.
      r_date-sign = 'I'.
      r_date-option = 'BT'.
      concatenate so_date-low+0(4)
                  so_date-low+4(2)
                  '01'
                  into r_date-low.
      r_date-high = so_date-low - 1.
      append r_date.
      clear r_date.
    read table r_loekz index 1.
      select mkpf~budat
             mseg~matnr
             mseg~bwart
             mseg~menge
             mseg~werks
             mseg~shkzg
             mseg~lgort
             makt~maktx
             into corresponding
             fields of
             table it_docs
             from mkpf as mkpf inner join mseg as mseg
             on mkpf~mandt = mseg~mandt and
                mkpf~mblnr = mseg~mblnr and
                mkpf~mjahr = mseg~mjahr
             inner join makt as makt
               on mseg~matnr = makt~matnr
             where
                mseg~werks IN SO_WERKS and
                mseg~matnr in so_matnr and
                mkpf~budat in r_date and
                mseg~bwart in r_movtype.
      Clear it_docs.
      loop at it_docs.
        if it_docs-shkzg = 'H'.
          it_docs-menge = - ( it_docs-menge ).
          modify it_docs.
        endif.
        move-corresponding it_docs to it_finalstock.
        collect it_finalstock.
        clear   it_finalstock.
        move it_docs-maktx to it_head-maktx.
      endloop.
      loop at p_it_stockclose into lwa_stockclose.
        read table it_finalstock with key
                           matnr = lwa_stockclose-matnr
                           werks = lwa_stockclose-werks
                           lgort = lwa_stockclose-lgort.
        if sy-subrc eq 0.
          lwa_stockclose-labst = lwa_stockclose-labst +
                                 it_finalstock-menge.
          modify p_it_stockclose from lwa_stockclose.
          read table p_it_stockclose into lwa_stockclose index 1.
          "with key matnr = wa_head-matnr.
          "budat = wa_head-p_date.
          if sy-subrc = 0.
            w_dval = lwa_stockclose-labst.
          ENDIF.
          clear lwa_stockclose.
        endif.
      endloop.
    endform.                    " f003_change_closing_stock
    *&      Form  f004_determine_mat_docs
    *       DEsc : Determination of Receipts and Issues
    form f004_determine_mat_docs  changing p_it_mkpf like it_mkpf[]
                                           p_it_mseg like it_mseg[].
      data : lwa_mkpf like line of p_it_mkpf[],
             lwa_mseg like line of p_it_mseg[],
              ls_quantity   type mseg-menge,
              sum_issue type mseg-menge,
              sum_receipt type mseg-menge,
              sum_531 type mseg-menge,
              sum_541 type mseg-menge,
              sum_101  type mseg-menge,
              sum_511  type mseg-menge,
              sum_261  type mseg-menge,
              sum_601  type mseg-menge,
              sum_201 type mseg-menge,
              sum_641 type mseg-menge,
              sum_po  type mseg-menge,
              sum_551  type mseg-menge,
              sum_331  type mseg-menge,
              sum_161  type mseg-menge,
              sum_305  type mseg-menge,
              sum_309  type mseg-menge,
              sum_701  type mseg-menge,
              sum_702  type mseg-menge.
    ***Determination of Mat Docs
      select mblnr xblnr budat mjahr cpudt from mkpf
             into corresponding fields
             of table it_mkpf
             where budat in so_date.
    ***Determination of Receipts and issues
    *  loop at p_it_mkpf into lwa_mkpf.
    *    select mblnr matnr bwart menge werks mjahr shkzg lgort
    *          from mseg into corresponding
    *          fields of lwa_mseg
    *          where mblnr = lwa_mkpf-mblnr
    *          and   mjahr = lwa_mkpf-mjahr
    *          and   werks in so_werks
    *          and   matnr in so_matnr
    *          and   bwart in r_movtype.
    *      if lwa_mseg-shkzg = 'H'.
    *        lwa_mseg-menge = - ( lwa_mseg-menge ).
    *      endif.
    *      move : lwa_mkpf-budat to lwa_mseg-budat,
    *             lwa_mkpf-xblnr to lwa_mseg-xblnr,
    *             lwa_mkpf-cpudt to lwa_mseg-cpudt.
    *      append lwa_mseg to p_it_mseg.
    *      move lwa_mseg-matnr to it_head-matnr.
    *      move lwa_mseg-budat to it_head-p_date.
    *      move lwa_mseg-bwart to it_head-bwart.
    *      append it_head.
    *      clear it_head.
    *      clear lwa_mseg.
    *    endselect.
    *  endloop.
      sort it_mkpf by budat cpudt .
      loop at it_mkpf.
        at new budat.
          if w_opbal = SPACE.
            it_head-openbal = w_dval.
            w_chk = 1.
          else.
            it_head-openbal = w_opbal.
            w_chk = 2.
          endif.
        endat.
        if w_chk = 1.
          it_head-openbal = w_dval.
        elseif w_chk = 2.
          it_head-openbal = w_opbal.
        endif.
        select  Single *
              from mseg
              where mblnr = it_mkpf-mblnr
              and   mjahr = it_mkpf-mjahr
              and   werks in so_werks
              and   matnr in so_matnr
              and   bwart in r_movtype.
        if mseg-matnr ne SPACE.
          move mseg-mblnr to it_mseg-xblnr.
          move mseg-matnr to it_mseg-matnr.
          move mseg-bwart to IT_mseg-bwart.
          move mseg-menge to it_mseg-menge.
          move mseg-werks to it_mseg-werks.
          move mseg-mjahr to it_mseg-mjahr.
          move mseg-shkzg to it_mseg-shkzg.
          move mseg-lgort to it_mseg-lgort.
          if it_mseg-shkzg = 'H'.
            it_mseg-menge = - ( lwa_mseg-menge ).
          endif.
          move : it_mkpf-budat to it_mseg-budat,
                 it_mkpf-xblnr to it_mseg-xblnr,
                 it_mkpf-cpudt to it_mseg-cpudt.
    *      append lwa_mseg to p_it_mseg.
          append it_mseg.
    *  it_head-R_PO = it_head-r_po + ls_quantity.
          if ( it_mseg-bwart eq '101'
             or   it_mseg-bwart eq '102'
             or   it_mseg-bwart eq '103'
             or   it_mseg-bwart eq '104'
             or   it_mseg-bwart eq '105'
             or  it_mseg-bwart eq '106'
             or  it_mseg-bwart eq '161'
             or  it_mseg-bwart eq '162'
             or  it_mseg-bwart eq '122'
             or  it_mseg-bwart eq '123'
             or  it_mseg-bwart eq '511'
             or  it_mseg-bwart eq '512'
             or  it_mseg-bwart eq '531'
             or  it_mseg-bwart eq '532'
             or  it_mseg-bwart eq '561'
             or  it_mseg-bwart eq '562'
             or  it_mseg-bwart eq '305'
             or  it_mseg-bwart eq '306'
             or  it_mseg-bwart eq '702') and it_mseg-shkzg = 'S'.
            move it_mseg-menge to ls_quantity.
            sum_receipt = sum_receipt + ls_quantity.
          elseif
           ( it_mseg-bwart eq '261'
             or   it_mseg-bwart eq '262'
             or   it_mseg-bwart eq '601'
             or   it_mseg-bwart eq '602'
             or   it_mseg-bwart eq '201'
             or  it_mseg-bwart eq '202'
             or  it_mseg-bwart eq '551'
             or  it_mseg-bwart eq '552'
             or  it_mseg-bwart eq '541'
             or  it_mseg-bwart eq '542'
             or  it_mseg-bwart eq '331'
             or  it_mseg-bwart eq '332'
             or  it_mseg-bwart eq '333'
             or  it_mseg-bwart eq '334'
             or  it_mseg-bwart eq '335'
             or  it_mseg-bwart eq '336'
             or  it_mseg-bwart eq '641'
             or  it_mseg-bwart eq '642'
             or  it_mseg-bwart eq '643'
             or  it_mseg-bwart eq '644'
             or  it_mseg-bwart eq '351'
             or  it_mseg-bwart eq '352'
             or  it_mseg-bwart eq '301'
             or  it_mseg-bwart eq '302'
             or  it_mseg-bwart eq '303'
             or  it_mseg-bwart eq '304'
             or  it_mseg-bwart eq '309'
             or  it_mseg-bwart eq '310'
             or  it_mseg-bwart eq '909'
             or  it_mseg-bwart eq '910'
             or  it_mseg-bwart eq '701')  and it_mseg-shkzg = 'S'.
             move it_mseg-menge to ls_quantity.
            sum_issue = sum_issue + ls_quantity.
          endif.
        if ( it_mseg-bwart eq '101' or it_mseg-bwart eq '102'
            or it_mseg-bwart eq '103' or it_mseg-bwart eq '104'
            or it_mseg-bwart eq '105' or it_mseg-bwart eq '106')
            And it_mseg-shkzg = 'S'.
            move it_mseg-menge to ls_quantity.
            sum_po = sum_po + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '531'
             or it_mseg-bwart eq '532') and it_mseg-shkzg = 'S'.
            move it_mseg-menge to ls_quantity.
            sum_531 = sum_531 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '541' or it_mseg-bwart eq '542' ).
            move it_mseg-menge to ls_quantity.
            sum_541 = sum_541 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '102' or it_mseg-bwart eq '102' ).
            move it_mseg-menge to ls_quantity.
            sum_101 = sum_101 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '561' or it_mseg-bwart eq '562'
              OR IT_MSEG-BWART EQ '511' OR it_mseg-bwart eq '512').
            move it_mseg-menge to ls_quantity.
            sum_511 = sum_511 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '261' or it_mseg-bwart eq '262').
            move it_mseg-menge to ls_quantity.
            sum_261 = sum_261 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '601' or it_mseg-bwart eq '602').
            move it_mseg-menge to ls_quantity.
            sum_601 = sum_601 + ls_quantity.
          endif.
          if ( it_mseg-bwart eq '201' or it_mseg-bwart eq '202').
            move it_mseg-menge to ls_quantity.
            sum_201 = sum_201 + ls_quantity.
          endif.
        if ( it_mseg-bwart eq '551' or it_mseg-bwart eq '552').
            move it_mseg-menge to ls_quantity.
            sum_551 = sum_551 + ls_quantity.
          endif.
        if ( it_mseg-bwart eq '331' or it_mseg-bwart eq '332'
              or it_mseg-bwart eq '333' or it_mseg-bwart eq '334'
              or it_mseg-bwart eq '335' or it_mseg-bwart eq '336').
            move it_mseg-menge to ls_quantity.
            sum_331 = sum_331 + ls_quantity.
          endif.
        if ( it_mseg-bwart eq '161' or it_mseg-bwart eq '162'
              or it_mseg-bwart eq '123' or it_mseg-bwart eq '122').
            move it_mseg-menge to ls_quantity.
            sum_161 = sum_161 + ls_quantity.
          endif.
        if ( it_mseg-bwart eq '641' or it_mseg-bwart eq '642'
              or it_mseg-bwart eq '643' or it_mseg-bwart eq '644'
              or it_mseg-bwart eq '351' or it_mseg-bwart eq '352'
              or it_mseg-bwart eq '301' or it_mseg-bwart eq '302'
              or it_mseg-bwart eq '303' or it_mseg-bwart eq '304').
            move it_mseg-menge to ls_quantity.
            sum_641 = sum_641 + ls_quantity.
          endif.
      if ( it_mseg-bwart eq '305' or it_mseg-bwart eq '306').
            move it_mseg-menge to ls_quantity.
            sum_305 = sum_305 + ls_quantity.
          endif.
      if ( it_mseg-bwart eq '309' or it_mseg-bwart eq '310'
         or it_mseg-bwart eq '909' or it_mseg-bwart eq '910').
            move it_mseg-menge to ls_quantity.
            sum_309 = sum_309 + ls_quantity.
          endif.
    if ( it_mseg-bwart eq '701').
            move it_mseg-menge to ls_quantity.
            sum_701 = sum_701 + ls_quantity.
          endif.
    if ( it_mseg-bwart eq '702').
            move it_mseg-menge to ls_quantity.
            sum_702 = sum_702 + ls_quantity.
          endif.
          at end of budat.
        it_head-closing_bal = ( it_head-openbal + sum_receipt ) - sum_issue.
            w_opbal = it_head-closing_bal.
            move it_mseg-matnr to it_head-matnr.
            move it_mseg-budat to it_head-p_date.
            move it_mseg-bwart to it_head-bwart.
            move sum_po  to it_head-R_po.
            move sum_101  to it_head-R_ProdOrd.
            move sum_531 to it_head-R_ByProd.
            move sum_511  to it_head-R_OTHERS.
            move sum_receipt to it_head-r_total.
            move sum_261  to it_head-I_Prod.
            move sum_601  to it_head-I_cust.
            move sum_201  to it_head-I_CostCen.
            move sum_551  to it_head-I_Scrapping.
            move sum_541 to it_head-I_subcontractor.
            move sum_331  to it_head-I_Sampling.
            move sum_issue   to it_head-i_total.
            move sum_161  to it_head-PurRet.
            move sum_641  to it_head-stock_out.
            move sum_305  to it_head-stock_in.
            move sum_309  to it_head-M_to_M_transit.
            move sum_701  to it_head-phy_loss.
            move sum_702  to it_head-phy_gain.
            append it_head.
            w_chk = 0.
            sum_issue = 0.
            sum_receipt = 0.
            sum_531 = 0.
            sum_541 = 0.
            sum_101 = 0.
            SUM_511 = 0.
            sum_261 = 0.
            sum_601 = 0.
            sum_201 = 0.
            sum_po = 0.
            sum_551 = 0.
            sum_641 = 0.
            sum_701 = 0.
            sum_702 = 0.
          endat.
          clear it_head.
          clear it_mseg.
        endif.
    endloop.
      sort it_mseg by matnr budat bwart.
      sort it_head by matnr p_date bwart.
      delete ADJACENT duplicates from it_head.
    endform.                    " f004_determine_mat_docs
    *&      Form  f005_receipts_issues
    *       Desc
    form f005_receipts_issues  using    p_it_mseg  like it_mseg[]
                               changing p_it_issue like it_issue[]
                                        p_it_receipt like it_receipt[]
                                        p_it_matnr like it_matnr[].
      data : lwa_mseg like line of p_it_mseg[],
             lwa_issue like line of p_it_issue[],
             lwa_receipt like line of p_it_receipt[],
             lwa_matnr like line of p_it_matnr[],
             ls_quantity   type mseg-menge,
             wa_head type ty_head,
             lwa_stockclose like line of it_stockclose[].
    *  sort it_head by bwart p_date matnr.
    *  loop at it_head into wa_head.
    *    read table p_it_mseg into lwa_mseg with key bwart = wa_head-bwart.
    *    if sy-subrc = 0.
    *      if ( lwa_mseg-bwart eq '101'
    *          or   lwa_mseg-bwart eq '102'
    *          or   lwa_mseg-bwart eq '103'
    *          or   lwa_mseg-bwart eq '104'
    *          or   lwa_mseg-bwart eq '105'
    *          or  lwa_mseg-bwart eq '106') and lwa_mseg-shkzg = 'S'.
    *        loop at p_it_mseg into lwa_mseg where matnr = wa_head-matnr
    *                                        and   budat = wa_head-p_date
    *                                        and   bwart = wa_head-bwart.
    *          move lwa_mseg-menge to ls_quantity.
    *          wa_head-R_PO = ls_quantity + wa_head-R_PO.
    *          modify it_head from wa_head.
    *        endloop.
    *        clear ls_quantity .
    *      endif.
    *      if ( lwa_mseg-bwart eq '641'
    *       and lwa_mseg-shkzg = 'S' ).
    *        loop at p_it_mseg into lwa_mseg where matnr = wa_head-matnr
    *                                        and   budat = wa_head-p_date
    *                                        and   bwart = wa_head-bwart.
    *          IF SY-SUBRC = 0 .
    *            move lwa_mseg-menge to ls_quantity.
    *            wa_head-stock_out = ls_quantity + wa_head-stock_out.
    *            modify it_head from wa_head.
    *          ENDIF.
    *        endloop.
    *        clear ls_quantity .
    *      endif.
    *      read table it_stockclose into lwa_stockclose
    *         with key matnr = wa_head-matnr.
    *                  "budat = wa_head-p_date.
    *      if sy-subrc = 0.
    *        wa_head-openbal = lwa_stockclose-labst.
    *        modify it_head from wa_head.
    *      ENDIF.
    *    endif.
    *  endloop.
    *  sort it_head by bwart p_date matnr.
    *  loop at it_head into wa_head.
    *    read table it_mseg into lwa_mseg with key bwart = wa_head-bwart.
    *    if sy-subrc = 0.
    *      if ( lwa_mseg-bwart eq '101'
    *          or   lwa_mseg-bwart eq '102'
    *          or   lwa_mseg-bwart eq '103'
    *          or   lwa_mseg-bwart eq '104'
    *          or   lwa_mseg-bwart eq '105'
    *          or  lwa_mseg-bwart eq '106') and lwa_mseg-shkzg = 'S'.
    *        loop at it_mseg into lwa_mseg where matnr = wa_head-matnr
    *                                        and   budat = wa_head-p_date
    *                                        and   bwart = wa_head-bwart.
    *          move lwa_mseg-menge to ls_quantity.
    *          wa_head-R_PO = ls_quantity + wa_head-R_PO.
    *          modify it_head from wa_head.
    *        endloop.
    *        clear ls_quantity .
    *      endif.
    *      if ( lwa_mseg-bwart eq '641'
    *       and lwa_mseg-shkzg = 'S' ).
    *        loop at it_mseg into lwa_mseg where matnr = wa_head-matnr
    *                                        and   budat = wa_head-p_date
    *                                        and   bwart = wa_head-bwart.
    *          IF SY-SUBRC = 0 .
    *            move lwa_mseg-menge to ls_quantity.
    *            wa_head-stock_out = ls_quantity + wa_head-stock_out.
    *            modify it_head from wa_head.
    *          ENDIF.
    *        endloop.
    *        clear ls_quantity .
    *      endif.
    *      read table it_stockclose into lwa_stockclose
    *         with key matnr = wa_head-matnr.
    *                  "budat = wa_head-p_date.
    *      if sy-subrc = 0.
    *        wa_head-openbal = lwa_stockclose-labst.
    *        modify it_head from wa_head.
    *      ENDIF.
    *    endif.
    *  endloop.
    endform.                    " f005_receipts_issues
    *&      Form  COMMENT_BUILD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM comment_build USING p_it_st_list_top_of_page TYPE slis_t_listheader
      DATA: ls_line TYPE slis_listheader.
      REFRESH p_it_st_list_top_of_page.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info  = 'Details of Stock Ledger'.
      APPEND ls_line TO p_it_st_list_top_of_page.
    ENDFORM.                    " COMMENT_BUILD
    *&      Form  TOP_OF_PAGE-ALV
    *       text
    FORM top_of_page-alv.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_st_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE-ALV
    *&      Form  FIELDCAT
    *      -->P_IT_ST_FIELDCAT[]  text
    FORM fieldcat  USING p_it_st_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname  = 'P_DATE'.
      ls_fieldcat-datatype   = 'P_DATE'.
      ls_fieldcat-outputlen  = 18.
      ls_fieldcat-seltext_m  = text-002 .
    *  ls_fieldcat-rollname   = 'MATNR'.
      ls_fieldcat-key         = 'X'.
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'MATNR'.
      ls_fieldcat-rollname    = 'MATNR'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-outputlen  = 18.
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'MAKTX'.
      ls_fieldcat-rollname    = 'MAKTX'.
      ls_fieldcat-ddictxt     = 'L'.
        ls_fieldcat-outputlen  = 40.
      APPEND ls_fieldcat TO p_it_st_fieldcat.
    *  CLEAR ls_fieldcat.
    *  ls_fieldcat-fieldname   = 'BWART'.
    *  ls_fieldcat-rollname    = 'BWART'.
    *  ls_fieldcat-ddictxt     = 'L'.
    *  APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'OPENBAL'.
      ls_fieldcat-rollname    = 'OPENBAL'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-003 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'R_PO'.
      ls_fieldcat-rollname    = 'R_PO'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-004 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'R_PRODORD'.
      ls_fieldcat-rollname    = 'R_PRODORD'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-005 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'R_BYPROD'.
      ls_fieldcat-rollname    = 'R_BYPROD'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-006 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'R_OTHERS'.
      ls_fieldcat-rollname    = 'R_OTHERS'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-007 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'R_TOTAL'.
      ls_fieldcat-rollname    = 'R_TOTAL'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-008 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_PROD'.
      ls_fieldcat-rollname    = 'I_PROD'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-009 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_CUST'.
      ls_fieldcat-rollname    = 'I_CUST'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-010 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_COSTCEN'.
      ls_fieldcat-rollname    = 'I_COSTCEN'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-011 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_SCRAPPING'.
      ls_fieldcat-rollname    = 'I_SCRAPPING'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-012 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_SUBCONTRACTOR'.
      ls_fieldcat-rollname    = 'I_SUBCONTRACTOR'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-013 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_SAMPLING'.
      ls_fieldcat-rollname    = 'I_SAMPLING'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-014 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'I_TOTAL'.
      ls_fieldcat-rollname    = 'I_TOTAL'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-015 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'PURRET'.
      ls_fieldcat-rollname    = 'PURRET'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-016 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'STOCK_OUT'.
      ls_fieldcat-rollname    = 'STOCK_OUT'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-017 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'STOCK_IN'.
      ls_fieldcat-rollname    = 'STOCK_IN'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-018 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'STOCK_TRANSIT'.
      ls_fieldcat-rollname    = 'STOCK_TRANSIT'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-019 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'M_TO_M_TRANSIT'.
      ls_fieldcat-rollname    = 'M_TO_M_TRANSIT'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-020 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'PHY_LOSS'.
      ls_fieldcat-rollname    = 'PHY_LOSS'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-021 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'PHY_GAIN'.
      ls_fieldcat-rollname    = 'PHY_GAIN'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-022 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'CLOSING_BAL'.
      ls_fieldcat-rollname    = 'CLOSING_BAL'.
      ls_fieldcat-ddictxt     = 'L'.
      ls_fieldcat-seltext_m  = text-023 .
      APPEND ls_fieldcat TO p_it_st_fieldcat.
    ENDFORM.                    " FIELDCAT
    *&      Form  LAYOUT_BUILD
    *       text
    *      -->P_ST_LAYOUT  text
    FORM layout_build  USING    p_st_layout TYPE slis_layout_alv.
      p_st_layout-box_fieldname       = 'SELK'.  " Checkbox
      p_st_layout-get_selinfos        = 'X'.
      p_st_layout-f2code              =  'PICK' .  " Doppelklickfunktion
      p_st_layout-confirmation_prompt = 'X'.       "Sicherheitsabfrage
      p_st_layout-key_hotspot         = 'X'.       "Schlüssel als Hotspot
      p_st_layout-info_fieldname      = 'COL'.     "Zeilenfarbe
    ENDFORM.                    " LAYOUT_BUILD
    *&      Form  REUSE_ALV_LIST_DISPLAY
    *       text
    FORM reuse_alv_list_display .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                 i_background_id          = 'ALV_BACKGROUND'
                 i_callback_program       = s_repid
    *            I_CALLBACK_PF_STATUS_SET = S_STATUS
    *            I_CALLBACK_USER_COMMAND     = S_USER_COMMAND
    *            I_STRUCTURE_NAME         = ''
    *            IS_LAYOUT                = ST_LAYOUT
                 it_fieldcat              = it_st_fieldcat[]
    *            IT_EXCLUDING             =
    *            IT_SPECIAL_GROUPS        = ST_SP_GROUP
    *            IT_SORT                  =
    *            IT_FILTER                =
    *            IS_SEL_HIDE              =
    *            I_DEFAULT                = 'X'
    *            I_SAVE                   = S_SAVE
    *            IS_VARIANT               = S_VARIANT
                IT_EVENTS                = IT_ST_EVENTS[]
    *            IT_EVENT_EXIT            =
    *            IS_PRINT                 =
    *            IS_REPREP_ID             =
    *            I_SCREEN_START_COLUMN    = 0
    *            I_SCREEN_START_LINE      = 0
    *            I_SCREEN_END_COLUMN      = 0
    *            I_SCREEN_END_LINE        = 0
    *     IMPORTING
    *           E_EXIT_CAUSED_BY_CALLER   =
    *           ES_EXIT_CAUSED_BY_USER    =
           TABLES
                t_outtab                  =  it_head.
    ENDFORM.                    " REUSE_ALV_LIST_DISPLAY
    *&      Form  EVENTTAB_BUILD
    *       text
    *      -->P_IT_ST_EVENTS[]  text
    FORM eventtab_build  USING    p_st_events  TYPE slis_t_event .
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_st_events.
      READ TABLE p_st_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE st_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO p_st_events.
      ENDIF.
      READ TABLE p_st_events WITH KEY name = slis_ev_user_command
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE s_user_command TO ls_event-form.
        APPEND ls_event TO p_st_events.
      ENDIF.
    *  READ TABLE p_st_events WITH KEY name = slis_ev_pf_status_set
    *                         INTO ls_event.
    *  IF sy-subrc = 0.
    *    MOVE s_status TO ls_event-form.
    *    APPEND ls_event TO p_st_events.
    *  ENDIF.
    ENDFORM.                    " EVENTTAB_BUILD
    *&      Form  VARIANT_INIT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM variant_init .
      CLEAR s_variant.
      s_variant-report = s_repid.
      s_variant-handle = code.
    ENDFORM.                    " VARIANT_INIT

  • POSITION OF IMAGE IN TEMPLATE OPTIONAL REGION

    Hi,
    I am new to Dreamweaver and have designed a template with a
    table on my page. Each of 4 template areas are either editable or
    optional regions. In one optional region I have an image. I have
    defined the table to be aligned to the top of the table cell, but
    when the template is applied to the other pages, the image is in
    the middle vertically. I also have it set to be centered
    horizintally, but it stays to the left.
    What am I doing wrong?
    Any help would be appreciated.

    Post a link to the page, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "tlctara" <[email protected]> wrote in
    message
    news:fvsme0$l0d$[email protected]..
    >
    > Hi,
    > I am new to Dreamweaver and have designed a template
    with a table on my
    > page.
    > Each of 4 template areas are either editable or optional
    regions. In one
    > optional region I have an image. I have defined the
    table to be aligned
    > to the
    > top of the table cell, but when the template is applied
    to the other
    > pages, the
    > image is in the middle vertically. I also have it set to
    be centered
    > horizintally, but it stays to the left.
    > What am I doing wrong?
    > Any help would be appreciated.
    >
    >

  • Creating DW templates - Repeating Optional Region?

    Hello Again:
    I know that it isn't always the best to pose abstract questions on forums, but I am wondering if anyone can tell if/how one can create an optional region within a repeating region of a DW template?
    The specific conundrum I seem to face that if a region has two divs within it (one with and one without a textbox surrounding it, for example) and if the user of the template chooses to repeat the section, how can they delete the second div within the repeated region (deleting through the modify tempate option) without deleting all the previous instances of the div as well.
    If there is a way to do this, I would appreciate some guidance.
    Thanks in advance.
    Steve Webster.

    Yes, and first my apologies, as I could have provided the example first of all.  If you go to  http://socls.org/testing/immigration-refugee_law.html I can perhaps explain my objective better.  On that page you see a series of text boxes one with a gradient background and a second with a only a outline in red.   For the moment ignore the text boxes that are rendered side by side and assume that the 1st two horizontal text boxes are all that I want to repeat throughout the page.
    I want to place the two of those full width text boxes within a repeating region (or turn them into a repeating region).  However if the webmaster needs to add content but doesn't need a pair of text boxes, or otherwise gets to the end of her content sections and doesn't need a final red outlined box, then I would want that the last red outlined box to be optional, without however deleting previous instances.  Sometimes content can't be organized so neatly as to finish with an even number of "content sets".
    I think the bigger problem is, as I understand it, that you can't create two "divs" (in this case text boxes) and have each repeating independently, and allow each to be moved up and down as though they were passing through another text box/div that also constitutes a repeating region.  The only way to have the pattern to repeat is to "pair" them as a single unit (Or perhaps I have misunderstood how the repeating action works ?!?)  I have tried treating them as independent repeating regions and it doesn't seem to work in the manner I would like.  If you tie them together in this way, then the only way to end with an uneven number of text boxes is to make one optional.  But it seems that if you make the second in the pair optional, then by "turning it off", you end up turning all off.
    At least that is how it seems to work.
    You may be right that the design is too complicated to work as a template in this fashion.
    Or, perhaps I am fundamentally mistaken on the architecture of the repeat concept.
    Thanks again for your patience and persistence
    Steve.

  • "agesani Initialize With Options" timeout error on HP E4401B spectrum analyzer

    System: Windows XP Pro, LabVIEW 7.1, IVI Compliance Package 3.0, NI-VISA 4.1
    I have an HP E4401B Spectrum Analyzer.  I'm trying to write some LabVIEW code for it, using the agesani.llb library.
    When I try using the agesani Initialize With Options VI, I get the following error:
    Error code: BFFF0015
    Source: agesani Initialize WIth Options.vi<ERR>Driver Status: (Hex 0xBFFF0015) Primary Error: (Hex 0xBFFF0015) Timeout expired before operation completed.
    I've searched the NI Knowlege Base, and haven't found anything that seems useful.  What I _have_ found are the following items.
    Knowlege Base article "Time-Out Error with the Agesa Instrument Driver Example".  This refers to the agesa drivers, not the agesani drivers.  It also references an E4440A spectrum analyzer, not an E4401B.  The article says one cause could be that a compatibility mode other that SCPI is in use.  While the articles says how to fix this on an E4440A, the fix does not appear to apply to the E4401B.  In fact, if it is even _possible_ to have a mode other than SCPI on an E4401B, I can't figure out how to do it.  A second possibility the article suggests is that the spectrum analyzer is in Phase Noise mode rather than Spectrum Analyzer mode.  My E4401B is in SA (spectrum analyzer) mode.  I don't even see a way to put it in any other mode - I don't think the required options are installed.  Finally, my VI is configured as the article states - ID Query YES, Reset Device YES, etc.  I should note that the instrument's GPIB address is 18, and that this matches the resource name GPIO0::18::INSTR.
    Some additional information: The spectrum analyzer's screen is indicating the instrument is in Remote (R) mode as a Talker (T).  A "Query UNTERMINATED" error message appears at the bottom of the instrument screen.
    I've attached the results of a NI Spy capture to this message. (At least, I think I have. I've never tried doing this before, so if it doesn't show up, would some kind soul tell me how to include an attachment to my post?)
    Oh, yes.  The agesani version is driver version 1.1, updated 17 Aug 2007.  (The version that's currently on the NI download site.)
    Attachments:
    Capture4.spy ‏9 KB

    Hi MXI Master,
    If there's an instrument timeout, I haven't been able to find it yet.  Seems like there should be, so maybe I just haven't looked in the right place yet.  As for the timeout value on the computer, I'm not sure what you mean by this - could you elaborate, and maybe tell me where to find it?
    As far as SCPI mode, if it's possible to put the E4401B in something _other_ than SCPI mode, I haven't figured out how.  I can't find any support in the programming manual for anything other than SCPI.
    That kind of seques into my next couple points.  The NI Spy output indicates that one of the commands that is being sent is "*SRE 32".
    The "User's & Programmer's Reference" for the E4401B says (on page 206) "Send the *SRE <number> command (where <number> is the sum of the decimal values of the bits you want to enable plus the decimal value of bit 6).  [Bit 6 is the Request Service (RQS) Summary Bit.  BP]  For example, assume that you want to enable bit 7 so that whenever the operation status summary bit is set to 1, it will trigger a service request.  Send the *SRE 192 (128 + 64) command."
    This statement would seem to imply that the "*SRE 32" command that is being sent by the agesani "Initialize With Options" command is an illegal command, or at best an ineffective command.  In light of that, it is interesting to me that the NI Spy output indicates that the next line , viQuery(GPIB::18::INSTR (0x246E9C8), "%s?","%ld"), is generating an 0xBFFF0015 error.  In addition, I can find neither the "%s?" nor the "%ld" commands listed in the Programmer's Reference.  I wonder if these could be for a firmware revision later than mine (A.01.03), or for instrument options I don't have (A4H, A4J).  Alternatively, I wonder if these are simply mistakes.
    The next line in the NI Spy output, Formatted viWrite(CPIB0::18::INSTR (0x0246E9C89),"INST:NSEL?",11,11), also puzzles me.  The Programmer's Reference indicates that this is a supported command, to see what instrument application is currently selected.  (e.g. spectrum analyzer, GSM, Bluetooth, EDGE, noise figure, etc.)  However, when I try to issue this command to my instrument, by using the Instrument I/O Assistant Express VI, I get an "Undefined header" error on the instrument's front panel.  The instrument's error history shows the same "Undefined header" error.  Since my instrument only has the basic spectrum analyzer option installed, I wonder if this command is not valid?  (Personally, I wouldn't write instrument firmware code this way, but who knows?)  Alternatively, I wonder if this command requires a firmware revision more recent than mine.  (The Programmer's Reference is silent about this possibility.)
    The next line in the NI Spy output, Formatted viRead(GPIB::18::INSTR (0x0246E9C8),"",4000,0), has another 0XBFFF0015 error associated with it.
    Does this information shed any more light on the situation?

  • Create SAP B1 Query with Optional User Input Fields

    Hi All... any help is greatly appreciated, I am new to this forum and hope to contribute in the near future once I become more of an expert with B1.
    I have a query I need to build that will search about 10 UDF's. The problem is, I don't know how to make the user input fields optional within the query. Currently, I have the following queries as testing searching 2 UDF"s:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] OR T0.[U_LengthFT] =[%1]
    This query works when leaving one of the user input fields blank. However, the values it provides are wrong because it is an OR statement which will show item codes with a certain quality OR a certain size.
    The following query is the same as above but switched the OR to AND:
    SELECT T0.[ItemCode], T0.[ItemName], T0.[OnHand] FROM OITM T0 WHERE T0.[U_Quality] = [%0] AND T0.[U_LengthFT] =[%1]
    This query provides me with the correct values but will not work if one of the user defined fields is not filled out.
    How do I go about getting the results I want and not having the user fill out all the UDF's for the query to execute properly?

    I think I figured it out
    SELECT T0.ItemCode, T0.ItemName, T0.OnHand
    FROM OITM T0
    WHERE (T0.U_Quality = '[%0]' OR '[$0]' = '0') AND (T0.U_LengthFT ='[%1]' OR '[%1]' = '0')
    SAP must be defaulting empty user input field values to "0"
    I tried the above query and it worked!!!
    Is there anything you can add if I am missing something?
    Thanks, Alec.

Maybe you are looking for