Generic UDF to handle empty contexts and contexts with missing fields

Hi,
I have been trying to get my head around a UDF for this for a while, but cannot find the solution. I''l start by showing input structure, and expected target structure (subset of an invoice IDoc with 4 line items):
SOURCE:
E1EDK01 (0..1)
E1EDP01
---POSEX = 1
---E1EDP05
KOTXT (qualifier) = Z1
BETRG (amount) = 200,00
---E1EDP05
KOTXT = Z2
BETRG = 300,00
---E1EDP19...
E1EDP01
---POSEX = 2
---E1EDP05
KOTXT = Z1
---E1EDP05
KOTXT = Z2
BETRG = 400,00
---E1EDP19...
E1EDP01
---POSEX = 3
---E1EDP05
KOTXT = Z2
BETRG = 500,00
---E1EDP19...
E1EDP01
---POSEX = 4
---E1EDP19...
TARGET:
Line
---PosId = 1
---Price = 200.00
Line
---PosId = 2
---Price = N/A
Line
---PosId = 3
---Price = N/A
Line
---PosId = 4
---Price = N/A
I want the price from E1EDP05/BETRG where KOTXT = Z1to be set for each line. As you can see the source structure can be split in 4 cases:
1. for some line items there exist multiple E1EDP05-segments with one of them qualifier Z1 and one corresponding amount field. This is the "perfect" structure and easy to handle.
2. some line items contains E1EDP05 with qualifier Z1 with no BETRG. Problem-case
3. some line items contains no E1EDP05-segments with qualifier Z1, but contains other E1EDP05-segments. Can be solved.
4. some line items contains no E1EDP05-segments at all. Can be solved.
I need to (I believe) set the context of the KOTXT and BETRG to E1EDP01 since I want one value per line item, irrespective of how many E1EDP05-segments exist per line item. In cases where no value can be found for relevant qualifier (Z1) or no E1EDP05-segments exist for a line item I want a default value to be set (N/A).
My problem is that all these different cases might occur in the same file, and they mess up the values in each context, leading to wrong BETRG to be picked in some cases (where case 2 exist) since mapWithDefault cannot be used (context contains value for other qualifier).
Do you know how to handle all these cases?
Any pseudo-code for an UDF?
Many thanks for your help!
Br,
Kenneth

Hi Shweta!
Thanks a lot, your idea didn't completely solve my problem, but pointed me in the right direction and gave me some valuable ideas:)
For anyone wondering how it is done, I solved it by using your suggested two inputs, along with a third input (constant) which functions as default value for contexts where value-field is missing for a specific qualifier, or in case no segments with desired qualifier exists for a context.
My mapping now looks like the following (where KOTXT is qualifier and KRATE is value field) for the 3 inputs:
KOTXT(Context = E1EDP01) \
                            equalsS -->
Constant(qualifier value) /
KOTXT(Context = E1EDP05) \
                            equalsS  \
Constant(qualifier value) /            ifWithoutElse --> removeContexts -->
           KRATE (Context = E1EDP05) /
Constant(default value) -->
Then these 3 inputs goes into the following UDF (queue function):
int j=0;
boolean contextDone = false;
for(int i=0;i<a.length;i++)
     if(a<i>.equals("true"))
          if(b[j].equals(ResultList.SUPPRESS))
               result.addValue(c[0]);
          else
               result.addValue(b[j]);
          contextDone = true;
          j=j+1;
     if(a<i>.equals(ResultList.CC))
          if (contextDone)
               contextDone = false;
               result.addValue(ResultList.CC);
          else
               result.addValue(c[0]);
               result.addValue(ResultList.CC);
This results in a target node created for each context, where context relates to each line item in this case, where each value is either a default value or the value corresponding to the qualifier. This works in all cases where:
1. there are no segments containing relevant qualifier
2. there are segments with relevant qualifier, but missing value field
3. there are segments with relevant qualifier and value field
Thanks a lot again, Shweta, for guiding me!
Br,
Kenneth

Similar Messages

  • Connection MESG and INOB with additional field

    Hi friends,
    i'm beginner in ABAP and for this reason i create reports in ABAP query.
    So i create query between tables MSEG and INOB (then INOB with AUSP).
    In INOB-OBJEK - value is matnr and charg,
    but value in this field is: for example 
    matnr                    charg
    EK759064BK (8 free spaces) 0000000066
    EK759064BK (8 free spaces) 0000000067
    EK759064BK (8 free spaces)  0000000068
    EK759064BK (8 free spaces)  0000000069
    EK759064BK (8 free spaces) 0000000070
    My idea is to create additional field with MSEG-MATNR and MSEG-CHARG and relate with INOB-OBJEK
    (concatenate mseg-matnr mseg-charg into refkey.) 
    result is:
    EK759064BK0000000066
    EK759064BK0000000067
    EK759064BK0000000068
    EK759064BK0000000069
    EK759064BK0000000070
    Now my question is how to change code and create additional field like INOB-OBJEK, how to change my code so i have 8 free spaces between MATNR and CHARG?
    Edited by: Marin Lyubomirov on Dec 13, 2009 9:39 AM

    the ABAP keyword CONCATENATE has a parameter RESPECTING BLANKS
    So if you use this this parameter, then you would get the missing 8 spaces, because the material number field is 18 long and your material only 10 long.
    Alternative, just use an own field that is 8 long and do the concatenation like this :
    concatenate mseg-matnr myfield mseg-charg into refkey

  • URxvt - Handle clickable links and irssi with screen over ssh ?

    Hi,
    I use URxvt as a replacement to gnome-terminal. But I can't manage to make three things working :
    - First, I followed the wiki to set clickable links. It worked but since a little time (I don't know really when it stopped working) URxvt only colors the links. When I click on them, it doesn't do anything.
    Here is my .Xresources :
    ! Taille par défaut
    URxvt*geometry: 100x30
    ! Police TTF
    URxvt*font: xft:Bitstream Vera Sans Mono:style=Regular:pixelsize=12:antialias=true
    ! Taille du buffer et barre de défilement
    URxvt*saveLines: 10000
    URxvt*scrollBar: true
    URxvt*scrollBar_right: true
    URxvt*scrollColor: #c2dd5a
    URxvt*scrollBar_floating: true
    URxvt*scrollstyle: plain
    ! Curseur et nom du terminal
    URxvt*cursorColor: white
    URxvt*termName:xterm
    ! Couleurs
    URxvt*foreground: #ffffff
    !URxvt*background: #000000
    ! Black
    URxvt*color0: #101010
    URxvt*color8: #2e3436
    ! Red
    URxvt*color1: #cc0000
    URxvt*color9: #ff361e
    ! Green
    URxvt*color2: #8ae234
    URxvt*color10: #93ff00
    ! Yellow
    URxvt*color3: #ffc005
    URxvt*color11: #ffd00a
    ! Blue
    URxvt*color4: #004f9e
    URxvt*color12: #0071ff
    ! Purple
    URxvt*color5: #e50060
    URxvt*color13: #eb0061
    ! Cyan
    URxvt*color6: #4bb8fd
    URxvt*color14: #34E2E2
    ! White
    URxvt*color7: #eeeeec
    URxvt*color15: #f2f2f2
    ! Utilisation de la vraie transparence
    URxvt*depth: 32
    URxvt*background: rgba:0000/0000/0000/cccc
    ! Onglets
    URxvt*.perl-ext: tabbed
    URxvt.tabbed.tabbar-fg: 2
    URxvt.tabbed.tabbar-bg: 0
    URxvt.tabbed.tab-fg: 3
    URxvt.tabbed.tab-bg: 0
    ! Liens
    URxvt.perl-ext-common: default,matcher,fullscreen
    URxvt.urlLauncher: /usr/bin/firefox
    URxvt.matcher.button: 1
    URxvt.colorUL: #4682B4
    ! Fullscreen
    URxvt*keysym.F11: perl:fullscreen:switch
    ! touches home et end
    URxvt*keysym.Home: \033[1~
    URxvt*keysym.End: \033[4~
    - I'd like to automatically launch an urxvt term at startup and connect to an irssi screen session on a remote server (via ssh).
    I tried : urxvt -e "ssh user@remote -t irc" where irc is an alias on the remote server that attach the irssi screen session. The problem is that with this command, urxvt opens and close immediately. I then tried to add the -hold option and various combination of "bash -c" I saw on the forum but nothing worked...
    - And finally, how can I use nautilus-open-terminal to open a urxvt term in a specific folder ? I set the correct entries in dconf-editor and followed the wiki page but it doesn't work...
    Thanks
    Last edited by doupod (2013-04-06 16:42:18)

    I had similar but different issues regarding this.  Now, i have 256 color support in whatever terminal/ssh/screen session I'm in.
    The relevant config lines:
    .Xdefaults:
    XTerm*termName: xterm-256color
    URxvt*termName: rxvt-256color
    .vimrc
    " 256 colors only if you can handle it
    if $TERM =~ "-256color"
    set t_Co=256
    colorscheme zenburn
    endif
    .screenrc
    # term
    term xterm-256color
    # main options
    altscreen on
    attrcolor b ".I"
    defbce "on"
    # some termcaps
    termcapinfo xterm-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
    termcapinfo rxvt-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
    note: this setup caused an issue where background colors in mutt/htop inside screen did not extend passed the line's text.  i had to solve that via this workaround.
    Last edited by brisbin33 (2009-07-31 21:28:55)

  • There is a difference between how PE8 handles the panel and bin with Windows 7 and Vista.

    In Vista, the panel bin closes wehen unchecked in the Wndows menu.  The same procedure in Windows 7 collapses the panel.  Or am I wrong?

    10G의 경우엔 제가 보니 SELECT List에 dept테이블에 대한 테이블을 엑세스할 컬럼이 없으니 당연히
    한쪽 테이블만 엑세스하고 끝났네요.
    dept테이블의 deptno컬럼이 있으나 테이블을 엑세스할필요는 없고요.
    밑에것은 당연히 해쉬조인으로 풀리는것이 맞군요.
    제가 잘못보았읍니다.

  • ReadObject and problems with Vector field

    hello.
    i'm trying to send an object(data Packet for a chat application) and receive it via sockets.
    every thing is right but there is a Vector field(online users list)that has some problems.
    my clients receive every updated class that contains new user list.but they just see the first received list?
    it's so strange to me because every thing else (such as color,font,size,..) works fine.
    can you help me?

    Every time you resend an object you have already sent, ObjectOutputStream will just send a 'handle', not the actual object. If it's changed value this is a problem. Use ObjectOutputStream.reset() to cause it to forget everything previously sent.

  • Weblogic and cmp with blob fields

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

    I have an entity bean with cmp. This bean has a blob field. When ejbCreate and
    ejbPostCreate methods are executed in this bean, exception saying "row containing
    the LOB value is not locked" is thrown.
    The transaction attribute for the method is set to RequiresNew in the deployment
    descriptor.
    Can someone suggest what may be going wrong here.
    Thanks

  • Add GoodsIssue  and StockTransfers with specific field

    I have a little problem to add a documents via DI like:
    1. GoodsIssue with field in database called IGE1.OcrCode
    My code in C#
    private void add_GoodIssue()
                SAPbobsCOM.Documents vRw;
                vRw = (SAPbobsCOM.Documents)vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);
                vRw.DocObjectCodeEx = "60";
                vRw.Lines. ?? (OcrCode)
    2. StockTransfers with field in database called OWTR.Filler
    My code in C#
    private void add_StockTransfers()
                SAPbobsCOM.Documents vMM;
                vMM = (SAPbobsCOM.Documents)vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);
                vMM.DocObjectCodeEx = "67";
                vMM. ?? (Filler)
    I use SAP BO 2007A (8.00.235) PL11 HotFix1
    I try check it at SAP BO 2007A (8.00.242) PL15
    It is possible to add it via DI?
    Edited by: kkostek on Jun 28, 2011 9:31 AM

    Hello,
    I see you would like to issue draft docuemnts. Arentyou?
    use CostingCode to enter OcrCode this supports the distribution rules (profit centers).
    private void add_GoodIssue()
    SAPbobsCOM.Documents vRw;
    vRw = (SAPbobsCOM.Documents)vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);
    vRw.DocObjectCodeEx = "60";
    vRw.Lines.CostingCode  = "profitcenter"
    Draft stock transfers can be issued as stocktransferdraft document
    use oStockTransferDraft instead of oDrafts
    private void add_StockTransfers()
    SAPbobsCOM.StockTransfer  vMM;
    vMM = (SAPbobsCOM.Documents)vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransferDraft);
    vMM. FromWarehouse = "filler"
    Regards
    János

  • Please explain Context and Occurrences

    Hello Experts in XI,
    Just i started learning XI but i am getting confussion in this Area  Context part  and Occurrences concept       with clear examples and clear explanation.
    Thank u,
    santhosh

    Hi Santosh,
    Please go through these links which clearly explains context and context changes in mapping.....
    http://help.sap.com/saphelp_nw04/helpdata/en/35/fb8c4057d5701de10000000a1550b0/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    Regards,
    Madhu

  • Generic datasource based on custom table and hierarchy table

    Hi Gurus,
    I have a doubt regarding generic datasource.
    my requirement: to create a datasource with 10 fields. (7 fields from custom table and 3 fields whose values can be derived from a hierarchy table).
    I have a custom table. In this table one field refers to a hierarchy table. Using this hierarchy table, we can derive values to 3 new fields.
    My question is, If i create a generic datasource based on the custom table, how can i include the extra 3 fields which gets values from the hierarchy table.
    Where can i write the logic to extract the values for those 3 fields from the hierarchy table.
    Thanks
    Regards,
    Aarthi
    [email protected]

    Hi Aarthi,
    Sample code in the user exit woul be like this:
    DATA:  i_biw_tab LIKE BIW_MARA_S.
    WHEN '<data source>'.
        LOOP AT i_t_data INTO i_biw_tab.
          SELECT fields
            INTO <table from which you want the value
            FROM <table>
           WHERE <your condition>.
          IF sy-subrc = 0.
                 MODIFY i_t_data FROM i_biw_tab.
          ENDIF.
        ENDLOOP.
    Bye
    Dinesh

  • ALV: Right Button Click and Context Menu

    Hi Experts,
    I have to implement an ALV which should act on a right button click and show a context menu.
    Is this possible? I found only events for "on_double_click" or "on_link_click" and is it possible to show a context menu?
    Thanks in advanced.
    Best regards,
    Markus

    Hello Markus
    The relevant events are:
    CONTEXT_MENU_REQUEST
    USER_COMMAND
    Have a look at my sample report ZUS_SDN_ALV_CONTEXT_MENU_1.
    *& Report  ZUS_SDN_ALV_CONTEXT_MENU_1
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="910750"></a>
    *& Thread: ALV: Right Button Click and Context Menu
    *& Flow logic of screen 100 (no screen elements; ok_code = GD_OKCODE)
    *&    PROCESS BEFORE OUTPUT.
    *&      MODULE STATUS_0100.
    *&    PROCESS AFTER INPUT.
    *&      MODULE USER_COMMAND_0100.
    REPORT  zus_sdn_alv_context_menu_1.
    DATA:
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1,
      gt_knvv          TYPE STANDARD TABLE OF knvv.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender,
          handle_context_menu_request FOR EVENT context_menu_request
                                                     OF cl_gui_alv_grid
            IMPORTING
              e_object
              sender,
          handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1      TYPE knb1.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
    *        IS_ROW_ID    =
    *        IS_COLUMN_ID =
            is_row_no    = es_row_no.
    *   Triggers PAI of the dynpro with the specified ok-code
        CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
      ENDMETHOD.                    "handle_double_click
      METHOD handle_context_menu_request.
    *   define local data
        DATA: lt_fcodes    TYPE ui_funcattr,
              ls_fcode     TYPE uiattentry,
              ls_func      TYPE ui_func,
              lt_func      TYPE ui_functions.
        "   Inactivate all standard functions
        CALL METHOD e_object->get_functions
          IMPORTING
            fcodes = lt_fcodes.
        LOOP AT lt_fcodes INTO ls_fcode.
          ls_func = ls_fcode-fcode.
          APPEND ls_func TO lt_func.
        ENDLOOP.
        e_object->disable_functions( lt_func ).
    "   Add new functions
        e_object->add_separator( ).
        CALL METHOD e_object->add_function
          EXPORTING
            fcode = 'XD03'
            text  = 'Call Transaction'.
        CALL METHOD e_object->add_function
          EXPORTING
            fcode = 'DETAILS'
            text  = 'Display Details'.
      ENDMETHOD.                    "handle_context_menu_request
      METHOD handle_user_command.
    *   define local data
        DATA:
          ls_knb1   TYPE knb1,
          ls_row    TYPE lvc_s_row,
          ls_col    TYPE lvc_s_col.
        "   NOTE: in case of CL_GUI_ALV_GRID the functions of a context menu
        "         are handled in method USER_COMMAND.
        CHECK ( e_ucomm = 'XD03'      OR
                e_ucomm = 'DETAILS' ).
        CALL METHOD sender->get_current_cell
          IMPORTING
            es_row_id = ls_row
            es_col_id = ls_col.
        CASE e_ucomm.
          WHEN 'XD03'.
            READ TABLE gt_knb1 INTO ls_knb1 INDEX ls_row-index.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'DETAILS'.
      "       NOTE: only for the sake of simplicity the event handler method
            "             is called
            CALL METHOD lcl_eventhandler=>handle_double_click
              EXPORTING
                e_row  = ls_row
                sender = go_grid1.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_user_command
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = '1000'.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_cell_top
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click         FOR go_grid1,
        lcl_eventhandler=>handle_context_menu_request FOR go_grid1,
        lcl_eventhandler=>handle_user_command         FOR go_grid1.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_cell_bottom
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Display data
      gs_layout-grid_title = 'Customers'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      gs_layout-grid_title = 'Customers Details (Sales Areas)'.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNVV'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knvv  " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
    *   User has pushed button "Display Details"
        WHEN 'DETAIL'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM entry_show_details .
    * define local data
      DATA:
        ld_row      TYPE i,
        ls_knb1     TYPE knb1.
      CALL METHOD go_grid1->get_current_cell
        IMPORTING
          e_row = ld_row.
      READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
      CHECK ( syst-subrc = 0 ).
      SELECT        * FROM  knvv INTO TABLE gt_knvv
             WHERE  kunnr  = ls_knb1-kunnr.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    Regards
      Uwe

  • Question regarding IWDTree and context Value Node naming

    Hi,
    I have a question regarding the IWDTree / IWDTreeNodeType components.
    I have a context looking like this:
    Context
      + ResponseNode
        + PersonNode (1..1)
          + PersonAddressNode                    (empty node, placeholder)
          | + AdresNode (0..n)
          + PersonChildNode                      (empty node, placeholder)
          | + PersonNode (0..n)
          |   + PersonAddressNode                (empty node, placeholder)
          |     + AddressNode (0..n)
          + PersonParentsNode                    (empty node, placeholder)
            + PersonNode (0..n)
              + PersonAddressNode                (empty node, placeholder)
                + AddressNode (0..n)
    The context represents a person, a person's address, and a person's children and parents with their respective addresses.
    As a result, on different branches, a PersonNode and AddressNode can appear.
    And for some strange reason, all PersonNodes and AddressNodes link to the same ResponseNode.PersonNode.PersonParentsNode.PersonNode and ResponseNode.PersonNode.PersonParentsNode.PersonNode.PersonAddressNode.AddressNode respectively, irregardless of their branch...
    Is it illegal to have multiple PersonNode and AddressNode node names, and should they be named uniquely?

    Generally, node names need to be unique inside the context, attributes in different nodes can have same names. I wonder if the context structure you described will result in code without compile errors.
    The WD Tree can only be used with recursive context nodes or with a hierarchy of non-singleton child nodes.
    Can you give an example how your tree should look like at runtime?

  • User-Defined Function and Context Manipulation

    Hi Mapping Gurus, I need your help.
    I have a user-defined function and one of my input parameter (c) is in a loop (EDI segment).  So one, if I execute my function I get:
    Exception:[java.lang.ArrayIndexOutOfBoundsException: 0]
    If I change the context or use the remove context node function it’s working but it’s always taking the first row in consideration since I'm using c[0] .  Here is the logic:
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[0]"'";
    So since c is an array [], I have tried different logic to get to the right row.
    1- I tried using another parameter (e) to pass a counter or an index to my function.  So each time it's looping, it's passing a new value to the function but I’m still getting the first row and I’m not to sure why?
    int G = Integer.parseInt(e[0]);  // e[] = My counter field
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    2- I tried using a parameter stored in the container:
    String Num;
    Num = (String)getParameter(“counter”);
    if (Num == null)  G = 0;
    else
    G = Integer.parseInt(Num);
    G = G + 1;
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    Num = "" + G;
    setParameter(e[0], Num);
    and I’m still getting the first one, look like it’s using a different container each time it’s looping so the Value is always the same?
    4- I created a new user-defined function with the container logic, then it’s working but I’m back to the same problem in my main function, it’s only looking at e[0] for my counter all the time.
    5- I tried using the Seeburger Java Variables and guess what in the main fonction, as new UDF,... and guess what, same result!
    So anybody out there that was able to get UDF's working into a multiple context scenario?
    Am I missing something?
    I will reward points and beer for any help!

    This is one of the text with passing a counter to the function to try to go to the right row in the array since I'm doing a remove context and I'm getting all the d_234's:
    public void ReadTable(String[] a,String[] b,String[] c,String[] d,String[] e,ResultList result,Container container){
    int G = Integer.parseInt(e[0]); // My counter
    String var;
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    Now this one was with the internal container logic:
    int G;
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String Num;
    Num = (String)getParameter(e[0]);
    if (Num == null)  G = 0;
    else
    G = Integer.parseInt(Num);
    G = G + 1;
    Num = "" + G;
    setParameter(e[0], Num);
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    And now with the Seeburger Variables:
    int G;
    try {
    VariableBean be=VariableFactory.getVariableInstance("");
    G = Integer.parseInt(String.valueOf(be.getStringVariable("yves")));
    } catch (Exception f) {
    throw new RuntimeException(f);
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    try {
    G = G + 1;
    Num = "" + G;
    VariableBean be=VariableFactory.getVariableInstance("");
    be.setStringVariable("yves",Num);
    catch (Exception f) {
    throw new RuntimeException(f);
    All 3 logics were returning always the first row or a counter of 1 if the logic is in the main ReadTable function.

  • Converted WinHelp to HTML Help and context-sensitive topics aren't working.

    Converted WinHelp to HTML Help and context-sensitive topics
    aren't working. Anyone run across this?

    I am a developer and we have big project that needs to be
    converted from winhelp to HTML help. I received only the .CHM help
    file from the help auther. I added the HTMLhelp.lib file and
    HTMLhelp.h file in to my project. I tried to change atleast one
    page of the dialog. I added on helpinfo function htmlhelp function
    call and hard coded the .chm file path and for the right click I as
    well did the same thing. But I am getting "No Help topic is
    associated with this item" upon F1 key and crash after the right
    click with wincore.cpp error.
    The code is as below.
    BOOL CCnvCfgGenNRecPage::OnHelpInfo(HELPINFO* pHelpInfo)
    // TODO: Add your message handler code here and/or call
    default
    if (pHelpInfo->iContextType == HELPINFO_WINDOW)
    int nCtrlId = pHelpInfo->iCtrlId;
    DWORD dwContextId = pHelpInfo->dwContextId;
    //THE NEW HTMLFUNCTION CALL
    ::HtmlHelp((HWND)pHelpInfo->hItemHandle,
    "D:\\vista_setup\\Patmob\\PatMob.chm",
    HH_TP_HELP_WM_HELP,
    (DWORD)&IDARRAY(nCtrlId, dwContextId)) ;
    THE OLD CODE
    ::WinHelp ((HWND)pHelpInfo->hItemHandle,
    AfxGetApp()->m_pszHelpFilePath,
    HELP_WM_HELP,
    // HELP_WM_HELP flag brings up pop-up help and expects an
    array
    // of DWORD pairs of the control ID and the context help ID
    (DWORD)&IDARRAY(nCtrlId, dwContextId));
    return TRUE;
    DO I NEED ANY OTHER FILE? Should I checked out the dialog h
    file and .hm file which compling the html related code?
    Regards,
    Kreena

  • Intial Context and lookup tunning ?

    Doing a inital context and lookup for an EJB for every user in my webapp takes a lot
    of time, is there any tunning that can be done,can i get the Home Handle and put
    it in Application scope and have subsequent users reuse it ?
    Any examples or ideas will be appreciated.
    Thanks
    Joe

    The caveat is you still need to get the initial context per user per request
    (but you can cache the home handle.) The reason is that the WLS security
    context is allocated on a per-thread basis, and since each request can
    be served from different threads, this context needs to be refreshed on
    each request.
    regards,
    -Ade
    "Matt" <[email protected]> wrote in message
    news:3d29a25c$[email protected]..
    >
    Look at the ServiceLocator pattern (Sun J2EE pattern catalog on thewebsite). That
    should give you everything you need for this.
    Matt
    "Joe" <[email protected]> wrote:
    Doing a inital context and lookup for an EJB for every user in my webapp
    takes a lot
    of time, is there any tunning that can be done,can i get the Home Handle
    and put
    it in Application scope and have subsequent users reuse it ?
    Any examples or ideas will be appreciated.
    Thanks
    Joe

  • Value and context and queue diff

    Hi people
              In UDF editor cache, what is the use and diff between value and context queue radio buttons
    Thanks
    Shekar

    Refer
    http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm
    Value - returns string..
    Context/Queue  - returns array of values

Maybe you are looking for

  • Disappointed with Mountain Lion Please Help?

    Ever since i installed OS X Mountain Lion onto my Macbook White (Late 2011) my macbook has been running extremely slow at times my computer freezes and all apps become unresponsive, and i also have an 8GB ram installed, i have also installed the upda

  • HT3917 My apple wireless keyboard is not working after new batteries installed

    My apple wireless keyboard is not working after new batteries installed.

  • TweenMax a  Child symbol

    Hello everybody, this is my last try, then I will return to a brave tweening Designer. I asked a few times ago, but unforunately no solution at the end: I placed a symol on stage with a trigger at the first frame: sym.stop(); var eins = sym.createChi

  • Host Exp command

    Dear Gurus, I am trying to execute a command in PL/SQL as EXECUTE IMMEDIATE EXP PWD1/USER1@TEST FILE=D:\USER1.dmpbut I receive error message as ORA-00900: invalid SQL statement how can I write a function/ procedure to take backup of database *009*

  • 3D movement in AS 2.0

    I'm working on a project and I want to make a page that has 8 mcs in a circle. However, the circle is 3D. Some mcs are close, some are far. When a viewer clicks on an mc, the circle rotates. I've gotten ahold of some code and tried to implement it an