CL_RECD_CONDITION / retrieve condition amount in ABAP

Hi All,
New on RE-FX, I am in  charge of developping a report for RE-FX, returning in particular the conditions amounts.
I need yearly amounts for each contracts, knowing that contracts have several conditions.
APIs and BAPIs dont provide calculated amounts. I found the class CL_RECD_CONDITION, and I would like to use one of these methods (i guess at least one will provide req. info):
- IF_RECD_CONDITION~GET_CALC_VALUES
-IF_RECD_CONDITION~GET_STANDARD_VALUES
Unfortunately, I'm not able to call these methods in the abap, I always have this error message:
"You cannot create an instance of the class "CL_RECD_CONDITION" within
the class itself or one of its subclasses."
my code is as following:
    DATA lr_cond TYPE REF TO cl_recd_condition.
    CREATE OBJECT lr_cond.
    CALL METHOD lr_cond->if_recd_condition~get_standard_values
   CALL METHOD if_recd_condition->get_standard_values
      EXPORTING
        id_keydate        = w_keydate
   if_distribution   = ABAP_FALSE
        id_distobjnr      = wa_vicncn-objnr
      IMPORTING
   ed_condvalueday   =
   ed_condvalueweek  =
   ed_condvaluemonth =
        ed_condvalueyear  = w_recdcondvalueyear
   ed_taxvalueday    =
   ed_taxvalueweek   =
   ed_taxvaluemonth  =
   ed_taxvalueyear   =
   ed_calcvalue      =
   ed_distvalue      =
   ed_taxvalue       =.
Many thanks for your help if you have informations on the correct way to get these conditions' amounts!
Cheers
Oli

Hi Oli,
you just have first to create contract and condition manager to call afterwards methods for conditions.
Here a sample coding:
go_contract       TYPE REF TO if_recn_contract,
go_condition_mngr TYPE REF TO if_recd_condition_mngr,
gto_cond          TYPE re_t_if_recd_condition,
go_condition_mngr TYPE REF TO if_recd_condition_mngr,
go_cond          TYPE REF TO if_recd_condition.
1. Find contract
     CALL METHOD cf_recn_contract=>find
        EXPORTING
          id_bukrs      = p_bukrs
          id_recnnr     = p_recnnr
          id_activity   = gd_activity
          if_auth_check = abap_true
          if_enqueue    = abap_true
        RECEIVING
          ro_instance   = go_contract
        EXCEPTIONS
          error         = 1
          OTHERS        = 2.
2. Get condition manager
    go_condition_mngr = go_contract->get_condition_mngr( ).
3. Get condition objects
get cond list
  CALL METHOD go_cond_mngr->get_list
    EXPORTING
      if_incl_booking_context = abap_false
      if_incl_booking_min_max = abap_false
      if_incl_lock_context    = abap_false
    IMPORTING
      eto_condition           = gto_cond.
4. Loop at conditions and call method
LOOP AT gto_cond INTO go_cond.
  get standard values
    CALL METHOD go_cond->get_standard_values
      EXPORTING
        id_keydate        = id_keydate
      IMPORTING
        ed_condvalueday   = ld_condvalueday
        ed_condvalueweek  = ld_condvalueweek
        ed_condvaluemonth = ld_condvaluemonth
        ed_condvalueyear  = ld_condvalueyear
        ed_taxvalueday    = ld_taxvalueday
        ed_taxvalueweek   = ld_taxvalueweek
        ed_taxvaluemonth  = ld_taxvaluemonth
        ed_taxvalueyear   = ld_taxvalueyear.
ENDLOOP.
Hope that helps.
Regards, Franz

Similar Messages

  • Incorrect calculation of Condition amount ( KONV - KBETR ) in VA01.

    Hi All,
    I have a requirement like this ...
    When i create a credit memo in VA01 by using the Create with Reference option on the screen , it asks for a billing document number ( Invoice Number ) .
    After entering this number and then clicking the COPY icon, a credit memo gets created .
    The problem is that the newly created Credit memo has Condition Amount = 10%  ( KONV-KBETR ) for condition 'ZD01'  whereas in the Invoice for the condition  'ZD01' the Condition amout = 20% .
    What i think is that both the amount should be same ie 20 % for Credit Memo as well as Invoice.
    Can you please help me with this .
    Thanks ,
    Sumit

    plz post in SD forum.....its not related to ABAP.
    or check ur copy controls & sales pricing ,on what basis its picking 10%.
    regards
    Prabhu

  • Change in Invoice for condition amount.

    Hello Gurus,
    Actually I have a query where I want to make changes in the Invoice amount. I have maintain the contract and with respective of that contract I got due invoices of equal amount by the periodic billing. But now the case is that I want to raise the invoice amount without making changes in the contract value. So can I make changes in the invoice amount by adding a condition into the invoice condition directly or can I change the previous condition amount in invoice only?
    If we can make this changes please tell me how can we do it? Or else please suggest me the solution for above scenario.
    Thanks in advance,
    Sanju

    Hi Sanju
    Welcome!
    Q1: can I make changes in the invoice amount by adding a condition into the invoice condition directly or
    A: Adding a new condition type to your invoice will be an overhead for you as it's one change. Also it will require amendment to you invoice pricing procedure as well.
    Q2: can I change the previous condition amount in invoice only?
    If this is only one time change, this is better idea.
    Please revert if require more help.

  • Very Urgent--Adding Header condition amount in Net order value of PO

    Dear friends,
    Our client has following requirement.
    ---In Purchase order ,Header conditions related to delivery costs are using.
    --Currently when we add the header condition,that amount is not adding to the Net order value and not adding to the total value in the PO print document.But proportionaly distributing to the line items.
    --Because of this two problems one is not adding to net order so not considered for release strategy,secondas it is not adding in the net order value,header condition amount also is not coming in the total value in the print out.
    --Currently, this header amount is splitting and posting seperate line item for GR/IR clearing act in MIGO and MIRO..
    I have removed the Statistical tick and accrual tick in IMG, then header amount is adding to the Net order value and adding in the total value in the PO print. But in MIGO/MIRO, This amount is adding to the GR/IR clearing act ,instead of seperate GR/IR line item in MIGO/MIRO documents, But client wants the postings shall be made similar to previous one.
    I have checked with removing only Stastical key and not removing the accrual key.But header condition is not adding to Net order value. I have searched for User exits/BAdis,suitable are not found.
    How the Header condition amount can be added to the Net order value without removing the Statistical key in IMG.Are there any User exit/BAdis,
    Please suggest.
    Regards,
    Dayanand

    Dear Sairam,
    Thanks for your reply.
    Asper your suggestions i tried as follows.
    1) We have got condition types like surcharges/discounts before "Net inc dis"
        and Delivery costs/accruals/frieghts after "Net inc dis".
    2) My requirement is that whatever conditions types after Net inc dis like Del costs/Frieghts are not included in Net order value in PO,so amount is not included in Release strategy and print.Currently this amount is coming as seperate line itemGR/IR Clearing account in MIGO/MIRO.
    3) Asper your suggestion,i tried with Surcharge  condition existing before "Net inc Disc"--This is a header condition(Cond.cat is Insurance),but stastical tick is not there in Scema. I tried as it is ,amount is adding in Net order value.But seperate line item for this amount is not coming in MIGO/MIRO
    4) When i ticked the accrual key and statistical tick and added Accrual-FR1,then PO created ,amount is not adding in Net order value.
    5) When i removed only Stastical tick only even though amount is not adding.
    6) When i removed the Accrual tick also i.e both the ticks then only amount is adding in Net order value.But Line item of the header condition is not dispalying as a seperate line item in MIGO/MIRO
    For these Header conditions ,seperate line item shall come ,at the same time amount shall add in Net order Vaue for the purpose of including in the amount for Release strategy and print.
    Please suggest how to do it.
    Regards,
    Dayanand

  • How to know which condition amount of PO will be added to invenotry

    Hi,
      I am making a report of material moving average price  vs  last Po price aginst which GR is made  so I want to know  how to know that  from the purchase order all conditions  which condition amount will be added to inventory  like in case of import PO along with material cost octri and fright  conditioon which are added as delivery cost  amount of those conditions are added to invenotry  and excise duty  which is also delivery cost are updated in cenvat,  so how to know  from all condition which amount will be added to invenotry.
    I dont want to take amoun which is updated at the time of GR.
    regards,
    zafar

    Hi,
      Thanks for your reply,  in case of FI  condition in OBQ3   if any accout key is assign there we can check this in OBCN  from there it is easy to understand whethere it is dedcuctible or non deductable  but in MM i am not getting details whethere the condition is deductable or non deductable 
    FRB1  delivery cost  condition account key Z04  is assign the amount of this codnition is added to the materila account
    JCVD delivery cost condition account key is Z07  the amount of this condition is not added to the material now in customizing of those account key Z04 and Z07  in Define Transaction/Event Keys there is no setting for this  then how to know  whether the amount of particular condition will be added to inventory or not.
    regards,
    zafar

  • How to find the start condition of a ABAP program?

    Hello Gurus!,
    Could any one please explain how to find the start condition of a ABAP program?
    like its a event based or time based?and also how to find that event and time..
    Thanks in Advance...
    Dinakar

    Hi Dinkar,
    Go to Job Schedule, put Job Step parameter as your program and see scheduled Job.
    In Schedule Job double click to see start condition. and steps to see details and variant.
    Hope it helps.
    Thanks
    CK

  • PO item condition amount change in ME28

    Hi,
    The question is whether ME28 will update the PO item condition amount automatically when release PO ?
    If so, how ME28 determine the PO item condition amount to change.
    Please teach me if you have any idea.
    Thanks a lot !
    Regards,

    Hi
    If GRN or Invoice or Down Payment you cannot change the delivery condition.
    If you are not able to change the Basic Price check that any condition are maitian (MEK1) and also check that in customization the price should be picked ony from condition then you cannot change the price in PO.
    Hope this might solve your issue
    Regards
    Davey

  • Need to show the Condition amount or percentage(KBETR) in display mode.

    Hi,
    i need to show the Condition amount or percentage(KBETR) in display mode for VA02 transaction based on the condition type. the KBETR in the table control. so how it will become in display mode?
    already i tried with this code.
    in MV45AFZZ form userexit_field_modification.
    case screen.
    when screen-name = 'KOMV-KBETR'.
    read table xkomv with key kschl = c_xr1(XR1).
    if sy-subrc = '0'.
    SCREEN-INPUT = '0'.
      endif.
    in debugging mode the condition is satisfying but not modifying the screen.
    can anyone help me . please it is urgent.

    Hi Praveen,
      See in Exit 'LV69AFZZ' and subroutine 'USEREXIT_FIELD_MODIFICATION',
    code should be like this
      if komv-kschl eq 'your condition type'.
        case screen-name.
          when 'KOMV-KBETR'.
              screen-input = 0.
        endcase.
      endif.
    For header level conditions you need to use "form userexit_field_modific_kopf"
    try it.
    i hope it will solve your problem.
    ENJOY SAP.

  • Error ME 760 for condition amount change

    Hi experts,
    I am facing a strange problem.When I change the condition amount for PO in Item ---> Conditions. It is triggering the IDOC but returning an error message ''No IDoc items belonging to purchasing document found' in the Messages.
    What may be the reason..I have done all configurations.Don't know what problem this is...
    Experts help me on this.
    I also refered the Note 330172.
    Thanks.

    Hi Stars,
    Refer OSS note 456127 (Note 456127 - FAQ: Electronic Data Interchange (EDI) in purchasing) for Question 10.
    Hope this helps.
    Thanks
    Lakshman

  • ME22N : Item condition amount not changeable after a cancel document

    Dear guru ,
    I have created a purchase order , a position have two price condition PBXX and ZD30(custom).
    I have executed a goods receipt and also a cancel document for the goods receipt.
    If I try to change item condition amount for condition ZD30 the field is grey (not changeable). Instead item condition amount for condition PBXX is changeable.
    I donu2019t understand this behaviour
    Do you help me ?
    Thanks.

    Hi Cris,
    In M/06 , select Ctype ZD30 and click Detail.
    in "Changes which can be made" screen Amount/percentage will be ticked it means you cannt edit the amount in PO i.e. whichever indicator is ticked over here that value cannt be change in PO and whichever indicator is not ticked you can change the value in PO.
    I hope this small piece of info. helps you to exactly unterstand the behaviour of Ctype.
    Cheers
    Manoj Singh

  • Condition Amount Reference

    Hello,
    I would like to know the difference of "Cyclical Amount" option among the other Condition Amount References. What does it mean or how does it work to calculate the due date?
    When I choose the option 3 - Cyclical amount on the Frequency term, the due date of the Condition is getting Day+1 on the partner-rel. cash flow in relation of the object cash flow is respecting correctly.
    Tks

    Hi,
    could you provide some more details with example scenario.
    rgds,
    Srini

  • How to create the condition record by ABAP program

    Hi Friends,
    I want to create/change the condition record of PR00 by ABAP program. It seems that there have no such BAPI/standard function can help on this. Can any one of you point out a way to me?? Thanks in addvance.
    Joe GR.

    Joe,
      Check with below FM..
    BAPI_PRICES_CONDITIONS.
    Check this link:
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    examples....
    http://www.4ap.de/abap/bapi_prices_conditions.php
    Two useful threads on Same topic
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Re: Problem with BAPI_PRICES_CONDITIONS
    BAPI_PRICES_CONDITIONS
    Please check this sample code from other thread.
    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_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.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Don't forget to reward if useful....

  • IF condition to execute ABAP code; VBAK-VSBED; VBPA-KUNNR; XVBPA/YVBPA

    Hi All!
    I need some help. I have to change the MV45AFZZ, the FORM USEREXIT_MOVE_FIELD_TO_VBAK. The user exit should write the VBAK-VSBED (shipping condition) from the KNVV-VSBED for the VBPA-KUNNR, PARVW=WE (the ship-to-party partner). The user exit should also permit the modification of VBAK-VSBED directly from VA01 or VA02 (even if the ship-to-party remain the same).
    I write down the ABAP code but I need to write a condition in order to execute the modification of VBAK-VSBED:
    1. in VA01, for the first time;
    2. in VA01 and VA02 if I change the ship-to-party partner.
    Now, if I want to change VBAK-VSBED without modifying the ship-to-party, I can not. The user exit overwrite the VBAK-VSBED for the ship-to-party.
    The code is:
    READ TABLE xvbpa WITH KEY parvw = 'WE' .
    IF SY-SUBRC = 0.
      SELECT SINGLE * FROM knvv WHERE kunnr EQ xvbpa-kunnr and
                                      vkorg EQ xvbak-vkorg and
                                      vtweg EQ xvbak-vtweg and
                                      spart EQ xvbak-spart .
      vbak-vsbed  = knvv-vsbed.
    ENDIF.
    Any help will be appreciate.
    Florina C.

    Hi,
    try this example:
    *Table YVBPA should always be filled, when executing VA02, but if it is not, you
    *can simple select the Sales Partner from VBPA(in va02 scenario it would be in *DB aldready)
    if sy-tcode = 'VA01'.
      READ TABLE xvbpa WITH KEY parvw = 'WE' .
      IF SY-SUBRC = 0.
        SELECT SINGLE * FROM knvv
        WHERE kunnr EQ xvbpa-kunnr  and
           vkorg EQ xvbak-vkorg and
           vtweg EQ xvbak-vtweg and
           spart EQ xvbak-spart .
           vbak-vsbed = knvv-vsbed.
      ENDIF.
    else if tcode = 'VA02'.
      if YVBPA[] is initial.
          select single * from vbpa
          where vbeln = vbak-vbeln and parvw = 'WE'.
          if sy-subrc = 0.
                 partner_before_change = vbpa-kunnr.
          endif.
      else.
          READ TABLE yvbpa WITH KEY parvw = 'WE' .
          if sy-subrc = 0.
             partner_before_change = yvbpa-kunnr.
          endif.
      endif.
      READ TABLE xvbpa WITH KEY parvw = 'WE' .
      IF SY-SUBRC = 0 and
         xvbpa-kunnr <> partner_before_change.
         SELECT SINGLE * FROM knvv
         WHERE kunnr EQ xvbpa-kunnr and
               vkorg EQ xvbak-vkorg and
               vtweg EQ xvbak-vtweg and
               spart EQ xvbak-spart .
         vbak-vsbed = knvv-vsbed.
       endif.
    endif.
    Best Regards,

  • Exception condition "CNTL_ERROR WD-abap Smartform to pdf

    Hii, 
    I am using a webdynpro - abap application. I am showing  a smartform as a pdf in one on the windows.
    When the link in the main window is clicked, a secondary window. Instead of the pdf, I get following exception.Kindly help me understand, where would I be going wrong. Let me know if more details required.
    **Exception condition "CNTL_ERROR" raised. **
    Form: PBO_HTML_CONTROL of program SAPLSTXBC
    Module: HTML_CONTROL of program SAPLSTXBC
    Function: SSFCOMP_PDF_PREVIEW of program SAPLSTXBC
    Method: DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_COMPONENTCONTROLLER~DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: ONACTIONPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
    Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
    Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    The code in the DISPLAYPDF method is as follows:
    method DISPLAYPDF .
    DATA: I_RS38L_FNAM TYPE  RS38L_FNAM.
    DATA: CTRL TYPE SSFCTRLOP.
    DATA: OUT TYPE  SSFCOMPOP.
    DATA: I_SSFCRESCL TYPE SSFCRESCL.
    DATA: LT_OTFDATA TYPE TABLE OF ITCOO.
    CTRL-GETOTF = 'X'.
    CTRL-NO_DIALOG = 'X'.
    CTRL-PREVIEW = 'X'.
    OUT-TDNEWID = 'X'.
    OUT-TDDELETE = ' '.
    data: i_tsp03 type tsp03.
    clear i_tsp03.
    select single * from tsp03 into i_tsp03.
    *OUT-TDDEST = i_tsp03-PADEST.
    OUT-TDDEST = 'TEP1'.
    ********get context data
      DATA lo_nd_zwebquestionaire TYPE REF TO if_wd_context_node.
      DATA lo_el_zwebquestionaire TYPE REF TO if_wd_context_element.
      DATA ls_zwebquestionaire TYPE wd_this->element_zwebquestionaire.
    * navigate from <CONTEXT> to <ZWEBQUESTIONAIRE> via lead selection
      lo_nd_zwebquestionaire = wd_context->get_child_node( name = wd_this->wdctx_zwebquestionaire ).
    * get element via lead selection
      lo_el_zwebquestionaire = lo_nd_zwebquestionaire->get_element(  ).
    * get all declared attributes
      lo_el_zwebquestionaire->get_static_attributes(
        IMPORTING
          static_attributes = ls_zwebquestionaire ).
    ********get context data ends
    data: itab1 type TCHAR255.
    data: itab2 type TCHAR255.
    data: itab type zprint. "addition by chandani
    data fm_name type rs38l_fnam..
    clear fm_name.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME             = 'ZCPESMARTFORM'
      IMPORTING
        FM_NAME              = fm_name
      EXCEPTIONS
        NO_FORM              = 1
        NO_FUNCTION_MODULE   = 2
        OTHERS               = 3.
    CALL FUNCTION fm_name
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CTRL
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUT
       USER_SETTINGS              = ' '
       NAME                       = 'test'
       ZWEBQUESTIONAIRE           = ls_ZWEBQUESTIONAIRE
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = I_SSFCRESCL
    *   JOB_OUTPUT_OPTIONS         =
    TABLES                                  "addition by chandani
      itab                         = itab   "addition by chandani
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REFRESH LT_OTFDATA.
    LT_OTFDATA[] = I_SSFCRESCL-OTFDATA[].
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
      EXPORTING
        I_OTF                          = LT_OTFDATA
    * EXCEPTIONS
    *   CONVERT_OTF_TO_PDF_ERROR       = 1
    *   CNTL_ERROR                     = 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.
    DATA: PDF_DATA TYPE XSTRING,
          PDF_SIZE TYPE I.
    DATA: L_DUMMY TYPE STANDARD TABLE OF TLINE.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
    IMPORTING
       BIN_FILESIZE                = PDF_SIZE
       BIN_FILE                    = PDF_DATA
      TABLES
        OTF                         = LT_OTFDATA
        LINES                       = L_DUMMY
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 4
    *   OTHERS                      = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA lo_nd_pdf TYPE REF TO if_wd_context_node.
      DATA lo_el_pdf TYPE REF TO if_wd_context_element.
      DATA ls_pdf TYPE wd_this->element_pdf.
      DATA lv_sources LIKE ls_pdf-sources.
    * navigate from <CONTEXT> to <PDF> via lead selection
      lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    * get element via lead selection
      lo_el_pdf = lo_nd_pdf->get_element(  ).
    * get single attribute
      lo_el_pdf->Set_attribute(
        EXPORTING
          name =  `SOURCES`
          value = PDF_DATA ).
    endmethod.

    Use -  with gui_download
    call method cl_gui_frontend_services=>environment_get_variable
    exporting
    variable = p_envir_name
    changing
    value = ls_envir_path
    exceptions
    cntl_error = 1
    error_no_gui = 2
    others = 3.
    call method cl_gui_cfw=>flush
    exceptions
    cntl_system_error = 1
    cntl_error = 2
    others = 3.
    And refer the below notes: 972762
    ITS 620 Patch 23 and SAPKB62061
    ITS 640 Kernel Patch 148 and SAPKB64019
    ITS 700 Kernel Patch 77 and SAPKB70010
    and also refer the link below to get more info
    http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15
    thanx
    suriya

  • Problem retrieving large amount of data!

    Hi,
    I'm currently working with a database application accessing very big amount of data. One query could result in 500 000+ hits!
    I would like to present this data in a JTable.
    When the query is executed, I create a two-dimensional array and store the data in it. The problem is that I get OutOfMemoryError when I reach the 150 000th row and add it to the array.
    I've looked into the design pattern "Value List Handler" and it seems it could be of use. But still I need to populate an array with all the data, and then I get the error.
    Is there somehow I could query the database, populate part of the data in a smaller array, use the "Value List Handler" pattern to access small portions of the complete resultset?
    Another problem is that the user wants ability to sort asc/desc by clicking columnheaders in the JTable. The I need to access all data in that table to make it be sorted right. Could re-query the database with a "ORDER BY <column> ASC" and use a modification of the value list handler pattern?
    I'm a bit confused, please help!
    Kind regards, Andreas

    The only chance that I you have: only select as many rows as you display on the screen. When the user hits "next page" retrieve the next rows.
    You might be able to do this with a scrollable resultset, but with that you are left to the mercy of the JDBC driver concerning memory management.
    So you need to think about a solution where you issue a new SELECT narrowing down the result set depending on the first/last row displayed
    Search this forum for pagewise navigation this question gets asked about 5 times a week (mostly in conjunction with web applications, but the logic behind it, should be the same).
    Tailoring your TableModel might be tricky as well.
    Thomas

Maybe you are looking for