Select single

Hi experts,i have a query,plz help me.
can i use select single in the below condition.
crmd_link---table(key fields: guid_hi,guid_set)
crmd_cancel---table(key fields:guid)
SELECT SINGLE a~cancparty
                    a~canc_reason
              INTO (l_canc_party,l_canc_reason)
              FROM crmd_cancel AS a INNER JOIN crmd_link AS b
              ON aguid = bguid_set
              WHERE b~guid_hi = '32134241324'.
on the above  statement can i use select single????????

Hi Sravan,
You can use either of the following:
a) TRANSLATE : This command will change your 'T' to 'A' if its ZZXG1T. If its not, it will leave it as it is.
SELECT SINGLE * FROM T881 WHERE RLDNR = P_RLDNR.
DATA: WA_CHANGE(2) VALUE 'TA'.
TRANSLATE T881-TAB USING WA_CHANGE.
b) RELPACE : This too will perform the same function.
REPLACE 'T' WITH 'A' INTO T881-TAB.
The only difference between the two is that TRANSALTE replaces all occurances of a character with the one succeeding it in WA_CHANGE, while REPLACE will replace only the 1st occurance of the character.
Hope this helps,
Regards,
Madhur
NB: Please do award points if found helpful.
Message was edited by: Madhur Chopra

Similar Messages

  • Diff b/w select single * .... and select....up to 1 row

    Hi Abapers,
    What is the diff b/w Select single * from.... and select * ...up to 1 row.
    Thanks in advance.
    Subbu.

    Select SINGLE...
    SINGLE
    The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
    ... UP TO n ROWS
    Effect
    The set of results is restricted to a maximum of nrows.
    Example
    To output a list of the 3 business customers with the greatest discount:
    DATA WA_SCUSTOM TYPE SCUSTOM.
    SELECT * FROM SCUSTOM INTO WA_SCUSTOM UP TO 3 ROWS
             WHERE CUSTTYPE = 'B'
             ORDER BY DISCOUNT DESCENDING.
      WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME, WA_SCUSTOM-DISCOUNT.
    ENDSELECT.
    Notes
    If you use an UP TO n ROWS addition in an ORDER-BY clause , the lines read are sorted into the correct order. The first n lines are then displayed. The system may need to read more than n lines from the database to be able to do this.
    If n = 0, all selected lines are displayed.
    n < 0 results in a runtime error.
    <b>Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS</b>
    A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
    <b>So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?</b>
    If you're considering the statements
    SELECT SINGLE field INTO w_field FROM table.
    and
    SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
    then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
    Why is this ?? The answer is simple.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Get the difference ??
    If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
    Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
    Then run the program shown below:
    Report Z_Difference
           Message-id 38
           Line-Size  80
           Line-Count 0
           No Standard Page Heading.
    Start-Of-Selection.
      Data: w_Single type Posnr,
            t_Rows   type standard table of Posnr
                     initial size 0
                     with header line.
      Select single Posnr
        from zDifference
        into w_Single.
      Select Posnr
        into table t_Rows
        from zDifference
       up to 1 rows
       order by Posnr descending.
       Write :/ 'Select single:', w_Single.
       Skip 1.
       Write :/ 'Up to 1 rows :'.
       Loop at t_Rows.
            Write t_Rows.
       EndLoop.
    You should see the output:
    Select single: 000001
    Up to 1 rows : 000010
    The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
    In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
    Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !!
    Message was edited by:
            Judith Jessie Selvi

  • Difference between Select *    and Select single     ?

    difference between Select *    and Select single     ?

    HI,
    DATA : IT  TYPE TABLE OF MARA,
               WA TYPE MARA.
    Here it selects all the record and keeps in internal table it.
    Select  *  from mara into corresponding fields of table <b> it</b>.
    Here it slects only one record that to first record.
    If you wnat any specific record then use where condition.
    Select  single *  from mara into corresponding fields of <b>wa</b>.
    Message was edited by:
            Purshothaman P

  • Select single row in ALV grid

    ABAPer's ,
    Does anyone can guide me to select single row only in ALV grid , without OO.

    Hello,
    I did not get u.
    But check the below code it may help u.
    tables: mara.
    TYPE-POOLS: SLIS.
    data:repid like sy-repid.
    data: itb type mara occurs 0 with header line,
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
    IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
    ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
    selection-screen begin of block b.
    parameters: p_matnr type matnr.
    selection-screen end of block b.
    select * from mara into table itb where matnr = p_matnr.
    SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'HANDLE_USER_COMMAND'
       I_STRUCTURE_NAME               = 'MARA'
       IS_LAYOUT                      = IT_LAYOUT
       IT_FIELDCAT                    = IT_FIELDCAT[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itb
    EXCEPTIONS
      PROGRAM_ERROR                  = 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.
    FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
    SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    CLEAR IT_FIELDCAT[].
    IF RS_SELFIELD-FIELDNAME = 'MATNR'.
    READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
    WRITE: / ITB1-MAKTX.
    ENDIF.
    ENDCASE.
    ENDFORM. "HANDLE_USER_COMMAND
    Regards

  • Performance on Select Single&Write  AND Select*(For All Entries)&Read&Write

    Hi Experts,
    I got a code review problem & we are in a argument.
    I need the best performance code out of this two codes. I have tested this both on 5 & 1000 & 3000 & 100,000 & 180,000 records.
    But still, I just need a second opinion of experts.
    TYPES : BEGIN OF ty_account,
            saknr   TYPE   skat-saknr,
            END OF ty_account.
    DATA : g_txt50      TYPE skat-txt50.
    DATA : g_it_skat    TYPE TABLE OF skat,       g_wa_skat    LIKE LINE OF g_it_skat.
    DATA : g_it_account TYPE TABLE OF ty_account, g_wa_account LIKE LINE OF g_it_account.
    Code 1.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    LOOP AT g_it_account INTO g_wa_account.
      SELECT SINGLE txt50 INTO g_txt50 FROM skat
        WHERE spras = 'E'
          AND ktopl = 'XXXX'
          AND saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_txt50.
      CLEAR : g_wa_account, g_txt50.
    ENDLOOP.
    Code 2.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    SELECT * INTO TABLE g_it_skat FROM skat
      FOR ALL ENTRIES IN g_it_account
          WHERE spras = 'E'
            AND ktopl = 'XXXX'
            AND saknr = g_it_account-saknr.
    LOOP AT g_it_account INTO g_wa_account.
      READ TABLE g_it_skat INTO g_wa_skat WITH KEY saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_wa_skat-txt50.
      CLEAR : g_wa_account, g_wa_skat.
    ENDLOOP.
    Thanks & Regards,
    Dileep .C

    Hi Dilip.
    from you both the code I have found that you are selecting 2 diffrent fields.
    In Code 1.
    you are selecting SAKNR and then for these SAKNR you are selecting TXT50 from the same table.
    and in Code 2 you are selecting all the fields from SAKT table for all the values of SAKNR.
    I don't know whats your requirement.
    Better you declare a select option on screen and then fetch required fields from SAKT table for the values entered on screen for SAKNR.
    you only need TXT50 and SAKNR fields.
    so declare two types one for SAKNR and another for TXT50.
    Points to be remember.
    1. while using for all entries always check the for all entries table should not be blank.
    2. you will have to fetch all the key fields in table while applying for all entries,
        you can compare key fields with a constant which is greater than initial value.
    3. while reading the table sort the table by the field on which you are going to read it.
    try this:
    TYPES : BEGIN OF ty_account,
    saknr TYPE skat-saknr,
    END OF ty_account.
    TYPES : begin of T_txt50,
          saknr type saknr,
          txt50 type txt50,
    end of t_txt50.
    DATA: i_account type table of t_account,
          w_account type t_account,
          i_txt50 type table t_txt50,
          w_txt50 type t_txt50.
    select SAKNR from SKAT into table i_account.
    if sy-subrc = 0.
    sort i_account by saknr.
    select saknr txt50 from SKAT into table i_txt50
    for all entries in i_account
    where SAKNR = i_account-SAKNR
    here mention al the primary keys and compare them with their constants.
    endif.     
    Note; here you need to take care that, you will have to fetch all the key fields in table i_txt50.
    and compare those fields with there constants which should be greater than initial values.
    they should be in proper sequence.
    now for writing.
    loop at i_account into w_account.
    clear w_txt50.
    sort i_txt50 by saknr.
    read table i_txt50 into w_txt50 with key SAKNR = w_account-saknr
    if sy-subrc = 0.
    write: w_txt50-saknr, w-txt50-txt50.
    clear w_txt50, w_account.
    endif.
    endloop.
    Hope it wil clear your doubts.
    Thanks
    Lalit

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

  • Error in Select single statement

    Hi All,
    Following is the statement and error message im getting:
    Can anyone help me with this. I am not able to figure out whats wrong with this.
    <b>select SINGLE *
      from  vbrk where  vbeln eq iv_billno.</b>
    <u>Error:</u>
    The INTO clause is missing at SELECT, or the FROM addition at either DELETE, INSERT, MODIFY, or UPDATE is missing.          
    Thanks & Regards,
    Megha

    Program always needs a work area to store the values retrived from your select statement. Either you declare that work area as TABLES: VBRK or DATA: wa_vbrk LIKE VBRK.
    If you use the first option, then you don't need to do anything but it is an obsolete statement.
    If you use the second option, then you should change your select statement as follows
    SELECT SINGLE * FROM vbrk
                    INTO wa_vbrk
                   WHERE vbeln EQ iv_billno.

  • Is it not possible to give the select single field without an into clause

    Hi,
    i have to check whether my input value( only one filed) is available in the table.
    for eg i need to check whether company code is available in the table t001.
    then i will give .
    data lv_bukrs type t001-bukrs.
    lv_bukrs = 1010.
    select single bukrs from t001 where bukrs = lv_bukrs.
    here its asking for me to give a vaible to store the bukrs that is
    select single bukrs into dummyvalue from t001 where bukrs = lv_bukrs.
    Is it not possible to give the select single fieldname without an into clause

    Its Possible by declaring the tables statement
    <b>tables : AFKO.
    select single * from AFKO where <condition>.</b>
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. The addition ORDER BY can also not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Notes
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead.
    The addition SINLGE is not permitted in a subquery.
    Regards
    - Gopi

  • How to get option select single Values in select options

    Hello All,
    I have a requirement where, in select-options i should avoid the range selection and should have only select single values option. User wanted to give the list of 10000 materials by using copy and paste as we have in normal abap with pase clip board option.
    Please let me know if you need any further clarification. your quick response would be highly appreciated.
    Thanks
    Raj.

    Thanks for the reply, I have already done this but when you add values to it at a time 1000 material information we can not add.
    so you go to selection screen and you have only one input box with arrowe button. click on the arrow and then you will get the screen where it will ask you to add five records and that to ranges.
    but if you click the same arrow in normal selection screen of SAP you get 4 tabs in which first tab will be select single values.
    and there by using copy from notepad option we can add how many entries we want.
    Let me know if you need any further clarification to understant the requirement.
    Thanks,
    RaJ.

  • Problem with SELECT SINGLE

    hi
    can you find any error in this
    select single * from makt where matnr = p_matnr and spras = 'sv'.

    Hi,
    Use like this.
    data: BEGIN OF it_makt OCCURS 0,
    matnr LIKE maKT-matnr,
    maktx LIKE makt-maktx,
    END OF it_makt.
    data: process_tab_struct_tmp like IT_MAKT.
    field-symbols: <fs1>.
    after downloading file(excel) to excel_tab....code follows
    LOOP AT EXCEL_TAB.
    assign component excel_tab-col of structure
    process_tab_struct_tmp to <fs1>.
    <fs1> = excel_tab-value.
    at end of row.
    move-corresponding: process_tab_struct_tmp to IT_MAKT.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    INPUT = <b>it_makt-matnr</b>
    IMPORTING
    OUTPUT = <b>it_makt-matnr</b>.
    append IT_MAKT.
    endat.
    ENDLOOP.
    Do reward points to useful answers.
    Regards,
    Atish

  • Select Single * is not fetching all Data

    Hi,
    I have a peculiar problem, when i am extending the customer to a new company code, we are getting Dump saying 'ASSERTION_FAILED'
    when i debugg i am geeting issue with following Code of a FM 'KNA1_SINGLE_READER'
    IF NOT i_bypassing_buffer IS INITIAL.
        *SELECT SINGLE * FROM kna1*
                        INTO o_kna1
                        WHERE kunnr = i_kunnr.
        IF sy-subrc <> 0.
          MESSAGE e300(vs) WITH 'KNA1' RAISING not_found.
        ENDIF.
    i am passing customer number (i_kunnr), this code is executed 2 times first time it is fetching all columns but second time it is only fetching customer number and no other information regarding customer. But in data base all information is present. Can any one help me in this.
    Thanks a lot...
    Reddy
    Edited by: JAGAN MOHAN REDDY on Jun 2, 2010 11:30 AM

    Hi Jagan,
    It'll be helpful to others if you can please post how and what was done to resolve the issue.
    Thanks!
    Sandeep

  • Problem in select single statement : its urgent

    Dear ,
    i written one select single stmt i.e
    tables : ser03 .
        SELECT SINGLE  * FROM  ser03
               WHERE  obknr  = objk-obknr
               AND    bwart  = '101'
               AND    shkzg  = 'S'.
    based on this select stmt their are 5 records in database table satisfying the select stmt where clause  and this select stmt is picking the  fourth record . why this record is picking forth record only even this 4th record is not most recently created record and nor old record this record is middle one if any one plz tell me . points must be given . to access most recently recreated record how to write select stmt. plz tell me .

    Hi,
    hope this code will help you.
    just added the mandt in the where condition.
    SELECT SINGLE * FROM ser03
    WHERE mandt = sy-mandt
    AND obknr = objk-obknr
    AND bwart = '101'
    AND shkzg = 'S'.
    reward if helpful,
    teja.

  • "SELECT SINGLE"  is not working.

    Hi all,
    here i have one report. And in this i want just one row when my input material number match with my table material number this time if movement type is 131 then program will be terminated otherwise it's working but this coding is not working properly so can you please help me out.
    My code is below .
    data : matnr1 LIKE mseg-matnr,
           bwart1 LIKE mseg-bwart.
    loop at mseg.
        SELECT SINGLE matnr bwart from mseg into (matnr1,bwart1) where matnr = matnr.
    endloop.
      if bwart1 = '131'.
                MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
                SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
                LEAVE PROGRAM.
       endif.
       CLEAR matnr1.
       CLEAR bwart1.

    there should be all key fields in where condition of SELECT SINGLE
    here in select which matnr you are passing? selection screen of mseg-matnr?
    loop at mseg.
    SELECTmatnr bwart from mseg upto 1 rows  into (matnr1,bwart1) where matnr = matnr. endselect.
    endloop.
    if bwart1 = '131'.
    MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
    SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
    LEAVE PROGRAM.
    CLEAR matnr1.
    CLEAR bwart1.
    endif.
    Edited by: Sachin Bidkar on Feb 23, 2010 7:12 AM

  • Help in select single

    hallow
    i have erorr when i do this select what i miss
            DATA: l_ennda TYPE endda,
                  emp_status TYPE stat2.
            SELECT single endda stat2
              FROM pa0000
              INTO (l_endda , emp_status)
              WHERE stat2 = 0
              AND begda LE so_date-high
             AND endda GE so_date-low.
    the erorr is :
    The list "(L_ENDDA" after "INTO" is not of the the form (f1, ...,fn),          
    or contains an undefined field. the form (f1, ...,fn), or contains an          
    undefined field. the form (f1, ...,fn), or contains an undefined field.          
    efined field. the form (f1,
    reagrds

    Hi Ricardo,
      The error is coming because you have done one spelling mistake. In the declaration you have decalred 'l_ennda' but in the select statement you are using 'l_endda'.
    Kindly copy the below select statement:
    SELECT single endda stat2
              FROM pa0000
              INTO (l_ennda, emp_status)
              WHERE stat2 = 0
              AND begda LE so_date-high
             AND endda GE so_date-low.
    <b>Reward the point if reply is useful.</b>
    Regards,
    Gopal.

  • Problem in SELECT SINGLE Query

    Hi,
    I am writing a small quesry in PS, Though the entry exist in database table PRPS, The sy-subrc is 4 for this query.Can u help me.
    data : wa_src_prps like prps-posid.
    start-of-selection.
    wa_src_prps  = '3-3310-02-01-01-10-20'.
        DATA: lv_pbukr LIKE prps-pbukr.
        CLEAR: lv_pbukr.
        SELECT SINGLE pbukr INTO lv_pbukr
                             FROM prps
                             WHERE posid EQ wa_src_prps.
    if sy-subrc = 0.
    write:/5 wa_src_prps, lv_pbukr.
    endif.

    hi,
    DATA : wa_src_prps LIKE prps-posid.
    START-OF-SELECTION.
      wa_src_prps = '0-1000-0'.
    " Conversion Routine for domain PS_POSID
      CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
        EXPORTING
          input  = wa_src_prps
        IMPORTING
          output = wa_src_prps.
      DATA: lv_pbukr LIKE prps-pbukr.
      CLEAR: lv_pbukr.
      SELECT SINGLE pbukr INTO lv_pbukr
      FROM prps
      WHERE posid EQ wa_src_prps.
      IF sy-subrc = 0.
        WRITE:/5 wa_src_prps, lv_pbukr.
      ENDIF.

Maybe you are looking for