ABAP SQL Doubt

Hi ABAP Gurus,
Please help me in solving following ABAP SQL doubt.
In the table Zonfig there are two fields: FNAME and REQFLAG
FNAME.....REQFLAG
S1...........X
S2...........X
S3..........._
S4...........X
Other table T_Zconfig has one field : XNAME
XNAME
S1
S3
Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
That is in this case for FNAME S1 and S2 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S2.
Points will be surly awarded...
Thanks.

Hi ABAP Gurus,
Please help me in solving following ABAP SQL doubt.
In the table Zonfig there are two fields: FNAME and REQFLAG
FNAME.....REQFLAG
S1...........X
S2...........X
S3..........._
S4...........X
Other table T_Zconfig has one field : XNAME
XNAME
S1
S3
Now I have to select REQFLAG from Zconfig table for the values of field XNAME in T_Zconfig table.
That is in this case for FNAME S1 and S3 in Zonfig I need to fetch REQFLAG since in XNAME in T_Zonfig we just have S1 and S3.
Points will be surly awarded...
Thanks.

Similar Messages

  • Where to do the abap sql statement in sapscript (PO)

    Hi, all.
    Hope anybody can guide me to find a solution.
    My situation now is i have to do a purchase order in SAPSCRIPT starting from a standard po. I already found out all the related details as below:
    Program           SAPFM06P
    FORM routine      ENTRY_NEU
    Form              MEDRUCK
    So, now the problem now is I have to add some more data on my print out PO. After figure out for some time, I don't know where to do my abap sql statement. Like example, I want to retriece some data from the ADRC table. I opened the standard program SAPFM06P to add in the some sql statement, but i dun know where should i add in. Bcz if we straight away put the related ADRC field in our sapscript, it is useless, right?
    Thanks in advance.

    Thanks a lot.
    So, how should i add in code in order to fetch the data frm ADRC by using that routine. Because i only the codes like below. I don't where should i start add in.
    Form entry_neu using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    Or i come wrong place to add in any coding. Plz guide me.
    Thanks in advance.

  • Abap sql convert to native sql fuction

    hi expert!
    exist a function can do follow things:
      convert selection-screen's select-options which user key in
         to oracle where condition expression
    or exist one function can convert abap sql to oracle sql
    thank you very much

    example:
      EXEC SQL.
            CONNECT TO :'DATA BASE NAME'
          ENDEXEC.
          IF sy-subrc EQ 0 .
             TRY.
                  EXEC SQL .
                    SELECT COUNT(*) FROM <TABLE NAME>
                    INTO :recount
                    WHERE code = :itab-<FIELD>
                  ENDEXEC .
                CATCH cx_sy_native_sql_error INTO exc_ref.
                  error_text = exc_ref->get_text( ).
                  MESSAGE error_text TYPE 'I'.
              ENDTRY.

  • ABAP SQL manager

    Please, advice ABAP SQL manager.
    Program which allows to execute any SQL queries.

    hi ;
    İf you want execute T-sql in sap , u can use this program ;
    Regards.
    İrfan
    << cut and paste without attribution from https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7168fa07-0b01-0010-7698-87fbfc556f1d
    removed. Points unassigned. >>
    Edited by: Rob Burbank on Mar 27, 2009 5:35 PM

  • UNION statement in ABAP SQL

    Hi,
    How to achieve the UNION SQL operation results in ABAP? To be specific, I want to retrieve STCD1 field value from vendor master table (LFA1) for all vendors (LIFNR) that exist in table BSIK or BSAK.
    And I want to achieve the results in single SQL statement. So in essence, the resultant SQL would be something like:
    SELECT STCD1
    INTO TABLE my_internal_table
    FROM LFA1
    WHERE LIFNR IN (SELECT DISTINCT LIFNR
                                                FROM BSIK
                                UNION
                                SELECT DISTINCT LIFNR
                                               FROM BSAK)
    But the UNION is not a valid keyword in ABAP. Any idea how to achieve this?
    Regards,
    Chetan

    hi chetan,
    do you have any where condition to filter the records from bsak and bsik?
    your requirement cannot be realized in a single statement.
    you have to use two separate selects from bsak and bsik, then, collect all the vendors in one internal table and at last you have to use this table to get the vendor info from lfa1.
    regards,
    ravi

  • ABAP HR DOUBTS

    Hi ,
      I have some doubts  in ABAP-HR.Please clarify my doubts.
    1) Provide and end provide statements are obsolate.Shall we use select in place of provide and provide?.
    2) what are the important macros in ABAP HR?
    3)Do we have to use logical data base if we are using macros?.
    Moderator message: please do not ask interview-type questions, search for available information.
    Edited by: Thomas Zloch on Jan 6, 2011 10:57 AM

    Hi Shakir,
       First of all you have to assign logical database name say PNP in the attributes of the program. After assigning the logical data base, you can see teh button below with HR REPORT CATEGORY. Click on that and select Master dat(infotypes) radio button. After that go for f4 help to see the existed HR report categories. From that you select one which contains the fields you want. If you are not able to find Hr report category with the fields you want then you need to create your own report category with the fields you want.
    If you want to select only active employees
    RP-PROVIDE-FROM-LAST p0000 space pn-begda pn-endda.
    CHECK P0000-STAT2 = '3'.
    note: '3' or some other value based on the values stored in infotype 0000 for the employment status.
    if employee is not active then it will skip that employee and selects the next employee.

  • Read data from SharePoint using ABAP sql command

    We need to read data from a SharePoint site and update the sap object services with the information. There is a lot of information on how to put data into Sharepoint from SAP, but we need to get data from SharePoint and put it into SAP. Is it possible to retrieve data from SharePoint using sql command in ABAP program? If it is possible, what do we need to do to have SAP recognize where to get the SharePoint data?
    Richard Newman

    Hi Newman,
    You can use native sql in your abap code to read data from SharePoint's database. But I would suggest you to generate a SharePoint webservice which can provide you the neccessary data so that you can consume this webservice in ABAP
    (Will be quite faster than native sql).
    Regards,
    Ozcan.

  • ABAP Mapping doubt

    Hi.
    I'm trying to do an abap mapping. I've read weblogs from Robert Eijpe. The samples contained in the weblog worked fine but i have a doubt.
    ABAP class had a parameter called SOURCE. This parameter contains the XML but i think is contained in only one line. In the sample weblog, the XML is contained in an internal table.
    Question is ... how can i transform this SOURCE of 1 line into an internal table?
    Thanks.

    Hi Inigo,
    Please look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    Hope it helps you!
    cheers,
    Prashanth

  • ABAP OO Doubt - validate call method.

    Hi experts
    I'm beginer in ABAP OO and i created this code :
    output-cep = ch_adrc_struc-post_code1.
                 TRY.
                     CREATE OBJECT lr_cep.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
                 TRY.
                     CALL METHOD lr_cep->si_servico_cep_out
                       EXPORTING
                         output = output
                       IMPORTING
                         input  = input.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
    My doubt is : How to know the call method worked?
    In call function i use = if sy-subrc = 0 for check the return but can i use it after call method ?
    thanks a lot.

    there is an importing which is used to get back data.
    once you process input then you can decide whether method worked or not.

  • ABAP SQL: Multiplication in Select-Statement

    Hi everybody,
    in native SQL it should be possible to use a statement like:
    SELECT preisstueck, (anzahl*preisstueck) as gesamtpreis FROM kaufteile
    in ABAP I tried:
      SELECT profile
         (SUM( val2300 ) AS val2300    ) + ( SUM( val2315 ) AS val2315    ) + ( SUM( val2330 ) AS val2330 )    + (SUM( val2345 ) AS val2345 )
    But I get an Error: Unknown row: (
    Could anybody pls help?
    Thanks
    Regards
    Mario

    I would never recommend using native SQL. Please try to use OpenSQL so that other abapers can easily understand the code (in future). Suppose in future the customer decides to migrate from Oracle to DB2 or HANA then the sql has to be changed too.
    but if you still insist in using it here is a sample code. Please note that it works only for transparent tables.
    REPORT demo_native_sql.
    DATA: BEGIN OF wa,
            connid   TYPE spfli-connid,
            cityfrom TYPE spfli-cityfrom,
            cityto   TYPE spfli-cityto,
          END OF wa.
    DATA c1 TYPE spfli-carrid VALUE 'LH'.
    EXEC SQL PERFORMING loop_output.
      SELECT connid, cityfrom, cityto
      INTO   :wa
      FROM   spfli
      WHERE  carrid = :c1
    ENDEXEC.
    FORM loop_output.
      WRITE: / wa-connid, wa-cityfrom, wa-cityto.
    ENDFORM.
    Please note:
    Native SQL statements bypass the R/3 database interface. There is no table logging, and no synchronization with the database buffer on the application server. For this reason, you should, wherever possible, use Open SQL to change database tables declared in the ABAP Dictionary. In particular, tables declared in the ABAP Dictionary that contain long columns with the types LCHR or LRAW should only be addressed using Open SQL, since the columns contain extra, database-specific length information for the column. Native SQL does not take this information into account, and may therefore produce incorrect results. Furthermore, Native SQL does not support automatic client handling. Instead, you must treat client fields like any other.
    See native SQL syntax for
    Oracle:Native SQL for Oracle (SAP Library - ABAP Programming (BC-ABA))
    Informix: Native SQL for Informix (SAP Library - ABAP Programming (BC-ABA))
    DB2: Native SQL for DB2 Common Server (SAP Library - ABAP Programming (BC-ABA))

  • Pl/sql doubts clarification

    Hi,
    I have doubts with some of the questions given below:
    1.Identify two features of obfuscation. (Choose two.)
    A. The Import and Export utilities accept wrapped files.
    B. SQL' Plus cannot process the obfuscated source files.
    C. Only the wrap utility can obfuscate multiple programs at a time.
    D. Both the DBMS_DDL package and the Wrap utility can obfuscate multiple programs at a time.
    E. The source code is visible only through the DBA_SOURCE view and not through the USER_SOURCE or
    ALL_SOURCE View
    ANSWER: A and C(not sure)
    2.The anonymous block gives an error on execution. What Is the reason?
    A.
    The assignment in line 7 is not valid.
    B.
    The SQL does not support the Boolean data type.
    C.
    A null value cannot be applied to the bind arguments In the using clause in line 10
    D.
    The names of bind variables must be the same as the using clause bind arguments in line 10
    Answer: A or B.
    3.SCOTT executes the procedure as follows:
    SQL>SET SERVEROUTPUT ON
    SQL>EXEC read_file ('MY_DIR', FACULTYLIST.TXT')
    What is the outcome?
    A.
    It goes into an infinite loop.
    B.
    It executes successfully and displays only the list of faculty names.
    C.
    It does not execute and displays an error message because the end-of-file condition is not taken care of.
    D.
    It executes successfully and displays the list of faculty names followed by a “no data found” error message.
    Answer: D is right or not
    4.Which two tasks should be created as functions instead of as procedures? (Choose two.)
    A.
    reference host or bind variables in a PL/SQL block of code
    B.
    tasks that compute and return multiple values to the calling environment
    C.
    tasks that compute a value that must be returned to the calling environment
    D.
    tasks performed in SQL that increase data independence by processing complex data analysis within the Oracle server, rather than by retrieving the data into an application
    Answer: A and B(not sure B or C).
    Please,kindly reply to me ASAP.
    Thank you,
    karthi
    Edited by: 998492 on Apr 7, 2013 2:32 AM

    1. Thare are so many problems in this code. I will list a few.
    1. You cant specify the size of an argument in a procedure.
    2. You can call this procedure only once in a schema, coz the name of the table to  be created is static.
    3. *No need to create the table dynamically*. You can create the table at the design time and truncate/insert as required.
         Even it will not be required, I hope, to meet your requirement( A Cursor will be enough).
    4. In the EMP table join_date should be of date datatype. If it is already a date, no need of to_date in the procedure.
    5. Not using BIND Variables.
    6. Variable "v_cmd" is not declared2. Search for "string aggregation " in this forum and show us what you tried so far.

  • Beginner ABAPer asking Doubts in BDC

    Hi Guyz,
    I am a beginner in ABAP. Here i am sending some doubts on BDC . Any Kind of help will be highly Appreciated.
    Thanks,
    SAM
    1>How do we handle all the scrolling funcions(page ups, page downs atc), and values entered into table controls in BDC ?
    2> How do you take care of screen resolution in BDC?

    1) page up and page down ... i donno the actual procedure but this is one of the method...
    i hope this answers both of ur questions...
    After encountering the screen, say u need to select a field in a table. One of the methods is to press <b>Control F</b> on that screen then enter the field name which u want.. and press enter.. then that field will be the <b>first field in the screen resolution</b> ....
    just try this for a normal table like spfli... after going to the table display in <b>SE11 press control F or the Binoculars icon.</b>. then u will get a small window u just type in the name of the field u want.. and press enter .. see what happens,
    suppose ..
    have opened this spfli in se11 transaction and in display mode..
    Now <b>'PERIOD'</b> is the field which is not there in the resolution..
    so i have opened the find option ,provided the field name <b>PERIOD </b>in the field of search window.
    then pressed enter. Now i will get the same screen( spfli display screen ) with <b>period as the first field in that resolution</b> .. Now i can do whatever is i want with this field.. here i have double clicked on the domain of the field PERIOD.
    so u analyse this code....
    *spfli display screen..
    perform bdc_dynpro using 'SAPLSD41' '2200'. ( * spfli display screen , u can use ur screen number here )
    perform bdc_field using 'BDC_OKCODE'
    '=FIND'. (* To open the find window )
    perform bdc_dynpro using 'SAPLSD41' '0114'. ( * This is the find window )
    perform bdc_field using 'BDC_CURSOR'
    'RSDXX-FINDSTR'.
    perform bdc_field using 'BDC_OKCODE'
    '=CANC'. (* OK_CODE for enter )
    perform bdc_field using 'RSDXX-FINDSTR'
    'PERIOD'. ( * Here i am giving the field name which i want to search or which is not there in the resolution or u can give a vaiable name which contains the value <FIELD NAME> ).
    ( Now i got the spfli display screen with period as the first field in the screen resolution )
    perform bdc_dynpro using 'SAPLSD41' '2200'. (*The previous spfli display screen )
    perform bdc_field using 'BDC_OKCODE'
    '=WB_SELECT_OBJECT'. (* OK_CODE to double click on the domain of the field PERIOD )
    perform bdc_field using 'BDC_CURSOR'
    'DD03D-ROLLNAME(01)'.
    reward helpful answers...
    sai ramesh

  • Abap hr doubt

    Hi all,
    When we use GET PERNR statement , we declare TABLES:PERNR to define the structure pernr in our program.
    We declare the logical database as PNP for the standard  selection screen.Now , if we dont declare LDB as PNP and create our own selection screen and use GET PERNR statement by including tables: pernr in the program , it is giving error at GET PERNR statement.My doubt is how is the LDB linked to GET PERNR statement.
    Can anyone explain me clearly.
    Plss dont send links to other threads.
    Thanks & Regards
    Chandrika

    Hi sarath,
    1. I just tried. When we try to use
        Include SAPDBPNP in our Z Program,
        it gives SYNTAX error that
      "  Each ABAP program can contain only one "REPORT", "PROGRAM".
    2. The reason is that SAPDBPNP is a Program
        and not an include.
       Hence, like any other program if we try to include,
       it will give error.
    3. The PNP ldb has the program SAPDBPNP behind the scenes. But to use it we have to assign the LDB PNP in the attributes.
    4. There are some FMs LDB*  (eg. LDB_PROCESS)
        (I have not used them ) which allow
       to use a LDB without specifying in the attribute.
    regards,
    amit m.

  • How to check whether a value is empty in ABAP Sql

    Select matnr from mara where
    MARA~LVORM is null
    Basically if LVORM is blank, i.e., not popoulated, I want to get matnr.
    Will above query accomplish this in ABAP OPEN SQL.

    Hi,
    LVORM column is defined as a NOT NULL column.. so the values will be either a initial value (space, in this case) or filled with some value
    SELECT matnr
      INTO TABLE t_matnr
      FROM mara
      WHERE LVORM = space.
    https://cw.sdn.sap.com/cw/docs/DOC-40206
    http://learnsapmdm.blogspot.com/2009/01/data-modelling-and-database-design-in.html
    regards,
    Paulo Carvalho

  • BSP (ABAP, SQL & ITABS)

    Hi SCN Community,
    Today I have a question for the more experienced ABAP developers.
    I have a BSP Application which is based on HTML files.  The purpose of this BSP Application is to provide the front end user, with an interface where they can supply certain information which then needs to be executed in the BSP as SQL Queries.
    My environment for this purpose is as follows:
    The BSP Application is running on my SAP BW Dev server.
    The SQL Database which contains the information related to the queries, is an external (Same Domain) MS SQL Host.
    From what i've read, is that best practice would be to store that external DB in the Internal Tables (Temporary), so that the SQL Queries can be executed accordingly.
    My problem is, I have no SQL experience.  I do however have someone who can help me write the required SQL Queries to supply the required information to the Front End User, but I do not know how to approach this.  I have no clue how ITABS work, or how to implement and use them properly.
    I have already set up a DBCON entry for the external SQL Host and that part works, connection tested and is functional.
    Is there anyone who would be willing to assist me in getting this working?  Any technical advice would be highly appreciated.  If you do try to assist, please do so in as much detail as possible so that I can fully understand.
    Thank you,
    Kind Regards,

    hi ;
    İf you want execute T-sql in sap , u can use this program ;
    Regards.
    İrfan
    << cut and paste without attribution from https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7168fa07-0b01-0010-7698-87fbfc556f1d
    removed. Points unassigned. >>
    Edited by: Rob Burbank on Mar 27, 2009 5:35 PM

Maybe you are looking for

  • Send email from excel

    Can anyone help please. I would like to send a range from excel 2011 by email using VBA code. I can do this with Outlook but It fails because of using the Mac Mail Client. Is there any code out there that will send via the mac mail client Regards Gar

  • Preview "this layered Photoshop file was not saved with a composite image" error message?

    hi, i get this message: in preview, when i try to open a .psd file by double-clicking it: "this layered Photoshop file was not saved with a composite image" is there any program that will open this file, that came with my new iMac? OS 10.9.5 thanks!

  • Foreign contacts in my iPhone

    I have hundreds of foreign contacts in my iPhone that I did not enter.  Could my phone be syncing over iCould with someone else's account? 1) How can I get rid of the contacts without having to delete one by one, while still maintaining my real conta

  • Failed to find element.

    Hi all, Some times while playback I am facing on issue like failed to find element. like Navigation failed:Failed to find element window(index=0).frame(name="contentFrame" | index=1).form(name="QUERYTEXTCOMPONENTS" | index=5).formelement[INPUT](index

  • Ligthroom 5. Assertion Failed.

    I've installed trial version of Lightroom 5. I've never could open. It appears this message "assertion failed", and after the message "Lightroom-Abriendo catálogo:_DSC5861.NEF.lrcat", and it closes the program. Several years ago, I had installed ligh