BPS Variable for hierarchy type User-Exit

I try to make this type of variable.
The variable is NCSTOPU, hierarchy is
NHSTOPU like
NHMAIN
-- 4
    -- 401
    -- 402
    -- 403
  -- 5
     -- 501
     -- 502
     -- 503
So The ABAP is
FUNCTION ZCCB_AHR_VAR_HIER.
*"*"Ëîêàëüíûé èíòåðôåéñ:
*"  IMPORTING
*"     REFERENCE(I_TYPE) TYPE  UPC_Y_VAR_TYPE
*"     REFERENCE(I_AREA) TYPE  UPC_Y_AREA
*"     REFERENCE(I_VARIABLE) TYPE  UPC_Y_VARIABLE
*"     REFERENCE(IS_HIE_KEY) TYPE  UPC_YS_HIE_KEY
*"  EXPORTING
*"     REFERENCE(ET_HIE_NODES) TYPE  UPC_YT_HIESEL
DATA ZHIER type upc_ys_hiesel.
*CHANM  UPC_Y_CHANM
*HIENM     UPC_Y_HIENM
*HIEVER     UPC_Y_HIEVER
*DATETO     UPC_Y_DATETO
*NODENAME     UPC_Y_NODENAME
*HIECHA     UPC_Y_CHANM
*DUMMY_LEAF     UPC_Y_DUMMYLEAF
*TO_CHADEP     UPC_YTO_CHADEP
ZHIER-CHANM      = 'NCSTOPU'.
ZHIER-HIENM      = 'NHSTOPU'.
ZHIER-NODENAME   = '5'.
ZHIER-HIEVER     = 'A'.
ZHIER-HIECHA     = '5'.
ZHIER-DUMMY_LEAF = ''.
ZHIER-DATETO     = '99993112'.
INSERT ZHIER INTO TABLE ET_HIE_NODES.
ENDFUNCTION.
But it doesn't work.
The mistake is
Selected node 5 does not exist
The node 5  selected as the start value for characteristic 5 with the specified compound table does not exist in hierarchy NHSTOPU.
What is the problem?

Configuration of the variable:
Variable Type - Hierarchy node,
Characteristic - NCSTOPU,
Hierarchy - NHSTOPU,
Replacement type - user-exit,
FUNCTION MODULE NAME - ZCCB_AHR_VAR_HIER.
In the planning level the characteristic NCSTOPU is set with this variable.
In the Layout  1) the characteristic NCSTOPU - Lead Column,
                     2) Hierarchy in the lead column -  Hierarchical Data Model, BW Hierarchy

Similar Messages

  • BW-BPS Variables of type hierarchy node - user exit

    Hello,
    I created a variable SEM of type hierarchy node and with the replacement type "user exit". So I created a function to fill this variable and I don't find the right type for import and export parameters of my function. I have a dump : CALL_FUNCTION_CONFLICT_TYPE in the method GET_HIE_NODES
    Thank you for your help.
    Catherine Bellec

    Hello,
    For your information :
    the input parameter has the type UPC_YS_HIE_KEY and
    the export parameter the type UPC_YT_HIESEL
    Catherine Bellec

  • SEM-BPS: Variables of type hierarchy node user exit

    Hi,
    I read the "How to.." document "Variables of Type Exit".
    This document has example for variable type caracteristic.
    I need to use this kind of solution for global variables:
    I have the same variables in several planning areas. I have defined one ‘leading’ area containing the variable that should automatically set/adjust the corresponding variables in the other planning areas.
    I've created a SEM variable of type hierarchy node and with the replacement type user exit. There is a standard function module API_SEMBPS_VARIABLE_GETDETAIL which has to provide the selected hierarchy node in leading area to other areas.
    The function works ideally in test mode, but it doesn't work as the SEM user exit.
    Does anyone have experience in this problem?
    Thanks

    Your function module shall follow the expected interface (required for exit type). Function API_SEMBPS_VARIABLE_GETDETAIL is not for such usage.
    To see an example FM that is fit for a 'user exit' processing for hierarchy node, have a look at FM UPF_VARIABLE_USER_EXIT_HIER. There is inline documentation in the source code that shall help you create your own FM if required.
    cheers,

  • Calculating with formula variables of type user exit

    I created the following query:
    Rows: Characteristic = Employee
    Column: KYF = Status
    Filter: Year, Month
    The KYF ist a formula containing a formula variable. This variable of type user exit should return a value recording to the value of employee and has to be read in a customizing (data-) table by the user exit.
    Is it possible to read the values of employee row by row from the internal table which contains the amount of data before processing to output screen and fill the 'Status'-KYF or should I create a virtual keyfigure for this case.
    Thanks for all your feedback,
    Angelika

    Hi,
    It seems like Status is master data of Employee.
    As per your process, if you do either formula variable or virtual keyfigure you will face query performance problem. More over you cant simply access record by record characteristic value in formula variable. It will be another complex process like you have to call the characteristic value via replacement path.
    You have the following choices:
    You mentioned master data is availabe in custom table. Try to pull the custom table master data into employee info object. Maintain  status as one of the attribute of the master data. Then you can display Status value simply in the report. This will be global access like you use this Status value n number of info providers which is having Employee as one of the info object in the info provider.
    If the previous way is not possible, include the Status in the info provider level and write a simple update routine to populate the values. This will be info provider level.
    I am not sure whether you are in development environment or productive. If developement, then you can choose simply any one of the above ways.
    Regards,
    Vivek

  • Variable of type user exit

    Hi all,
    I have a variable of type user exit which is used to let the user enter a characteristic value in a popup-box.
    I am able to display the box and let the user enter a value, but then I'm stuck. Where does this value go?? How can I make sure that this value actually is used in the variable??
    I am attaching my current code cause I feel like something is missing with regards to exporting the correct value.
    Thanks and regards,
    TM
    DATA: i_sval Like sval occurs 0 with Header Line.
    data: v_subrc like sy-subrc.
    i_sval-tabname = 'ZASSET_AREA'.
    i_sval-fieldname = 'AREA'.
    i_sval-fieldtext = 'Asset Area'.
    i_sval-field_obl = 'X'.
    append i_sval.
    CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
    NO_VALUE_CHECK = ' '
    POPUP_TITLE = 'Asset Area'
    START_COLUMN = '5'
    START_ROW = '5'
    IMPORTING
    RETURNCODE = v_subrc
    TABLES
    FIELDS = i_sval
    EXCEPTIONS
    ERROR_IN_FIELDS = 1
    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.

    Hi,
    From the code you have written, I observe that after capturing the value in the pop-up, you are not passing the value back to the variable table.
    What I would suggest is, pass the variable value to the upc_var_cha_act table explicitly. This might resolve the problem.
    Sunil

  • Creation of  Variable for Hierarchy Node

    Greetings...fellow matez,
       I am using Characteristic "0PROFIT_CTR" : PROFIT CENTER
       Here, I created used SAP <b>Standard</b> variable 0N_PCTR (Profit Center/Profit Center Hierarchy)
       This meets my requirement of allowing User to Input the TOP MOST Hierarchy Node basically means my Hierarchy.
       Now, what I need is the ability of a User Input/Key In Variable to ask for a specific Node of my Hierarchy instead of just the <b>'main'</b> hierarchy
      Let me demonstrate with an example :-
      At the moment, I have a variable defined for "0PROFIT_CTR". So, I am able to choose "XXX GROUP" as my hierarchy.
      Now, under this "XXX Group" I have several Sub-Nodes like XXX-Functional Groups ; XXX-Business Units; XXX-Subsidaries.
      How can I create a variable which prompts for this Subnodes of my hierarchy ?

    Matez,
      Issue remains unresolved.
      What I need is a <b>Hierarchy - NODE</b> variable for my "Profit and Loss" Hierarhy
      But, when I use the variable option in the 'Selecting Variable for Hierarchy' scree, I only get to choose my Hierarchy instead of my Hierarchy Node.
      How can I created a variable of type Hierarchy-NODE instead of Hierarchy for my characteristic "0Account"
    Kindly advice matez!

  • Types User-exit

    Hi my Friends
    Plz can Give me exmples type User-exit.
    - What's la difference betwen Use-exit and Baddi ?
    Said
    <THREAD LOCKED. Please stop asking interview questions. There is already a lot of information out there, refer to the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to ask a good question and learn to search>
    Edited by: Mike Pokraka on Oct 14, 2008 3:16 PM

    Hi,
    the user exit ZXPADU01  is for all infotypes , it should work for all infotypes ,
    one more things is this will  triggered only for create and copy operation only,
    means automatically it will be called in PA40 beacuse this is create opration
    and in PA30 it will be worked for create and copy operation only,
    so try to activate this include and respective function and its function group .
    and try to test by including break-point in this code.
    dynamic actions will be used for creating infotypes and respective default values based on other infotype .
    please do the same and let me know so that we can think for other solution.

  • Hi Can body send links & Material For  Bapi, Badi,User-exits

    Hi Abapers,
                       Can body send links & Material For  Bapi, Badi,User-exits, This is my mail id [email protected]
    With Regards
    Bhaskar rao.M

    Hi Bhaskar,
    User Exit
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.planetsap.com/userexit_main_page.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    USER EXITS
    https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=312792
    https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=1320078
    https://forums.sdn.sap.com/click.jspa?searchID=672084&messageID=2669896
    BADI(Business Add-In) is the object oriented method of user exits...
    Each BAdI has a definition and more than one implementation. The definition means the methods(in class concept) that are used for performing various functions. The BAdI definition can be viewed in SE18 transaction(for standard ones) and user-defined BAdIs can be created in the same transaction as well.
    When you create a BAdI definition, an class interface will be automatically created and you can define your methods in the interface. The implementation of the methods can be done in SE19 transaction
    Check these links for info about badi..
    BADI's
    BADI's
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    BADI's
    BADI's
    BADI's
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    http://www.esnips.com/web/BAdI
    http://www.allsaplinks.com/badi.html
    New to Badi
    Intro.....
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    diff betweem badi n customer exits........
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    BAPI
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    List of all BAPIs
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Regards,
    Priyanka.

  • Workflow for record type = User

    Hi All,
    I would like to create an WF for record type = 'User' that will update one 'User' object field based on the value entered in other 'User' object field.
    Simple to do for any record type except 'User' which is not an option in the Workflow Rule New record type LOV, any ideas for an workaround here?
    10x,
    AlexD.

    Hi Alex, unfortunately I have no answer, but I´m looking for something similar. I want to link object fields of the user´s direct manager to the appropriate object fields of the user. I don´t wanna save the values via a workflow, as the value should be dynamic if it changes in the user profile of the manager.
    If this could be combined with a dynamic user layout for the administrator it would enable perfect user management. Does anyone have an idea? Many thanks, Joerg

  • Code help for formula variable with processing type customer exit

    Hi Gurus,
    I need help in user exit code. I am calculating a formula variable ( demand variability) in the user exit for a range of values given in the selection screen ( i.e processing based on the values given I_STEP = 2).
    i am able to populate the E_T_RANGE table  but the output is sending a single value output.
    Expected Output
    Plant ( sel screen Input) I Material ( Sel screen Input) I Demand Var(calculated O/P)
    1800   I  12345 I   0.609
    1700  I   21355 I   1.234                     
    Actual Result
    Plant ( sel screen Input) I Material ( Sel screen Input) I Demand Var(calculated O/P)
    1800   I  12345 I   0.609
    1700  I   21355 I   0.609(WRONG )               
    Here you can see that its sending the same values for all the plant and material combination.
    I found in debugging that it populates 2 values into E_T_RANGE table in loop. But it is giving out only one value to all.
    I tried to refresh and clear that but its giving the same output. Can we use E_T_RANGE in loop to give out range of values?. how to out put this throught user exit?
    did anyone face this kind of issue and solved it?. Help is needed urgently. any help or guidance is greatly appreciated.
    Regards
    satish.

    Hi Oliver,
    Thanks for the reply. Dont get confused here please. It was an example . For example
    I give one plant as input and 2 materials as input .
    You see the sample code :
    WHEN 'ZPRDEMVA'. ( formula variable name)
        IF i_step = 2.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'ZPRPLTSV'. ( plant variable input)
          CLEAR L_S_RANGE.
            v_werks          = LOC_VAR_RANGE-LOW.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'ZPRMATSV'.
          CLEAR L_S_RANGE.
            v_matnr          = LOC_VAR_RANGE-LOW.
    CALCULATES THE FORMULA VARIABLE (DEMAND VARIABILITY)    
    WE TAKE DATA FROM ANOTHER ODS AND DOES CALCULATION.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          l_s_range-low = sum2.
    DOES ALL CALCULATIONS PERFECTLY AND SINCE THERE ARE 2 MATERIALS AS INPUT, PUTS 2 VALUES IN E_T_RANGE. BUT IN THE OUPUT IT DUPLICATES SAME VALUE TO 2 RECORDS AS I POSTED IN THE FIRST
          Append l_s_range to E_T_RANGE.
          ENDLOOP.
          ENDLOOP.
        ENDIF.

  • Create new BPS documents from "COPY DOCUMENTS" user exit.

    Hi Gerd,
    thank you so much for your reply.
    I'm continuing other thread here. (Copy "document icon" to new sheet from "SEM-BPS 1" sheet)
    <b> We've a layout that doesn't use macros. </b>
    We'd like to attach a document for each line that is entered on this layout. All the document attribute characteristics are included in this layout.
    Document contents & technical name can be any thing.
    Should I be able to do this?
    This ensures that users be able to edit documents on other layouts which is crucial.
    I tested this For couple of lines and I was successful.
    Before I'd like to start implementing this, I appreciate your inputs on the prcoess that I follow if this is an effective way of doing?
    Any concerns from the performance side?
    any other hidden issues/concerns that you might be familiar with?
    1) I'm reading all document attribute characteristic values of the layout new lines from the user exit.
    2) I've created one variable for each "document attribute characteristic"
    3) I've created "COPY DOCUMENTS planning function" and included variables in the parameter group
    4) user exit in step 1 fills all variables (fills only 1 value at a time) & passes to "COPY DOCUMENTS parameter group"
    4) due to restriction of only single entry variables usage in
    "COPY plannig funciton", I'm using "API_SEMBPS_FUNCTION_EXECUTE" and executing "COPY DOCUMENTS planning funciton" as many times as number of new lines
    5) if there are 6 new lines, user exit in step 1 loops 6 times & calls "API_SEMBPS_FUNCTION_EXECUTE" 6 times which inturn executes "COPY DOCUMENTS planning funciton" 6 times
    Am I on the right & effective path?
    Is there any better approach?
    Appreciate your inputs

    Hi,
    This is one way you can do that. The bad side of your implementation is that the planning function is called 6 times. It would be better to copy the coding of the planning function and modify it in such a way that you can do all of the steps in one go. If the performance is all right I would still leave it the way it is as then you do not have to change to coding.
    Best regards,
    Gerd

  • Missing English documentation for WPUE0002 enhancemnt user-exits

    Hi all,
    I'd like to change some segment fields data before processing IDoc type WPUWBW, and I thought user-exit  EXIT_SAPLWPUE_141 from WPUE0002 enhancement could help me to do so.
    But, when I search for documentation on this module it doesn't exist in English, only in German. How can I get it in English?
    Or, anyone could tell me how to use it? Any examples?
    Thanks very much in advance,
    Maite.

    Hello Maite,
    just a brief summary of the documentation:
    Function module to check and/or modify IDOCs, before the POS inbound processing
    The original IDOC is transfered in table INPUT_IDOC_SEGMENTS of parameter I_INTERFACE. Only the modified segments have to be exported in table OUTPUT_CHANGED_IDOC_SEGMENTS.
    Log of modifications (if not switched off via parameter O_NO_LOGGING_REQUIRED):
    - EDI log - logs the modified segments (same as for modifications in EDI editor)
    - POS log - logs the modifications for each field
       O_NO_LOGGING_REQUIRED  =
       'P' write only POS log
       'X' write only EDI log
       'A' write minimum EDI log (one record per change transaction, independant from the no. of changes)
    Use parameter O_STOP_IDOC_PROCESSING to stop the IDOC processing. POS-Status 4 "refused by system" is set for the IDOC. For IDOCs with POS status 4, the user can decide, to process the IDOC. In this case, the parameter shouldn't be set again. The import table I_INTERFACE-WPLST contains records with "VERBUCHUNG" (UPDATE?) = '4' for the segments, the user decided to process again.
    When the IDOC has been processed, it cannot be refused completely. If parameter O_STOP_IDOC_PROCESSING is set in this case, the processing will be cancelled and message WP032 is written to the log.
    Messages for the processing logs can be exported in table OUTPUT_ERROR_MESSAGES.
    - Raising exceptions will cause a short dump. You can use MESSAGE ... RAISING to transfer error messages into the protocol.
    - Commit work not allowed
    - All database changes have to be done by update modules.
    Best regards
    Stephan

  • Purchase requisition document type- USER EXIT

    Hi,
    I want to create two separate document type for material and services for PR that is created from PS. What is the user exit I shall use for the purpose or any other way to do.
    Zinni

    Hi
    Check this link for user exit.
    http://sap.niraj.tripod.com/id21.html
    Thanks
    S.Murali
    Edited by: S. Murali on Jul 8, 2009 2:30 PM
    Edited by: S. Murali on Jul 8, 2009 2:30 PM

  • Help me for finding out user-exits in sap

    hi,
    i am subhasis . i want to know how u will know where the user-exits available.
    please replay.

    Hi,
    Go through this program and another way is there go through that also.
    1) Open CMOD(Project maintenance) Transaction. Enter a project name starting with Z. Press enter.
    2) Goto Enhancement window by clicking the enhancement button in the application tool bar.
    3) Write SUSR0001 in the enhancement column and press enter.
    4) Goto Components window (It will show all the exits included in this enhancement), in our case only one Function Exit will be shown.
    5) Double click on the Function exit EXIT_SAPLSUSF_001.  
         The following function source code will be displayed in the function editor
    just run this report u get badi
    REPORT ZNEGI16 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    Hi Crm_learner,
    gothrough this navigation.
    se93->provide for which transaction code u want to impliment the badi->display option->copy the package name.
    next
    se18->press f4 help->information system->provide the package name->enter
    It will display the all the badis.
    provode the badi name->select implimentation option in menubar->create->prvide the implimantation name->enter
    provide the implimantation shrt text->save the badi.
    Go for the interface option->double click onthe method->provide the coding in between method and endmethod. and active the badi.
    program automatically call this badi and execute u code.
    This is the badi.
    DEFINING THE BADI
    1) execute Tcode SE18.
    2) Specify a definition Name : ZBADI_SPFLI
    3) Press create
    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
    multiple use.
    5) Choose the interface tab
    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
    7) Dbl clk on interface name to start class builder . specify a method name (name,
    level, desc).
    Method level desc
    Linese;ection instance methos some desc
    8) place the cursor on the method name desc its parameters to define the interface.
    Parameter type refe field desc
    I_carrid import spfli-carrid some
    I_connid import spefi-connid some
    9) save , check and activate…adapter class proposed by system is
    ZCL_IM_IM_LINESEL is genereated.
    IMPLEMENTATION OF BADI DEFINITION
    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
    2) Specify aname for implementation ZIM_LINESEL
    3) Specify short desc.
    4) Choose interface tab. System proposes a name fo the implementation class.
    ZCL_IM_IMLINESEL which is already generarted.
    5) Specify short desc for method
    6) Dbl clk on method to insert code..(check the code in “AAA”).
    7) Save , check and activate the code.
    Some useful URL
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    Now write a sample program to use this badi method..
    Look for “BBB” sample program.
    “AAA”
    data : wa_flights type sflight,
    it_flights type table of sflight.
    format color col_heading.
    write:/ 'Flight info of:', i_carrid, i_connid.
    format color col_normal.
    select * from sflight
    into corresponding fields of table it_flights
    where carrid = i_carrid
    and connid = i_connid.
    loop at it_flights into wa_flights.
    write:/ wa_flights-fldate,
    wa_flights-planetype,
    wa_flights-price currency wa_flights-currency,
    wa_flights-seatsmax,
    wa_flights-seatsocc.
    endloop.
    “BBB”
    *& Report ZBADI_TEST *
    REPORT ZBADI_TEST .
    tables: spfli.
    data: wa_spfli type spfli,
    it_spfli type table of spfli with key carrid connid.
    *Initialise the object of the interface.
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    selection-screen begin of block b1.
    select-options: s_carr for spfli-carrid.
    selection-screen end of block b1.
    start-of-selection.
    select * from spfli into corresponding fields of table it_spfli
    where carrid in s_carr.
    end-of-selection.
    loop at it_spfli into wa_spfli.
    write:/ wa_spfli-carrid,
    wa_spfli-connid,
    wa_spfli-cityfrom,
    wa_spfli-deptime,
    wa_spfli-arrtime.
    hide: wa_spfli-carrid, wa_spfli-connid.
    endloop.
    at line-selection.
    check not wa_spfli-carrid is initial.
    create object exit_ref.
    exit_ref1 = exit_ref.
    call method exit_ref1->lineselection
    EXPORTING
    i_carrid = wa_spfli-carrid
    i_connid = wa_spfli-connid.
    clear wa_spfli. 
    Rewards some points.
    Rgds,
    P.Naganjana Reddy

  • Need Logic for writing the User exit

    Hi Gurus,
    I am writing the User Exit code to populate the 'Valid to' field in the data source.
    Technical Name - DATUB  and Type- DATS
    I am using the FM 'GET_STPO"
    My extract structure has following fields.
    MANDT
    MATNR
    WERKS
    STLAN
    STLNR
    STLAL
    STLTY
    STLKN
    STPOZ
    DATUV
    IDNRK
    PSWRK
    MEINS
    MENGE
    MTART
    DISMM
    DATUB
    I am not getting the DATUB value for some of the BOM Node Numbers(STLKN).
    Please suggest me as How Can I write the code?
    Thanks a lot.
    Shalaka.

    Hi ,
    You can also try this :
    int countold = 0;
    int countnew = 0;
    int k = 0;
    for(int i =0;i<var1.length;i++)
    countold = countnew + 1;
    countnew = countnew + Integer.parseInt(var1<i>);
    for( int j = countold-1 ;j<countnew;j++)
    result.addValue(var2[k]);
    k++;
    result.addContextChange();
    Regards,
    Ganesh

Maybe you are looking for

  • Invalid handel error?Urgent

    Hi, I am frequently getting invalid handle error in my jsp response from the server.I had created the connection pool which I use in my jsp pages.The pool has the application scope.In certain pages I use multiple statements,after processing the logic

  • Error when I try to turn on genius

    I can not get genius to turn on properly in iTunes. When I try to turn it on it collects information, sends it to apple, then the "server times out" when "delivering your genius results" Any ideas to fix this? It is annoying because after the server

  • How To Store Files On a Server?

    I am using the Tomcat 5.0.27 web container. I have always store things into the database. Now, I am told to store files (uploaded files) on the server. And, when clients want the files later on, clients can download them. Because I have not yet had t

  • Is there anyway to STOP Skype from updating?

    I"m the first to admit that I'm probably the most illiterate computer and technological adult using a newer mini laptop.  I'm confused with the new Skype. On my other computer I could use Skype with basically no problems and with no fee at all.  I on

  • Online Links for Multithreading C++ Application in Unix

    Hi Everybody, I am working in Solaris Sparc 5.8 Machine. I need to implement Multithreading for C++ Application in Unix Environment. It would be of great help if you can mention any website or online links which gives examples of how to do Multithrea