ABAP code is not shown in SQ01

Hi,
can somebody help us to understand why ABAP code inserted in a query is shown in SE38 but not in SQ01?
The query was probably created with Quickviewer. How can we correct this?
Thank you.

Hi Suneel,
MOVE l_calweek TO loc_s_range-low.
loc_s_range-sign = 'I'.
loc_s_range-opt = 'EQ'.
MOVE l_week_temp TO loc_s_range-high.
APPEND loc_s_range TO e_t_range.
CLEAR: loc_s_range,l_calweek,l_week_temp.
ENDIF.
In the last few lines of your code(given above), where you assign 'EQ' to the range options, please assign 'BT' and check. I think as you are giving 'EQ', it takes only the value given in range-low. If you give 'BT', it should take values between range-low and range-high.
Correction suggestion given below.
MOVE l_calweek TO loc_s_range-low.
loc_s_range-sign = 'I'.
loc_s_range-opt = 'BT'.
MOVE l_week_temp TO loc_s_range-high.
APPEND loc_s_range TO e_t_range.
CLEAR: loc_s_range,l_calweek,l_week_temp.
ENDIF.
Thanks,
Archana

Similar Messages

  • Enhancing 0FI_GL_4  - ABAP code is NOT working -  URGENT PLEASE ???

    Hi all,
        I want to enhance 0FI_GL_4 extractor with CHECT, RWBTR & PRIDT from PAYR table if VBELN of 0FI_GL_4  is not BLANK, with the following conditions:
    1.Load all the records of PAYRQ table into PAYRQ internal table LT_PAYRQ
    with matching BELNR, AUGBL & BUKRS from I_DTFIGL_4 internal table.
    2.Load all the records of PAYR table into PAYR internal table LT_PAYR
    with matching AUGBL & BUKRS from LT_PAYRQ internal table.
    3.Read PAYR internal table LT_PAYR with matching BELNR (from I_DTFIGL_4
          internal table) and fill the new fields  CHECT, RWBTR & PRIDT.
    The following the is ABAP code, but it is NOT working:
    DATA:I_DTFIGL_4 LIKE DTFIGL_4 OCCURS 0 WITH HEADER LINE,
         L_TABIX LIKE SY-TABIX.
    DATA: BEGIN OF LS_PAYRQ,
                 ZBUKR LIKE PAYRQ-ZBUKR,
                 BELNR LIKE PAYRQ-BELNR,
                 AUGBL LIKE PAYRQ-AUGBL,
             END OF LS_PAYRQ.
    DATA: LT_PAYRQ LIKE LS_PAYRQ OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF LS_PAYR,
                 VBLNR LIKE PAYR-VBLNR,
                 CHECT LIKE PAYR-CHECT,
                 RWBTR LIKE PAYR-RWBTR,
                 PRIDT LIKE PAYR-PRIDT,
             END OF LS_PAYR.
    DATA: LT_PAYR LIKE LS_PAYR OCCURS 0 WITH HEADER LINE.
    WHEN '0FI_GL_4'.
        I_DTFIGL_4 = C_T_DATA.
        SELECT BELNR   AUGBL  ZBUKR
          FROM PAYRQ
          INTO CORRESPONDING FIELDS OF TABLE LT_PAYRQ
          FOR ALL ENTRIES IN I_DTFIGL_4
          WHERE BELNR = I_DTFIGL_4-BELNR
            AND AUGBL = I_DTFIGL_4-AUGBL
            AND BUKRS = I_DTFIGL_4-BUKRS.
        SORT LT_PAYRQ BY BELNR.
        SELECT VBLNR CHECT RWBTR PRIDT
           FROM PAYR
           INTO CORRESPONDING FIELDS OF TABLE LT_PAYR
           FOR ALL ENTRIES IN LT_PAYRQ WHERE VBLNR = LT_PAYRQ-AUGBL
           AND ZBUKR = LT_PAYRQ-ZBUKR.
        SORT LT_PAYR BY VBLNR.
        LOOP AT C_T_DATA INTO I_DTFIGL_4.
            L_TABIX = SY-TABIX.
         IF NOT I_DTFIGL_4-VBELN IS INITIAL.     " IF BILLING DOCUMENT EXISTS
            READ TABLE LT_PAYR WITH KEY VBLNR = I_DTFIGL_4-BELNR.
            IF SY-SUBRC = 0.
               MOVE LT_PAYR-CHECT   TO  I_DTFIGL_4-ZZCHECT.
               MOVE LT_PAYR-RWBTR  TO  I_DTFIGL_4-ZZRWBTR.
               MOVE LT_PAYR-PRIDT    TO  I_DTFIGL_4-ZZPRIDT.
               MODIFY C_T_DATA FROM I_DTFIGL_4 INDEX L_TABIX.
            ENDIF.
            CLEAR:I_DTFIGL_4-ZZCHECT,I_DTFIGL_4-ZZRWBTR,I_DTFIGL_4-ZZPRIDT,
                  LT_PAYR,  LT_PAYRQ.
          ENDIF.
        ENDLOOP.
    Could you please find the problem with above ABAP code and correct it.
    Since I want to enhance it,  if VBELN is not Blank and do I have to move the IF condition (I_DTFIGL_4-VBELN IS INITIAL) to another location for better performance.
    Thanks,
    Venkat..

    Dear Gajesh,
    Please accept my thanks for your Spontaneous reply.
    Selection Screen data is given below.
    1 --> Material Number
    2 --> Inspection Lot Number
    3 --> Date of Lot Creation
    4--> Inspection Type
    Normally the clint will give the Inspection Type ie 4th input and Date of Lot creation ie 3rd Input (Range of Date).
    Please do the needful.
    With Best Regards,
    Raghu Sharma

  • Im doing a data entry work, in which a rreport is submitted after the work . There is a security code which we have to put it. But currently the code is not shown onthe page.

    The security code didnt appear on my firefox webpage.
    == This happened ==
    Every time Firefox opened

    Hello Rehan.
    Although possibly not related to your problem, I will remind you that the version of Firefox you are using at the moment has been discontinued and is no longer supported. Furthermore, it has known bugs and security problems. I urge you to update to the latest version of Firefox, for maximum stability, performance, security and usability. You can get it for free, as always, at [http://www.getfirefox.com getfirefox.com].
    As for your problem, can you be more specific? Show the code and so on...

  • Calling a web service in an ABAP code

    Hello Experts,
          Is it possible to consume a web service in an ABAP code?
    Note: I am using SAP R/3 4.7.
    Thanks!
    Jeffrey

    Do you mean opening the web browser through our ABAP source code?
    If yes, then please use the function module: "CALL_INTERNET_ADDRESS". This will do the job for you..
    Reward points if I have helped you.
    Regards

  • Company Code field now shown in Cost Center Master Data

    Hi
    I am new, I configured CCA. Created Controlling area and versions. When I created a cost center company code field not shown. I think one cost center assined to a one company code but in cost center master data Company code field not shown. I want to cost center company code specific. I using ECC6
    Pl help.

    Hi,
    When you will assign additional company codes, the cost centre created now, by default will be assigned to the existing company code, and for the new one - you will have to define cost centres again. So, everything is fine, do not worry.
    Regards,
    Eli

  • Unwanted ABAP Code Block Triggering - IF condition not working

    Friends,
    I am facing weird issue in my production system i.e. one of the code block which was bounded in IF condition is getting triggered. However, as per the data that I have in my system this IF condition should skip that code block.
    Let me give you code and execution flow here:
    I have Program A in which I am submitting Program B in background mode to selected server. This Program A will be executed by end user in Background mode.
    call function 'JOB_OPEN'
         exporting
           jobname          = job_name
         importing
           jobcount         = job_number
         exceptions
           cant_create_job  = 01
           invalid_job_data = 02
           jobname_missing  = 03.
    if sy-subrc = 0.
         submit program B
                  via job job_name number job_number
                  with p_sched  = sched
                  with period_p = period
                  with fyear_p  = fyear
                  with username = ruser
    and return.
    call function 'JOB_CLOSE'
         exporting
           jobcount             = job_number
           jobname              = job_name
           sdlstrtdt            = start_date
           sdlstrttm            = start_time
          targetserver          = l_targetserver          "V05++
         exceptions
           cant_start_immediate = 01
           invalid_startdate    = 02
           jobname_missing      = 03
           job_close_failed     = 04
           job_nosteps          = 05
           job_notex            = 06
           lock_failed          = 07.
    endif.
    As you can see in code, I am passing job to run on l_targetserver. This program also releases some other jobs on other programs.
    In Program B, I have code like this:
    Top Include.
    start-of-selection.
    perform routine1 using p_fyear. "THIS HAS SOME SELECT QUERIES  AND  OTHER CODE and THERE IS NO ISSUE WITH IT. THIS ROUTINE IS
    ALSO HAVING ONE AND ONLY 'CLEAR' statement on DELTA_FLAG.
    perrform routine2.
    form routine2.
    loop itab into wa.  " This itab was populated in routine1
      perform get_flag." WE ARE PASSING VALUE TO DELTA_FLAG VARIABLE HERE. YOU CAN CHECK CODE BELOW.
    perform process_data. "CHECK THIS ROUTINE
    peform update_records.
    endloop.
    endform.
    Form Get_FLag.
    select * from dbtable into localtable where <condition>. " THIS QUERY RETURNS SOME DATA AND MY FLAG WILL BE SET AS 'X'.
    if sy-subrc = 0.
    delta_flag = 'X'. "THis one declared in top include.
    endif.
    EndForm.
    Form Process_Data.
    Perform get_dataset1.
    while counter <> 0. " Variable Counter declared in top include and default value is 20. Value will be decreased in side this loop. No issues with it.
    if wa-fld1 = '1'. "Check value of one of the field.
      continue.
    endif.
    perform get_delta_data. " We have Unwanted ABAP code (for my scenario) here.
    endwhile.
    Endform.
    form update_records.
    call function 'FUNCTION' in update task exporting par1 = itab.
    commitwork
    endform.
    form get_delta_data.
    if delta_flag is initial.
    select data from BSEG into i_bseg where <condition>. " This query is getting triggered in my system.
    endif.
    endform.
    All my data objects were declared in Top include of the program. Subroutines with their parameters were same as above code. I am not using any sub-routine second time or out-side of this program. As shown, this program updates records to one of the table with UPDATE function module IN UPDATE TASK and there is COMMITWORK after that. This task is part of
    As you could understand, DELTA_FLAG is having 'X' but query on BSEG is getting triggered. We are not clearing this variable after populating 'X' to it. I can see this query from Program B captured in ST12 trace results. (Verified it multiple times)
    I did this analysis:
    1. Ran this process in foreground with debugging, then there is no issue.
    2. Debugged 'Finished' job of my production system, but I dont see this code triggered in Debug mode.
    3. Replicated same execution process in our non-production environments, but there is no issue.
    Let me know if you need any other details.
    Thanks for your time.
    Regards,
    Naveen

    I forgot the one bit, which might actually have been useful: I'd be moving the if delta_flag is initial. out of form get_delta_data, before perform get_delta_data.Since you are calling in nested loops there, every little bit of run-time counts, and "philosophically" I feel - procedure should do what its name promises it will, and not check whether it's "appropriate time" to do it
    cheers and good luck
    Jānis

  • ABAP Query change not coming while execute corresponding T.code

    Hi gurus
      I added some values(country field)  in existing ABAP query in development server using sq01 . Now the changes were not coming  (in the selection screen for field selection) while running the query using corresponding Z T.code. In SE93 it shows START REPORT as report name. Can anyone guide me how to change an existing query and how to transport it properly into production server.
    Regards
    Arun

    This is happened due to
    -ve Qty (Quantity of goods received)

  • SQ01 - Join of different tables or ABAP Code in SAP Query

    Hello,
    I am trying to link some TO tables LTAK and LTAP together with the header table of the production orders AFKO.
    It seems that the SQ01 won't let me joint the LT* and the AFKO table.
    But I need to read some values from the AFKO table according to the transfer orders apart from the production order number.
    Is there a way in QUERY to join this or can I add somewhere in the query a little ABAP code?
    My aim is to avoid writing a ABAP report due to various reason.
    Any help would be nice.
    Cheers
    Uwe Neumann

    Hello,
    thanx for your answers so far.
    I was able to join in the third table.
    After a little investigation, I found out that I have to join the table AFPO with the materialnumber instead of AFKO, because the components are in AFPO.
    But this is just the one side of the material.
    Let's assume the transfer order contains of material A and B and we have production order 111.
    If I would let run the query, it would select all material A and B in table AFKO, because I have not said, just look for material A and B for production order 111. As I cannot join the field AFPO-AUFNR with LTAK-BENUM this is missing.
    Where can I specify this?
    Best regards
    Uwe Neumann

  • LSMW--- I am not seeing some variables, which r using in abap code!

    Hi Experts,
    Am enhancing the LSMW---> Create_Material, so I hv some basic doubts, pls. clarify,
    1 - In the following satemenrts of the code, the programmer used my_langu(variable?), so, Where the programmer has declared(attributes & value) the my_langu ? I searched in FIXED VALUES radio button, Global data, double clicking, abap code radio button, I culd not find it!
    Target Field: E1BP_MLTX-LANGU Language key
    E1BP_MLTX-LANGU = my_fv_langu. (like theses many variables r using in the abap code, but I culd not track them to see, thrier attributes!)
    2 - In abap code, the programmer is using <b><i>skip_transaction</i></b>! but, we dont hv skip_transaction in ABAP code?
    thanq.

    Hi,
    skip_transdaction is a LSMW Global Function and not an ABAP command:
    Global function     Description
    transfer_record.     Transfers the current record (i.e. for the current target structure) to the output buffer.
    transfer_this_record '...'.     Transfers a record of another target structure to the output buffer. The name of the target structure has to be specified as argument in single quotes.
    at_first_transfer_record.     Transfers the current record to the output buffer, if it is the first transaction.
    on_change_transfer_record.     Transfers the current record to the output buffer, if it has changed compared to the last record.
    transfer_transaction.     Writes the current transaction to an output file. All records of the output buffer are transferred to the output file.
    skip_record.     The current record is not transferred to the output buffer.
    skip_transaction.     The current transaction is not written to the output file.
    I'm not sure about the my_langu(variable?).
    Hope it helps some.

  • Create a note in me21n by abap code

    Hi experts,
    i'm wondering if it's possible to create a note by abap code ?
    I found this function module during my research "SO_WIND_NOTE_CREATE_API1",
    but i don't understand how to use it, and if it's helpful for my need.
    Thanks in advance for replies !

    Hi Yacine,
    Ya it is possible to create a note by abap code. The FM you mentioned here can be used for it also.
    But what is your exact requirement? To create a note from ME21N does not require this FM. You can directly go to the GOS toolbar on the top left hand corner. There you have option for creating the note.
    Regards,
    Abijith

  • Simple Abap Code Case i_chabsnm is not working

    Please help me asap, I am trying to enhance the BW datasource with only one field "Responsible" in 0refx_2 datasource . I am getting the error in code that case i_chabasnm is unknown and tables not defined by data statement
    please help me to correct the code I am just picking the field RESPONSIBLE from Table VIBDPR
    Abap Code below:
    Tables:  VIBDPR.          "Property master data table
    data:    l_tabix like sy-tabix.
    case i_CHABASNM.
    *Enhancement of Property Master Record
      WHEN '0REFX_2'.
        case i_datasource.
          WHEN '0REFX_2'.
            data:  l_s_REIS_MEASUREMENT_TRAN like REIS_MEASUREMENT_TRAN.
            loop at i_t_data into l_s_REIS_MEASUREMENT_TRAN.
              l_tabix = sy-tabix.
    select single * from VIBDPR where BUKRS = l_s_ REIS_MEASUREMENT_TRAN - BUKRS.
              if sy-subrc = 0.
                l_s_BIW_VIBDPR_s-ZZRESPONSIBLE = VIBDPR-RESPONSIBLE.
                modify i_t_data from l_s_ REIS_MEASUREMENT_TRAN index l_tabix.
              endif.
            endloop.
        endcase.
    endcase

    I am getting the error in cmid abap code that
    REIS_MEASUREMENT_TRAN shall be a flat structure but that is the extract structure in datasource 0refx_2  so what should i change on this
    Tables:  VIBDPR.          "Property master data table
    data:    l_tabix like sy-tabix.
    data:    i_CHABASNM.
    case i_CHABASNM.
    *Enhancement of Property Master Record
      WHEN '0REFX_2'.
        case i_datasource.
          WHEN '0REFX_2'.
            data:  l_s_REIS_MEASUREMENT_TRAN like REIS_MEASUREMENT_TRAN.
            loop at i_t_data into l_s_REIS_MEASUREMENT_TRAN.
              l_tabix = sy-tabix.
    select single * from VIBDPR where BUKRS = l_s_ REIS_MEASUREMENT_TRAN - BUKRS.
              if sy-subrc = 0.
                l_s_BIW_VIBDPR_s-ZZRESPONSIBLE = VIBDPR-RESPONSIBLE.
                modify i_t_data from l_s_ REIS_MEASUREMENT_TRAN index l_tabix.
              endif.
            endloop.
        endcase.
    endcase

  • SQ01 DIsplay Problem (Can v write abap code ) Sql Query

    Hi
    Need help in SQL Query
    I generated one sql query which has the following output in general .
    Customer   name   description   amount
    asrq1  sharekhan      Amount payed      10
    asrq1  sharekhan     Amount Advance     20
    asrq1  sharekhan    Amount due             30
    but i need the output in the following way
    Customer  name  AMount payed     Amount  Advance                  Amount Due
    asrq1   sharekhan  10    20     30
    and iam new this sql query but came to know we can write code ..but iam unable to initiliaze to write
    a peace of code as i dont know what are the select-options defined ..i saw in the include but didnt got it
    % comes prefix of select-options,and iam unable to get he internal table which is displayed in the query .
    can anyone help me in this answers will be awarded points.

    First, I will suggest to go for ABAP report for this kinda requirement.
    If you really want to go for it through SQ01, even then you will have to write some ABAP to display the records in one row. You will need to create three custom fields.
    I will give Psudo for one field:
    Field Name := ZAmountPayed
    Select Amount_Payed into varAmountPayed from Table Where Emp# = '12345'
    ZAmountPayed := varAmountPayed
    Convert the above into relative ABAP code and create 2 more similar fields, and you should be all set.
    You have to know the table names and any other calculations to get the right data.

  • ABAP WebDynPro User Interface Elements not shown on layout while designing

    Hi,
    When I create a new custom ABAP WedDynpro, the UI Element library is not shown on the view layout.
    I have tried a lot of options in exploring this.
    Kindly help me
    Thanks
    Sai.

    Have you followed the instructions in the online help:
    For the layout editor in the View Designer, all the services specified in Active Services in SICF for Web Dynpro ABAP must be activated. More information: SAP Notes 1009930 and 1008689
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/e86de5008b4d9ae10000000a155369/frameset.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/d28dfa34bb12bee10000000a1553f7/frameset.htm
    The view designer is a web application itself and your system must be properly setup for web access for this to work.  Also look at your Fully Qualified Domain Name setup:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/be9442572e1231e10000000a1550b0/frameset.htm
    Although a nice feature, the view deisgner is not required for building Web Dynpro Applications.  You can do 100% of the activities with the view designer turned off by working with the UI element tree on the right side of the page.  You can right mouse click and use the context menu to access most functions.  I'm sure that you want to get the view designer working, but until then you can still function.

  • Not able to remove the ABAP code from Transformation

    Hello Experts,
    We have transformation for DSO in that for one infoobject, field routine is written, Break Point is hard coded there and it's move to production. Now we are trying to remove that break point from development and then move it production.
    we are doing following activity to remove the break point.
    1. Open the transformation.
    2. Open the field routine.
    3. Going to ABAP code in field  routine.
    4. Remove the hard coded Break Point from ABAP code.
    5. Saving the code.
    6. It's taking to again filed routine window.
    7. We close the window and activate the transformation.
    8. When again check the ABAP code in field routine then it shows hard coded Break Point again.
    9. Not able to remove the hard coded break point.
    Can anyone know how to do this.
    Help will be appreciated.
    Thanks

    Hi,
    As pointed above, after point 6 don't simply close the window but click on Transfer Value and then activate your transformation. Refresh the system and check again.
    Regards,
    Arminder

  • Any sample ABAP code to send Lotus Notes email to a list of people?

    Any sample ABAP code to send Lotus Notes email to a list of people?
    We will give you reward points!

    hi..
      This sample code help you to send mail from SAP .
    REPORT  ZSSO_DOCUMENT_SEND_API1.
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS  2 WITH HEADER LINE.
    DATA: OBJHEAD LIKE SOLISTI1   OCCURS  1 WITH HEADER LINE.
    DATA: OBJBIN  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
    DATA: OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
    DATA: RECLIST LIKE SOMLRECI1  OCCURS  5 WITH HEADER LINE.
    DATA: DOC_CHNG LIKE SODOCCHGI1.
    DATA: TAB_LINES LIKE SY-TABIX.
    Creating the document to be sent
    DOC_CHNG-OBJ_NAME = 'OFFER'.
    DOC_CHNG-OBJ_DESCR = 'Auction of a Picasso jr'.
    OBJTXT = 'Reserve price : $250000'.
    APPEND OBJTXT.
    OBJTXT = 'A reproduction of the painting to be auctioned'.
    APPEND OBJTXT.
    OBJTXT = 'is enclosed as an attachment.'.
    APPEND OBJTXT.
    DESCRIBE TABLE OBJTXT LINES TAB_LINES.
    READ TABLE OBJTXT INDEX TAB_LINES.
    DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
    Creating the entry for the compressed document
    CLEAR OBJPACK-TRANSF_BIN.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM   = 0.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM   = TAB_LINES.
    OBJPACK-DOC_TYPE   = 'RAW'.
    APPEND OBJPACK.
    Creating the document attachment
    (Assume the data in OBJBIN are given in BMP format)
    OBJBIN = ' \O/ '. APPEND OBJBIN.
    OBJBIN = '  |  '. APPEND OBJBIN.
    OBJBIN = ' / \ '. APPEND OBJBIN.
    DESCRIBE TABLE OBJBIN LINES TAB_LINES.
    OBJHEAD = 'picasso.bmp'. APPEND OBJHEAD.
    Creating the entry for the compressed attachment
    OBJPACK-TRANSF_BIN = 'X'.
    OBJPACK-HEAD_START = 1.
    OBJPACK-HEAD_NUM   = 1.
    OBJPACK-BODY_START = 1.
    OBJPACK-BODY_NUM   = TAB_LINES.
    OBJPACK-DOC_TYPE   = 'BMP'.
    OBJPACK-OBJ_NAME   = 'ATTACHMENT'.
    OBJPACK-OBJ_DESCR = 'Reproduction object 138'.
    OBJPACK-DOC_SIZE   = TAB_LINES * 255.
    APPEND OBJPACK..
    Entering names in the distribution list
    RECLIST-RECEIVER = '[email protected]'.
    RECLIST-REC_TYPE = 'U'.
    APPEND RECLIST.
    RECLIST-RECEIVER = 'DLI-NEUREICH'.
    RECLIST-REC_TYPE = 'P'.
    APPEND RECLIST.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA = DOC_CHNG
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK   = 'X'
         TABLES
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = OBJBIN
              CONTENTS_TXT  = OBJTXT
              RECEIVERS     = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS = 1
              DOCUMENT_NOT_SENT  = 2
              OPERATION_NO_AUTHORIZATION = 4
              OTHERS = 99.
    CASE SY-SUBRC.
      WHEN 0.
        WRITE: / 'Result of the send process:'.
        LOOP AT RECLIST.
          WRITE: / RECLIST-RECEIVER(48), ':'.
          IF RECLIST-RETRN_CODE = 0.
            WRITE 'sent successfully'.
          ELSE.
            WRITE 'not sent'.
          ENDIF.
        ENDLOOP.
      WHEN 1.
        WRITE: / 'no authorization to send to the specified number of'              'recipients!'.
      WHEN 2.
        WRITE: / 'document could not be sent to any of the recipients!'.
      WHEN 4.
        WRITE: / 'no authorization to send !'.
      WHEN OTHERS.
        WRITE: / 'error occurred during sending !'.
    ENDCASE.
    Go for SCOT  transaction to send those mails.
    REGARDS,
    VEERESH

Maybe you are looking for