Generation of program code for the ABAP Query

Dear all,
In the creation of the ABAP query, in the final step of SQ01, Query- more functions- generate program is made.
Why the program code is generated for the ABAP query? please  give the logical explaination for the same.
Thanks and Regards,
Prash

Prash,
a) Do you mean Program code does not have significance in query creation?
No it does not mean this.  All queries run based on an ABAP program.  In the standard query editing process, when you save and execute the query, you will automatically re-build the existing ABAP program as necessary.  You do not need, though, to execute the menu steps you outlined in order to build, maintain, or execute the query.  It is only there for special purposes, as outlined above by Jürgen
b) Can we see the program code generated in any transaction?
From any screen, System > Status.  Place your cursor on the field in "Program (screen)".  Double click.
Rgds,
DB49

Similar Messages

  • ABAP Code for the SQL Query

    Hi,
    I am a BASIS person.
    I need to create an ABAP program which willl return the <b>count</b> of rows returned by the following query.Pls help me in this
    <b>SELECT AGR_NAME FROM AGR_1250 where OBJECT IN (select OBJCT from
    TOBJ where OCLSS IN ('RS','RSR','RSBC')) AND
    AGR_NAME LIKE 'Z%'</b>
    Message was edited by:
            Balaji R

    hi, Balaji,
    TABLES: ekpo, ekko.
    DATA: BEGIN OF itab1 OCCURS 0,
    ebeln LIKE ekpo-ebeln,
    ebelp LIKE ekpo-ebelp,
    matnr LIKE ekpo-matnr,
    END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0,
    ebeln LIKE ekko-ebeln,
    lifnr LIKE ekko-lifnr,
    bukrs LIKE ekko-ebeln,
    END OF itab2.
    DATA: count LIKE sy-dbcnt.
    DATA: BEGIN OF itab3 OCCURS 0,
    ebeln LIKE ekpo-ebeln,
    ebelp LIKE ekpo-ebelp,
    matnr LIKE ekpo-matnr,
    lifnr LIKE ekko-lifnr,
    bukrs LIKE ekko-bukrs,
    END OF itab3.
    SELECT-OPTIONS: s_ebeln FOR ekpo-ebeln.
    SELECT ebeln ebelp matnr INTO TABLE itab1 FROM ekpo
    WHERE ebeln IN s_ebeln.
    IF NOT itab1[] IS INITIAL.
      SELECT ebeln lifnr bukrs INTO TABLE itab2 FROM ekko
      FOR ALL ENTRIES IN itab1
      WHERE ebeln = itab1-ebeln.
    count = sy-dbcnt.
    ENDIF.
    LOOP AT itab1.
      READ TABLE itab2 WITH KEY
             ebeln = itab1-ebeln.
      itab3-ebeln = itab1-ebeln.
      itab3-ebelp = itab1-ebelp.
      itab3-matnr = itab1-matnr.
      itab3-lifnr = itab2-lifnr.
      itab3-bukrs = itab2-bukrs.
      APPEND itab3.
    ENDLOOP.
    LOOP AT itab3.
      WRITE : / sy-vline,
                itab3-ebeln, sy-vline,
                itab3-ebelp, sy-vline,
                itab3-matnr, sy-vline,
                itab3-lifnr, sy-vline,
                itab3-bukrs, sy-vline.
    ENDLOOP.
    write : count.
    <b>
    Regards,
    Azhar</b>

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • How  to  crate a spool number for the abap program

    hi
    how  to  create a spool number for the abap program

    Hi,
    Check this thread
    how to create a spool requset for 'z program'.
    Regards,
    Satish

  • Need ABAP code for the below Services requirement

    Hi,
    We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
    1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
    2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
    3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
    4.This will be the Service entry record for that PO number.
    Can any one Please suggest me to how to write the ABAP code for the above logic.
    Thanks & Regards,
    Dinakar

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • Content Query Web Part (CQWP) displaying ASCII code for the colon portion of a time

    I'm having an issue with a CQWP displaying &#58; for the colon portion of a time.  For example, instead of 6:30, the CQWP shows 6&#58;30. 
    I checked our encoding which is set to UTF-8.  We also have a custom style on the CQWP and I've made sure that our custom itemstyle.xsl file has the disable-output-escaping property set to yes. 
    When I look at the list I'm querying from, the ascii code is not showing in there; it's displaying properly as 6:30.  I tried to flip this by replacing the colon with the ascii symbol in the list but it still showed the ascii code on the CQWP.
    Any ideas?

    Hi Cameron,  thanks for your reply.  The solution in the blog would work for an area that is only for date or time.  Unfortunately, this particular section of my CQWP is more than just a time; it's the summary of a news article--
    which may or may not contain a time depending on what the news article is about. 
    In further testing I have also noticed, when viewing the source code, that the colon is represented as
    &amp;#58; which tells me that the ampersand of the ascii code for the colon is also being convertied to ascii (in a sort-of double
    conversion situation.)  This isn't something I've ever seen before.

  • How to Find unused programs / T-codes for the past three months

    How to find the unused programs / transaction codes for the past three months,
    I tried with the ST03 Transaction but it gives only the Tcodes, program used in last one monthu2026
    Regards,
    Purshoth

    This depends on the data retention time (in days) maintained in your system. In ST03, on the right hand side, check "Collector" tab, under that "Performance Database" and then "Reorganization" which will give you the details retention times  (in days).
    Also please check the link http://inet.tamko.com:8081/saphelp/helpdata/EN/c4/3a68d5505211d189550000e829fbbd/frameset.htm for more details.
    Thank You.

  • Can we assign Transaction code to created  ABAP Query of  SQ01

    Hi ,
    Friends I want to run the abap query assigning t.code to it .. i will be thankfull if any body give me the steps or remedy .
    thanks

    Hi you there.... you can try this
    1) create an abap report with the following source code
    REPORT ZRUN_QUERY .
                          DECLARACIÓNES                                    *
    DATA:
    REPORTNAME LIKE AQADEF-PGNAME.
    PANTALLA DE SELECCION                                                *
    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: P_BGNAME LIKE AQADEF-BGNAME OBLIGATORY,
                  P_QUNAME LIKE AQADEF-QUNAME OBLIGATORY.
      SELECTION-SCREEN END   OF BLOCK B1.
    SELECTION-SCREEN END   OF BLOCK B0.
    CUERPO DEL PROGRAMA                                                 *
    CALL FUNCTION 'RSAQ_REPORT_NAME'
         EXPORTING
              WORKSPACE  = SPACE
              USERGROUP  = P_BGNAME
              QUERY      = P_QUNAME
         IMPORTING
             REPORTNAME = REPORTNAME.
    CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
         EXPORTING
              QUERYREPORT       = REPORTNAME
              VARIANTE          = SPACE
        EXCEPTIONS
             ONLY_WITH_VARIANT = 1
             VARIANT_NOT_EXIST = 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.
    2) Create a transaction for this program
    3) Create a parameter transaction and execute this report passing by parameter the usergroup and Query, then, the program will automatically solve the program name and execute it.
    Regards,
    Daniel

  • How to find T-Code assigned to ABAP Query...

    Hi All,
    I have ABAP query, Infoset and user grp with me.
    Can anybody let me know, how to find the T-code assigned to this ABAp Query.
    Regards,
    Sanjay

    Hi.
    In SQ01 tcode .. Check the Program attached to the SAP Query .
    Then Goto Tcode SE93 and Open this Program.
    There you can find the (Transactions)Tcodes created for this program.
    Note: You can also check in TSTC table using the Program name. It a Tcode is already created for ur Query then it will be in TSTC.
    REWARD IF HELPFUL,

  • How to find the report for the SAP query (Query exists in table AQLQCAT)

    Hello Experts,
    I need to find the tables used in the SAP Query but i don't have access to transaction SQ01,SQ02 and SQ03 to check the same.
    Therefore i checked table AQLQCAT and got the SAP Queries in the system. Then searched for the reports that would have been generated for the same passing  AQusergroupquery name*  in transaction SE38.
    But unfortunately the program does not exists for the given paramenter.
    Could you please let me know how to get the report name for the SAP Query.
    Secondly please suggest any other way of checking the tables used in the SAP Query.
    Also the table name from where i can download the SAP Queries.
    Thanks in advance.
    Regards,
    Rahul Sinha

    I suggest you a simple method.
    Execute the query. When the selection screen is showed,  go to menu and click to SYSTEM->STATUS.
    Check the program name and double click it to access the program code.
    Search for tables or functions into the source code in order to understand where data are taken.
    If you do not find anything , go to the program atttribute and check for logic database, sometimes they are used....
    Best regards.

  • Can we give Transaction code for an SAP Query(SQ01)..?

    Hi All,
           Can we assign an Transaction code for an SAP Query...?If yes, How..?
    Waiting for your valuable replies.
    Thanks and regards,
    Rahul.

    Hi Rahul,
                   In SQ01,
    go to menu path
                   Query--->morefunctions -
    >Display report name.
    Copy this program name. then
    GotoSE93  .enter a tcode name .press create.
    select program and selection screen option .
    enter the Program name.
    Reward points if helpful.
    regards,
    Hemant

  • TCODE for an ABAP query

    My requirement is to create a TCODE for an ABAP query, Can I use the program name directly to do so ..? if so is there any chance that the program name may change..?

    hi
    good
    use the SE93 create the tcode for the abap program,if you r going to change in the abap program than also your tcode ll work.
    thanks
    mrutyun^

  • How to create t.code for a sap query

    i have created a sap query.
    user wants this as a t.code.
    how to assign a t.code for teh sap query.
    kindly explain me.

    hi,
    The other way of doing it.
    1. Instead of creating your queries in SQ01, use SQVI. Create a query in your production system.
    2. Now execute the query. When you have reached the selection screen, go to System > Status.
    3. Copy the program name.
    4. Now create a Z executable program in your development client. Put this one line of code in it:
    submit program_name_copied_fr_production via selection-screen and return.
    5. Create a TCode and assign the Z program to the TCode.
    6. Transport the Z program and TCode over to Production system.
    Hope this works for you, Do reward.

  • Can we change the ABAP QUERY exists in Global area

    Hi All,
    I have a requirement to  add new column in the ABAP query in layout for that I am changing a ABAP query ME80FN which is calling  infoset  /SAPQUERY/ME80FN  defined in the global area ( Environment->query areas->global area).
    1) Can I change this infoset and query
    or
    2) Do I need to follow any other steps.
    If I change the existing query in DEV can I transport this to production.
    Please clarify.
    Thanks,
    Jwala

    Yes. We can change the background of an input field. The way you do this is by editing the theme that webdynpro application uses. To edit the theme, you will need to install NWDS PLUS the theme edit plugin (Available for download from SAP).
    Once you have edited the theme, you will need to upload your theme back to application server. You can use the program : BSP_UPDATE_MIMEREPOS to do this.
    Bydefault, the theme used by webdynpro applications is :
    /SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow
    You can apply another theme by calling the webdynpro application with a theme parameter. For example, if my webdynpro application name is "zgopaltest", then
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow</b></i>
    will apply the sap_tradeshow theme.
    Likewise, you can apply diffrent theme. There is another theme that SAP provides. Its called : sap_hcb. Hence, you can apply the theme to the above application by:
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_hcb</b></i>

  • What excatly this program do for the R/3 job

    Hi,
    In R/3 side there is a job and got there variant and program. I want to know what excatly this program do for the R/3 job where we can see in SM37?
    Thanks,

    Hi......
    Go to SE38 >> Give the Program name................Display.............from there check the code...........u will get the answer..........but for that u hav to know ABAP..........
    U can take help of some ABAPER.............
    Actually..........a vriant is something like a specific selections............for an example...... if you have a report instead doing the selections all the time.. you save the selection as variant............it reduces time..........errors in input...........you can schedule a background job only using variants........
    Generally..........we create a JOb in SM36.........as already said............there the job is created using the program and the variant..............while executing the job...........this program get executed.........
    Regards,
    Debjani.........

Maybe you are looking for

  • PO- Output to the PO creators by email in pdf

    Hi ALL, we have a requirement is to have the PO- Output  to the PO creators by email in pdf. Format.  how can we acheive this requirement , what is the partner function can be used for person who creates PO , where can we maintian his eamil ID . plea

  • WLSE 2.11 AUTO STARTUP CONFIG

    Hello, can anyone help, we have a problem with our startup configuration templates. When we create a new one it quite often apples a different configuration template, often one above or below the requested one. As such we have the wrong templates bei

  • UIX page getProperties() method.

    Hi, I am having the following code in the controller for my UIX pages:- public static EventResult Search(BajaContext context, Page page, PageEvent event) Page nextPage; String entity = event.getParameter("entity"); String Name = event.getParameter("N

  • How to add PDF on itunes 12.0.1? VERY URGENT!!!

    Can someone please explain to me, where I can find iBooks on the new iTunes 12.0.1 (Yosemite)? Or at least to tell me how to put PDF file in iTunes so I can transfer it on my iphone and ipad. IT IS VERRY URGENT!!! Thank you!

  • Syncing with iPad cord to new iPad (3)?

    Can I use my cord from my iPad 1 to sync my iPad (3)?