How to get selection screen elements and its table reference of a report ?

halo experts
How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
For eg if my selection screen 1000 is
parameters: p_carrid type spfli-carrid,
select-options :s-_connid type sflight-connid.
is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
REPORT  ZTEST_PROG.
TABLES sflight.
DATA:
       screen_tab TYPE STANDARD TABLE OF screen,
       wa_screen TYPE screen,
       scrn_nm TYPE string,
       scrn_leftover TYPE string,
       l_type TYPE REF TO cl_abap_typedescr,
       typ_nm TYPE string,
       typ_pre TYPE string.
FIELD-SYMBOLS <fs_data> TYPE ANY.
PARAMETERS p_carrid TYPE spfli-carrid.
SELECT-OPTIONS s_connid FOR sflight-connid.
INITIALIZATION.
  LOOP AT SCREEN.
    IF screen-group3 = 'PAR'
      OR screen-group3 = 'LOW'.
        APPEND screen TO screen_tab.
    ENDIF.
  ENDLOOP.
START-OF-SELECTION.
  LOOP AT screen_tab INTO wa_screen.
    ASSIGN (wa_screen-name) TO <fs_data>.
    l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
    IF wa_screen-group3 = 'LOW'.
      SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
      TRANSLATE scrn_nm TO UPPER CASE.
    ELSE.
      scrn_nm = wa_screen-name.
    ENDIF.
    SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
    WRITE:
             / 'Screen Name:  ', scrn_nm,
             / 'DDIC Type:    ', typ_nm.
  ENDLOOP.
When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
DATA: structure_reference TYPE REF TO cl_abap_structdescr,
      components_table TYPE abap_compdescr_tab,
      components_structure LIKE LINE OF components_table.
structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
components_table = structure_reference->components.
I don't know if this answers any of your questions but I hope that some of it is useful.

Similar Messages

  • How to move some xml element and its content to a new frame

    Hi All,
    How to move some xml element and its content to a new frame.

    Hi Chinnadk,
    Sorry my code its comment some lines. Now only I check the forum thread, you just try one more time.
    #target InDesign;
    #include "/Program Files (x86)/Adobe/Adobe InDesign CS5.5/Scripts/XML Rules/glue code.jsx"
    var myDoc = app.activeDocument;
    //____________________ XML RULE SET
    var myRuleSet = new Array (new margintag);
    with(myDoc){
        var elements = xmlElements;
        __processRuleSet(elements.item(0), myRuleSet);
    function margintag(){
        this.name = "margintag";
        //this.xpath = "//margintag[@type='mn2']";
        this.xpath = "//margintag";
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                app.select(myElement);
                try{
                    var myPrePara = app.selection[0].paragraphs[-1].parentTextFrames[0].paragraphs.previousItem(app.selection[0].paragraphs[-1]);
                    if(myPrePara.characters[-1].contents=="\r"){
                        myPrePara.characters[-1].remove();
                    var myTextframe = myElement.placeIntoInlineFrame(["7p9","6p"]);
                    myTextframe.appliedObjectStyle= myDoc.objectStyles.item("MN1");
                    myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
                    myTextframe.parentStory.paragraphs.everyItem().appliedParagraphStyle = app.activeDocument.paragraphStyles.itemByName("MN1");
                    }catch(e){}
                app.selection = null;
            return true;
    thx,
    csm_phil

  • [JS-CS4] - How to read the XML Element and its Attributes

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

  • How to get Portal Login User and Its Related BP in CRM?

    Hi,
    An ABAP Webdynpro program is called in CRM from Portal user by a portal link. How to get the user ID and its related BP in CRM? Thanks!
    The portal is integrated with ECC, and all users and BPs are maintained in ECC then replicated to CRM.
    Best regards,
    Hao

    Hi,
    Try the below code
    IUserFactory userfact=UMFactory.getUserFactory();
    IUser user=userfact.getUserByUniqueName(request.getUser().getUserId());
    String usrid=user.getUniqueName();
    And also you can get the groups assigned to user by using the below code
    Iterator groups = user.getParentGroups(true);
    while (groups.hasNext()) {
         String groupstr = (String) groups.next();
         IGroup g = UMFactory.getGroupFactory().getGroup(groupstr);
         response.write("Group name "g.getUniqueName()"<br>");
    Regards
    Suresh

  • How to get ICH Screen Element Objects

    Would anyone tell me how to get ICH Screen element objects i.e Screen ID like ALRTOVW

    Hi Bris,
    You can run the transaction only from the normal SAPGUI. Try it once again in this format:
    /N/SCF/SCREENCFG.
    Best regards,
    attila

  • How to get selected  row index  of a Table ?

    hi gurus,I'm new  to Webdynpro for abap
    I'm displaying    just Flight details in a Table  so
    how to get selected  row index  of a  Table  and need  to be display in Message manager.

    Hi,
    For getting the row index use the following code.
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA index TYPE i.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_el_node = lo_nd_node->get_lead_selection(  ).
      index = lo_el_node->get_index( ).
    node is the name of the node which is binded to the table.
    For printing the message u can use code wizard.
    Press ctrl-F7. Now Select generate message.
    IN this select the method  REPORT_SUCCESS
    In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
    Write the whole code in onLeadSelect of the table.
    Regards,
    Pankaj Aggarwal

  • How to get selection screen details of any report dynamically

    Hi
    We have a requirement where we need to submit different reports based upon  certain conditions. I need to know FM or other way around to fetch the details of selection screen (name of selection screen parameters or select option and whether its a parameter or select option) any report. Please guide me in this regard.
    Regards
    Swetabh

    DATA : SEL_TAB TYPE RSPARAMS OCCURS 0.
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
        EXPORTING
          CURR_REPORT           = 'ZRP_PACKING_INVOICE_MAIN'
        TABLES
          SELECTION_TABLE       =  SEL_TAB.
        SUBMIT ZSH_SD_INVOICE_NEW WITH
                                        SELECTION-TABLE  SEL_TAB  AND  RETURN.
    above f.m will get the all details of selection screen and give u in internal table  and that can be passed to submit statement...

  • How to get profit center group and its description

    According to three tables(as below), i get profit center group, how to get its description&#65311;
    CEPC  (Profit Center Master Data Table)
    SETLEAF
    SETNODE
    PS:(Referrence to teh link fields in table)
    For Profit centre Group ( SETLEAF-SETNAME )
    Select BSEG-BUKRS / BSEG-PRCTR from BSEG.
    SELECT SINGLE SETNAME INTO WA_SETNAME
    FROM SETLEAF
    WHERE SETCALSS = '0106'
    AND SUBCLASS = BSEG-BUKRS
    AND VALFROM = BSEG-PRCTR
    i can get two records, why?

    Hi,
    I am not sure of the significance of this table...
    But looking at the table structure it is having LINEID as one of the key fields..
    So you can have more than one record for the same combination..
    Thanks,
    Naren

  • How to get selection screen variant name of a report ?

    Hi Experts,
    Can any body please suggest, how I can get the variant name that was selected when a report program was being scheduled in background?
    I am using system field SY-SLSET but it is working only at foregrounf execution.In background mode it holds different value like '&0000000000038'.
    Thanks in advance.

    Hi !
    When running the program in foreground (SE38 -> F8) or in a background job (SM36), sy-slrel is correctly filled.
    When running in background via SE38 transaction (run in background  : F9), sy-slrel is not filled correctly (&000010 for example).
    However, in the second case, you still are in foreground when in the selection screen. Thus this simple but quite efficient idea of  [Vinod Vemuru|http://wiki.sdn.sap.com/wiki/display/~ncz6anw] :
    http://wiki.sdn.sap.com/wiki/display/ABAP/Howtogetthevariantnamewhenrunningthereportinbackgroundfromselectionscreen

  • How to get the xml element and comment name in a page?

    I need to list all element and comment name in a page

    Hi,
    do
      //K2Vector<XMLReference> allXMLRefs;
                        std::vector<XMLReference> allXMLRefs;
      IActiveContext* context = GetExecutionContextSession()->GetActiveContext();
                        UIDRef documentUIDRef = ::GetUIDRef(context->GetContextDocument());
                        XMLReference rootXMLRef = GetRootXMLReference(documentUIDRef);
                        GetFlattenedElementList(documentUIDRef,allXMLRefs);
                        std::ostringstream os;
                        for(std::vector<XMLReference>::iterator it = allXMLRefs.begin(); it != allXMLRefs.end(); ++it)
                                  XMLReference nextref = *it;
                                  PMString tag_name;
                                  os.str("");
                                  os <<  AsString(nextref,tag_name).GetPlatformString().c_str();
      CAlert::WarningAlert(os.str().c_str());
              }while(kFalse);
    I use above code to get tag name.
    Any one help me to get the comment tag in XML

  • How to get Selection Screen in WAD?

    Hi Experts,
    I have designed a WAD where when executed, the selection screen does not come. It goes straight to the report.
    I have used a table for the Data Providers.
    What settings I have to make for the selection screen to pop out?
    Kindly guide me.
    With kind regards,
    Shreeem.

    Hi,
    Have a look at below thread,
    Display of the selection screen in WAD
    Hope this helps.
    Regards,
    Mani

  • How to get selected Row Index in a table based ona  VO?

    Hi All,
    I'm writing an ADF form wherein I use a VO based on a SQL query. I'd like to know how to get the index of a selected row. I havea selection Listener in place where I can print the selected Row's data using getSelectedRowData().toString() on the table.
    How can I get certain Attributes from this selected row.
    One solution I thought of is to get the row index and then read attributes. But I cant seem to figure out how to get rowIndex for a selected row. Any sugestions?
    Using JDeveloper 11g.
    Thanks
    P.

    If your selected row is marked as current row you can use
    // Get a attribute value of the current row of iterator
    DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("testIterator");
    String attribute = (String)iterBind.getCurrentRow().getAttribute("field1");Where 'testIterator' is the name of the iterator you use for the table and 'field1' is the name of an attribute you want to get.
    Or you can iterate over the selected row keys (even if it's only one):
    // get  selected Rows of a table 2
    for (Object facesRowKey : table.getSelectedRowKeys()) {
    table.setRowKey(facesRowKey);
    Object o = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
    Row row = rowData.getRow();
    TestRow testRow = (TestRow)((DCDataRow)row).getDataProvider() ;
    }Where TestRow is the row type of the VO of your table.
    Timo

  • How to get selected row values in a table using check box

    Hi ADF Experts,
    JDEV Version 11.1.1.7.0
    My requirement is getting the selected row valuesof a af:table using a checkbox(multi select).
    Thanks,
    Animesh

    Hi,
    add a transient attribute to the POJO entity and update this through a check box. The ensure you have autosubmit=true set on the check box. In a value change listener set or remove the row's checbox attribute value
    Frank

  • How to get selected item value and display text in selectOneChoice ?

    Hi
    Thank you for reading my post
    I bind the a selectOneChoice component to my backing bean so i have an object which represent this component in the backing bean.
    now i need to find which item is selected by use , i know that i can use
    getSelect_service().getValue.toString() , but it will return the value of the selected item, how about its display text ?
    I should say that i create an static list for selectOneChoice items.
    thanks

    Using JDeveloper 10.1.3.1, freshly downloaded off OTN. I used the following code to try and identify the problem you are encountering. I attempted to use a valueChangeListener in combination with af:selectOneChoice components that use SelectItems and the singular SelectItem. I could not reproduce the error in either case. Please post more information about your development environment.
              <af:selectOneChoice label="Label 1"
                                  binding="#{backing_test.selectOneChoice1}"
                                  id="selectOneChoice1"
                                  valueChangeListener="#{backing_test.valueChangeListener}"
                                  autoSubmit="true" immediate="true">
                <af:selectItem label="1" value="1"
                               binding="#{backing_test.selectItem1}"
                               id="selectItem1"/>
                <af:selectItem label="2" value="2"
                               binding="#{backing_test.selectItem2}"
                               id="selectItem2"/>
                <af:selectItem label="3" value="3"
                               binding="#{backing_test.selectItem3}"
                               id="selectItem3"/>
              </af:selectOneChoice>
              <af:selectOneChoice label="Label 2"
                                  binding="#{backing_test.selectOneChoice2}"
                                  id="selectOneChoice2"                              valueChangeListener="#{backing_test.valueChangeListener}"
                                  autoSubmit="true" immediate="true">
                <f:selectItems value="#{backing_test.items}"
                               binding="#{backing_test.selectItems1}"
                               id="selectItems1"/>
              </af:selectOneChoice>
        public void valueChangeListener(ValueChangeEvent evt){
            // returns a UISelectOneChoice object
            System.out.println(evt.getSource().getClass().getName());
            // returns a string
            System.out.println(evt.getNewValue().getClass().getName());
        public Map getItems(){
            items = new HashMap();
            items.put("11","11");
            items.put("12","12");
            items.put("13","13");
            return items;
        }

  • How to get the programs (elements and premiere)from my old computer on my new PC?

    Can I get the programs from my old computer and use tham on my new (windows 8.1) computer?
    what do I do?

    I just did this so I hope I can remember.  I have a MAC so I went into my MAC hard drive and then library > application support > adobe > photoshop elements > 10 > creations > effects.  I selected all of my files and copied them.  I then went back to photoshop elements > 12 > creations and pasted the files into effects.  I then restarted PSE and all of my files were there! 

Maybe you are looking for